nl stringlengths 22 185 | sql stringlengths 22 608 | db_id stringclasses 40
values | table_schema stringclasses 305
values |
|---|---|---|---|
What are the different types of powertrains? | SELECT DISTINCT type_of_powertrain FROM vehicles | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Show name, type of powertrain, and annual fuel cost for all vehicles with model year 2013 or 2014. | SELECT name , type_of_powertrain , annual_fuel_cost FROM vehicles WHERE model_year = 2013 OR model_year = 2014 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What are the names, types of powertrains, and yearly fuel costs for vehicles with model years in either 2013 2014? | SELECT name , type_of_powertrain , annual_fuel_cost FROM vehicles WHERE model_year = 2013 OR model_year = 2014 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Show types of powertrain with vehicles both from 2014 and 2013. | SELECT type_of_powertrain FROM vehicles WHERE model_year = 2014 INTERSECT SELECT type_of_powertrain FROM vehicles WHERE model_year = 2013 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What are the types of powertrains that have vehicles that were made in both 2013 and 2014? | SELECT type_of_powertrain FROM vehicles WHERE model_year = 2014 INTERSECT SELECT type_of_powertrain FROM vehicles WHERE model_year = 2013 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Show all types of powertrain and the number of vehicles in each type. | SELECT type_of_powertrain , count(*) FROM vehicles GROUP BY type_of_powertrain | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
How many vehicles have each type of powertrain? | SELECT type_of_powertrain , count(*) FROM vehicles GROUP BY type_of_powertrain | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What is the type of powertrain with most number of vehicles. | SELECT type_of_powertrain FROM vehicles GROUP BY type_of_powertrain ORDER BY count(*) DESC LIMIT 1 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Which type of powertrain is most common? | SELECT type_of_powertrain FROM vehicles GROUP BY type_of_powertrain ORDER BY count(*) DESC LIMIT 1 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Show minimum, maximum, and average annual fuel cost for all vehicles. | SELECT min(annual_fuel_cost) , max(annual_fuel_cost) , avg(annual_fuel_cost) FROM vehicles | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What are the minimum, maximum, and average annual fuel costs across all vehicles? | SELECT min(annual_fuel_cost) , max(annual_fuel_cost) , avg(annual_fuel_cost) FROM vehicles | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Show name and model year for vehicles with city fuel economy rate less than or equal to highway fuel economy rate. | SELECT name , model_year FROM vehicles WHERE city_fuel_economy_rate <= highway_fuel_economy_rate | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What are the names and model years for vehicles that have a city fuel economy rate less than or equal to its highway fuel economy rate? | SELECT name , model_year FROM vehicles WHERE city_fuel_economy_rate <= highway_fuel_economy_rate | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Show the type of powertrain with at least two vehicles, and the average annual fuel cost for vehicles in each such type. | SELECT type_of_powertrain , avg(annual_fuel_cost) FROM vehicles GROUP BY type_of_powertrain HAVING count(*) >= 2 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What are the types of powertrains for which there are two or more vehicles, and what are their average annual fuel costs? | SELECT type_of_powertrain , avg(annual_fuel_cost) FROM vehicles GROUP BY type_of_powertrain HAVING count(*) >= 2 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Show the name, age, membership credit for all customers? | SELECT name , age , membership_credit FROM customers | vehicle_rent | [{'table_name': 'customers', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What are the names, ages, and membership credits for all customers? | SELECT name , age , membership_credit FROM customers | vehicle_rent | [{'table_name': 'customers', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Show the name and age of the customer with maximum membership credit. | SELECT name , age FROM customers ORDER BY membership_credit DESC LIMIT 1 | vehicle_rent | [{'table_name': 'customers', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What is the name and age of the customer with the most membership credit? | SELECT name , age FROM customers ORDER BY membership_credit DESC LIMIT 1 | vehicle_rent | [{'table_name': 'customers', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What is the average age for customers with a membership credit above the average? | SELECT avg(age) FROM customers WHERE membership_credit > (SELECT avg(membership_credit) FROM customers) | vehicle_rent | [{'table_name': 'customers', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Return the average age for customers who have membership above the average across all customers. | SELECT avg(age) FROM customers WHERE membership_credit > (SELECT avg(membership_credit) FROM customers) | vehicle_rent | [{'table_name': 'customers', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Show all information for all discounts. | SELECT * FROM discount | vehicle_rent | [{'table_name': 'discount', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Return all information about discounts. | SELECT * FROM discount | vehicle_rent | [{'table_name': 'discount', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
Show the name and total hours of renting for each vehicle. | SELECT T2.name , sum(T1.total_hours) FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id = T2.id GROUP BY T2.id | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
What are the names and total rental hours for each vehicle? | SELECT T2.name , sum(T1.total_hours) FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id = T2.id GROUP BY T2.id | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
Show the name of vehicles with no renting history. | SELECT name FROM vehicles WHERE id NOT IN (SELECT vehicles_id FROM renting_history) | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
What are the names of vehicles that have never been rented? | SELECT name FROM vehicles WHERE id NOT IN (SELECT vehicles_id FROM renting_history) | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
Show the name of customer with at least two renting history records. | SELECT T2.name FROM renting_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.id GROUP BY T2.id HAVING count(*) >= 2 | vehicle_rent | [{'table_name': 'customers', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
What are the names of customers who have two or more records of rental history? | SELECT T2.name FROM renting_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.id GROUP BY T2.id HAVING count(*) >= 2 | vehicle_rent | [{'table_name': 'customers', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
Show the name and model year of the vehicle with most number of renting history records. | SELECT T2.name , T2.model_year FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id = T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
What is the name and model year of the vehicle which has been rented the most times? | SELECT T2.name , T2.model_year FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id = T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
Show the vehicle name with a descending order of total hours of renting. | SELECT T2.name FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id = T2.id GROUP BY T2.id ORDER BY sum(T1.total_hours) DESC | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
What are the names of vehicles, sorted descending by total hours of renting? | SELECT T2.name FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id = T2.id GROUP BY T2.id ORDER BY sum(T1.total_hours) DESC | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
What is the discount name with most number of renting history records? | SELECT T2.name FROM renting_history AS T1 JOIN discount AS T2 ON T1.discount_id = T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1 | vehicle_rent | [{'table_name': 'discount', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
Return the name of the discount that corresponds to the most rental history records. | SELECT T2.name FROM renting_history AS T1 JOIN discount AS T2 ON T1.discount_id = T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1 | vehicle_rent | [{'table_name': 'discount', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'membership credit'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
Find the name and powertrain type of the cars that rented for more than 30 total hours. | SELECT T2.name , T2.Type_of_powertrain FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id = T2.id GROUP BY T1.vehicles_id HAVING sum(T1.total_hours) > 30 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
What are the names and powertrain types of cars that have more than 30 total rental hours? | SELECT T2.name , T2.Type_of_powertrain FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id = T2.id GROUP BY T1.vehicles_id HAVING sum(T1.total_hours) > 30 | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}, {'table_name': 'renting history', 'table_schema': [{'col_name': 'id'}, {'col_name': 'customer id'}, {'col_name': 'discount id'}, {'col_name': 'vehicles id'}, {'col_name': 'total hours'}], 'foreign_key_columns': ['discount id', 'vehicles id', 'customer id'], 'primary_keys': ['id']}] |
Find the average city and highway fuel rates for cars with different powertrain types. | SELECT avg(City_fuel_economy_rate) , avg(Highway_fuel_economy_rate) , Type_of_powertrain FROM vehicles GROUP BY Type_of_powertrain | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What are the average city fuel economy rate, average highway fuel economy rate for different types of powertrains? | SELECT avg(City_fuel_economy_rate) , avg(Highway_fuel_economy_rate) , Type_of_powertrain FROM vehicles GROUP BY Type_of_powertrain | vehicle_rent | [{'table_name': 'vehicles', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'model year'}, {'col_name': 'type of powertrain'}, {'col_name': 'combined fuel economy rate'}, {'col_name': 'city fuel economy rate'}, {'col_name': 'highway fuel economy rate'}, {'col_name': 'cost per 25 miles'}, {'col_name': 'annual fuel cost'}, {'col_name': 'notes'}], 'foreign_key_columns': [], 'primary_keys': ['id']}] |
What is the average amount of a student loan? | SELECT avg(amount_of_loan) FROM Student_Loans | cre_Students_Information_Systems | [{'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}] |
Compute the average amount of student loans. | SELECT avg(amount_of_loan) FROM Student_Loans | cre_Students_Information_Systems | [{'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}] |
List the biographical data and student id for the students who take 2 or more classes and the students who have less than 2 detentions. | SELECT T1.bio_data , T1.student_id FROM Students AS T1 JOIN Classes AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) >= 2 UNION SELECT T1.bio_data , T1.student_id FROM Students AS T1 JOIN Detention AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) < 2 | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}, {'table_name': 'detention', 'table_schema': [{'col_name': 'detention id'}, {'col_name': 'detention type code'}, {'col_name': 'student id'}, {'col_name': 'datetime detention start'}, {'col_name': 'datetime detention end'}, {'col_name': 'detention summary'}, {'col_name': 'other details'}], 'foreign_key_columns': ['detention type code', 'student id'], 'primary_keys': ['detention id']}] |
What are the biographical data and student id of the students who either took two or more classes and or have less than two detentions? | SELECT T1.bio_data , T1.student_id FROM Students AS T1 JOIN Classes AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) >= 2 UNION SELECT T1.bio_data , T1.student_id FROM Students AS T1 JOIN Detention AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) < 2 | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}, {'table_name': 'detention', 'table_schema': [{'col_name': 'detention id'}, {'col_name': 'detention type code'}, {'col_name': 'student id'}, {'col_name': 'datetime detention start'}, {'col_name': 'datetime detention end'}, {'col_name': 'detention summary'}, {'col_name': 'other details'}], 'foreign_key_columns': ['detention type code', 'student id'], 'primary_keys': ['detention id']}] |
List the details of the teachers who teach some class whose detail has the substring 'data' but do not teach a class whose detail contains the prefix 'net' | SELECT T1.teacher_details FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.class_details LIKE '%data%' EXCEPT SELECT T1.teacher_details FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.class_details LIKE 'net%' | cre_Students_Information_Systems | [{'table_name': 'teachers', 'table_schema': [{'col_name': 'teacher id'}, {'col_name': 'teacher details'}], 'foreign_key_columns': [], 'primary_keys': ['teacher id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
Which teachers teach a class that has the substring 'data' in its detail but do not teach a class that has prefix 'net' in its detail? Give me the teacher details. | SELECT T1.teacher_details FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.class_details LIKE '%data%' EXCEPT SELECT T1.teacher_details FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.class_details LIKE 'net%' | cre_Students_Information_Systems | [{'table_name': 'teachers', 'table_schema': [{'col_name': 'teacher id'}, {'col_name': 'teacher details'}], 'foreign_key_columns': [], 'primary_keys': ['teacher id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
List the biographical data of the students who never had a detention or student loan . | select bio_data from students where student_id not in (select t1.student_id from students as t1 join detention as t2 on t1.student_id = t2.student_id union select t1.student_id from students as t1 join student_loans as t2 on t1.student_id = t2.student_id) | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}, {'table_name': 'detention', 'table_schema': [{'col_name': 'detention id'}, {'col_name': 'detention type code'}, {'col_name': 'student id'}, {'col_name': 'datetime detention start'}, {'col_name': 'datetime detention end'}, {'col_name': 'detention summary'}, {'col_name': 'other details'}], 'foreign_key_columns': ['detention type code', 'student id'], 'primary_keys': ['detention id']}] |
Which students never had a detention or student loan ? Find their biographical data . | select bio_data from students where student_id not in (select t1.student_id from students as t1 join detention as t2 on t1.student_id = t2.student_id union select t1.student_id from students as t1 join student_loans as t2 on t1.student_id = t2.student_id) | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}, {'table_name': 'detention', 'table_schema': [{'col_name': 'detention id'}, {'col_name': 'detention type code'}, {'col_name': 'student id'}, {'col_name': 'datetime detention start'}, {'col_name': 'datetime detention end'}, {'col_name': 'detention summary'}, {'col_name': 'other details'}], 'foreign_key_columns': ['detention type code', 'student id'], 'primary_keys': ['detention id']}] |
What are the loan amounts and loan dates of the students who have at least 2 achievements? | SELECT amount_of_loan , date_of_loan FROM Student_Loans WHERE student_id IN ( SELECT student_id FROM Achievements GROUP BY student_id HAVING count(*) >= 2 ) | cre_Students_Information_Systems | [{'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}, {'table_name': 'achievements', 'table_schema': [{'col_name': 'achievement id'}, {'col_name': 'achievement type code'}, {'col_name': 'student id'}, {'col_name': 'date achievement'}, {'col_name': 'achievement details'}, {'col_name': 'other details'}], 'foreign_key_columns': ['achievement type code', 'student id'], 'primary_keys': ['achievement id']}] |
List the amount and date of loan for the students who have two or more achievements. | SELECT amount_of_loan , date_of_loan FROM Student_Loans WHERE student_id IN ( SELECT student_id FROM Achievements GROUP BY student_id HAVING count(*) >= 2 ) | cre_Students_Information_Systems | [{'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}, {'table_name': 'achievements', 'table_schema': [{'col_name': 'achievement id'}, {'col_name': 'achievement type code'}, {'col_name': 'student id'}, {'col_name': 'date achievement'}, {'col_name': 'achievement details'}, {'col_name': 'other details'}], 'foreign_key_columns': ['achievement type code', 'student id'], 'primary_keys': ['achievement id']}] |
List the detail and id of the teacher who teaches the most courses. | SELECT T1.teacher_details , T1.teacher_id FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'teachers', 'table_schema': [{'col_name': 'teacher id'}, {'col_name': 'teacher details'}], 'foreign_key_columns': [], 'primary_keys': ['teacher id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
What are the detail and id of the teacher who teaches the largest number of courses? | SELECT T1.teacher_details , T1.teacher_id FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'teachers', 'table_schema': [{'col_name': 'teacher id'}, {'col_name': 'teacher details'}], 'foreign_key_columns': [], 'primary_keys': ['teacher id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
What are the distinct descriptions of all the detentions which have ever happened? | SELECT distinct(T1.detention_type_description) FROM Ref_Detention_Type AS T1 JOIN Detention AS T2 ON T1.detention_type_code = T2.detention_type_code | cre_Students_Information_Systems | [{'table_name': 'detention', 'table_schema': [{'col_name': 'detention id'}, {'col_name': 'detention type code'}, {'col_name': 'student id'}, {'col_name': 'datetime detention start'}, {'col_name': 'datetime detention end'}, {'col_name': 'detention summary'}, {'col_name': 'other details'}], 'foreign_key_columns': ['detention type code', 'student id'], 'primary_keys': ['detention id']}] |
Return the distinct descriptions of all the detentions that have happened. | SELECT distinct(T1.detention_type_description) FROM Ref_Detention_Type AS T1 JOIN Detention AS T2 ON T1.detention_type_code = T2.detention_type_code | cre_Students_Information_Systems | [{'table_name': 'detention', 'table_schema': [{'col_name': 'detention id'}, {'col_name': 'detention type code'}, {'col_name': 'student id'}, {'col_name': 'datetime detention start'}, {'col_name': 'datetime detention end'}, {'col_name': 'detention summary'}, {'col_name': 'other details'}], 'foreign_key_columns': ['detention type code', 'student id'], 'primary_keys': ['detention id']}] |
List the personal details and the address type descriptions of all the students. | SELECT DISTINCT T1.student_details , T3.address_type_description FROM Students AS T1 JOIN Students_Addresses AS T2 ON T1.student_id = T2.student_id JOIN Ref_Address_Types AS T3 ON T2.address_type_code = T3.address_type_code | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'students addresses', 'table_schema': [{'col_name': 'student address id'}, {'col_name': 'address id'}, {'col_name': 'address type code'}, {'col_name': 'student id'}, {'col_name': 'date from'}, {'col_name': 'date to'}], 'foreign_key_columns': ['address type code', 'address id', 'student id'], 'primary_keys': ['student address id']}] |
What are the personal details and the address type descriptions of each student? | SELECT DISTINCT T1.student_details , T3.address_type_description FROM Students AS T1 JOIN Students_Addresses AS T2 ON T1.student_id = T2.student_id JOIN Ref_Address_Types AS T3 ON T2.address_type_code = T3.address_type_code | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'students addresses', 'table_schema': [{'col_name': 'student address id'}, {'col_name': 'address id'}, {'col_name': 'address type code'}, {'col_name': 'student id'}, {'col_name': 'date from'}, {'col_name': 'date to'}], 'foreign_key_columns': ['address type code', 'address id', 'student id'], 'primary_keys': ['student address id']}] |
List the the address details and the biographical information of the students. | SELECT T1.address_details , T3.bio_data FROM Addresses AS T1 JOIN Students_Addresses AS T2 ON T1.address_id = T2.address_id JOIN Students AS T3 ON T2.student_id = T3.student_id | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'addresses', 'table_schema': [{'col_name': 'address id'}, {'col_name': 'address details'}], 'foreign_key_columns': [], 'primary_keys': ['address id']}, {'table_name': 'students addresses', 'table_schema': [{'col_name': 'student address id'}, {'col_name': 'address id'}, {'col_name': 'address type code'}, {'col_name': 'student id'}, {'col_name': 'date from'}, {'col_name': 'date to'}], 'foreign_key_columns': ['address type code', 'address id', 'student id'], 'primary_keys': ['student address id']}] |
What are the address details and biographical information of each student? | SELECT T1.address_details , T3.bio_data FROM Addresses AS T1 JOIN Students_Addresses AS T2 ON T1.address_id = T2.address_id JOIN Students AS T3 ON T2.student_id = T3.student_id | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'addresses', 'table_schema': [{'col_name': 'address id'}, {'col_name': 'address details'}], 'foreign_key_columns': [], 'primary_keys': ['address id']}, {'table_name': 'students addresses', 'table_schema': [{'col_name': 'student address id'}, {'col_name': 'address id'}, {'col_name': 'address type code'}, {'col_name': 'student id'}, {'col_name': 'date from'}, {'col_name': 'date to'}], 'foreign_key_columns': ['address type code', 'address id', 'student id'], 'primary_keys': ['student address id']}] |
List the biographical data and the date of the transcript of all the students. | SELECT T1.bio_data , T2.date_of_transcript FROM Students AS T1 JOIN Transcripts AS T2 ON T1.student_id = T2.student_id | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'transcripts', 'table_schema': [{'col_name': 'transcript id'}, {'col_name': 'student id'}, {'col_name': 'date of transcript'}, {'col_name': 'transcript details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['transcript id']}] |
What are the biographical data and the date of transcript issuance of each student? | SELECT T1.bio_data , T2.date_of_transcript FROM Students AS T1 JOIN Transcripts AS T2 ON T1.student_id = T2.student_id | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'transcripts', 'table_schema': [{'col_name': 'transcript id'}, {'col_name': 'student id'}, {'col_name': 'date of transcript'}, {'col_name': 'transcript details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['transcript id']}] |
How many students got the most common result in the behavioral monitoring details? Also list the result details. | SELECT count(DISTINCT student_id) , behaviour_monitoring_details FROM Behaviour_Monitoring GROUP BY behaviour_monitoring_details ORDER BY count(*) DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'behaviour monitoring', 'table_schema': [{'col_name': 'behaviour monitoring id'}, {'col_name': 'student id'}, {'col_name': 'behaviour monitoring details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['behaviour monitoring id']}] |
Find the most common result in the behavioral monitoring details. What are the count and the details of this result? | SELECT count(DISTINCT student_id) , behaviour_monitoring_details FROM Behaviour_Monitoring GROUP BY behaviour_monitoring_details ORDER BY count(*) DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'behaviour monitoring', 'table_schema': [{'col_name': 'behaviour monitoring id'}, {'col_name': 'student id'}, {'col_name': 'behaviour monitoring details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['behaviour monitoring id']}] |
Which students not only got the most common result but also got a result obtained by 3 students in behaviour monitoring? List the student's biographical data and details. | SELECT T1.bio_data , T1.student_details FROM Students AS T1 JOIN Behaviour_Monitoring AS T2 ON T1.student_id = T2.student_id WHERE T2.behaviour_monitoring_details IN ( SELECT behaviour_monitoring_details FROM Behaviour_Monitoring GROUP BY behaviour_monitoring_details ORDER BY count(*) DESC LIMIT 1 ) INTERSECT SELECT T1.bio_data , T1.student_details FROM Students AS T1 JOIN Behaviour_Monitoring AS T2 ON T1.student_id = T2.student_id WHERE T2.behaviour_monitoring_details IN ( SELECT behaviour_monitoring_details FROM Behaviour_Monitoring GROUP BY behaviour_monitoring_details HAVING count(*) = 3 ) | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'behaviour monitoring', 'table_schema': [{'col_name': 'behaviour monitoring id'}, {'col_name': 'student id'}, {'col_name': 'behaviour monitoring details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['behaviour monitoring id']}] |
Find the biographical data and details of students who got not only the most common result but also a result that is obtained by 3 students in behaviour monitoring. | SELECT T1.bio_data , T1.student_details FROM Students AS T1 JOIN Behaviour_Monitoring AS T2 ON T1.student_id = T2.student_id WHERE T2.behaviour_monitoring_details IN ( SELECT behaviour_monitoring_details FROM Behaviour_Monitoring GROUP BY behaviour_monitoring_details ORDER BY count(*) DESC LIMIT 1 ) INTERSECT SELECT T1.bio_data , T1.student_details FROM Students AS T1 JOIN Behaviour_Monitoring AS T2 ON T1.student_id = T2.student_id WHERE T2.behaviour_monitoring_details IN ( SELECT behaviour_monitoring_details FROM Behaviour_Monitoring GROUP BY behaviour_monitoring_details HAVING count(*) = 3 ) | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'behaviour monitoring', 'table_schema': [{'col_name': 'behaviour monitoring id'}, {'col_name': 'student id'}, {'col_name': 'behaviour monitoring details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['behaviour monitoring id']}] |
Which students only got the most common result for his or her all behaviour monitoring details? List the students' biographical information. | SELECT T1.bio_data FROM Students AS T1 JOIN Behaviour_Monitoring AS T2 ON T1.student_id = T2.student_id WHERE T2.behaviour_monitoring_details IN ( SELECT behaviour_monitoring_details FROM Behaviour_Monitoring GROUP BY behaviour_monitoring_details ORDER BY count(*) DESC LIMIT 1 ) EXCEPT SELECT T1.bio_data FROM Students AS T1 JOIN Behaviour_Monitoring AS T2 ON T1.student_id = T2.student_id WHERE T2.behaviour_monitoring_details NOT IN ( SELECT behaviour_monitoring_details FROM Behaviour_Monitoring GROUP BY behaviour_monitoring_details ORDER BY count(*) DESC LIMIT 1 ) | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'behaviour monitoring', 'table_schema': [{'col_name': 'behaviour monitoring id'}, {'col_name': 'student id'}, {'col_name': 'behaviour monitoring details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['behaviour monitoring id']}] |
What is the biographical information of the students who got the most common result for their behaviour monitoring details ? | select t1.bio_data from students as t1 join behaviour_monitoring as t2 on t1.student_id = t2.student_id where t2.behaviour_monitoring_details in ( select behaviour_monitoring_details from behaviour_monitoring group by behaviour_monitoring_details order by count(*) desc limit 1 ) except select t1.bio_data from students as t1 join behaviour_monitoring as t2 on t1.student_id = t2.student_id where t2.behaviour_monitoring_details not in ( select behaviour_monitoring_details from behaviour_monitoring group by behaviour_monitoring_details order by count(*) desc limit 1 ) | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'behaviour monitoring', 'table_schema': [{'col_name': 'behaviour monitoring id'}, {'col_name': 'student id'}, {'col_name': 'behaviour monitoring details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['behaviour monitoring id']}] |
Which students have gone through any event? List the students' biographical data and event date. | SELECT T1.bio_data , T2.event_date FROM Students AS T1 JOIN Student_Events AS T2 ON T1.student_id = T2.student_id | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'student events', 'table_schema': [{'col_name': 'event id'}, {'col_name': 'event type code'}, {'col_name': 'student id'}, {'col_name': 'event date'}, {'col_name': 'other details'}], 'foreign_key_columns': ['event type code', 'student id'], 'primary_keys': ['event id']}] |
Find the biographical data and event date for students who participated in any events. | SELECT T1.bio_data , T2.event_date FROM Students AS T1 JOIN Student_Events AS T2 ON T1.student_id = T2.student_id | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'student events', 'table_schema': [{'col_name': 'event id'}, {'col_name': 'event type code'}, {'col_name': 'student id'}, {'col_name': 'event date'}, {'col_name': 'other details'}], 'foreign_key_columns': ['event type code', 'student id'], 'primary_keys': ['event id']}] |
How many students have joined in the most common type of event? List the number, the event type and description. | SELECT count(*) , T2.event_type_code , T3.event_type_description FROM Students AS T1 JOIN Student_Events AS T2 ON T1.student_id = T2.student_id JOIN Ref_Event_Types AS T3 ON T2.event_type_code = T3.event_type_code GROUP BY T2.event_type_code ORDER BY count(*) DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'student events', 'table_schema': [{'col_name': 'event id'}, {'col_name': 'event type code'}, {'col_name': 'student id'}, {'col_name': 'event date'}, {'col_name': 'other details'}], 'foreign_key_columns': ['event type code', 'student id'], 'primary_keys': ['event id']}] |
What is the type of event the most students joined? Give me the number of students, and the event type code and description. | SELECT count(*) , T2.event_type_code , T3.event_type_description FROM Students AS T1 JOIN Student_Events AS T2 ON T1.student_id = T2.student_id JOIN Ref_Event_Types AS T3 ON T2.event_type_code = T3.event_type_code GROUP BY T2.event_type_code ORDER BY count(*) DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'student events', 'table_schema': [{'col_name': 'event id'}, {'col_name': 'event type code'}, {'col_name': 'student id'}, {'col_name': 'event date'}, {'col_name': 'other details'}], 'foreign_key_columns': ['event type code', 'student id'], 'primary_keys': ['event id']}] |
How are all the achievements described? List the achievement detail and the type description. | SELECT T1.achievement_details , T2.achievement_type_description FROM Achievements AS T1 JOIN Ref_Achievement_Type AS T2 ON T1.achievement_type_code = T2.achievement_type_code | cre_Students_Information_Systems | [{'table_name': 'achievements', 'table_schema': [{'col_name': 'achievement id'}, {'col_name': 'achievement type code'}, {'col_name': 'student id'}, {'col_name': 'date achievement'}, {'col_name': 'achievement details'}, {'col_name': 'other details'}], 'foreign_key_columns': ['achievement type code', 'student id'], 'primary_keys': ['achievement id']}] |
What are the achievement detail and the type description of each achievements? | SELECT T1.achievement_details , T2.achievement_type_description FROM Achievements AS T1 JOIN Ref_Achievement_Type AS T2 ON T1.achievement_type_code = T2.achievement_type_code | cre_Students_Information_Systems | [{'table_name': 'achievements', 'table_schema': [{'col_name': 'achievement id'}, {'col_name': 'achievement type code'}, {'col_name': 'student id'}, {'col_name': 'date achievement'}, {'col_name': 'achievement details'}, {'col_name': 'other details'}], 'foreign_key_columns': ['achievement type code', 'student id'], 'primary_keys': ['achievement id']}] |
How many teachers have taught a student who has not won any achievements? | SELECT count(DISTINCT T1.teacher_id) FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.student_id NOT IN ( SELECT student_id FROM Achievements ) | cre_Students_Information_Systems | [{'table_name': 'teachers', 'table_schema': [{'col_name': 'teacher id'}, {'col_name': 'teacher details'}], 'foreign_key_columns': [], 'primary_keys': ['teacher id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}, {'table_name': 'achievements', 'table_schema': [{'col_name': 'achievement id'}, {'col_name': 'achievement type code'}, {'col_name': 'student id'}, {'col_name': 'date achievement'}, {'col_name': 'achievement details'}, {'col_name': 'other details'}], 'foreign_key_columns': ['achievement type code', 'student id'], 'primary_keys': ['achievement id']}] |
Count the number of teachers who have taught students who have never won an achievement. | SELECT count(DISTINCT T1.teacher_id) FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.student_id NOT IN ( SELECT student_id FROM Achievements ) | cre_Students_Information_Systems | [{'table_name': 'teachers', 'table_schema': [{'col_name': 'teacher id'}, {'col_name': 'teacher details'}], 'foreign_key_columns': [], 'primary_keys': ['teacher id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}, {'table_name': 'achievements', 'table_schema': [{'col_name': 'achievement id'}, {'col_name': 'achievement type code'}, {'col_name': 'student id'}, {'col_name': 'date achievement'}, {'col_name': 'achievement details'}, {'col_name': 'other details'}], 'foreign_key_columns': ['achievement type code', 'student id'], 'primary_keys': ['achievement id']}] |
List the date of the transcripts and the transcript details. | SELECT date_of_transcript , transcript_details FROM Transcripts | cre_Students_Information_Systems | [{'table_name': 'transcripts', 'table_schema': [{'col_name': 'transcript id'}, {'col_name': 'student id'}, {'col_name': 'date of transcript'}, {'col_name': 'transcript details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['transcript id']}] |
What are the date and detail of each transcript? | SELECT date_of_transcript , transcript_details FROM Transcripts | cre_Students_Information_Systems | [{'table_name': 'transcripts', 'table_schema': [{'col_name': 'transcript id'}, {'col_name': 'student id'}, {'col_name': 'date of transcript'}, {'col_name': 'transcript details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['transcript id']}] |
List the achievement type code, achievement details and the date of the achievements. | SELECT achievement_type_code , achievement_details , date_achievement FROM Achievements | cre_Students_Information_Systems | [{'table_name': 'achievements', 'table_schema': [{'col_name': 'achievement id'}, {'col_name': 'achievement type code'}, {'col_name': 'student id'}, {'col_name': 'date achievement'}, {'col_name': 'achievement details'}, {'col_name': 'other details'}], 'foreign_key_columns': ['achievement type code', 'student id'], 'primary_keys': ['achievement id']}] |
What are the type code, details, and date of each achievement? | SELECT achievement_type_code , achievement_details , date_achievement FROM Achievements | cre_Students_Information_Systems | [{'table_name': 'achievements', 'table_schema': [{'col_name': 'achievement id'}, {'col_name': 'achievement type code'}, {'col_name': 'student id'}, {'col_name': 'date achievement'}, {'col_name': 'achievement details'}, {'col_name': 'other details'}], 'foreign_key_columns': ['achievement type code', 'student id'], 'primary_keys': ['achievement id']}] |
Show the detention start time and end time of the detentions. | SELECT datetime_detention_start , datetime_detention_end FROM Detention | cre_Students_Information_Systems | [{'table_name': 'detention', 'table_schema': [{'col_name': 'detention id'}, {'col_name': 'detention type code'}, {'col_name': 'student id'}, {'col_name': 'datetime detention start'}, {'col_name': 'datetime detention end'}, {'col_name': 'detention summary'}, {'col_name': 'other details'}], 'foreign_key_columns': ['detention type code', 'student id'], 'primary_keys': ['detention id']}] |
What are the starting time and ending time of each detention record? | SELECT datetime_detention_start , datetime_detention_end FROM Detention | cre_Students_Information_Systems | [{'table_name': 'detention', 'table_schema': [{'col_name': 'detention id'}, {'col_name': 'detention type code'}, {'col_name': 'student id'}, {'col_name': 'datetime detention start'}, {'col_name': 'datetime detention end'}, {'col_name': 'detention summary'}, {'col_name': 'other details'}], 'foreign_key_columns': ['detention type code', 'student id'], 'primary_keys': ['detention id']}] |
Show the biographical information of the students whose details include the substring 'Suite'. | SELECT bio_data FROM Students WHERE student_details LIKE '%Suite%' | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}] |
Which students have 'Suite' as a substring in their details? Give me their biographical information. | SELECT bio_data FROM Students WHERE student_details LIKE '%Suite%' | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}] |
List the details for all the pairs of teachers and students who are in the same class. | SELECT T1.teacher_details , T3.student_details FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id = T2.teacher_id JOIN Students AS T3 ON T2.student_id = T3.student_id | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'teachers', 'table_schema': [{'col_name': 'teacher id'}, {'col_name': 'teacher details'}], 'foreign_key_columns': [], 'primary_keys': ['teacher id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
What are the pairs of teachers and students who are in the same class? Give me the pairs of their details. | SELECT T1.teacher_details , T3.student_details FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id = T2.teacher_id JOIN Students AS T3 ON T2.student_id = T3.student_id | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'teachers', 'table_schema': [{'col_name': 'teacher id'}, {'col_name': 'teacher details'}], 'foreign_key_columns': [], 'primary_keys': ['teacher id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
How many courses do teachers teach at most? Also find the id of the teacher who teaches the most. | SELECT count(*) , teacher_id FROM Classes GROUP BY teacher_id ORDER BY count(*) DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
Which teacher teaches the most courses? Give me the id of the teacher and the number of courses he or she teaches. | SELECT count(*) , teacher_id FROM Classes GROUP BY teacher_id ORDER BY count(*) DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
How many courses do students take at most? Also find the id of the student who takes the most courses. | SELECT count(*) , student_id FROM Classes GROUP BY student_id ORDER BY count(*) DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
Which student is taking the most courses? Give me the id of the student and the number of courses he or she is taking. | SELECT count(*) , student_id FROM Classes GROUP BY student_id ORDER BY count(*) DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
Which students take 2 courses? List student id and details. | SELECT T1.student_id , T1.student_details FROM Students AS T1 JOIN Classes AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) = 2 | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
What are the ids and details of the students who take 2 courses? | SELECT T1.student_id , T1.student_details FROM Students AS T1 JOIN Classes AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) = 2 | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
What is the least common detention type? Show the type code and the description. | SELECT T1.detention_type_code , T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY count(*) ASC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'detention', 'table_schema': [{'col_name': 'detention id'}, {'col_name': 'detention type code'}, {'col_name': 'student id'}, {'col_name': 'datetime detention start'}, {'col_name': 'datetime detention end'}, {'col_name': 'detention summary'}, {'col_name': 'other details'}], 'foreign_key_columns': ['detention type code', 'student id'], 'primary_keys': ['detention id']}] |
Give me the type code and description of the least common detention type. | SELECT T1.detention_type_code , T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY count(*) ASC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'detention', 'table_schema': [{'col_name': 'detention id'}, {'col_name': 'detention type code'}, {'col_name': 'student id'}, {'col_name': 'datetime detention start'}, {'col_name': 'datetime detention end'}, {'col_name': 'detention summary'}, {'col_name': 'other details'}], 'foreign_key_columns': ['detention type code', 'student id'], 'primary_keys': ['detention id']}] |
Which students have a student loan more than the average amount? List the students' biographical data and the details. | SELECT T1.bio_data , T1.student_details FROM Students AS T1 JOIN Student_Loans AS T2 ON T1.student_id = T2.student_id WHERE T2.amount_of_loan > ( SELECT avg(amount_of_loan) FROM Student_Loans ) | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}] |
Find the biographical data and details for students whose student loan is above the average amount. | SELECT T1.bio_data , T1.student_details FROM Students AS T1 JOIN Student_Loans AS T2 ON T1.student_id = T2.student_id WHERE T2.amount_of_loan > ( SELECT avg(amount_of_loan) FROM Student_Loans ) | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}] |
When was the earliest date of loan? | SELECT date_of_loan FROM Student_Loans ORDER BY date_of_loan ASC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}] |
Return the earliest date of loan in the record. | SELECT date_of_loan FROM Student_Loans ORDER BY date_of_loan ASC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}] |
Which student has the loan with the minimum value? List the student's biographical information. | SELECT T1.bio_data FROM Students AS T1 JOIN Student_Loans AS T2 ON T1.student_id = T2.student_id ORDER BY T2.amount_of_loan ASC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}] |
Find the biographical information of the student with the smallest student loan. | SELECT T1.bio_data FROM Students AS T1 JOIN Student_Loans AS T2 ON T1.student_id = T2.student_id ORDER BY T2.amount_of_loan ASC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'students', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'bio data'}, {'col_name': 'student details'}], 'foreign_key_columns': [], 'primary_keys': ['student id']}, {'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}] |
When was the transcript issued for the student with loan of maximum value? | SELECT T1.date_of_transcript FROM Transcripts AS T1 JOIN Student_Loans AS T2 ON T1.student_id = T2.student_id ORDER BY T2.amount_of_loan DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'transcripts', 'table_schema': [{'col_name': 'transcript id'}, {'col_name': 'student id'}, {'col_name': 'date of transcript'}, {'col_name': 'transcript details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['transcript id']}, {'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}] |
What is the transcript issuance date for the student with the largest amount of loan? | SELECT T1.date_of_transcript FROM Transcripts AS T1 JOIN Student_Loans AS T2 ON T1.student_id = T2.student_id ORDER BY T2.amount_of_loan DESC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'transcripts', 'table_schema': [{'col_name': 'transcript id'}, {'col_name': 'student id'}, {'col_name': 'date of transcript'}, {'col_name': 'transcript details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['transcript id']}, {'table_name': 'student loans', 'table_schema': [{'col_name': 'student loan id'}, {'col_name': 'student id'}, {'col_name': 'date of loan'}, {'col_name': 'amount of loan'}, {'col_name': 'other details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['student loan id']}] |
Which teachers have taught the student with the earliest transcript issuance? List the teacher details. | SELECT T1.teacher_details FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id = T2.teacher_id JOIN Transcripts AS T3 ON T2.student_id = T3.student_id ORDER BY T3.date_of_transcript ASC LIMIT 1 | cre_Students_Information_Systems | [{'table_name': 'transcripts', 'table_schema': [{'col_name': 'transcript id'}, {'col_name': 'student id'}, {'col_name': 'date of transcript'}, {'col_name': 'transcript details'}], 'foreign_key_columns': ['student id'], 'primary_keys': ['transcript id']}, {'table_name': 'teachers', 'table_schema': [{'col_name': 'teacher id'}, {'col_name': 'teacher details'}], 'foreign_key_columns': [], 'primary_keys': ['teacher id']}, {'table_name': 'classes', 'table_schema': [{'col_name': 'class id'}, {'col_name': 'student id'}, {'col_name': 'teacher id'}, {'col_name': 'class details'}], 'foreign_key_columns': ['teacher id', 'student id'], 'primary_keys': ['class id']}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.