Question

Write a SQL query to create a table that contains the albumId and number of songs...

Write a SQL query to create 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";
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

======

create table track_count as
select <albumid_column>, count(*) from <albums_table_name> group by <albumid_column>;

Please comment if you need any help.

Add a comment
Know the answer?
Add Answer to:
Write a SQL query to create a table that contains the albumId and number of songs...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT