Project Assignment 8

Implementing a Multi-User Music Database

Supporting Sharing, Syndication, Monetization

At this point you should have a pretty good idea of what your database will be modeling.

Using your data model diagram and notes, and the SQL CREATE TABLE statement, implement the database schema for your data model. It doesn't have to be perfect; the point of this assignment is to exercise your creativity in figuring out how entities and relationships might end up as tables. We will be discussing database design and SQL along the way, and will be refactoring your database schema over time.

Specific Tasks

Note: be sure to log in as the user created in assignment 6. You should also use the database created in assignment 6.

Record your CREATE TABLE statements in your documentation.

Hints

When finished, you can use the utility mysqldump to export your database schema to a file (which you can then quickly paste into your documentation). For example, from your shell prompt:

  mysqldump -u root -p my_database_name > schema.txt

Keep your CREATE TABLE statements simple. In other words, just declare the table name, field names and data types, and the primary key.

Example:

  CREATE TABLE fans (
    `id` int(10) unsigned NOT NULL auto_increment,
    `first_name` varchar(32) NOT NULL,
    `last_name` varchar(64) NOT NULL,
    `gender` char(1),
    `birthday` datetime,
    PRIMARY KEY (`id`)
  );

Whatever naming convention you choose doesn't matter (eg, camel case v. underscores, plural v. singular table names) but be consistent.

Create one table at a time.

Don't get too caught up on the specifics of each attribute's data type (eg, should it be 30 characters... or 40? Doesn't matter right now).

To be completed by Monday, Feb 11.