1.

Design a set of database tables for a pizza restaurant.

The restaurant stores the names, addresses, and phone numbers of its home delivery customers. All the current and previous orders for each customer are stored in the database. An order includes one or more pizzas. A pizza has size, crust type, and up to eight different toppings. The cost of the pizza is computed based on size, crust type, and a price per topping.

List the SQL code creating the tables.


Answer:


2.

Design a set of database tables for use in hotel reservations.

A guest account stores name, address, phone. A hotel consists of a location, and price per room. A guest can stay at one hotel on any one date. A hotel can have multiple guests on any one date.

Give the SQL statements creating the tables.


Answer:


3.

Give a SQL query that lists all pizza toppings for your pizza restaurant database.

The restaurant stores the names, addresses, and phone numbers of its home delivery customers. All the current and previous orders for each customer are stored in the database. An order includes one or more pizzas. A pizza has size, crust type, and up to eight different toppings. The cost of the pizza is computed based on size, crust type, and a price per topping.


Answer:


4.

Give a SQL query that lists the names of customers who have ordered pizzas with pepporoni.

The restaurant stores the names, addresses, and phone numbers of its home delivery customers. All the current and previous orders for each customer are stored in the database. An order includes one or more pizzas. A pizza has size, crust type, and up to eight different toppings. The cost of the pizza is computed based on size, crust type, and a price per topping.


Answer:


5.

Give a SQL query that lists the names of customers who have ordered three or more pizzas.

The restaurant stores the names, addresses and phone numbers of its home delivery customers. All the current and previous orders for each customer are stored in the database. An order includes one or more pizzas. A pizza has size, crust type, and up to eight different toppings. The cost of the pizza is computed based on size, crust type, and a price per topping.


Answer:


6.

Give an SQL query that will increase the price per topping by 10%.

The restaurant stores the names, addresses and phone numbers of its home delivery customers. All the current and previous orders for each customer are stored in the database. An order includes one or more pizzas. A pizza has size, crust type, and up to eight different toppings. The cost of the pizza is computed based on size, crust type, and a price per topping.


Answer:


7.

Write a Java program to implement your pizza restaurant database.

The restaurant stores the names, addresses and phone numbers of its customers. All the current and previous orders for each customer are stored in the database. An order includes one or more pizzas. A pizza has size, crust type and up to eight different toppings. The cost of the pizza is computed based on size, crust type, and price per topping.


Answer:


8.

Create a Java program to implement your hotel reservation database.

Design a set of database tables for use in hotel reservations. A guest account stores name, address, phone. A hotel consists of a location, and price per room. A guest can stay at one hotel on any one date. A hotel can have multiple guests on any one date.
Allow a user to request a list of guests staying at a specific hotel on a specific date.


Answer:


9.

Describe the functions of COMMIT and ROLLBACK


Answer:


10.

What is a ResultSet used for?


Answer:


11.

Define the following terms: primary key, index file, and secondary index


Answer: