
Task 2: Simple Music Management 
===============================

Write a web based application that is able to maintain a personal
music collection that is stored in a database.

Data model 
----------

A data record of the table "music" consists of just four attributes:

  - Title of the song (string up to 72 characters), 
  - Artist (string up to 72 characters), 
  - Publishing year (a four digit interger number), and 
  - Genre (a numerical foreign key to the "id" attribute of the table "genres"). 

A database schema is provided that implements the tables "music" and
"genres". A database dump contains SQL code that populates the
database with some sample records. It is not allowed to use any
database features like triggers, stored procedures, autoincrements, or
the like.

Application requirements 
------------------------

The application should be able to perform the following tasks: 

  - Enter a new database record 
  - Search for a database record 
  - Edit an existing database record 

Deleting records is not necessary. Duplicate records or duplicate
attributes are allowed. To search for a record, the user may provide
values to one or more attributes. The program should display all
records that match exactly the entered attributes.

Allowed prerequisites 
---------------------

You may use a database of your own choice that is available via normal
package management of a common distribution like MySQL or
PostgreSQL. You may use extra libraries, modules, or packages for your
programming language, but you need to explain how to install them via
normal package management of a common distribution.

Database definition 
-------------------

CREATE DATABASE jukebox;

CREATE TABLE music (
   title VARCHAR(72),
   artist VARCHAR(72),
   year INT NOT NULL,
   genre INT NOT NULL
);

CREATE TABLE genres (
   id INT,
   desc VARCHAR(20)
);

Sample Data 
-----------

INSERT INTO genres VALUES (1, 'Rock');
INSERT INTO genres VALUES (2, 'Pop');
INSERT INTO genres VALUES (3, 'Classical');
INSERT INTO genres VALUES (4, 'Folk');
INSERT INTO genres VALUES (5, 'Jazz');

INSERT INTO music VALUES ('Money for Nothing', 'Dire Straits', 1984, 2);
INSERT INTO music VALUES ('Hey, Joe',          'Jimi Hendrix', 1966, 1);
INSERT INTO music VALUES ('Like a Virgin',     'Madonna', 1984, 2);
INSERT INTO music VALUES ('Yesterday',         'Beatles', 1965, 2);
INSERT INTO music VALUES ('Country Roads',     'John Denver', 1971, 4);
INSERT INTO music VALUES ('Toccata and Fugue', 'Johan Sebastian Bach', 1703, 3);
