View the step-by-step solution to:

Schema: artists artistId: the unique ID number assigned to this artist name: the name of this artist albums albumId: the unique ID number assigned to...

Schema:

  1. artists
  • artistId: the unique ID number assigned to this artist
  • name: the name of this artist
  1. albums
  • albumId: the unique ID number assigned to this album
  • title: the title of this album
  • artistId: the unique ID of the artist on this album
  1. tracks
  • trackId: the unique ID number assigned to this track
  • name: the name of this track
  • albumId: the unique ID of the album that this track is on
  • mediaTypeId: don't worry about this!
  • genreId: don't worry about this!
  • composer: the composer of this track
  • milliseconds: the length of this track in milliseconds
  • bytes: the size of this track file in bytes
  • unitPrice: the price of this track

So far, we haven't yet considered the artists table. What if we want to know how many albums each artist has released?

Create a SQL query to construct a table that contains the name of each artist along with how many albums that artist has released (that are in the albums table).

You should get the following output:

sqlite> SELECT * FROM album_count LIMIT 10;
Aaron Copland & London Symphony Orchestra|1
Aaron Goldberg|1
Academy of St. Martin in the Fields & Sir Neville Marriner|1
Academy of St. Martin in the Fields Chamber Ensemble & Sir Neville Marriner|1
Academy of St. Martin in the Fields, John Birch, Sir Neville Marriner & Sylvia McNair|1
Academy of St. Martin in the Fields, Sir Neville Marriner & Thurston Dart|1
Accept|2
Adrian Leaper & Doreen de Feis|1
Aerosmith|1
CREATE TABLE album_count as
  select "REPLACE THIS LINE WITH YOUR SOLUTION";

Top Answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online