Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

Purdue University Fort Wayne SQL Queries Worksheet

Purdue University Fort Wayne SQL Queries Worksheet

Purdue University Fort Wayne SQL Queries Worksheet

Description

Your task in this assignment is to write a set of SQL queries (I will supply the tables). The script file has been added to the question and run it in SQLDeveloper to build the tables you will be querying:

CD(CID, Title, Artist, YearReleased, Price)

CDSTORE(SID, Name, City, State)

CDORDER(OrderID, StoreID, CDID, Quantity, OrderDate)

In addition to the primary keys underlined above, CDID in CDORDER is a foreign key referencing CID in CD, and StoreID in CDORDER is a foreign key referencing SID in CDSTORE. Look at the Columns, Data, and Constraints for each of the three tables before continuing, to be sure that they have been constructed correctly. You might also want to draw the foreign keys and reference arrows into the set of relation schemas given above to be sure that you understand the links among the tables. For each of the following query problems, follow the steps discussed in class: interpret the problem, predict the output by solving it by hand on the needed table(s), write a query to solve the problem, and test the query. (Many of these query problems can be solved with information from just one of the given tables, but some will require inner joins.) In a separate .sql file (do not modify CDs2022.sql), write a script that contains just eight SQL queries to solve the following problems (in this order):

1. Give the title, price, and year of all CDs released by Alice Stein before 2017, ordered from the newest CD to the oldest CD.

2. Give an alphabetical list of the names of all stores whose names begin with ‘CD’.

3. Display the number of CDs released in each year, ordered from the earliest year to the latest. (Include the value of the year itself in each line of your output as well.)

4. For each artist, give the artist’s name and the average price of the CDs released by that artist, ordered from the lowest average price to the highest average price.

5. For each store that has ordered CDs, give the ID of the store and the total quantity of CDs that the store has ordered. Order the output by the ID of the store.

6. Give the IDs and names of all CD stores that placed an order during April of 2021.

7. List, in alphabetical order, the titles of all CDs ordered by stores in New York (‘NY’). (Hint: You will need to join all three tables together to solve this problem.)

8. For each CD, give the title of the CD and how many orders have been placed for that CD – not the total quantity, just how many orders have been placed for any quantity of that CD. Order the output from the CD with the most orders placed for it to the CD with the fewest. (If no one has ordered the CD yet, you do not have to include it in the output.)

You may write and test your queries individually in SQLDeveloper, but once you have them working, you should put them all together into a single script file and be sure that the queries can be run all together in this form. Run the script file containing your queries to verify that your results are correct.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20