SQL Command Class 12
SQL Command Class 12
SQL Command Class 12
SELECT column_name(s) The LEFT JOIN keyword returns all records from the left
FROM table1 table (table1), and the matching records (if any) from the
LEFT JOIN table2 right table (table2).
ON table1.column_name = table2.column_name;
SELECT column_name(s) The RIGHT JOIN keyword returns all records from the
FROM table1 right table (table2), and the matching records (if any)
RIGHT JOIN table2 from the left table (table1).
ON table1.column_name = table2.column_name;
SELECT column_name(s) The CROSS JOIN or full join keyword returns all records
FROM table1 from both tables (table1 and table2).
CROSS JOIN table2;
Select all the different countries from the "Customers" The DISTINCT statement is used to return only distinct
table: (different) values.
SELECT DISTINCT Country FROM Customers;