Part
1: Choose
a project and design an E/R diagram.
Part 2: Relational design and database creation.
Part 3: Queries, updates, and indexes.
Part 4: Embedded SQL.
The project is worth 20% of your course grade. The parts are equally important.
What to turn in:
Your first step is to identify the domain you would like to manage with your database, and to construct an Entity-Relationship diagram for the database. We suggest that you pick an application that you will enjoy working with, since you'll be stuck with it for the whole semester! It's especially required that you pick an application where you can populate your database using real, as opposed to fabricated, data. Your project should consist of at least 10 entities/relationships. If you cannot collect the data, you can use the employee database located here. If you choose this database, you have to expand it with 10 more relationships in an enterprise settings. Using the employee database is not encouraged.
Try to pick an application with a schema that is relatively substantial, but not too enormous. For example, your E/R design should have in the range of five or so entity sets, and a similar number of relationship sets. This is a ballpark figure only - shooting for somewhere between 3 and 10 is fine - you'll sense if your design is too simple or too complex. You should, in anyway, have different kinds of relationships (e.g., many-one, many-many) and different kinds of data (strings, integers, etc.), but your application need not necessarily require advanced features such as weak entity sets, "is-a" relationships, or roles. Try to design the database reflecting real world scenarios.
If you're having trouble thinking of an application, take a look at any Web shopping site. They all have a similar theme: products, customers, orders, shopping baskets, etc., and typically make for an interesting and appropriately sized application. If you're still having trouble, or if you're unsure whether your proposed application is appropriate, please feel free to consult with the TA or the instructor. Coming up with a good design now will pay off greatly as the project progresses.
MAKE SURE TO SAVE A COPY OF YOUR E/R DIAGRAM - YOU WILL NEED IT FOR SUBSEQUENT PROJECT PARTS.
What to turn in:
What to turn in:
(a) Queries and Updates
Develop and test:
In Part 3 (a), you may have discovered that some queries run very slowly over your large database. As discussed in class, an important technique for improving the performance of queries is to create indexes. An index on an attribute A of relation R allows the database to quickly find all tuples in R with a given value for attribute A (which is useful when evaluating selection or join conditions involving attribute A). An index can be created on any attribute of any relation, or on several attributes combined. See this page for more informationon how to create an index in MySQL.
What to turn in: