Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The given SQL creates an Album table and a Song table. The SHOW COLUMNS queries show information about the Album and Song table columns.
The given SQL creates an Album table and a Song table. The SHOW COLUMNS queries show information about the Album and Song table columns. Modify the two CREATE TABLE statements: 1. Add a primary key constraint to the Album table's ID column. 2. Add a primary key constraint to the Song table's ID column. 3. Add a foreign key constraint to the Song table so the AlbumID column refers to the Album table's ID column. 1 Add a primary key 2 CREATE TABLE Album ( 3 ID INT, 4 Title VARCHAR(60), 5 ReleaseYear INT 6); 7 8 9 CREATE TABLE Song ( 10 ID INT, -- Add primary and foreign keys 11 Title VARCHAR(60), 12 Artist VARCHAR (60), 13 AlbumID INT 14); 15 16 SHOW COLUMNS 17 FROM Album; 18 19 SHOW COLUMNS 20 FROM Song; The given SQL creates an Album table and a Song table. The SHOW COLUMNS queries show information about the Album and Song table columns. Modify the two CREATE TABLE statements: 1. Add a primary key constraint to the Album table's ID column. 2. Add a primary key constraint to the Song table's ID column. 3. Add a foreign key constraint to the Song table so the AlbumID column refers to the Album table's ID column. 1 Add a primary key 2 CREATE TABLE Album ( 3 ID INT, 4 Title VARCHAR(60), 5 ReleaseYear INT 6); 7 8 9 CREATE TABLE Song ( 10 ID INT, -- Add primary and foreign keys 11 Title VARCHAR(60), 12 Artist VARCHAR(60), 13 AlbumID INT 14); 15 16 SHOW COLUMNS 17 FROM Album; 18 19 SHOW COLUMNS 20 FROM Song;
Step by Step Solution
★★★★★
3.44 Rating (144 Votes )
There are 3 Steps involved in it
Step: 1
To modify the CREATE TABLE statements to add a primary key constraint to the Album tables ID column ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started