Write SQL queries that will answer the following questions, using the data in the PetStore database. As usual, please write all of your queries using your favorite text editor. When you are finished, save them as a file named Assignment6.sql and upload the file here to Canvas.
(6 points) What is the total (sale) value of the animals sold in December of 2004?
(8 points) To what state did the pet store sell the most merchandise (as measured by the total sales value) in July of 2004? Hint: Order your output appropriately and use LIMIT 1 at the end of your query (look up LIMIT using Google).
(6 points) Which animals sold for less than their cost (from the supplier)?
(8 points) List the cats that took longer than average cats to sell (measure time to sell as the sale date minus the order date from the supplier).
(7 points) Use an outer join to list the animal IDs of all dogs that are still in stock in the pet store (i.e., all dogs that have not been sold).
(7 points) Use an outer join to list all merchandise items (show the item ID and description) with more than 100 units on hand that have not been ordered on any order recorded in the database.
(6 points) Repeat the previous question, but use a subquery instead of an outer join. Hint: Use NOT IN.
(7 points) Using an outer join, produce a list of all of the customer IDs, and for each customer show how many sales have been made to that customer (each record in the tSale table is considered one sale). The number of sales must be zero for all customers who have never purchased anything from the pet store.
Our Advantages
Plagiarism Free Papers
We ensure that all our papers are written from scratch. We deliver original plagiarism-free work. To guarantee this, we submit all work alongside a plagiarism report.
Free Revisions
All our papers are completed and submitted before the deadline. We ensure this to provide you with enough time to go through the work and point out any sections or topics that may need revision or polishing. We provide unlimited revision services for free.
Title-page
All papers have a title page providing your personal and institutional information. We do not charge you for this title page.
Bibliography
All papers have a bibliography or references page. This page is a requirement for academic and professional documents. We provide this page at no cost for all our papers.
Originality & Security
At Thehomeworklabs, we guarantee the confidentiality and security of your information. We value our clients and take confidentiality seriously. All personal information is treated with confidentiality and stored safely to ensure that no third parties gain access to it. We also provide original work and attach an originality/plagiarism report alongside all papers.
24/7 Customer Support
Our customer support team is available 24/7 to provide you with any necessary assistance when you need it. You can contact us at any time, day or night, via email or through the live chat button.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
We provide our customers with the best experience in the academic and business writing field.
Pricing
We provide the best quality of service at affordable prices. We also allow our clients to make partial payments for their orders. You can also contact our customer support team in case you need to discuss a different payment plan.
Communication
Admission help & Client-Writer Contact
We realize that sometimes clarification is necessary to ensure that quality work is done. Therefore, we provide a button for clients and writers to communicate in case some clarification is needed.
Deadlines
Paper Submission
We ensure that we submit all papers ahead of their respective deadlines. This allows you to go through the documents and request any revision, corrections, or polishing before the paper is due.
Reviews
Customer Feedback
We encourage customer feedback, positive or negative. We can identify the various areas that we need to improve to provide even better services through your feedback. Please feel free to give us feedback.