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...

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


Construct a SQL query to form a table that contains the albumId and number of songs on the album with that albumId. HINT: Remember that count(*) will count the number of rows in each group of a GROUP BY statement.

You should get the following output:

sqlite> SELECT * FROM track_count LIMIT 10;
1|10
3|3
4|8
5|15
6|13
7|12
9|8
10|14
11|12
12|12
CREATE TABLE track_count as
  select "REPLACE THIS LINE WITH YOUR SOLUTION";

Top Answer

Answer) Here we need to construct a table using... View the full 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