Write the SQL code to display all the columns and rows/records in the Orders table Write the
Fantastic news! We've Found the answer you've been seeking!
Question:
- Write the SQL code to display all the columns and rows/records in the Orders table
- Write the SQL code to display the order_id, customer_id and the order_date for all orders.
- Write the SQL code to display the order_id, customer_id and order_date for all orders but order the results by order_date in ascending order.
- Write the SQL code to display the order_id of all of the orders that have been shipped. (Please look at the data in the Orders table to figure out how to identify if an order has been shipped.Also, watch my video above for a hint)
- Write the SQL code to display the order_id of all orders that have the status 1
- Write the SQL code to display the customer_id for all customers who have placed orders (If a customer has placed more than one order, their customer_id should NOT repeat)
- Write the SQL code to display the order_id and order_date of all orders that were placed in 2017 (January 1st to December 31st). (Don't forget that date values go inside quotes and have to be in the correct format)
- Write the SQL code to display the order_id of all orders that belonged to customer_id 2 and were not shipped. (Please look at the data in the Orders table to figure out how to identify if an order has not shipped yet. Also, watch my video above for a hint)
- Write the SQL code to display how many orders were placed in total. (hint: use a certain aggregate function)
- Write the SQL code to display how many orders were placed in total FOR EACH customer_id.
Related Book For
Database Systems Design Implementation and Management
ISBN: 978-1285196145
11th edition
Authors: Carlos Coronel, Steven Morris
Posted Date: