db_name
stringclasses 146
values | prompt
stringlengths 310
4.81k
|
|---|---|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# What is the maximum and minimum market value of companies?
#
### SQL:
#
# SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company
#
### End.
|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# What is the headquarter of the company with the largest sales?
#
### SQL:
#
# SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1
#
### End.
|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# Show the different headquarters and number of companies at each headquarter.
#
### SQL:
#
# SELECT Headquarters , COUNT(*) FROM company GROUP BY Headquarters
#
### End.
|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# Show the most common headquarter for companies.
#
### SQL:
#
# SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# Show the headquarters that have at least two companies.
#
### SQL:
#
# SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2
#
### End.
|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# Show the headquarters that have both companies in banking industry and companies in oil and gas industry.
#
### SQL:
#
# SELECT Headquarters FROM company WHERE Industry = "Banking" INTERSECT SELECT Headquarters FROM company WHERE Industry = "Oil and gas"
#
### End.
|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# Show the names of companies and of employees.
#
### SQL:
#
# 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
#
### End.
|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# Show names of companies and that of employees in descending order of number of years working for that employee.
#
### SQL:
#
# 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
#
### End.
|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# Show the names of employees that work for companies with sales bigger than 200.
#
### SQL:
#
# 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
#
### End.
|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# Show the names of companies and the number of employees they have
#
### SQL:
#
# 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
#
### End.
|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# List the names of people that are not employed by any company
#
### SQL:
#
# SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM employment)
#
### End.
|
company_employee
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# people ( People_ID, Age, Name, Nationality, Graduation_College )
# company ( Company_ID, Name, Headquarters, Industry, Sales_in_Billion, Profits_in_Billion, Assets_in_Billion, Market_Value_in_Billion )
# employment ( Company_ID, People_ID, Year_working )
#
# employment.People_ID can be joined with people.People_ID
# employment.Company_ID can be joined with company.Company_ID
#
### Question:
#
# list the names of the companies with more than 200 sales in the descending order of sales and profits.
#
### SQL:
#
# SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion , Profits_in_Billion DESC
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# How many film are there?
#
### SQL:
#
# SELECT count(*) FROM film
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Count the number of films.
#
### SQL:
#
# SELECT count(*) FROM film
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# List the distinct director of all films.
#
### SQL:
#
# SELECT DISTINCT Director FROM film
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the different film Directors?
#
### SQL:
#
# SELECT DISTINCT Director FROM film
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What is the average ticket sales gross in dollars of films?
#
### SQL:
#
# SELECT avg(Gross_in_dollar) FROM film
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Return the average gross sales in dollars across all films.
#
### SQL:
#
# SELECT avg(Gross_in_dollar) FROM film
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the low and high estimates of film markets?
#
### SQL:
#
# SELECT Low_Estimate , High_Estimate FROM film_market_estimation
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Return the low and high estimates for all film markets.
#
### SQL:
#
# SELECT Low_Estimate , High_Estimate FROM film_market_estimation
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the types of film market estimations in year 1995?
#
### SQL:
#
# SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Return the types of film market estimations in 1995.
#
### SQL:
#
# SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the maximum and minimum number of cities in all markets.
#
### SQL:
#
# SELECT max(Number_cities) , min(Number_cities) FROM market
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Return the maximum and minimum number of cities across all markets.
#
### SQL:
#
# SELECT max(Number_cities) , min(Number_cities) FROM market
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# How many markets have number of cities smaller than 300?
#
### SQL:
#
# SELECT count(*) FROM market WHERE Number_cities < 300
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Count the number of markets that have a number of cities lower than 300.
#
### SQL:
#
# SELECT count(*) FROM market WHERE Number_cities < 300
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# List all countries of markets in ascending alphabetical order.
#
### SQL:
#
# SELECT Country FROM market ORDER BY Country ASC
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the countries for each market, ordered alphabetically?
#
### SQL:
#
# SELECT Country FROM market ORDER BY Country ASC
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# List all countries of markets in descending order of number of cities.
#
### SQL:
#
# SELECT Country FROM market ORDER BY Number_cities DESC
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the countries for each market ordered by decreasing number of cities?
#
### SQL:
#
# SELECT Country FROM market ORDER BY Number_cities DESC
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Please show the titles of films and the types of market estimations.
#
### SQL:
#
# SELECT T1.Title , T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the titles of films and corresponding types of market estimations?
#
### SQL:
#
# SELECT T1.Title , T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Show the distinct director of films with market estimation in the year of 1995.
#
### SQL:
#
# 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
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Who are the different directors of films which had market estimation in 1995?
#
### SQL:
#
# 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
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What is the average number of cities of markets with low film market estimate bigger than 10000?
#
### SQL:
#
# 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
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Give the average number of cities within markets that had a low market estimation larger than 10000?
#
### SQL:
#
# 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
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Please list the countries and years of film market estimations.
#
### SQL:
#
# SELECT T2.Country , T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the countries of markets and their corresponding years of market estimation?
#
### SQL:
#
# SELECT T2.Country , T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Please list the years of film market estimations when the market is in country "Japan" in descending order.
#
### SQL:
#
# 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
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the years of film market estimation for the market of Japan, ordered by year descending?
#
### SQL:
#
# 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
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# List the studios of each film and the number of films produced by that studio.
#
### SQL:
#
# SELECT Studio , COUNT(*) FROM film GROUP BY Studio
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# How films are produced by each studio?
#
### SQL:
#
# SELECT Studio , COUNT(*) FROM film GROUP BY Studio
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# List the name of film studio that have the most number of films.
#
### SQL:
#
# SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What is the name of teh studio that created the most films?
#
### SQL:
#
# SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# List the names of studios that have at least two films.
#
### SQL:
#
# SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the names of studios that have made two or more films?
#
### SQL:
#
# SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# List the title of films that do not have any market estimation.
#
### SQL:
#
# SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation)
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the titles of films that do not have a film market estimation?
#
### SQL:
#
# SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation)
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Show the studios that have produced films with director "Nicholas Meyer" and "Walter Hill".
#
### SQL:
#
# SELECT Studio FROM film WHERE Director = "Nicholas Meyer" INTERSECT SELECT Studio FROM film WHERE Director = "Walter Hill"
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the names of studios that have produced films with both Nicholas Meyer and Walter Hill?
#
### SQL:
#
# SELECT Studio FROM film WHERE Director = "Nicholas Meyer" INTERSECT SELECT Studio FROM film WHERE Director = "Walter Hill"
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Find the titles and studios of the films that are produced by some film studios that contained the word "Universal".
#
### SQL:
#
# SELECT title , Studio FROM film WHERE Studio LIKE "%Universal%"
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the titles and studios of films that have been produced by a studio whose name contains "Universal"?
#
### SQL:
#
# SELECT title , Studio FROM film WHERE Studio LIKE "%Universal%"
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Show the studios that have not produced films with director "Walter Hill".
#
### SQL:
#
# SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = "Walter Hill"
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Which studios have never worked with the director Walter Hill?
#
### SQL:
#
# SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = "Walter Hill"
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# List the studios which average gross is above 4500000.
#
### SQL:
#
# SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Which studios have an average gross of over 4500000?
#
### SQL:
#
# SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What is the title of the film that has the highest high market estimation.
#
### SQL:
#
# 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
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Return the title of the film with the highest high estimate?
#
### SQL:
#
# 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
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# What are the titles and directors of the films were never presented in China?
#
### SQL:
#
# 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')
#
### End.
|
film_rank
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# film ( Film_ID, Title, Studio, Director, Gross_in_dollar )
# market ( Market_ID, Country, Number_cities )
# film_market_estimation ( Estimation_ID, Low_Estimate, High_Estimate, Film_ID, Type, Market_ID, Year )
#
# film_market_estimation.Market_ID can be joined with market.Market_ID
# film_market_estimation.Film_ID can be joined with film.Film_ID
#
### Question:
#
# Return the titles and directors of films that were never in the market of China.
#
### SQL:
#
# 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')
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# How many calendar items do we have?
#
### SQL:
#
# SELECT count(*) FROM Ref_calendar
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Count the number of all the calendar items.
#
### SQL:
#
# SELECT count(*) FROM Ref_calendar
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show all calendar dates and day Numbers.
#
### SQL:
#
# SELECT calendar_date , day_Number FROM Ref_calendar
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are all the calendar dates and day Numbers?
#
### SQL:
#
# SELECT calendar_date , day_Number FROM Ref_calendar
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the number of document types.
#
### SQL:
#
# SELECT count(*) FROM Ref_document_types
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# How many document types are there?
#
### SQL:
#
# SELECT count(*) FROM Ref_document_types
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# List all document type codes and document type names.
#
### SQL:
#
# SELECT document_type_code , document_type_name FROM Ref_document_types
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are all the document type codes and document type names?
#
### SQL:
#
# SELECT document_type_code , document_type_name FROM Ref_document_types
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the name and description for document type code RV?
#
### SQL:
#
# SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = "RV"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Give me the name and description of the document type code RV.
#
### SQL:
#
# SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = "RV"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the document type code for document type "Paper"?
#
### SQL:
#
# SELECT document_type_code FROM Ref_document_types WHERE document_type_name = "Paper"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Find the code of the document type "Paper".
#
### SQL:
#
# SELECT document_type_code FROM Ref_document_types WHERE document_type_name = "Paper"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the number of documents with document type code CV or BK.
#
### SQL:
#
# SELECT count(*) FROM All_documents WHERE document_type_code = "CV" OR document_type_code = "BK"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# How many documents have document type code CV or BK?
#
### SQL:
#
# SELECT count(*) FROM All_documents WHERE document_type_code = "CV" OR document_type_code = "BK"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the date when the document "Marry CV" was stored?
#
### SQL:
#
# SELECT date_stored FROM All_documents WHERE Document_name = "Marry CV"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# When was the document named "Marry CV" stored? Give me the date.
#
### SQL:
#
# SELECT date_stored FROM All_documents WHERE Document_name = "Marry CV"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the day Number and date of all the documents?
#
### SQL:
#
# SELECT T2.day_Number , T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Return the day Number and stored date for all the documents.
#
### SQL:
#
# SELECT T2.day_Number , T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the document type name for the document with name "How to read a book"?
#
### SQL:
#
# 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"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Find the document type name of the document named "How to read a book".
#
### SQL:
#
# 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"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the number of locations.
#
### SQL:
#
# SELECT count(*) FROM Ref_locations
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# How many locations are listed in the database?
#
### SQL:
#
# SELECT count(*) FROM Ref_locations
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# List all location codes and location names.
#
### SQL:
#
# SELECT location_code , location_name FROM Ref_locations
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are all the location codes and location names?
#
### SQL:
#
# SELECT location_code , location_name FROM Ref_locations
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the name and description for location code x?
#
### SQL:
#
# SELECT location_name , location_description FROM Ref_locations WHERE location_code = "x"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Give me the name and description of the location with code x.
#
### SQL:
#
# SELECT location_name , location_description FROM Ref_locations WHERE location_code = "x"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the location code for the country "Canada"?
#
### SQL:
#
# SELECT location_code FROM Ref_locations WHERE location_name = "Canada"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the location code of the country "Canada".
#
### SQL:
#
# SELECT location_code FROM Ref_locations WHERE location_name = "Canada"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# How many roles are there?
#
### SQL:
#
# SELECT count(*) FROM ROLES
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Count the total number of roles listed.
#
### SQL:
#
# SELECT count(*) FROM ROLES
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# List all role codes, role names, and role descriptions.
#
### SQL:
#
# SELECT role_code , role_name , role_description FROM ROLES
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are all the role codes, role names, and role descriptions?
#
### SQL:
#
# SELECT role_code , role_name , role_description FROM ROLES
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the name and description for role code "MG"?
#
### SQL:
#
# SELECT role_name , role_description FROM ROLES WHERE role_code = "MG"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Find the name and description of the role with code "MG".
#
### SQL:
#
# SELECT role_name , role_description FROM ROLES WHERE role_code = "MG"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the description for role name "Proof Reader".
#
### SQL:
#
# SELECT role_description FROM ROLES WHERE role_name = "Proof Reader"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What is the description of the role named "Proof Reader"?
#
### SQL:
#
# SELECT role_description FROM ROLES WHERE role_name = "Proof Reader"
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# How many employees do we have?
#
### SQL:
#
# SELECT count(*) FROM Employees
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Find the number of employees we have.
#
### SQL:
#
# SELECT count(*) FROM Employees
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# Show the name, role code, and date of birth for the employee with name 'Armani'.
#
### SQL:
#
# SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani'
#
### End.
|
cre_Doc_Tracking_DB
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Document_Types ( Document_Type_Code, Document_Type_Name, Document_Type_Description )
# Ref_Calendar ( Calendar_Date, Day_Number )
# Ref_Locations ( Location_Code, Location_Name, Location_Description )
# Roles ( Role_Code, Role_Name, Role_Description )
# All_Documents ( Document_ID, Date_Stored, Document_Type_Code, Document_Name, Document_Description, Other_Details )
# Employees ( Employee_ID, Role_Code, Employee_Name, Gender_MFU, Date_of_Birth, Other_Details )
# Document_Locations ( Document_ID, Location_Code, Date_in_Location_From, Date_in_Locaton_To )
# Documents_to_be_Destroyed ( Document_ID, Destruction_Authorised_by_Employee_ID, Destroyed_by_Employee_ID, Planned_Destruction_Date, Actual_Destruction_Date, Other_Details )
#
# All_Documents.Date_Stored can be joined with Ref_Calendar.Calendar_Date
# All_Documents.Document_Type_Code can be joined with Ref_Document_Types.Document_Type_Code
# Employees.Role_Code can be joined with Roles.Role_Code
# Document_Locations.Document_ID can be joined with All_Documents.Document_ID
# Document_Locations.Date_in_Locaton_To can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Date_in_Location_From can be joined with Ref_Calendar.Calendar_Date
# Document_Locations.Location_Code can be joined with Ref_Locations.Location_Code
# Documents_to_be_Destroyed.Document_ID can be joined with All_Documents.Document_ID
# Documents_to_be_Destroyed.Actual_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Planned_Destruction_Date can be joined with Ref_Calendar.Calendar_Date
# Documents_to_be_Destroyed.Destruction_Authorised_by_Employee_ID can be joined with Employees.Employee_ID
# Documents_to_be_Destroyed.Destroyed_by_Employee_ID can be joined with Employees.Employee_ID
#
### Question:
#
# What are the name, role code, and date of birth of the employee named 'Armani'?
#
### SQL:
#
# SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani'
#
### End.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.