# 3.9.4 Assignment

course: Academy — 65-GENAI-for-Engineers
module: Academy/65-GENAI-for-Engineers
type: pdf
source_url: https://personal-learn.armco.dev/files/Academy/65-GENAI-for-Engineers/assignments/3.9.4_Assignment__Hands-On_Examples_with_Practice_(Joins)/3.9.4_Assignment.pdf
pages: 2

---
[page 1]
Assignment: SQL Joins 
 Instructions: 
 ●  Use appropriate  JOIN  types based on the scenario. 
 ●  Submit SQL queries along with brief explanations where required. 
 ●  Use any sample tables (  Customers  ,  Orders  ,  Employees  ,  Products  , etc.) or define 
 your own schema if needed. 
 Q1. Theoretical 
 Explain the difference between  INNER JOIN  ,  LEFT JOIN  ,  and  FULL OUTER JOIN  with 
 the help of a Venn diagram. 
 Include real-life examples for each. 
 Q2. Hands-on 
 You have two tables: 
 Customers(CustomerID, Name, City) 
 Orders(OrderID, CustomerID, Amount) 
 Write SQL queries for the following: 
 ●  a) List all customers and their order amounts (include customers with no orders). 
 ●  b) List only those customers who have placed at least one order. 
 Q3. Hands-on 
 Using the tables: 
 Employees(EmpID, Name, DepartmentID) 
 Departments(DepartmentID, DeptName) 
 Write an SQL query to get a list of all employees along with their department names. 
 If any employee is not assigned a department, show “Not Assigned”.

[page 2]
Q4. Theoretical + Hands-on 
 Scenario: 
 You are designing a dashboard that shows product sales. 
 You have the following tables: 
 Products(ProductID, ProductName) 
 Sales(SaleID, ProductID, QuantitySold) 
 a) Which type of join would you use to show all products and their sales count, including those 
 with zero sales? 
 b) Write the SQL query. 
 Q5. Hands-on 
 Write a query to find customers who placed orders but whose details are missing from 
 the  Customers  table. 
 Use appropriate  JOIN  and explain why this type of  join is suitable.