Question: Create SQL queries for displaying the following results. 1. Which employees hired after Jan 1, 1985 live in area code 615? Display their last names,

Create SQL queries for displaying the following results.
1. Which employees hired after Jan 1, 1985 live in area code 615? Display their last names, first names, and hire dates sorted in ascending order by last name and descending order by hire date.
2. Display invoice numbers, product counts, and total amount for all invoices. This query will display one row for each invoice sorted in the ascending order of invoice numbers.
3. List customers who placed invoices on Jan 16, 2010. Display CUST_IDS along with invoice dates sorted in the descending order of Invoice dates.
4. Provide the number of Vendors hailing from each state. Provide suitable alias for the vendor count. This query will display one row for each Vendor State in the descending order of Vendor count.
5. For each area code with total of customer balances exceeding 1000, list customer counts and the total of customer balances. This query will list one row for each area code.
6. List the employee details for employees hired after Jan 1, 1990 whose last name falls between John and Zack. Sort the results in the ascending order of employee last names. For each employee the query should list employee number, employee last name & first name and employee hire date.
7. List Product code, Product description and Quantity above minimum (i.e., difference between Product quantity on hand and minimum quanity) for products which may need to be need to be reordered shortly (i.e., whose Quantities on hand above respective minimum quantities are less than 10 units). Sort the results in the ascending order of Quantity above minimum.
8. For each product discount offered (P_DISCOUNT), list number of products and average prices (provide suitable headings as aliases) for products whose quantity on hand is greater than 10 units. Your query will display one line for each product discount value.
9. Display customer details (customer code, customer last and first names, area code and customer balance) for customers living in area code 615 with cutomer balances either less than 250 or greater than 300.
10. For each state, display the number of vendors residing in the state (give suitable heading as alias) whose V_Order is Y. Your query should display one line for each vendor state sorted in the descending order of number of vendors.
Table Name CUSTOMER EMP INVOICE LINE Primary Key P CODE TV CODE CUS CODE EMP CODE INV NUMBER INV NUMBER, LINE NUMBER
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
