Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Data is Provided in the pictures, I need help creating SQL queries. Query Questions: Query 1: Write a SELECT statement that returns these columns:

The Data is Provided in the pictures, I need help creating SQL queries.

image text in transcribedimage text in transcribedimage text in transcribed

Query Questions:

Query 1:

Write a SELECT statement that returns these columns:

Promotion Description

Service Description

Only return the values for those services with ID

Sort the data by the Service Description

Use aliases for the tables.

Query 2:

Write a SELECT statement that returns the following columns:

Employee's Full Name

Title

Their location address

Use aliases for the tables.

Query 3:

Write a SELECT statement that returns each customer who DO NOT have an order. Return these columns:

The first and last names

email address of the customer

Sort the result set in descending sequence by the last name of the customer Use aliases for the tables.

Query 4:

Write one SELECT statement that returns the following columns for those customers with orders:

Customer's Full name

Order details such as Order Date, Service Description, Order Status

Total amount invoiced

Note: You may result multiple rows if an order has more than 1 items

Sort the data by the Customer's Last Name

Use aliases for the tables.

PROMOTION \begin{tabular}{r|l|l|l|l|} \hline PromoCode & PromoDesc & StartDate & EndDate & Status \\ \hline 1 & 50% off 6th item & 20190101 & 20221231 & 1 \\ \hline 2 & Memorial Day 1/2 off All & 20230501 & 20230531 & A \\ \hline 3 & Student Back to School 10\% Discoun & 20200201 & & A \\ \hline 4 & Senior Citizen 15% & 20230201 & 20230331 & A \\ \hline 5 & Vets Discount 10% & 20220101 & 20221231 & I \\ \hline 6 & Military Gets 10% & 20220601 & & A \\ \hline \end{tabular} CATEGORY_SVC CategoryID CategoryName 1 Small clothing 2 Large clothing 3 Bedding 5 Women Formal 6 Home SERVICE \begin{tabular}{|r|l|r|r|r|} \hline ServicelD & ServiceDescription & \multicolumn{1}{|l|}{ UnitPrice } & \multicolumn{1}{l|}{ CategorylD } & \multicolumn{1}{l|}{ CreatedDate } \\ \hline 1 & Shirts & 10.00 & 1 & 20190101 \\ \hline 2 & Blankets & 25.00 & 3 & 20190101 \\ \hline 3 & Large bedding & 30.00 & 3 & 20200301 \\ \hline 4 & Pants & 12.00 & 1 & 20200302 \\ \hline 5 & Delicate evening dresses & 60.00 & 5 & 20210101 \\ \hline 6 & skirts & 8.00 & 1 & 20220102 \\ \hline 7 & Winter Jackets & 25.00 & 2 & 20220103 \\ \hline 8 & Men formal wear & 35.00 & 2 & 20230131 \\ \hline 9 & Curtains & 50.00 & 6 & 20230131 \\ \hline \end{tabular} CUSTOMER EMPLOYEE PROMO_SVC \begin{tabular}{r|r|r|r|} \hline PromoServID & PromoCode & ServicelD & CreatedDate \\ \hline 1 & 1 & 1 & 20210501 \\ \hline 2 & 3 & 5 & 20221215 \\ \hline 3 & 5 & 4 & 20221201 \\ \hline 4 & 6 & 50230101 \\ \hline 5 & 3 & 20220704 \\ \hline 6 & 3 & 2 & 20221201 \\ \hline \end{tabular} ORDER "*p-pending "*c-completed ORDER_SVC INVOICE Tax rate 8.625%

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

Recommended Textbook for

More Books

Students also viewed these Databases questions