Complete the code to select all columns from both tables using a CROSS JOIN.
SELECT * FROM employees [1] departments;The CROSS JOIN keyword returns the Cartesian product of the two tables, combining each row of the first table with every row of the second table.
Complete the code to count the total number of combinations produced by a CROSS JOIN between two tables.
SELECT COUNT(*) FROM products [1] categories;The CROSS JOIN produces all possible combinations of rows from both tables, so counting the rows after a CROSS JOIN gives the total number of combinations.
Fix the error in the query to correctly perform a CROSS JOIN between two tables.
SELECT * FROM orders [1] customers;CROSS JOIN does not use an ON clause because it returns all combinations of rows. The ON clause should be removed when using CROSS JOIN.
Fill both blanks to create a query that selects all columns from two tables using CROSS JOIN and filters the result with a WHERE clause.
SELECT * FROM sales [1] customers WHERE sales.region [2] 'East';
Use CROSS JOIN to combine all rows, then filter with = in the WHERE clause to select rows where the region is 'East'.
Fill all three blanks to create a query that uses CROSS JOIN and filters rows where the product price is greater than 100 and the category name is 'Electronics'.
SELECT * FROM products [1] categories WHERE products.price [2] 100 AND categories.name [3] 'Electronics';
The CROSS JOIN combines all rows. The WHERE clause filters products with price greater than 100 and categories named 'Electronics'.