CREATE TABLE Manufacturers (
    Code NUMBER PRIMARY KEY,
    Name TEXT,
    Headquarter TEXT,
    Founder TEXT,
    Revenue NUMBER
);
CREATE TABLE Products (
    Code NUMBER PRIMARY KEY,
    Name TEXT,
    Price NUMBER,
    Manufacturer NUMBER,
    FOREIGN KEY ("Manufacturer") REFERENCES Manufacturers("Code")
);

Question: Who is the founder of Sony?
SQL: SELECT founder FROM manufacturers WHERE name  =  'Sony'

Question: Return the founder of Sony.
SQL: SELECT founder FROM manufacturers WHERE name  =  'Sony'

Question: Where is the headquarter of the company founded by James?
SQL: SELECT headquarter FROM manufacturers WHERE founder  =  'James'

Question: What is the headquarter of the company whose founder is James?
SQL: SELECT headquarter FROM manufacturers WHERE founder  =  'James'

Question: Find all manufacturers' names and their headquarters, sorted by the ones with highest revenue first.
SQL: SELECT name ,  headquarter FROM manufacturers ORDER BY revenue DESC

Question: What are the names and headquarters of all manufacturers, ordered by revenue descending?
SQL: SELECT name ,  headquarter FROM manufacturers ORDER BY revenue DESC

Question: What are the average, maximum and total revenues of all companies?
SQL: SELECT avg(revenue) ,  max(revenue) ,  sum(revenue) FROM manufacturers

Question: Return the average, maximum, and total revenues across all manufacturers.
SQL: SELECT avg(revenue) ,  max(revenue) ,  sum(revenue) FROM manufacturers

Question: How many companies were created by Andy?
SQL: SELECT count(*) FROM manufacturers WHERE founder  =  'Andy'

Question: Return the number of companies created by Andy.
SQL: SELECT count(*) FROM manufacturers WHERE founder  =  'Andy'

Question: Find the total revenue created by the companies whose headquarter is located at Austin.
SQL: SELECT sum(revenue) FROM manufacturers WHERE headquarter  =  'Austin'

Question: What is the sum of revenue from companies with headquarters in Austin?
SQL: SELECT sum(revenue) FROM manufacturers WHERE headquarter  =  'Austin'

Question: What are the different cities listed?
SQL: SELECT DISTINCT headquarter FROM manufacturers

Question: Give the distinct headquarters of manufacturers.
SQL: SELECT DISTINCT headquarter FROM manufacturers

Question: Find the number of manufactures that are based in Tokyo or Beijing.
SQL: SELECT count(*) FROM manufacturers WHERE headquarter  =  'Tokyo' OR headquarter  =  'Beijing'

Question: How many manufacturers have headquarters in either Tokyo or Beijing?
SQL: SELECT count(*) FROM manufacturers WHERE headquarter  =  'Tokyo' OR headquarter  =  'Beijing'

Question: Find the founder of the company whose name begins with the letter 'S'.
SQL: SELECT founder FROM manufacturers WHERE name LIKE 'S%'

Question: Who is the founders of companies whose first letter is S?
SQL: SELECT founder FROM manufacturers WHERE name LIKE 'S%'

Question: Find the name of companies whose revenue is between 100 and 150.
SQL: SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150

Question: What are the names of companies with revenue between 100 and 150?
SQL: SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150

Question: What is the total revenue of all companies whose main office is at Tokyo or Taiwan?
SQL: SELECT sum(revenue) FROM manufacturers WHERE Headquarter  =  'Tokyo' OR Headquarter  =  'Taiwan'

Question: Return the total revenue of companies with headquarters in Tokyo or Taiwan.
SQL: SELECT sum(revenue) FROM manufacturers WHERE Headquarter  =  'Tokyo' OR Headquarter  =  'Taiwan'

Question: Find the name of product that is produced by both companies Creative Labs and Sony.
SQL: SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony'

Question: What are the names of products produced by both Creative Labs and Sony?
SQL: SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony'

Question: Find the name, headquarter and founder of the manufacturer that has the highest revenue.
SQL: SELECT name ,  headquarter ,  founder FROM manufacturers ORDER BY revenue DESC LIMIT 1

Question: What are the names, headquarters and founders of the company with the highest revenue?
SQL: SELECT name ,  headquarter ,  founder FROM manufacturers ORDER BY revenue DESC LIMIT 1

Question: Find the name, headquarter and revenue of all manufacturers sorted by their revenue in the descending order.
SQL: SELECT name ,  headquarter ,  revenue FROM manufacturers ORDER BY revenue DESC

Question: What are the names, headquarters and revenues for manufacturers, sorted by revenue descending?
SQL: SELECT name ,  headquarter ,  revenue FROM manufacturers ORDER BY revenue DESC

Question: Find the name of companies whose revenue is greater than the average revenue of all companies.
SQL: SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers)

Question: What are the names of manufacturers with revenue greater than the average of all revenues?
SQL: SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers)

Question: Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.
SQL: SELECT name FROM manufacturers WHERE revenue  <  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')

Question: What are the names of companies with revenue less than the lowest revenue of any manufacturer in Austin?
SQL: SELECT name FROM manufacturers WHERE revenue  <  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')

Question: Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.
SQL: SELECT sum(revenue) FROM manufacturers WHERE revenue  >  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')

Question: What is the total revenue of companies with revenue greater than the lowest revenue of any manufacturer in Austin?
SQL: SELECT sum(revenue) FROM manufacturers WHERE revenue  >  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')

Question: Find the total revenue of companies of each founder.
SQL: SELECT sum(revenue) ,  founder FROM manufacturers GROUP BY founder

Question: What is the total revenue of companies started by founder?
SQL: SELECT sum(revenue) ,  founder FROM manufacturers GROUP BY founder

Question: Find the name and revenue of the company that earns the highest revenue in each city.
SQL: SELECT name ,  max(revenue) ,  Headquarter FROM manufacturers GROUP BY Headquarter

Question: What are the names and revenues of the companies with the highest revenues in each headquarter city?
SQL: SELECT name ,  max(revenue) ,  Headquarter FROM manufacturers GROUP BY Headquarter

Question: Find the total revenue for each manufacturer.
SQL: SELECT sum(revenue) ,  name FROM manufacturers GROUP BY name

Question: What is the total revenue of each manufacturer?
SQL: SELECT sum(revenue) ,  name FROM manufacturers GROUP BY name

Question: Find the average prices of all products from each manufacture, and list each company's name.
SQL: SELECT avg(T1.price) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name

Question: What are the average prices of products for each manufacturer?
SQL: SELECT avg(T1.price) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name