db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
department_management
select count(*) from head where age > 56
Question: how many heads of the departments are older than 56 ? | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
how many heads of the departments are older than 56 ?
department_management
select name , born_state , age from head order by age
Question: list the name, born state and age of the heads of departments ordered by age. | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
list the name, born state and age of the heads of departments ordered by age.
department_management
select creation , name , budget_in_billions from department
Question: list the creation year, name and budget of each department. | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
list the creation year, name and budget of each department.
department_management
select max(budget_in_billions) , min(budget_in_billions) from department
Question: what are the maximum and minimum budget of the departments? | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
what are the maximum and minimum budget of the departments?
department_management
select avg(num_employees) from department where ranking between 10 and 15
Question: what is the average number of employees of the departments whose rank is between 10 and 15? | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
what is the average number of employees of the departments whose rank is between 10 and 15?
department_management
select name from head where born_state != 'california'
Question: what are the names of the heads who are born outside the california state? | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
what are the names of the heads who are born outside the california state?
department_management
select distinct t1.creation from department as t1 join management as t2 on t1.department_id = t2.department_id join head as t3 on t2.head_id = t3.head_id where t3.born_state = 'alabama'
Question: what are the distinct creation years of the departments managed by a secretary born in state 'alabama'? | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
what are the distinct creation years of the departments managed by a secretary born in state 'alabama'?
department_management
select born_state from head group by born_state having count(*) >= 3
Question: what are the names of the states where at least 3 heads were born? | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
what are the names of the states where at least 3 heads were born?
department_management
select creation from department group by creation order by count(*) desc limit 1
Question: in which year were most departments established? | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
in which year were most departments established?
department_management
select t1.name , t1.num_employees from department as t1 join management as t2 on t1.department_id = t2.department_id where t2.temporary_acting = 'yes'
Question: show the name and number of employees for the departments managed by heads whose temporary acting value is 'yes'? | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
show the name and number of employees for the departments managed by heads whose temporary acting value is 'yes'?
department_management
select count(distinct temporary_acting) from management
Question: how many acting statuses are there? | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
how many acting statuses are there?
department_management
select count(*) from department where department_id not in (select department_id from management);
Question: how many departments are led by heads who are not mentioned? | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
how many departments are led by heads who are not mentioned?
department_management
select distinct t1.age from management as t2 join head as t1 on t1.head_id = t2.head_id where t2.temporary_acting = 'yes'
Question: what are the distinct ages of the heads who are acting? | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
what are the distinct ages of the heads who are acting?
department_management
select t3.born_state from department as t1 join management as t2 on t1.department_id = t2.department_id join head as t3 on t2.head_id = t3.head_id where t1.name = 'treasury' intersect select t3.born_state from department as t1 join management as t2 on t1.department_id = t2.department_id join head as t3 on t2.head_id = t3.head_id where t1.name = 'homeland security'
Question: list the states where both the secretary of 'treasury' department and the secretary of 'homeland security' were born. | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
list the states where both the secretary of 'treasury' department and the secretary of 'homeland security' were born.
department_management
select t1.department_id , t1.name , count(*) from management as t2 join department as t1 on t1.department_id = t2.department_id group by t1.department_id having count(*) > 1
Question: which department has more than 1 head at a time? list the id, name and the number of heads. | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
which department has more than 1 head at a time? list the id, name and the number of heads.
department_management
select head_id , name from head where name like '%ha%'
Question: which head's name has the substring 'ha'? list the id and name. | Tables: department -> Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. head -> head_ID, name, born_state, age. management -> department_ID, head_ID, temporary_acting. | Joins: management.head_ID = head.head_ID, management.department_ID = department.Department_ID,
which head's name has the substring 'ha'? list the id and name.
farm
select count(*) from farm
Question: how many farms are there? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
how many farms are there?
farm
select count(*) from farm
Question: count the number of farms. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
count the number of farms.
farm
select total_horses from farm order by total_horses asc
Question: list the total number of horses on farms in ascending order. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
list the total number of horses on farms in ascending order.
farm
select total_horses from farm order by total_horses asc
Question: what is the total horses record for each farm, sorted ascending? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what is the total horses record for each farm, sorted ascending?
farm
select hosts from farm_competition where theme != 'aliens'
Question: what are the hosts of competitions whose theme is not 'aliens'? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what are the hosts of competitions whose theme is not 'aliens'?
farm
select hosts from farm_competition where theme != 'aliens'
Question: return the hosts of competitions for which the theme is not aliens? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
return the hosts of competitions for which the theme is not aliens?
farm
select theme from farm_competition order by year asc
Question: what are the themes of farm competitions sorted by year in ascending order? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what are the themes of farm competitions sorted by year in ascending order?
farm
select theme from farm_competition order by year asc
Question: return the themes of farm competitions, sorted by year ascending. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
return the themes of farm competitions, sorted by year ascending.
farm
select avg(working_horses) from farm where total_horses > 5000
Question: what is the average number of working horses of farms with more than 5000 total number of horses? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what is the average number of working horses of farms with more than 5000 total number of horses?
farm
select avg(working_horses) from farm where total_horses > 5000
Question: give the average number of working horses on farms with more than 5000 total horses. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
give the average number of working horses on farms with more than 5000 total horses.
farm
select max(cows) , min(cows) from farm
Question: what are the maximum and minimum number of cows across all farms. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what are the maximum and minimum number of cows across all farms.
farm
select max(cows) , min(cows) from farm
Question: return the maximum and minimum number of cows across all farms. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
return the maximum and minimum number of cows across all farms.
farm
select count(distinct status) from city
Question: how many different statuses do cities have? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
how many different statuses do cities have?
farm
select count(distinct status) from city
Question: count the number of different statuses. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
count the number of different statuses.
farm
select official_name from city order by population desc
Question: list official names of cities in descending order of population. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
list official names of cities in descending order of population.
farm
select official_name from city order by population desc
Question: what are the official names of cities, ordered descending by population? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what are the official names of cities, ordered descending by population?
farm
select official_name , status from city order by population desc limit 1
Question: list the official name and status of the city with the largest population. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
list the official name and status of the city with the largest population.
farm
select official_name , status from city order by population desc limit 1
Question: what is the official name and status of the city with the most residents? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what is the official name and status of the city with the most residents?
farm
select t2.year , t1.official_name from city as t1 join farm_competition as t2 on t1.city_id = t2.host_city_id
Question: show the years and the official names of the host cities of competitions. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
show the years and the official names of the host cities of competitions.
farm
select t2.year , t1.official_name from city as t1 join farm_competition as t2 on t1.city_id = t2.host_city_id
Question: give the years and official names of the cities of each competition. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
give the years and official names of the cities of each competition.
farm
select t1.official_name from city as t1 join farm_competition as t2 on t1.city_id = t2.host_city_id group by t2.host_city_id having count(*) > 1
Question: show the official names of the cities that have hosted more than one competition. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
show the official names of the cities that have hosted more than one competition.
farm
select t1.official_name from city as t1 join farm_competition as t2 on t1.city_id = t2.host_city_id group by t2.host_city_id having count(*) > 1
Question: what are the official names of cities that have hosted more than one competition? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what are the official names of cities that have hosted more than one competition?
farm
select t1.status from city as t1 join farm_competition as t2 on t1.city_id = t2.host_city_id group by t2.host_city_id order by count(*) desc limit 1
Question: show the status of the city that has hosted the greatest number of competitions. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
show the status of the city that has hosted the greatest number of competitions.
farm
select t1.status from city as t1 join farm_competition as t2 on t1.city_id = t2.host_city_id group by t2.host_city_id order by count(*) desc limit 1
Question: what is the status of the city that has hosted the most competitions? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what is the status of the city that has hosted the most competitions?
farm
select t2.theme from city as t1 join farm_competition as t2 on t1.city_id = t2.host_city_id where t1.population > 1000
Question: please show the themes of competitions with host cities having populations larger than 1000. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
please show the themes of competitions with host cities having populations larger than 1000.
farm
select t2.theme from city as t1 join farm_competition as t2 on t1.city_id = t2.host_city_id where t1.population > 1000
Question: what are the themes of competitions that have corresponding host cities with more than 1000 residents? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what are the themes of competitions that have corresponding host cities with more than 1000 residents?
farm
select status , avg(population) from city group by status
Question: please show the different statuses of cities and the average population of cities with each status. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
please show the different statuses of cities and the average population of cities with each status.
farm
select status , avg(population) from city group by status
Question: what are the statuses and average populations of each city? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what are the statuses and average populations of each city?
farm
select status from city group by status order by count(*) asc
Question: please show the different statuses, ordered by the number of cities that have each. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
please show the different statuses, ordered by the number of cities that have each.
farm
select status from city group by status order by count(*) asc
Question: return the different statuses of cities, ascending by frequency. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
return the different statuses of cities, ascending by frequency.
farm
select status from city group by status order by count(*) desc limit 1
Question: list the most common type of status across cities. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
list the most common type of status across cities.
farm
select status from city group by status order by count(*) desc limit 1
Question: what is the most common status across all cities? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what is the most common status across all cities?
farm
select official_name from city where city_id not in (select host_city_id from farm_competition)
Question: list the official names of cities that have not held any competition. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
list the official names of cities that have not held any competition.
farm
select official_name from city where city_id not in (select host_city_id from farm_competition)
Question: what are the official names of cities that have not hosted a farm competition? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what are the official names of cities that have not hosted a farm competition?
farm
select status from city where population > 1500 intersect select status from city where population < 500
Question: show the status shared by cities with population bigger than 1500 and smaller than 500. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
show the status shared by cities with population bigger than 1500 and smaller than 500.
farm
select status from city where population > 1500 intersect select status from city where population < 500
Question: which statuses correspond to both cities that have a population over 1500 and cities that have a population lower than 500? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
which statuses correspond to both cities that have a population over 1500 and cities that have a population lower than 500?
farm
select official_name from city where population > 1500 or population < 500
Question: find the official names of cities with population bigger than 1500 or smaller than 500. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
find the official names of cities with population bigger than 1500 or smaller than 500.
farm
select official_name from city where population > 1500 or population < 500
Question: what are the official names of cities that have population over 1500 or less than 500? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what are the official names of cities that have population over 1500 or less than 500?
farm
select census_ranking from city where status != 'village'
Question: show the census ranking of cities whose status are not 'village'. | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
show the census ranking of cities whose status are not 'village'.
farm
select census_ranking from city where status != 'village'
Question: what are the census rankings of cities that do not have the status 'village'? | Tables: city -> City_ID, Official_Name, Status, Area_km_2, Population, Census_Ranking. farm -> Farm_ID, Year, Total_Horses, Working_Horses, Total_Cattle, Oxen, Bulls, Cows, Pigs, Sheep_and_Goats. farm_competition -> Competition_ID, Year, Theme, Host_city_ID, Hosts. competition_record -> Competition_ID, Farm_ID, Rank. | Joins: farm_competition.Host_city_ID = city.City_ID, competition_record.Farm_ID = farm.Farm_ID, competition_record.Competition_ID = farm_competition.Competition_ID,
what are the census rankings of cities that do not have the status 'village'?
student_assessment
select t1.course_name from courses as t1 join student_course_registrations as t2 on t1.course_id = t2.course_id group by t1.course_id order by count(*) desc limit 1
Question: which course has most number of registered students? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
which course has most number of registered students?
student_assessment
select t1.course_name from courses as t1 join student_course_registrations as t2 on t1.course_id = t2.course_id group by t1.course_id order by count(*) desc limit 1
Question: what is the name of the course with the most registered students? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what is the name of the course with the most registered students?
student_assessment
select student_id from student_course_registrations group by student_id order by count(*) limit 1
Question: what is id of students who registered some courses but the least number of courses in these students? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what is id of students who registered some courses but the least number of courses in these students?
student_assessment
select student_id from student_course_registrations group by student_id order by count(*) limit 1
Question: what are the ids of the students who registered for some courses but had the least number of courses for all students? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the ids of the students who registered for some courses but had the least number of courses for all students?
student_assessment
select t2.first_name , t2.last_name from candidates as t1 join people as t2 on t1.candidate_id = t2.person_id
Question: what are the first name and last name of all candidates? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the first name and last name of all candidates?
student_assessment
select t2.first_name , t2.last_name from candidates as t1 join people as t2 on t1.candidate_id = t2.person_id
Question: what are the first and last names of all the candidates? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the first and last names of all the candidates?
student_assessment
select student_id from students where student_id not in (select student_id from student_course_attendance)
Question: list the id of students who never attends courses? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
list the id of students who never attends courses?
student_assessment
select student_id from students where student_id not in (select student_id from student_course_attendance)
Question: what are the ids of every student who has never attended a course? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the ids of every student who has never attended a course?
student_assessment
select student_id from student_course_attendance
Question: list the id of students who attended some courses? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
list the id of students who attended some courses?
student_assessment
select student_id from student_course_attendance
Question: what are the ids of all students who have attended at least one course? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the ids of all students who have attended at least one course?
student_assessment
select t1.student_id , t2.course_name from student_course_registrations as t1 join courses as t2 on t1.course_id = t2.course_id
Question: what are the ids of all students for courses and what are the names of those courses? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the ids of all students for courses and what are the names of those courses?
student_assessment
select t2.student_details from student_course_registrations as t1 join students as t2 on t1.student_id = t2.student_id order by t1.registration_date desc limit 1
Question: what is detail of the student who most recently registered course? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what is detail of the student who most recently registered course?
student_assessment
select t2.student_details from student_course_registrations as t1 join students as t2 on t1.student_id = t2.student_id order by t1.registration_date desc limit 1
Question: what details do we have on the students who registered for courses most recently? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what details do we have on the students who registered for courses most recently?
student_assessment
select count(*) from courses as t1 join student_course_attendance as t2 on t1.course_id = t2.course_id where t1.course_name = 'english'
Question: how many students attend course english? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
how many students attend course english?
student_assessment
select count(*) from courses as t1 join student_course_attendance as t2 on t1.course_id = t2.course_id where t1.course_name = 'english'
Question: how many students are attending english courses? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
how many students are attending english courses?
student_assessment
select count(*) from courses as t1 join student_course_attendance as t2 on t1.course_id = t2.course_id where t2.student_id = 171
Question: how many courses do the student whose id is 171 attend? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
how many courses do the student whose id is 171 attend?
student_assessment
select count(*) from courses as t1 join student_course_attendance as t2 on t1.course_id = t2.course_id where t2.student_id = 171
Question: how many courses does the student with id 171 actually attend? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
how many courses does the student with id 171 actually attend?
student_assessment
select t2.candidate_id from people as t1 join candidates as t2 on t1.person_id = t2.candidate_id where t1.email_address = '[email protected]'
Question: find id of the candidate whose email is [email protected]? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
find id of the candidate whose email is [email protected]?
student_assessment
select t2.candidate_id from people as t1 join candidates as t2 on t1.person_id = t2.candidate_id where t1.email_address = '[email protected]'
Question: what is the id of the candidate whose email is [email protected]? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what is the id of the candidate whose email is [email protected]?
student_assessment
select candidate_id from candidate_assessments order by assessment_date desc limit 1
Question: find id of the candidate who most recently accessed the course? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
find id of the candidate who most recently accessed the course?
student_assessment
select candidate_id from candidate_assessments order by assessment_date desc limit 1
Question: what is the id of the candidate who most recently accessed the course? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what is the id of the candidate who most recently accessed the course?
student_assessment
select t1.student_details from students as t1 join student_course_registrations as t2 on t1.student_id = t2.student_id group by t1.student_id order by count(*) desc limit 1
Question: what is detail of the student who registered the most number of courses? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what is detail of the student who registered the most number of courses?
student_assessment
select t1.student_details from students as t1 join student_course_registrations as t2 on t1.student_id = t2.student_id group by t1.student_id order by count(*) desc limit 1
Question: what are the details of the student who registered for the most number of courses? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the details of the student who registered for the most number of courses?
student_assessment
select t1.student_id , count(*) from students as t1 join student_course_registrations as t2 on t1.student_id = t2.student_id group by t1.student_id
Question: list the id of students who registered some courses and the number of their registered courses? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
list the id of students who registered some courses and the number of their registered courses?
student_assessment
select t1.student_id , count(*) from students as t1 join student_course_registrations as t2 on t1.student_id = t2.student_id group by t1.student_id
Question: for every student who is registered for some course, how many courses are they registered for? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
for every student who is registered for some course, how many courses are they registered for?
student_assessment
select t3.course_name , count(*) from students as t1 join student_course_registrations as t2 on t1.student_id = t2.student_id join courses as t3 on t2.course_id = t3.course_id group by t2.course_id
Question: how many registed students do each course have? list course name and the number of their registered students? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
how many registed students do each course have? list course name and the number of their registered students?
student_assessment
select t3.course_name , count(*) from students as t1 join student_course_registrations as t2 on t1.student_id = t2.student_id join courses as t3 on t2.course_id = t3.course_id group by t2.course_id
Question: for each course id, how many students are registered and what are the course names? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
for each course id, how many students are registered and what are the course names?
student_assessment
select candidate_id from candidate_assessments where asessment_outcome_code = 'pass'
Question: find id of candidates whose assessment code is 'pass'? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
find id of candidates whose assessment code is 'pass'?
student_assessment
select candidate_id from candidate_assessments where asessment_outcome_code = 'pass'
Question: what are the ids of the candidates that have an outcome code of pass? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the ids of the candidates that have an outcome code of pass?
student_assessment
select t3.cell_mobile_number from candidates as t1 join candidate_assessments as t2 on t1.candidate_id = t2.candidate_id join people as t3 on t1.candidate_id = t3.person_id where t2.asessment_outcome_code = 'fail'
Question: find the cell mobile number of the candidates whose assessment code is 'fail'? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
find the cell mobile number of the candidates whose assessment code is 'fail'?
student_assessment
select t3.cell_mobile_number from candidates as t1 join candidate_assessments as t2 on t1.candidate_id = t2.candidate_id join people as t3 on t1.candidate_id = t3.person_id where t2.asessment_outcome_code = 'fail'
Question: what are the cell phone numbers of the candidates that received an assessment code of 'fail'? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the cell phone numbers of the candidates that received an assessment code of 'fail'?
student_assessment
select student_id from student_course_attendance where course_id = 301
Question: what are the id of students who registered course 301? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the id of students who registered course 301?
student_assessment
select student_id from student_course_attendance where course_id = 301
Question: what are the ids of the students who registered for course 301? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the ids of the students who registered for course 301?
student_assessment
select student_id from student_course_attendance where course_id = 301 order by date_of_attendance desc limit 1
Question: what is the id of the student who most recently registered course 301? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what is the id of the student who most recently registered course 301?
student_assessment
select student_id from student_course_attendance where course_id = 301 order by date_of_attendance desc limit 1
Question: what are the ids of the students who registered for course 301 most recently? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the ids of the students who registered for course 301 most recently?
student_assessment
select distinct t1.city from addresses as t1 join people_addresses as t2 on t1.address_id = t2.address_id
Question: find distinct cities of addresses of people? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
find distinct cities of addresses of people?
student_assessment
select distinct t1.city from addresses as t1 join people_addresses as t2 on t1.address_id = t2.address_id
Question: what are the different cities where people live? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the different cities where people live?
student_assessment
select distinct t1.city from addresses as t1 join people_addresses as t2 on t1.address_id = t2.address_id join students as t3 on t2.person_id = t3.student_id
Question: find distinct cities of address of students? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
find distinct cities of address of students?
student_assessment
select distinct t1.city from addresses as t1 join people_addresses as t2 on t1.address_id = t2.address_id join students as t3 on t2.person_id = t3.student_id
Question: what are the different cities where students live? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the different cities where students live?
student_assessment
select course_name from courses order by course_name
Question: list the names of courses in alphabetical order? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
list the names of courses in alphabetical order?
student_assessment
select course_name from courses order by course_name
Question: what are the names of the courses in alphabetical order? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the names of the courses in alphabetical order?
student_assessment
select first_name from people order by first_name
Question: list the first names of people in alphabetical order? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
list the first names of people in alphabetical order?
student_assessment
select first_name from people order by first_name
Question: what are the first names of the people in alphabetical order? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the first names of the people in alphabetical order?
student_assessment
select student_id from student_course_registrations union select student_id from student_course_attendance
Question: what are the id of students who registered courses or attended courses? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
what are the id of students who registered courses or attended courses?

No dataset card yet

New: Create and edit this dataset card directly on the website!

Contribute a Dataset Card
Downloads last month
0
Add dataset card