Question: CREATE DATABASE music; USE music; CREATE TABLE singer ( id ?? NOT NULL, firstname ??, lastname ??, birthdate ??, PRIMARY KEY (??) ); CREATE TABLE

CREATE DATABASE music;

USE music;

CREATE TABLE singer

(

id ?? NOT NULL,

firstname ??,

lastname ??,

birthdate ??,

PRIMARY KEY (??)

);

CREATE TABLE album

(

id ?? NOT NULL,

title ??,

singer_id ??,

published ??,

PRIMARY KEY (??),

FOREIGN KEY (singer_id) references singer(id)

);

CREATE TABLE genre

(

id ?? NOT NULL,

NAME ???,

PRIMARY KEY (id)

);

CREATE TABLE album_genre

(

id ?? ,

genre_id ???,

album_id ???,

PRIMARY KEY (id)

FOREIGN KEY (genre_id) references genre(id),

FOREIGN KEY (album_id) references album(id)

);

INSERT INTO singer (id, firstname, lastname, birthdate) values

(1, ??,?? ,?? ),

(2, ??,?? ,?? ),

(3, ??,?? ,?? ),

(4, ??,?? ,?? );

INSERT INTO genre (id, NAME) values

(1, ??),

(2, ??),

(3, ??),

(4, ??);

INSERT INTO album (id, title, singer_id, published) values

(1, ??,?? ,?? ),

(2, ??,?? ,?? ),

(3, ??,?? ,?? ),

(4, ??,?? ,?? );

INSERT INTO album_genre (id, genre_id, album_id) values

(1, ??, ??),

(2, ??, ??),

(3, ??, ??),

(4, ???, ??);

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!