. Add 2 foreign key constraints to the songs table: artist_id and genre_id are the foreign...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
. 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 -+ . 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 -+
Expert Answer:
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date:
Students also viewed these databases questions
-
The new business dynamics of the printing and graphics industry is bringing more pressure on the printing machines manufacturers, for sure. Would you agree with the statement that says: "The change...
-
command coming out wrong mysql> mysql> mysql> alter table songs add foreign key(artist_id) references artist(id); ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint...
-
In this assignment, you will be asked to write SQL queries to get relevant information from the database you built from Assignment 3 and therefore to answer some questions pertaining to the S record...
-
In the expression 2 4 , the number 2 is called the______and 4 is called the_______.
-
Many business computers have three distinct and worldwide unique identifiers. What are they?
-
Define each of the following terms: a. PV; I; INT; FVN; PVAN; FVAN; PMT; M; INOM b. Opportunity cost rate c. Annuity; lump sum payment; cash flow; uneven cash flow stream d. Ordinary (deferred)...
-
Express the stress-strain relationships in Equation 2.37 in terms of offaxis engineering constants such as the moduli of elasticity, shear modulus, Poisson's ratios, and shear-coupling ratios. 3 Ex...
-
On January 1, 2011, Pepper Company purchases 80% of the common stock of Salty Company for $270,000. On this date, Salty has total owners equity of $300,000. The excess of cost over book value is due...
-
An electron travels in a circle perpendicular to a magnetic field. (Recall m = 9.1x10 -31 kg and qe = 1.6x10 -19 C.) The speed of the electron is 200m/s and the radius of the circle is 0.1m....
-
Chris, a local baker, is interested in opening her very own Cupcake Cafebut to make it worth her while she needs to earn at least $35,000 per year in profit from all segments. She's lucked out and...
-
We are in a leadership crisis in the United States. A couple of weeks ago the Wall Street Journal ranked California as one of the worst run states in the nation. When we were thriving in wealth a few...
-
ABC, Inc. sells for $30 and pays $1.00 annual dividend per share, which you expect to grow at 7%. What is your expected return on his stock? What would be the expected return if the price rises to...
-
Cost Estimation Template Summary This model sums several line items to project total cost. The primary objective of this model is to run simple simulation to determine the Certainty % for an...
-
Company A has agreed to buy Company B for $55.00/share in stock. Company A and Company B's stock prices on the day before announcement were $112.00 and $42.00 respectively. Company B has 200,000...
-
3. If x + y = 12 and xy = 27, find the value of x +y.
-
If Hyundai expects the value of the won to strengthen appreciably against the U.S. dollar over the next decade, should it still expand its presence in the United States?
-
Give the layout of a hydro - electric power plant and briefly explain the working of any two of its main components. (14)
-
Place a tick in the appropriate grid to identify the balance that would be brought down in each of the following named accounts, in the books of Rizwy Mohamed: (a) In the Cash account: if Rizwy...
-
What does it mean when a data warehouse is nonvolatile?
-
In Example 23 on page 58, would you get the same result if you performed the PROJECT command before the JOIN command? Why or why not?
-
The owner of Colonial Adventure Tours knows the importance of the SQL language in database management. He realizes that he can use SQL to perform the same functions that you performed with queries in...
-
When a contracting hot ball of gas spins into a disk shape, it cools faster due to (a) increased radiation transfer. (b) increased surface area. (c) decreased insulation. (d) increased convection...
-
The Sun contains what percentage of the solar systems mass? (a) about 35% (b) 85% (c) the percentage varies over time (d) over 99%
-
The nebular theory is based on the observation that the solar system (a) follows patterns indicating that it formed progressively from physical processes. (b) has a structure much like an atom. (c)...
Study smarter with the SolutionInn App