Project Database Schema Design

You will begin your project by designing a schema for the database you will be creating and using for the project. Your schema should have at least four tables, but can be much larger. Table size (# of columns...) can vary. There can be foreign keys between columns in different tables. Each column must have a datatype (I mean SQL datatypes here, e.g. VARCHAR) and declared to be either a key or not a key. Choose imaginative and meaningful column and table names.

The following is a description of what the database should store. Certain aspects of the domain will be mandatory. In addition, you are expected to invent a few other attributes of interest to model in your database. The description of the domain will be given informally, and you will need to prepare a database schema that models the domain.

The Inventory Domain

An inventory in general is a catalog of all the products that a company has. In this case, the company sells books and CDs on its web site. You have been in business for quite some time and your retail business is fairly large. In the interest of efficiency, you have a number of warehouses spread out across the country. Each of these warehouses have different stock quantities of each of the products that are on sale.

The following are the mandatory aspects of the domain that you need to model

Your inventory schema should model the details of all products you have and their availability at the different warehouses, and the warehouses themselves. Here are some details about each of the data entities that your schema should model.

Books: Every book has a title, author (one or more), a publisher, and an ISBN (a unique number that is used to identify the book). Clearly you should model the selling price of a book.

Books are organized by categories (e.g. fiction, drama, fantasy, history, etc.), so that they can be easily searched. Any book also has a set of keywords that describe the contents of the books. You should model both the categories and the keywords.

Music: Every CD has an album name, an artist (one or more), a recording company, some unique identification (like the ISBN for books), and a selling price. Just as books, CDs are also categorized by genre (e.g. rock'n roll, jazz, classical, etc.). Further CDs can be of various types - singles, albums, commemorative editions, etc.

Availability: Each of the books and CDs can be either in-stock or out-of-stock at the different warehouses. You will be definitely interested in the quantity in stock at your warehouses (for each product), so that you have an up-to-date availability information.

Warehouses: Each warehouse has a particular location (street address, city, state, zip code) and contact information (telephone number, fax number, manager's name).

All products may have discounts, you should model them as well.

Optional modeling: In addition to the mandatory aspects of the domain, you should add about 4 attributes of your own. You are welcome to visit any of your favorite online stores for ideas on additional attributes to model in your application.

Queries You Should Support

The interface to the system should be through a web page (see the project support page for details on how to do that). For each of the queries below, you should have a form that implements it. The layout is up to you, i.e., you can have all the forms to be on the same page, or spread out any way you like.