CPSC 343 Database Theory and Practice Fall 2026

Project

A significant component of this course is a project in which you will design and implement a database-driven application, bringing together concepts and material from many parts of the course. You will be responsible for designing and implementing both the database and the application.


Due Dates

The project is divided into five milestones, each covering a distinct part of the overall design and implementation process. Milestones which have been assigned are listed below; see the schedule page for tentative due dates for upcoming milestones.

datedue
Fri 9/18 milestone 1: topic and requirements
Fri 10/9 milestone 2: modeling and design
Wed 11/4 milestone 3: implementation
milestone 4: data integrity and security
milestone 5: performance audit and final handin

This is a significant project, and is important to work on it steadily and not leave it until the last minute. Furthermore, the cumulative nature of the project, with little in the way of extra time between phases of the project, means that a late milestone isn't just a late handin — it's also a late start on everything that follows. This means that late milestones are largely not accepted — budget your time so you can complete each milestone on time, and hand in what you have when a milestone is due even if it isn't complete. A few grace days are available for the occasional "just need a day or two more!" crunch; see the late policy for details.


Topic and Requirements (Milestone 1)

Topic Selection

The domain and functionality of the application is up to you; some ideas are given below but you are welcome to come up with your own. The only two real requirements are that the topic is sufficiently distinct from the examples discussed in class and it is able to support everything the course will ask you to build. The criteria below are a minimum bar, not a full checklist — if you can't say "yes" (even tentatively) to one of them, your topic likely won't be able to encompass everything it will need to. You also don't need every detail worked out now, just a plausible reason your topic could satisfy each criterion. Don't worry if you aren't sure about some of them — the purpose of the check-in meeting for this milestone is to help with exactly that.

Some possible ideas:

Note that these ideas are given as a starting point — you still need to make sure your topic satisfies the criteria given above (without also being too big).

Deliverables

Project Proposal

Your project proposal needs to contain two things:

Topic Checklist

In addition to the project proposal, briefly outline how your topic meets each of the 10 criteria listed above. You don't need full details or big explanations, just enough to see that your topic is suitable. If you aren't sure how or if your project might meet some of the criteria, come to office hours to discuss it — that's the purpose of the check-in meeting for this milestone.

Check-in and Handin

Check-in Meeting — must be completed by 9/23

A 15-minute check-in meeting is required to discuss your project topic and the checklist. Stop by office hours or make an appointment. Check-in meetings must be completed by 9/23 (several days after the milestone is due). Sooner is better so you can move on to milestone 2!

Deliverables Handin — due in class 9/18

Hand in a hardcopy of your project proposal and the topic checklist.

Handin Meeting

There is no separate handin meeting for this milestone.


Modeling and Design (Milestone 2)

This is where the project really begins, with modeling the data requirements and designing the database itself.

Application Requirements

You outlined a set of use cases (user tasks) in your project proposal, now formalize the requirements for your application: create a requirements document with the brief description of the topic and the list of use cases from your project proposal. The rest of the design and implementation of your project will be based on this document.

ER Model

Create an ER/EER model that captures the data requirements implied by your use cases — what data is needed to support the functionality identified? Use the ER and EER features appropriate for your domain, but also make sure you include the elements listed below. If any of these are not naturally supported by your original set of use cases, add a few new use cases to demonstrate those structures — don't just add things to the ER model that aren't supported by your requirements document. Clearly mark any additions or revisions from what was in your original project proposal.

Your ER diagram must contain:

Using PlantUML (preferred) or another diagramming tool for your ER diagram is recommended so that it is easily editable.

Also create two lists of things present in the data requirements but which are not captured by the ER diagram:

Relational Schema

Convert your ER/EER model to a relational schema following the mapping process discussed in class.

For each relation, identify a primary key along with any foreign key(s) and appropriate NOT NULL, UNIQUE, and CHECK constraints. (If a key wasn't already identified in the ER model, derive candidate key(s) from the functional dependencies and choose one as the primary key.) In a separate list, include any structural constraints not represented in the relational schema. (You don't need to repeat the policy constraints — those are still outside the scope of the database itself.)

Functional Dependencies and Normalization

Identify the functional dependencies that hold in your domain — go back to the entity sets and elements from the ER model to avoid being misled by how a table happens to be organized.

