Left Join: ========== table1 left join table2 Syntax for left join is: ------------------------- select alias-name-left-table.col1, alias-name-left-table.col2, ...., alias-name-right-table.col1, alias-name-right-table.col2, ..... from left-side-table-name alias-name inner join right-side-table-name alias name on condition; Scenario: --------- Online Store and customer orders Imagine you are working for an online store that sells products. You have two tables: 1) Customers table which contains: about customers 2) Orders table which contains the information about orders Solution: --------- 1) Create the table with the name of "Customers" by using the below syntax: create table customers ( customerId number, customerName varchar2(50), email varchar2(100) ); 2) Insert the data into the customers table by using the below syntax insert into customers values(&customerId, &customerName, &email); 3) Create the table with the name of "Orders" by using the below syntax: create table orders001 ( orderId number, customerId number, orderDate date ); 4) Insert the data into the orders table by using below syntax: insert into orders001 values(&orderId, &customerId, &orderDate); Question: -------- Write a query to generate a report showing all customers and their total orders. If a customer hasn't placed any orders yet, you still want to include then in the report with Null. Query: ------ select c.customerId, c.customerName, c.email, o.orderId, o.orderDate, o.totalAmount from customers c left join orders002 o on c.customerId = o.customerId; Assignment: ----------- Write a sql query to create two tables named with: Students Courses And prepare a report with all the student information who has enrolled for courses. and the student information who has not enrolled for any course as null.(Using left join)