COMP 340: Databases, Fall 2019
Project Milestone 3
Your task for this milestone twofold: (a) get data that you can use to populate
your database, and (b) determine the general "outline" of your project website.
Part A
Your database will probably need some initial "seed" data to get started, as usually
an application running with an empty database is not particularly useful, because lots of features
can't be demonstrated on an empty database. For instance, if you are building an online store, having no products and/or no
registered customers does not make for a useful application.
- Determine how you will find some data that you can use to populate your database. This data does not necessarily have to
be "real world" data, but it's nice if it is. On the other hand, there are many ways to generate fake data that appears to be
real. As an example, for the flights database used in HW2, I used a real-world listing of airlines, sources, and destinations, but
I wrote a Python program to generate fake flight numbers and picked source-destination pairs randomly. Then I generated a bunch of
fake name/address data by using Mockaroo. If you google for "fake data generator" you'll find
other websites that can generate plenty of data.
- Create a script that will populate your database tables (from schema.sql) with your initial seed data. This script can be
similar to the populate.sql file that we wrote for our Flask applications, or it can be a populate.py file that inserts data using Python
into your tables. It's easy to interface with a PostgreSQL database from Python
using the psycopg2 library.
Part B
While you can design your website any way that is appropriate for your topic, I suggest keeping things very simple. Your project
website will not be graded on look and feel, but rather content and functionality. To that end, for part B, I would like your group
to create a list of every operation your website can perform. Each operation is a start-to-finish concept of something the user
can do on the website. For instance, for the blog we created during the Flask lab, we created four operations:
- Add an entry
- Edit an entry
- Browse/list entries
- Delete an entry
You should create a list such as this for your project. The intent behind this milestone is that if nothing else, you can use this
list to guide development of your website. I do not mind if your project website literally is nothing more than a list of links to these
operations (just like the blog). You can order these hierarchically if some of the operations are nested or depend on each other.
For instance, for an online store, you might have:
- Create account
- Modify account
- Change email
- Change address
- Change credit card
- Log into account
- Browse for products
- Add product to shopping cart
- Search for products
- Add product to shopping cart
- View shopping cart
- Remove product from cart
- Remove all products from cart
Your list should include at least one operation that will include an SQL SELECT statement, at least one operation that includes
an INSERT, at least one that includes an UPDATE, and at least one that includes a DELETE. Deviating from this is OK, but must be justified.
(For instance, I can imagine a situation where it would be inappropriate to ever DELETE anything.)
What to turn in
Turn in two (or more, if necessary) files on Moodle:
Part A: On Moodle, turn in your populate script (this will probably be either a file called populate.sql, or
populate.py). I should be able to directly run this file on my computer, either by running the SQL commands through the PostgreSQL interface, or by
running the populate.py program. If you have altered your database schema, upload a new version of schema.sql as well.
Part B: On Moodle, turn in a document with a list of operations that your website will do.