Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Adjust the query below to display the artworks along with the names of the artists! Expected result: Query to be Adjusted: SELECT * FROM moma.artists

Adjust the query below to display the artworks along with the names of the artists! Expected result:

image text in transcribed

Query to be Adjusted:

SELECT * FROM moma.artists WHERE name IN ( SELECT fnf.name || ' ' || ln.name AS first_last FROM misc.first_names_f AS fnf CROSS JOIN misc.last_names AS ln UNION SELECT fnm.name || ' ' || ln.name AS first_last FROM misc.first_names_m AS fnm CROSS JOIN misc.last_names AS ln ) ORDER BY name;

HINT

Use the query from above as a subquery. This means, leave it alone for a moment.

In the main query, alias the tables moma.artists as mat,moma.artwork_artist as mawat, and moma.artworks as maw.

Create an inner join of these three tables, and display mat.name, maw.title.

Then add a WHERE clause with mat.name IN (...). Order the results by name.

Finally, in the main query replace the ellipsis ... with the code of the subquery.

\begin{tabular}{l|l} name & title \\ \hline Alice Adams & Untitled (wood sculpture) \\ Alice Adams & Screen from American Abstract Artists 60th Anniversary Print Portfolio \\ Andrea Klein & Album cover for Bruce Springsteen, Born in the U.S.A. \\ Ansel Adams & Dunes, Oceano, California \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions