Question: How will be those SQL functions write down The Table Name is: How many rows are in the Orders table? (Hint: Look up COUNT function)
How will be those SQL functions write down
The Table Name is:
-
How many rows are in the Orders table? (Hint: Look up COUNT function)
-
List all columns in the Orders table in reverse numerical order (from largest to smallest) by order number. Limit the output to the first 5 rows.
-
What are the earliest and latest order dates in the Orders table? (Hint: Lookup MAX and MIN functions)
-
List employee first names in alphabetical order along with a count of employees that have each first name. (Hint: you will need GROUP BY and ORDER BY clauses.)
-
What orders do not have a status of Cancelled? Sort by order number. (Hint: Use the not equals operator.)
-
Update Steve Pattersons first name to Steven in the employees table. Ensure that your update will not change a person whose first name is Steve but whose last name is not Patterson and will not change a person whose last name is Patterson but whose first name is not Steve. (There will be no results grid for this question.)
-
List customer name, contact last name, contact first name, phone, city, and credit limit for customers in the cities of Paris or Lyon in France and who have a credit limit between 100000 and 130000. Do not assume that city names are unique. There can be cities with the same name in different countries. (Hint: Remember to use parentheses in the WHERE clause if you have both ANDs and ORs.)
-
List the year, month and total $ amount of payments for each month. Order by year and month. (Hint: Make sure you get payments, not orders. Also make sure to get total payments, not individual payments.)
-
What is the average payment $ amount?
-
Add a new table called Dates to the classicmodels schema with the following columns:
| Column | Primary Key | Data Type | Optional |
| FullDate | Yes | Date | No |
| MonthName | No | 3 characters | No |
| YearNumber | No | Integer | No |
| QuarterNumber | No | Integer | No |
| Notes | No | Variable, up to 150 characters | Yes |
Make sure all the properties of the columns required above are implemented in your SQL statement. You may NOT use the pop-up menu in the schema list to create the table. You must write your SQL statement from scratch and include a screenshot of the entire statement below.
-
Which month(s) in what year(s) from question 8 have the highest payment total amount? Your query may not use a LIMIT clause. It must work if there are any number of months tied for the highest payment total amount. It must not produce any output for a month that is not the highest payment total or tied for the highest payment total.
2 3 st 5 classicmodels Tables customers employees offices orderdetails orders payments productlines products Views Stored Procedures Functions sys 2 3 st 5 classicmodels Tables customers employees offices orderdetails orders payments productlines products Views Stored Procedures Functions sys
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
