Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider these two tables generated by a brand - new music downloading app, shown here along with their ERD. You will use these tables to

Consider these two tables generated by a brand-new music downloading app, shown here along with their ERD. You will use these tables to answer questions 3 through 7.
users table
id username premium_user
1001 ziggy TRUE
1002 aladdin FALSE
1003 duke TRUE
1004 tom FALSE
1005 jareth FALSE
downloads table
id user_id file_name
1011002 space-oddity
1021004 heroes
1031002 heroes
1041005 heroes
1051001 rebel-rebel
1061002 rebel-rebel
1071005 fame
1081002 changes
ERD
An entity relationship diagram showing the connection between two tables: A user table, and a downloads table. The users table contains three fields: id, username, and premium user. The id field is the primary key of the users table. The downloads table contains three fields: id, user_id, and file_name. Within the downloads table, the id field is the primary key, and user_id is a foreign key with a many to one relationship to the primary key in the users table.
Now, consider a third table called songs that lists all songs in this music service's collection.
downloads table
id user_id file_name
1011002 space-oddity
1021004 heroes
1031002 heroes
1041005 heroes
1051001 rebel-rebel
1061002 rebel-rebel
1071005 fame
1081002 changes
songs table
file_name year_released
changes 1971
fame 1975
heroes 1977
modern-love 1983
rebel-rebel 1974
space-oddity 1969
starman 1972
New ERD, including songs table
An entity relationship diagram showing the connection between three tables: Users, downloads, and songs. The users table contains three fields: id, username, and premium-user. The id field is the primary key of the users table. The downloads table contains three fields: id, user_id, and file_name. The id field is the primary key of the downloads table. User_id is a foreign key that has a many to one relationship with the user tables primary key. File_name is a foreign key that has a many to one relationship with the songs tables primary key. The songs table contains two fields: file_name, and year_released. The file_name field is the primary key of the songs table.
If you were to use the query below to RIGHT JOIN the downloads table to the songs table, how many rows would be in the resulting table?
SELECT
d.id,
d.file_name,
s.year_released
FROM downloads d
RIGHT JOIN songs s
ON d.file_name = s.file_name;
Question 7 options:
a)
5
b)
7
c)
8
d)
10

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_2

Step: 3

blur-text-image_3

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

2nd Edition

1597499471, 978-1597499477

More Books

Students also viewed these Databases questions

Question

Compose the six common types of social business messages.

Answered: 1 week ago

Question

Describe positive and neutral messages.

Answered: 1 week ago