Question: . Add 2 foreign key constraints to the songs table: artist_id and genre_id are the foreign keys. 15.1. You may use either one or
. Add 2 foreign key constraints to the songs table: artist_id and genre_id are the foreign keys. 15.1. You may use either one or two statements to add the constraints. ysql> select * from songs; id | title 1 | Lover 3 | Maps 4 | Under Pressure 5 Blue Danube 6 | Misery 7 | Her Majesty 8 | Revolution_9 9 | A Kind_Of_Magic 10 11 | | | | | Broadway I Hope You Dance | 12 | Turn Off The Light 13 | Bohemian_Rapsody 14 | Dont_Stop_Me_Now 15 | We Will_Rock_You 16 | We_Are_The_Champions Daylight Payphone | minutes | 3 | 3 20 21 | She Will_Be_Loved 22 | Sunday Morning 23 | Im _Like_a_Bird. 24 | Canon_in_D 25 | Canon_in_D | 26 | Star Wars | 27 | Sea Drift | 28 | Let It_Be 27 rows in set (0.00 sec) | 3 | 10 | 3 10 18 12 | 3 17 | The Show Must Go On | 2 18 Your_My_Best Friend | 3 19 14 14 15 14 | 3 | 5 4 2 3 4 3 17 | 3 13 | 23 4 I seconds | sales | artist_id | genre_id | 41 | 5 | 461 58 | 36 | 23 | 15 | 59 | 59 | 55 | 34 35 | 44 | 43 | 13 | 53 | 33 37 | 57 13 5 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 1.90 | 2.50 | 1.50 | 6.00 | 1.00 | 4.00 | 2.00 | 8.50 | 1.20 | 2.30 | 7.00 4.50 2.90 | 0.90 | 0.20 0.50 1.90 | 36 10 33 32 43 0.10 34 | 23.50 | 1 | 3 | 41 5 | 13 61 71 81 91 10 | 11 | 12 | 13 14 | 15 | 16 I 17 I 18 | 19 | 201 21 | 22 | 23 | 241 25 | 26 | 27 | 28 | 3 | 3 | 41 3 | 3 | 31 3 | 334333 41 3 | 11 3 | 41 41 4 41 3 | 3 | 31 31 31 24 1 24 24 1 24 1 31 mysql> select * from artist; +----+- | id | name +----+- 1 1 | Taylor_swift Maroon5 2 Queen Strauss Maroon_5 3 4 5 6 7 8 | The Beatles Goo Goo_Dolls Lee_Ann_Womack Nelly_Furtado Barrymoore_Chamber Orchestra 9 10 11 | 12 | Beatles +----+--- 12 rows in set (0.00 sec) | London_Philharmonic_Orchestra -+
Step by Step Solution
There are 3 Steps involved in it
Query to add artistid foreign key constraint ... View full answer
Get step-by-step solutions from verified subject matter experts
