| CPSC 310 / 603 Database Systems Project |
Importance notice: Our classroom is changed to Scoates 215, starting now.
Overview:
In this programming project, you and your teammates will build a substantial database of your choice with a real-world application. It has five parts:
Part 1: Choose a project and design an E/R diagram. (Due Tuesday, 09/30/2008, 12:45pm)
Part 2: Design the relational schema. (Due Tuesday, 10/07/2008, 12:45pm)
Part 3: Create an actual database using MySQL. (Due Tuesday, 10/21/2008, 12:45pm)
Part 4: Queries and updates to the database. (Due Tuesday, 11/04/2008, 12:45pm)
Part 5: Embedded SQL. (Due Tuesday, 11/25/2008, 12:45pm)
The project counts as 25% of your grade. Each part is 5% of your grade.
Teams:
Team 1: Nathan Benjamin, nbenjamin@tamu.edu; Christopher (Corey) Laird, lairdcc@tamu.edu; Jessica Gonzales, unknownletter@tamu.edu; Irene Soto, isoto0041@tamu.edu (team communicator)
Team 2: Peiyi Lee, peiyilee@tamu.edu; Michael Simon, msimon101010@gmail.com; Curtis Engel, stickman17@tamu.edu; Lei Gu, gulei@tamu.edu; Richard Conrad, trombonium@tamu.edu (team communicator)
Team 3: Clint Burney, clintburney@tamu.edu; Joshua Gartner, joshg410@tamu.edu; Mark Metcalf, m-diddy@tamu.edu; Saeed Noori, snoori@tamu.edu; Jo Anne Rodriguez, joanne0902@tamu.edu (team communicator)
Team 4: Charles Smith, csmith3332@tamu.edu; Prince Woodrow, abovedarim0305@tamu.edu; Gary Rabe, krabe3ag@tamu.edu; Casey Gonzales, bottomlesspit2@tamu.edu (team communicator)
Submission:
Turn in all parts of the project online using the CSNet. A signed hard copy of the project cover page should also be submitted in class.
Every team should choose one student as the team communicator, who will be responsible for turning in the project. For each project part, only one copy needs to be turned in electronically. However, as a team project, it is important for every student to participate in all aspects of the project. So with each part of the project, the submission should be accompanied with a statement describing the participation of each team member. The statement is part of the project cover page. Your signature in the cover page serves as a certification that the statement correctly describes what you did. Part of your grade will be based on how evenly everyone participated.
MySQL:
We will use the DBMS MySQL for the project. You should start getting familiar with MySQL via their web page. A good place to start is the tutorial.
Every student needs to apply for a MySQL database account in the CS department. Here is the link showing you how to apply for the account.
Part 1: E/R Diagram. (Due Tuesday, 09/30/2008, 12:45pm)
Pick a database application that you really like working on! Then design an E/R diagram for it. The E/R diagram should have about five entity sets and about five relationship sets. Include different kind of relationships (e.g., many-one, many-many) and different kinds of data (strings, integers, etc.). You can, but are not required to, use features such as weak entity sets, "is-a" relationships, or roles.
1. Write a short (one paragraph or so) description of the database application. The description should be brief and relatively informal. If there is any unique or particularly difficult aspects of your proposed application, please point it out. Your description will be graded on its suitability and conciseness.
2. Specify an E/R diagram for your proposed database. Underline the key attributes for entity sets and include arrowheads indicating the multiplicity of the relationship sets. If there are weak entity sets of "is-a" relationships, be sure to notate them appropriately.
You should turn in: 1. A written description of the database application. Turn it in online as a separate file. 2. The E/R diagram. Turn it in online as a separate file. 3. The project cover page. Turn it in online as a separate file, and also turn in a signed hard copy in class.
Part 2: Relational Schema. (Due Tuesday, 10/07/2008, 12:45pm)
In this part, you will produce a relational schema for the E/R diagram that you submitted last time.
Using the method for translating an E/R diagram to relations, produce a set of relation schemas for your database design. Be sure to underline key attributes in the relations schemas.
For each relation, specify all the nontrivial functional dependencies.
Is each relation in your schema in Boyce-Codd Normal Form (BCNF) with respect to the functional dependencies you specified? If not, decompose the relation into smaller relations so that each relation is in BCNF. Again, underline the key attributes, and specify all the nontrivial functional dependencies for the new relations.
Are there any nontrivial multivalued dependencies (MVDs) in your relations? If so, specify the MVDs, then decompose the relations into smaller ones so that each relation is in the Fourth Normal Form (4NF). Again, underline the key attributes.
Now that you have decomposed your relations as far as possible, are there any relations that can be combined without introducing redundancy (i.e., without creating BCNF or 4NF violations)? If so, combine them.
Is there anything you still don't like about the schema (e.g., attribute names, relation structure, etc.)? If so, modify the relational schema to something you prefer.
You should turn in: 1. Schemas for all relations in your database, with keys underlined. Turn it in online as a separate file. 2. For each relation, list all the nontrivial functional dependencies. Turn it in online as a separate file. 3. The project cover page. Turn it in online as a separate file, and also turn in a signed hard copy in class.
Part 3: Creating the Database in MySQL. (Due Tuesday, 10/21/2008, 12:45pm)
In this part of the project, you will create a relational schema for your database in the MySQL database system, and you will populate the tables in your database with initial data sets.
If your application naturally includes relations that are expected to be relatively small (e.g., schools within a university), then it is fine to use some small relations, but please ensure that you have relations of the sizes prescribed above as well. When writing a program to fabricate data, there are two important points to keep in mind:
Turn in your program code for generating or transforming data, a small sample of the records generated for each relation (5 or so records per relation), and a script log showing the successful loading of your data into MySQL.
You should turn in:
| 1. a script file containing SQL commands for creating each table in you database application (createTable.sql) |
| 2. a script log file showing a MySQL session in which your tables are created successfully (createLog.txt) |
| 3. a few (approximately 5-10) records of "realistic" data per relation (realData.txt or realData.doc or realData.pdf) |
| 4. the commented source code for your program to generate or transform data. |
| 5. written explanation of how your program works. This is not line-by-line commenting, but a high level global idea of how you generate your synthetic data. (explanation.txt or explanation.doc or explanation.pdf) |
| 6. a small sample of the "synthetic" records generated for each relation by your program (5 or so records per relation) (syntheticData.txt or syntheticData.doc or syntheticData.pdf) |
| 7. a script log file showing the successful loading of your "synthetic" data into MySQL per each relation (syntheticLog.txt or syntheticLog.doc or syntheticLog.pdf) |
| 8. a script file containing SQL commands for inserting synthetic data (approximately 5-10 records as a sample) generated by your program (insertSyntheticData.sql) |
| 9. a script file containing SQL commands (SELECT * FROM each table_name) for selecting the synthetic data per each table (selectSyntheticData.sql) |
| 10. a script log file showing a MySQL session in which the SELECT commands are run successfully (selectSyntheticDataLog.txt) |
| 11. Project cover page. (Turn in both an electronic copy and a hard copy.) |
Part 4: Queries and Updates. (Due Tuesday, 11/04/2008, 12:45pm)
In this part of the project, you will issue SQL queries and updates against your database. Since you will be modifying your data as part of this assignment, we strongly suggest that you adopt a routine for getting repeated "fresh" starts with MySQL. You need to save and keep all SQL commands such as creating/dropping database, creating tables, inserting real data and/or synthetic data, querying tuples, updating tuples, etc., in script files. If needed, you just can run these script files again in order to re-setup your database.
Develop and test:
Please note:
You should try to use most or all of the SQL constructs discussed in class and in the textbook. You will not receive full credit if your queries and modifications are all extremely simple.
You should turn in:
| 1. a copy of all of your SQL commands (query.sql and update.sql) |
| 2. a script log file showing a MySQL session in which your SQL commands are run successfully on both your small and large databases (queryLog.txt and updateLog.txt) |
| 3. Project cover page. (Turn in both an electronic copy and a hard copy.) |
Part 5: Using Java and Embedded SQL. (Due: Tuesday, 11/25/2008, 12:45pm)
In this part of the project, you will interact with your database from an external program. Your task is to build a moderately user-friendly interactive application program front end to your database using the Java programming language. Your program should consist of a continuous loop in which:
You should include both queries and modifications among your options. As in Part 4, please include some "interesting" queries or modifications, i.e., operations that require some of the more complex SQL constructs such as subqueries, aggregates, set operators, etc. As a general example, if your database is a campus applicant database, then your interface might include in its menu a number of useful queries on the database, with both input and output in a format more convenient and pleasing than raw interactive SQL. Some queries perform statistical analysis requiring multiple levels of grouping, other queries are simpler.
Your application code should interact with the database using the JDBC call-level interface for Java programs. You can refer to following links.
We are not expecting anything particularly fancy in terms of the interface itself. For example, in Java a menu printed via print function is fine. Also, handling of SQL errors can be quite simple. You can write a routine that just prints the error message from MySQL, or model your error handler after one of our sample programs.
You should turn in:
| 1. written explanation of how your program works. This is not line-by-line commenting, but a high level global idea of what is going on in your program. (explanation.txt or explanation.doc or explanation.pdf) |
| 2. commented source code for your programs |
3. Your embedded SQL based application must provide the
following functions: connecting to a database, querying, inserting, deleting
and updating. The more complex the queries that your application can handle,
the more credit you will get. Turn in a file called captured-screen.doc (or
.txt or .pdf) that contains screen captures showing examples of running each
of your functions. Here is a way to capture a screen shot:
|
| 4. Project cover page. (Turn in both an electronic copy and a hard copy.) |
Acknowledgement to:
Arthur Keller
of UC Santa Cruz and
Jennifer Welch, TAMU, for their orignal versions of the project
design.