Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is SQL, I need help with these statements please!!! Here is everything needed to do it: Write SQL statements for questions given below for

This is SQL, I need help with these statements please!!! Here is everything needed to do it:

Write SQL statements for questions given below for the PetStore database. Save your SELECT statements as Qry1, Qry2, , Qry8 in a text file (e.g., Notepad file)

Note: If the database in which you execute the PetStore database script has tables with table names listed below, please delete these tables to prevent error.

Table names in PetStore database: Customer Employee Sale City Supplier Animal AnimalOrder SaleAnimal Category AnimalOrderItem MerchandiseOrder OrderItem Merchandise SaleItem Breed CustomerAccount Preferences.

1. List the ItemID, Description, Quantity on hand, Category, and List price for all merchandise items for category cat with quantity on hand of more than 50 and list price of less than or equal to $25.00. Display result-set in descending order of the list price. (Note Please refer to the Merchandise table.)

2. List AnimalID, Category, Breed, ListPrice, DateBorn and Gender for female cats with list price greater than $150. Display result-set in descending order of the list price. (Note Please refer to the Animal table.)

3. List SupplierID, Supplier Name, Supplier City and Supplier State for suppliers from Nebraska and Kentucky. Display result-set in ascending order of supplier name. (Note Please refer to the Supplier and City tables.)

4. List customers who have made at least one purchase at the Pet Store during April 2007. Display CustomerID, Customer name, and Phone number in ascending order of customer last name, and within each last name in ascending order of first name. In the result-set each customer should be displayed only once. (Note Please refer to the Customer and Sale tables.)

5. Based on the sale price of the animals sold, find the most expensive bird(s) sold during the first six months of 2007. Display the AnimalID, Breed, Category, Gender, List price, and Sale price. (Note Please refer to the Sale, SaleAnimal, and Animal tables.)

6. List the number of dogs sold and the total sales generated by dogs sold between January 1st, 2007 and May 15th, 2007. Display the number of dogs sold and total sales amount with appropriate column headings. (Note SaleAnimal table contains the AnimalIDs and Sale Price of animals sold. Total sales generated by dogs is the sum of sale price of dogs sold. Please refer to the Sale, SaleAnimal, and Animal tables.)

7. From animals sold, list dogs that have some white color and have a list price less than $150. Display AnimalID, Name, Category, Breed, Gender, Color and List price in descending order of list price. (Note Please refer to the SaleAnimal and Animal tables.)

8. What is the total number of sales transactions processed by employees that are from Connecticut and Texas during the 4th quarter of 2007? Display the number of sales transactions with column heading SalesTransConnTexas.

image text in transcribed

Sale (PetStore) 9 SaleID SaleDate Employeeld Customer Sales Tax Customer (PetStore) 9 CustomerID Phone First Name Last Name Address ZpCode CityID City (PetStore) CityID ZpCode Employee (PetStore) 7 EmployeeID Last Name First Name Phone Address ZipCode CEID TaxPayerID DateHred DateReleased Manager Employee level Title City State AreaCode Population 1990 Population 1980 Country Latitude Loa Hut ale Supplier (PetStore) * 9 Supplier ID Name Contact Name Phone Address ZipCode CityID AnimalOrder (PetStore) * Order ID Order Date ReceiveDate SupplerID Shipping Cost Employee MerchandiseOrder (PetStore) PONumber Order Date ReceiveDate Suppler ID EmployeeID Shipping Cost AnimalOrder Item (PetStore) OrderID AD Cost Sale Item (PetStore) 9 SaleID Trem Quantity Sale Price SaleAnimal (PetStore) 9 SalelD Anini Sale Price Animal (PetStore) Animal OrderItem (PetStore) PONumber Trend Quantity Cost Category Breed Datelor Gender Registered Color List Price Photo Category (PetStore) Category Registration IngeFile Image Height Image Width Breed (PetStore) 9 Category 9 Breed Merchandise (PetStore) Item Description QuantityOnHand List Price Category Relationship Diagram for Pet Store Database

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

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

7. Identify six intercultural communication dialectics.

Answered: 1 week ago