SQL 5 – Assignment

PRACTICE QUESTIONS FOR SUB-MODULE 5

Instructions for Practice Questions

To effectively practice SQL joins, use the provided dataset, which includes the following tables:

  • Customers (customer details)
  • Orders (order transactions)
  • Products (electronic product details)

Your Task:

  1. Use SQL queries to answer each practice question.
  2. Write and execute your SQL code using Microsoft SQL Server or any preferred SQL environment.
  3. Ensure your queries retrieve the correct data based on the given scenarios.
  4. If needed, modify or expand your queries to explore additional insights.

Reminder: Always reference the dataset structure to correctly use column names in your queries.

Happy Querying! 

QUESTIONS

  1. Write an SQL query to get a list of customers who have placed at least one order.
  2. Write an SQL query to retrieve all customers and their orders. If a customer has not placed an order, their details should still appear in the result.
  3. Write an SQL query to retrieve all products and their corresponding orders. If a product has never been ordered, it should still appear in the result.

EXTRACT THE SCRIPT OF YOUR QUERY AND UPLOAD.