Problem Sets + Solutions for computer science topics
SELECT product_name, company_name, category_name
FROM products
JOIN categories ON categories.category_id = products.category_id
JOIN suppliers ON suppliers.supplier_id = products.supplier_id;
SELECT category_name, ROUND(AVG(unit_price), 2)
FROM products
JOIN categories ON categories.category_id = products.category_id
GROUP BY category_name;
SELECT city, company_name, contact_name, 'customers' AS role
FROM customers
UNION ALL
SELECT city, company_name, contact_name, 'suppliers' AS role
FROM suppliers;