SQL Commands Questions for BAIT_2
SQL Commands Questions for BAIT_2
Tables Schema:
1. SUPPLIER
o supplier_id (INT)
o supplier_name (VARCHAR)
o city (VARCHAR)
o country (VARCHAR)
o contact_name (VARCHAR)
o phone (VARCHAR)
o email (VARCHAR)
o supply_date (DATE)
2. MANUFACTURER
o manufacturer_id (INT)
o manufacturer_name (VARCHAR)
o city (VARCHAR)
o country (VARCHAR)
o contact_name (VARCHAR)
o phone (VARCHAR)
o email (VARCHAR)
o product_type (VARCHAR)
A:
20. Q: Find all manufacturers who have their names starting with 'S'.
23. Q: List all suppliers who have supplied after '2024-01-01' and are from 'Canada'.
A:
30. Q: Count the number of unique product types in the MANUFACTURER table.
34. Q: Find the top three cities with the most suppliers.
A:
SELECT city, COUNT(*) as supplier_count
FROM SUPPLIER
GROUP BY city
ORDER BY supplier_count DESC
LIMIT 3;
36. Q: Retrieve all suppliers and their corresponding manufacturer details for matching
cities.
A:
40. Q: Retrieve the manufacturer names and count of product types they produce.