Question: In MySql (1) Create the tables needed to implement your database (2) Define primary keys and foreign keys (3) Define the relationships among your tables.

In MySql 

(1) Create the tables needed to implement your database 

(2) Define primary keys and foreign keys 

(3) Define the relationships among your tables.

(4) Define any necessary referential integrity constraints between your tables.

(5) Add sample data to the database tables (each table should have at least 10 rows).

rm.JPG

The red color attributes are the primary key and green color attributes are the foreign key of the relation.


  • The Customer relation has the details of the customer.
  • Each customer has a sign up id. It was stored in the relation User, with CustId has the foreign key. (Referential integrity constraints)
  • The song relation has the details of the song
  • The purchase relation has details of the purchase made by the customer. A purchase will have single song only. (Referential integrity constraints)
  • The album relation contains the details of all albums with its artist id detail. A album will have a single artist. (Referential integrity constraints)
  • The genre relation has the details of different genres available.
  • Song_Genre_Album relation has the details of the song title and its genre and Album title.
     

Relation Name Customer User Purchase Song Album Attribute1 Attribute2 Attribute3 Attribute4 Attribute5 Custid CustName EmailAddress Age CreditCar Num UserName CustId Password Price Order Num Purchase_Date Song Title Song Title Duration_in_secs Release_Date Album Title produced_city Artist Id CustId Artist Genre Artist_Id Genre Name HomeCity ResidenceCity Description Song_Genre_Album Song Title Genre Album Title

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!