id
int64
0
8.66k
db_id
stringclasses
146 values
schema
stringclasses
146 values
question
stringlengths
3
224
output
stringlengths
18
577
4,100
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
What is the maximum and minimum market value of companies?
SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company
4,101
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
What is the headquarter of the company with the largest sales?
SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1
4,102
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
Show the different headquarters and number of companies at each headquarter.
SELECT Headquarters , COUNT(*) FROM company GROUP BY Headquarters
4,103
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
Show the most common headquarter for companies.
SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1
4,104
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
Show the headquarters that have at least two companies.
SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2
4,105
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
Show the headquarters that have both companies in banking industry and companies in oil and gas industry.
SELECT Headquarters FROM company WHERE Industry = "Banking" INTERSECT SELECT Headquarters FROM company WHERE Industry = "Oil and gas"
4,106
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
Show the names of companies and of employees.
SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID
4,107
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
Show names of companies and that of employees in descending order of number of years working for that employee.
SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID ORDER BY T1.Year_working
4,108
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
Show the names of employees that work for companies with sales bigger than 200.
SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200
4,109
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
Show the names of companies and the number of employees they have
SELECT T3.Name , COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name
4,110
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
List the names of people that are not employed by any company
SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM employment)
4,111
company_employee
CREATE TABLE "people" ( "People_ID" int, "Age" int, "Name" text, "Nationality" text, "Graduation_College" text, PRIMARY KEY ( "People_ID" ) ); CREATE TABLE "company" ( "Company_ID" real, "Name" text, "Headquarters" text, "Industry" text, "Sales_in_Billion" rea...
list the names of the companies with more than 200 sales in the descending order of sales and profits.
SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion , Profits_in_Billion DESC
4,112
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
How many film are there?
SELECT count(*) FROM film
4,113
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Count the number of films.
SELECT count(*) FROM film
4,114
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
List the distinct director of all films.
SELECT DISTINCT Director FROM film
4,115
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the different film Directors?
SELECT DISTINCT Director FROM film
4,116
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What is the average ticket sales gross in dollars of films?
SELECT avg(Gross_in_dollar) FROM film
4,117
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Return the average gross sales in dollars across all films.
SELECT avg(Gross_in_dollar) FROM film
4,118
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the low and high estimates of film markets?
SELECT Low_Estimate , High_Estimate FROM film_market_estimation
4,119
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Return the low and high estimates for all film markets.
SELECT Low_Estimate , High_Estimate FROM film_market_estimation
4,120
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the types of film market estimations in year 1995?
SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995
4,121
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Return the types of film market estimations in 1995.
SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995
4,122
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the maximum and minimum number of cities in all markets.
SELECT max(Number_cities) , min(Number_cities) FROM market
4,123
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Return the maximum and minimum number of cities across all markets.
SELECT max(Number_cities) , min(Number_cities) FROM market
4,124
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
How many markets have number of cities smaller than 300?
SELECT count(*) FROM market WHERE Number_cities < 300
4,125
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Count the number of markets that have a number of cities lower than 300.
SELECT count(*) FROM market WHERE Number_cities < 300
4,126
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
List all countries of markets in ascending alphabetical order.
SELECT Country FROM market ORDER BY Country ASC
4,127
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the countries for each market, ordered alphabetically?
SELECT Country FROM market ORDER BY Country ASC
4,128
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
List all countries of markets in descending order of number of cities.
SELECT Country FROM market ORDER BY Number_cities DESC
4,129
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the countries for each market ordered by decreasing number of cities?
SELECT Country FROM market ORDER BY Number_cities DESC
4,130
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Please show the titles of films and the types of market estimations.
SELECT T1.Title , T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID
4,131
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the titles of films and corresponding types of market estimations?
SELECT T1.Title , T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID
4,132
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Show the distinct director of films with market estimation in the year of 1995.
SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995
4,133
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Who are the different directors of films which had market estimation in 1995?
SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995
4,134
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What is the average number of cities of markets with low film market estimate bigger than 10000?
SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000
4,135
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Give the average number of cities within markets that had a low market estimation larger than 10000?
SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000
4,136
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Please list the countries and years of film market estimations.
SELECT T2.Country , T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID
4,137
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the countries of markets and their corresponding years of market estimation?
SELECT T2.Country , T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID
4,138
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Please list the years of film market estimations when the market is in country "Japan" in descending order.
SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC
4,139
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the years of film market estimation for the market of Japan, ordered by year descending?
SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC
4,140
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
List the studios of each film and the number of films produced by that studio.
SELECT Studio , COUNT(*) FROM film GROUP BY Studio
4,141
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
How films are produced by each studio?
SELECT Studio , COUNT(*) FROM film GROUP BY Studio
4,142
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
List the name of film studio that have the most number of films.
SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1
4,143
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What is the name of teh studio that created the most films?
SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1
4,144
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
List the names of studios that have at least two films.
SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2
4,145
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the names of studios that have made two or more films?
SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2
4,146
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
List the title of films that do not have any market estimation.
SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation)
4,147
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the titles of films that do not have a film market estimation?
SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation)
4,148
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Show the studios that have produced films with director "Nicholas Meyer" and "Walter Hill".
SELECT Studio FROM film WHERE Director = "Nicholas Meyer" INTERSECT SELECT Studio FROM film WHERE Director = "Walter Hill"
4,149
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the names of studios that have produced films with both Nicholas Meyer and Walter Hill?
SELECT Studio FROM film WHERE Director = "Nicholas Meyer" INTERSECT SELECT Studio FROM film WHERE Director = "Walter Hill"
4,150
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Find the titles and studios of the films that are produced by some film studios that contained the word "Universal".
SELECT title , Studio FROM film WHERE Studio LIKE "%Universal%"
4,151
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the titles and studios of films that have been produced by a studio whose name contains "Universal"?
SELECT title , Studio FROM film WHERE Studio LIKE "%Universal%"
4,152
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Show the studios that have not produced films with director "Walter Hill".
SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = "Walter Hill"
4,153
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Which studios have never worked with the director Walter Hill?
SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = "Walter Hill"
4,154
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
List the studios which average gross is above 4500000.
SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000
4,155
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Which studios have an average gross of over 4500000?
SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000
4,156
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What is the title of the film that has the highest high market estimation.
SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1
4,157
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Return the title of the film with the highest high estimate?
SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1
4,158
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
What are the titles and directors of the films were never presented in China?
SELECT title , director FROM film WHERE film_id NOT IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')
4,159
film_rank
CREATE TABLE "film" ( "Film_ID" int, "Title" text, "Studio" text, "Director" text, "Gross_in_dollar" int, PRIMARY KEY ( "Film_ID" ) ); CREATE TABLE "market" ( "Market_ID" int, "Country" text, "Number_cities" int, PRIMARY KEY ( "Market_ID" ) ); CREATE TABLE "film_market_estimation" ( "Estimati...
Return the titles and directors of films that were never in the market of China.
SELECT title , director FROM film WHERE film_id NOT IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')
4,160
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
How many calendar items do we have?
SELECT count(*) FROM Ref_calendar
4,161
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Count the number of all the calendar items.
SELECT count(*) FROM Ref_calendar
4,162
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Show all calendar dates and day Numbers.
SELECT calendar_date , day_Number FROM Ref_calendar
4,163
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What are all the calendar dates and day Numbers?
SELECT calendar_date , day_Number FROM Ref_calendar
4,164
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Show the number of document types.
SELECT count(*) FROM Ref_document_types
4,165
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
How many document types are there?
SELECT count(*) FROM Ref_document_types
4,166
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
List all document type codes and document type names.
SELECT document_type_code , document_type_name FROM Ref_document_types
4,167
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What are all the document type codes and document type names?
SELECT document_type_code , document_type_name FROM Ref_document_types
4,168
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What is the name and description for document type code RV?
SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = "RV"
4,169
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Give me the name and description of the document type code RV.
SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = "RV"
4,170
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What is the document type code for document type "Paper"?
SELECT document_type_code FROM Ref_document_types WHERE document_type_name = "Paper"
4,171
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Find the code of the document type "Paper".
SELECT document_type_code FROM Ref_document_types WHERE document_type_name = "Paper"
4,172
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Show the number of documents with document type code CV or BK.
SELECT count(*) FROM All_documents WHERE document_type_code = "CV" OR document_type_code = "BK"
4,173
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
How many documents have document type code CV or BK?
SELECT count(*) FROM All_documents WHERE document_type_code = "CV" OR document_type_code = "BK"
4,174
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What is the date when the document "Marry CV" was stored?
SELECT date_stored FROM All_documents WHERE Document_name = "Marry CV"
4,175
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
When was the document named "Marry CV" stored? Give me the date.
SELECT date_stored FROM All_documents WHERE Document_name = "Marry CV"
4,176
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What is the day Number and date of all the documents?
SELECT T2.day_Number , T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date
4,177
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Return the day Number and stored date for all the documents.
SELECT T2.day_Number , T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date
4,178
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What is the document type name for the document with name "How to read a book"?
SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = "How to read a book"
4,179
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Find the document type name of the document named "How to read a book".
SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = "How to read a book"
4,180
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Show the number of locations.
SELECT count(*) FROM Ref_locations
4,181
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
How many locations are listed in the database?
SELECT count(*) FROM Ref_locations
4,182
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
List all location codes and location names.
SELECT location_code , location_name FROM Ref_locations
4,183
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What are all the location codes and location names?
SELECT location_code , location_name FROM Ref_locations
4,184
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What are the name and description for location code x?
SELECT location_name , location_description FROM Ref_locations WHERE location_code = "x"
4,185
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Give me the name and description of the location with code x.
SELECT location_name , location_description FROM Ref_locations WHERE location_code = "x"
4,186
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What is the location code for the country "Canada"?
SELECT location_code FROM Ref_locations WHERE location_name = "Canada"
4,187
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Show the location code of the country "Canada".
SELECT location_code FROM Ref_locations WHERE location_name = "Canada"
4,188
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
How many roles are there?
SELECT count(*) FROM ROLES
4,189
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Count the total number of roles listed.
SELECT count(*) FROM ROLES
4,190
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
List all role codes, role names, and role descriptions.
SELECT role_code , role_name , role_description FROM ROLES
4,191
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What are all the role codes, role names, and role descriptions?
SELECT role_code , role_name , role_description FROM ROLES
4,192
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What are the name and description for role code "MG"?
SELECT role_name , role_description FROM ROLES WHERE role_code = "MG"
4,193
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Find the name and description of the role with code "MG".
SELECT role_name , role_description FROM ROLES WHERE role_code = "MG"
4,194
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Show the description for role name "Proof Reader".
SELECT role_description FROM ROLES WHERE role_name = "Proof Reader"
4,195
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What is the description of the role named "Proof Reader"?
SELECT role_description FROM ROLES WHERE role_name = "Proof Reader"
4,196
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
How many employees do we have?
SELECT count(*) FROM Employees
4,197
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Find the number of employees we have.
SELECT count(*) FROM Employees
4,198
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
Show the name, role code, and date of birth for the employee with name 'Armani'.
SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani'
4,199
cre_Doc_Tracking_DB
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR( 15 ) NOT NULL, Document_Type_Name VARCHAR( 255 ) NOT NULL, Document_Type_Description VARCHAR( 255 ) NOT NULL, PRIMARY KEY ( Document_Type_Code ) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL, Day_Number INTEGER, PRIM...
What are the name, role code, and date of birth of the employee named 'Armani'?
SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani'