Queries 2
- Due Mar 2, 2015 by 11:59pm
- Points 11
- Submitting a file upload
- Available after Feb 27, 2015 at 11:30am
Using the class_music_festival that you reverse engineered last week answer these questions, showing the step-by-step queries you used and the result that you get.
Remember to build up your queries slowly and use SELECT * on each step to confirm that you are getting what you think you are getting. Grading is 1 point for each query (query and answer). If you do not have step-by-step queries you will not receive any points. Remember to lay your queries out well (clause on each line, AND parts indented).
- How many people bought tickets to the festival?
- Given that tickets are issued in order within a purchase, find the number of the very last ticket sold? (This requires thinking first about sorting the tickets by the date of the purchase they were bought in and then by the ticket.id since those are assumed to be in order). So it requires two parts to an ORDER BY statement.
- What are the names of the bands that perform in the BMI venue?
- Show all the purchases in the order that they were purchased (just the final query needed here, not the results)
- Who purchased ticket number TA9875424?
- When was the first ticket to a performance at the venue BMI purchased?
- When is the first show (band name, venue name and start time) that Domhog Kiwter has a ticket to?
- Which band that performed at the AMD venue had the highest fee?
- How many tickets were sold for the performance that started at 2011-09-18 20:30:00?
Database improvement (2 points)
The festival organizers want to improve the festival. They propose tracking attendee's enjoyment of each performance, in a way that makes it possible to ask which bands/venues are the most popular. Propose changes to the database that would make this possible. Create a strategy for obtaining these ratings from festival goers, and ensure that the proposed extensions make your strategy possible (e.g., you can't email people without their email addresses!). Your answer should be in the form of a paragraph, an addition to the ERD, relational vocab for the ERD and a table sketch.
Rubric
Criteria | Ratings | Pts | ||
---|---|---|---|---|
Q1
threshold:
pts
|
|
pts
--
|
||
Q2
threshold:
pts
|
|
pts
--
|
||
Q3
threshold:
pts
|
|
pts
--
|
||
Q4
threshold:
pts
|
|
pts
--
|
||
Q5
threshold:
pts
|
|
pts
--
|
||
Q6
threshold:
pts
|
|
pts
--
|
||
Q7
threshold:
pts
|
|
pts
--
|
||
Q8
threshold:
pts
|
|
pts
--
|
||
Q9
threshold:
pts
|
|
pts
--
|
||
Database addition: Suggested database schema changes appropriate
threshold:
pts
|
|
pts
--
|
||
Database addition: Sensible and fully described collection strategy
threshold:
pts
|
|
pts
--
|
||
Total Points:
11
out of 11
|