Then go relation by relation: for each relation, identify the functional dependencies that hold for that relation and determine its candidate key(s). (Use this to identify an appropriate primary key for any relation that didn't already have one from the ER model and to verify that the primary key is appropriate otherwise.) Then normalize any relation that isn't already in BCNF, or explain why it isn't possible or desirable to do so. For any relation you do decompose, briefly name the anomaly that the original structure was vulnerable to.

Your schema may not need any further decomposition — in fact, that's likely if you followed good ER design practices in the first place. You do still need to go through the process of identifying the functional dependencies and demonstrating why each schema is in BCNF — there's nothing to fix, but you need to show that instead of simply claiming that everything is fine.

Design Analysis and Process

Discuss the choices you made in all three steps above — ER modeling, relational mapping, and normalization — wherever there was a decision to be made. (You do not need to address cases where there was really only one way to go.) In particular, be sure to address:

This document is the main place where your reasoning is visible and it is an important piece of your handin — a correct-looking schema with a thin or missing design analysis doesn't give much evidence that you understand why it's correct. Focus on places where there was a legitimate choice of alternatives — you don't need to document where there really was only one reasobnable way to go.

Aim for approximately 2-4 pages.

Deliverables

Check-in and Handin

Check-in Meeting — must be completed by 10/2

A 15-minute check-in meeting is required to discuss your ER model before you proceed with the ER-to-relational mapping and normalization steps. Sooner is better so that you have time to act on any feedback and still complete the last two steps on time.

Deliverables Handin — due in class 10/9

Hand in hardcopies of the deliverables listed above.

Handin Meeting

Handin meetings will be scheduled for Monday 10/12 and Tuesday 10/13. A signup list will be made available a few days in advance.


Implementation (Milestone 3)

This is where your design becomes a working system: you will build the database from your milestone 2 schema, load it with enough data to be able to test your application's functionality, and build the back end of your application as a REST API (business logic and data access, no user interface) that supports your use cases. This is the largest milestone of the project and the one where most of the code gets written, so plan your time accordingly — don't leave it until the last week. Authentication and authorization are not part of this milestone; they come next, in milestone 4. For now your endpoints can be open to anyone, though it's worth keeping in mind which ones will eventually need to know who is calling.

Work in layers and get something running end to end early. A good order is: create the database, build one use case's path all the way through (data access, business logic, endpoint, test), and then expand to the rest of your use cases. Getting one complete vertical slice working will give you the framework and proof-of-concept for the rest.

Database Definition

Implement your relational schema in MySQL. Implement the full schema even if you don't implement any use cases that use some of the relations. You can use MySQL Workbench to define the tables or write the CREATE TABLE statements from scratch, but note that you will need to hand in the CREATE TABLE statements. You should:

If you made changes to your ER diagram after milestone 2 or if implementing the schema reveals problems with your milestone 2 design, make the necessary changes in all places — keep the design documents and the database consistent with each other — and keep a short dated change log listing what you changed, when, and why. Changing your design as you learn more is normal and expected; changes that are visible and explained are good process, while a final schema that doesn't match what you handed in earlier without explanation is not.

Populate your database with sample data using MySQL Workbench's interface to enter rows by hand, by writing INSERT statements, or (recommended) by creating CSV files and importing them using LOAD DATA INFILE. (See homework 10 for examples of CSV files.) You don't need a ton of data, but add enough so that your queries return meaningful, non-trivial results and include some interesting cases (e.g. related rows in several tables, NULLs where they're allowed, and ties or duplicates where they'd occur in real data) so that you can fully check your queries. You only need to populate tables used by endpoints that you are implementing.

Technical Details

Use the username_project database in MySQL, where username is replaced by your username. You will need to connect to MySQL using your account (sent out via email) rather than guest in order to access the database.

Remember that you can run SHOW CREATE TABLE table in a query tab in MySQL Workbench to get the CREATE TABLE statement for an existing table.

Endpoints

Design and implement a REST API that supports the use cases from your requirements document. Follow the REST conventions discussed in class: resources named with nouns, the HTTP method conveying the action, and appropriate status codes. Your API should:

A given endpoint can satisfy more than one requirement e.g. one that involves a join and sorts its results counts toward the three join endpoints, the one sorting endpoint, and the 12 total endpoints.

Include a concise API document listing each endpoint: the HTTP method and path, a one-line description, which use case it supports, what it expects in the request (path and query parameters and the JSON body, if any, with field names and types), the JSON structure it returns on success, and the error status codes it can produce. For example:

POST /members/7/loans  — check out a book (use case 4)
Request body:  { "bookId": 42 }
Success:       201 Created, { "loanId": 118, "bookId": 42, "dueOn": "2026-11-18" }
Errors:        400 missing bookId; 404 no such member or book; 409 book already checked out

Note that authentication and authorization is not part of this milestone! You don't need login or logout endpoints and every route is public.

Implementation

Build your back end in Java using JDBC to talk to MySQL and the lightweight web framework and JSON library introduced in class. You may reuse code from posted class examples (slides or Java files) and from the provided code and your own work on the photo album homework, as-is or with modifications. You may not copy or use code, even with modifications, from other sources (including AI and other students) — see the course Academic Integrity and AI policies.

Organize your code into the three layers discussed in class:

Organize your code into packages as in the photo album homework.

Your application should also handle errors deliberately rather than letting things fail on their own. At a minimum, make sure that:

Use a centralized error handler as discussed in class and implemented in the photo album homework.

Test your API as you build it using curl or, for GET requests, a web browser. Writing a script that exercises your endpoints (including the error cases) as done in the photo album homework is highly recommended — it's the best way to catch a problem you introduced while fixing something else.

Technical Details

Coming soon!

Deliverables

Check-in and Handin

Check-in Meeting — required by 10/30

A 15-minute check-in meeting is required to discuss your API design and progress implementing the first use case and to clear up any sticking points regarding implementation. Bring a draft of your API document listing your endpoints and have your code available (bring a laptop with your code running or have copied your code into a m3-checkin folder in the handin directory before the meeting). Sooner is better for the meeting!

Deliverables Handin — due in class 11/4

Hand in hardcopies of the deliverable documents — the requirements document, ER/EER diagram, relational schema, change log, database definition, and API document. Hand in your code to the handin folder. The database will be checked in MySQL.

Handin folder details coming soon!

Handin Meeting

Handin meetings will be scheduled for Thursday 11/5 and Friday 11/6. A signup list will be made available a few days in advance.

The handin meeting will discuss your database implementation, your API design, and your code. Make sure that you have handed in all of the deliverables by the due date.