You will use the Northwind database for this and all other SQL assignments going
ID: 3885719 • Letter: Y
Question
You will use the Northwind database for this and all other SQL assignments going forward. 1. List the complete customers table 2. List all products. Sort by unitPrice then by productname 3. Show the ProductID, ProductName. UnitPrice, UnitsInStock and UnitsOnOrder for all products that have been discontinued 4. List the customerId, the CompanyName and the first 8 characters in the company name using the customer table. 5. List the CustomerId and freight charges for the customers with the 10 largest freight charges 6. List the CustomerID and CompanyName for all Customers that contain 'Market' in their name. 7. Northwind has finally decided to give all employees an using the customer table charges in their name email address. The domain name will be northwind.com. Create a list of employee first and last names and email addresses in the format of first initial.Lastname@northwind.com. (Note the period between first initial and last name) Their ISP requires all email address to be submitted in lowercase Sort by last name in Ascending order. 8. List all customers who live in the following countries: France, Germany, USA or UK Use the IN Keyword. 9. List the largest 5 percent of freight charges. 10. The employee table Notes column contains a great deal of information concerning each employee including the languages they speak. Northwind needs someone who speaks German Notes of any employee with German in the notes to represent the company at a meeting. List the LastName, HomePhone and Notes of any employee with German in the notes. 11. List all orders with an order date in July 2014. Use the Between Keyword 12. List all orders with an order date in July 2014. DO NOT use the between Keyword 13. List all orders with no shipped date 14. List the customer IDs from the orders table. List each customerID only once. 15. List the customer Id, city, region and postal code for all customers. Sort by city, then by customer IDExplanation / Answer
Answer 1)
select * from Customers
Explanation: The above command will display all the attributes with their values of table Customers. Or we can say the above command will list complete Customers table.
Answer 2)
i) select * from Products order by UnitPrice desc
ii) select * from Products order by ProductName desc
Explanation: The first command will list products sort by unit price while second sql command will list products sort by product name.
Answer 3)
select ProductID,ProductName,UnitPrice,UnitsInStock,UnitsOnOrder from Products where Discontinued = 1
Explanation: The command will list the attributes if Discontinued attribute is True
Answer 4)
select CustomerID, LEFT(CompanyName, 8) from Customers
Explanation: The above command will show customer id and 8 charcters of company name
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.