Question: SQL query help, any help would be greatly appreciated! 1. Write SQL queries (using JOINS ) to return results for the following: a. CUSTOMER and
SQL query help, any help would be greatly appreciated!

1. Write SQL queries (using JOINS) to return results for the following: a. CUSTOMER and PAYMENT b. LOCATION and CUSTOMER c. EMPLOYEE and ORDER
2. Rewrite the queries in #1 using SUBQUERIES
Using Subqueries in various formats
3. Write a query that answers this question: Which customer has more than 2 completed orders? Return the following:
Name of the Customer
the total number of orders for each customer
Use a DERIVED table in your logic
4. Write a query to illustrate the use of a subquery in a SELECT clause to return the following
the most recent invoice for each customer
5. Write a query to illustrate the use of a subquery as a source in a JOIN
Return each service that has a promotion
____________________________________________________________________
Thank you in advance!!
\begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ PAYMENT } \\ \hline PK & PaymentID \\ \hline & PaymentType \\ AccountNum \\ RoutingNum \\ CreditCardNum \\ CCExpDate \\ CCSecurityNum \\ Status \\ CreatedDate \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ PROMO_SVC } \\ \hline PK & PromeServID \\ \hline FK & ServicelD \\ FK & PromoCode \\ & CreatedDate \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ PROMOTION } \\ \hline PK & PromoCode \\ \hline & PromoDescriptionStartDateEndDateStatus \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ INVOICE } \\ \hline PK & InvoicelD \\ \hline FK & CustomerID \\ FK & OrderID \\ FK & EmployeelD \\ & SubTotal \\ TaxAmount \\ TotalAmount \\ InvoiceDate \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ CATEGORY_SVC } \\ \hline PK & CategoryID \\ \hline & CategoryName \\ \hline \end{tabular} CellPhone Title DateOfHire
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
