0% found this document useful (0 votes)
131 views1 page

SQL 1 Questions

The document describes several database relations for a symphony organization: Person stores customer contact information, Show stores performance details, Song stores musical works, SongsPerformed links songs to performances, Purchase tracks ticket purchases, Musician stores musician profiles, and PerformedIn links musicians to performances. It also provides examples of SQL queries to find customer emails for a 2019 show, shows with Canadian musicians and their attendance, and flute players.

Uploaded by

Amir Jafarvand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views1 page

SQL 1 Questions

The document describes several database relations for a symphony organization: Person stores customer contact information, Show stores performance details, Song stores musical works, SongsPerformed links songs to performances, Purchase tracks ticket purchases, Musician stores musician profiles, and PerformedIn links musicians to performances. It also provides examples of SQL queries to find customer emails for a 2019 show, shows with Canadian musicians and their attendance, and flute players.

Uploaded by

Amir Jafarvand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Here are some relations that exist in a database for a symphony.

Person(email, name, age)


• This relation stores anyone who has signed up for our mailing list. Tuples in this relation
may not be listed in Purchase.

Show(id, year, month, date, showing, attendanceNumber)


• Showing describes whether a show was during morning, afternoon, or evening

Song(composer, title)

SongsPerformed(showID, composer, title)


• showID is a foreign key referring to Show
• composer and title are foreign keys referring to attributes of the same name in Song

Purchase(email, showID, price)


• email is a foreign key referring to the email attribute in Person
• showID is a foreign key referring to Show

Musician(id, name, instrument, position, nationality)

PerformedIn(id, showID)
• id refers to the attribute of the same name in Musician
• showID is a foreign key referring to Show

Write SQL statements to answer the following questions:


1. Find the email addresses of people who attended a show in January 2019.

Do you need DISTINCT? Why or why not?

2. Find the year, month, date, and attendance numbers of all shows that had a Canadian
musician perform in it.

3. Find the names of all musicians who play the flute.

Do you need DISTINCT? Why or why not?

Page 1 of 1

You might also like