input
stringlengths
191
7.13k
output
stringlengths
19
578
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: List the name of ships in ascending order of tonnage. [/INST]
SELECT Name FROM ship ORDER BY Tonnage ASC;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: what are the names of the ships ordered by ascending tonnage? [/INST]
SELECT Name FROM ship ORDER BY Tonnage ASC;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What are the type and nationality of ships? [/INST]
SELECT TYPE , Nationality FROM ship;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What are the types and nationalities of every ship? [/INST]
SELECT TYPE , Nationality FROM ship;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: List the name of ships whose nationality is not "United States". [/INST]
SELECT Name FROM ship WHERE Nationality != "United States";
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What are the names of the ships that are not from the United States? [/INST]
SELECT Name FROM ship WHERE Nationality != "United States";
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: Show the name of ships whose nationality is either United States or United Kingdom. [/INST]
SELECT Name FROM ship WHERE Nationality = "United States" OR Nationality = "United Kingdom";
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What are the names of the ships that are from either the US or the UK? [/INST]
SELECT Name FROM ship WHERE Nationality = "United States" OR Nationality = "United Kingdom";
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What is the name of the ship with the largest tonnage? [/INST]
SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What is the ship with the largest amount of tonnage called? [/INST]
SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: Show different types of ships and the number of ships of each type. [/INST]
SELECT TYPE , COUNT(*) FROM ship GROUP BY TYPE;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: For each type, how many ships are there? [/INST]
SELECT TYPE , COUNT(*) FROM ship GROUP BY TYPE;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: Please show the most common type of ships. [/INST]
SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What is the most common type of ships? [/INST]
SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: List the nations that have more than two ships. [/INST]
SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What are the nations that have more than two ships? [/INST]
SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: Show different types of ships and the average tonnage of ships of each type. [/INST]
SELECT TYPE , avg(Tonnage) FROM ship GROUP BY TYPE;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: For each type, what is the average tonnage? [/INST]
SELECT TYPE , avg(Tonnage) FROM ship GROUP BY TYPE;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: Show codes and fates of missions, and names of ships involved. [/INST]
SELECT T1.Code , T1.Fate , T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What are the mission codes, fates, and names of the ships involved? [/INST]
SELECT T1.Code , T1.Fate , T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: Show names of ships involved in a mission launched after 1928. [/INST]
SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What are the names of ships that were involved in a mission launched after 1928? [/INST]
SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: Show the distinct fate of missions that involve ships with nationality "United States" [/INST]
SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = "United States";
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What are the different fates of the mission that involved ships from the United States? [/INST]
SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = "United States";
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: List the name of ships that are not involved in any mission [/INST]
SELECT Name FROM ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM mission);
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What are the names of the ships that are not involved in any missions? [/INST]
SELECT Name FROM ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM mission);
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000. [/INST]
SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000;
Tables: mission, ship Columns: mission.Mission_ID, mission.Ship_ID, mission.Code, mission.Launched_Year, mission.Location, mission.Speed_knots, mission.Fate, ship.Ship_ID, ship.Name, ship.Type, ship.Nationality, ship.Tonnage Question: What are the types of the ships that have both shiips with tonnage more than 6000 and those with tonnage less than 4000? [/INST]
SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the number of students in total. [/INST]
SELECT count(*) FROM list;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: How many students are there? [/INST]
SELECT count(*) FROM list;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the last names of students studying in room 111. [/INST]
SELECT lastname FROM list WHERE classroom = 111;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: What are the last names of students in room 111? [/INST]
SELECT lastname FROM list WHERE classroom = 111;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the first names of students studying in room 108. [/INST]
SELECT firstname FROM list WHERE classroom = 108;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: What are the first names of students in room 108? [/INST]
SELECT firstname FROM list WHERE classroom = 108;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: What are the first names of students studying in room 107? [/INST]
SELECT DISTINCT firstname FROM list WHERE classroom = 107;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: List the first names of all the students in room 107. [/INST]
SELECT DISTINCT firstname FROM list WHERE classroom = 107;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: For each classroom report the grade that is taught in it. Report just the classroom number and the grade number. [/INST]
SELECT DISTINCT classroom , grade FROM list;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: What are the grade number and classroom number of each class in the list? [/INST]
SELECT DISTINCT classroom , grade FROM list;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which grade is studying in classroom 103? [/INST]
SELECT DISTINCT grade FROM list WHERE classroom = 103;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the grade taught in classroom 103. [/INST]
SELECT DISTINCT grade FROM list WHERE classroom = 103;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the grade studying in room 105. [/INST]
SELECT DISTINCT grade FROM list WHERE classroom = 105;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which grade is studying in room 105? [/INST]
SELECT DISTINCT grade FROM list WHERE classroom = 105;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which classrooms are used by grade 4? [/INST]
SELECT DISTINCT classroom FROM list WHERE grade = 4;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the classrooms in which grade 4 is studying. [/INST]
SELECT DISTINCT classroom FROM list WHERE grade = 4;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which classrooms are used by grade 5? [/INST]
SELECT DISTINCT classroom FROM list WHERE grade = 5;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Show me the classrooms grade 5 is using. [/INST]
SELECT DISTINCT classroom FROM list WHERE grade = 5;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the last names of the teachers that teach fifth grade. [/INST]
SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: what are the last names of the teachers who teach grade 5? [/INST]
SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the first names of the teachers that teach first grade. [/INST]
SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: What are the first names of the teachers who teach grade 1? [/INST]
SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the first names of all the teachers that teach in classroom 110. [/INST]
SELECT firstname FROM teachers WHERE classroom = 110;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which teachers teach in classroom 110? Give me their first names. [/INST]
SELECT firstname FROM teachers WHERE classroom = 110;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the last names of teachers teaching in classroom 109. [/INST]
SELECT lastname FROM teachers WHERE classroom = 109;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which teachers teach in classroom 109? Give me their last names. [/INST]
SELECT lastname FROM teachers WHERE classroom = 109;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Report the first name and last name of all the teachers. [/INST]
SELECT DISTINCT firstname , lastname FROM teachers;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: What are the first name and last name of all the teachers? [/INST]
SELECT DISTINCT firstname , lastname FROM teachers;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Report the first name and last name of all the students. [/INST]
SELECT DISTINCT firstname , lastname FROM list;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Show each student's first name and last name. [/INST]
SELECT DISTINCT firstname , lastname FROM list;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find all students taught by OTHA MOYER. Output the first and last names of the students. [/INST]
SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which students study under the teacher named OTHA MOYER? Give me the first and last names of the students. [/INST]
SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find all students taught by MARROTTE KIRK. Output first and last names of students. [/INST]
SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "MARROTTE" AND T2.lastname = "KIRK";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which are the first and last names of the students taught by MARROTTE KIRK? [/INST]
SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "MARROTTE" AND T2.lastname = "KIRK";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the first and last name of all the teachers that teach EVELINA BROMLEY. [/INST]
SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "EVELINA" AND T1.lastname = "BROMLEY";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which teachers teach the student named EVELINA BROMLEY? Give me the first and last name of the teachers. [/INST]
SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "EVELINA" AND T1.lastname = "BROMLEY";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the last names of all the teachers that teach GELL TAMI. [/INST]
SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "GELL" AND T1.lastname = "TAMI";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: What are the last names of the teachers who teach the student called GELL TAMI? [/INST]
SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "GELL" AND T1.lastname = "TAMI";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: How many students does LORIA ONDERSMA teaches? [/INST]
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "LORIA" AND T2.lastname = "ONDERSMA";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Count the number of students the teacher LORIA ONDERSMA teaches. [/INST]
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "LORIA" AND T2.lastname = "ONDERSMA";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: How many students does KAWA GORDON teaches? [/INST]
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "KAWA" AND T2.lastname = "GORDON";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the number of students taught by the teacher KAWA GORDON. [/INST]
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "KAWA" AND T2.lastname = "GORDON";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the number of students taught by TARRING LEIA. [/INST]
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "TARRING" AND T2.lastname = "LEIA";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: How many students are taught by teacher TARRING LEIA? [/INST]
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "TARRING" AND T2.lastname = "LEIA";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: How many teachers does the student named CHRISSY NABOZNY have? [/INST]
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISSY" AND T1.lastname = "NABOZNY";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the number of teachers who teach the student called CHRISSY NABOZNY. [/INST]
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISSY" AND T1.lastname = "NABOZNY";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: How many teachers does the student named MADLOCK RAY have? [/INST]
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "MADLOCK" AND T1.lastname = "RAY";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the number of teachers who teach the student called MADLOCK RAY. [/INST]
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "MADLOCK" AND T1.lastname = "RAY";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names. [/INST]
SELECT DISTINCT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: What are the first and last names of the first-grade students who are NOT taught by teacher OTHA MOYER? [/INST]
SELECT DISTINCT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the last names of the students in third grade that are not taught by COVIN JEROME. [/INST]
SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname != "COVIN" AND T2.lastname != "JEROME";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students. [/INST]
SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname != "COVIN" AND T2.lastname != "JEROME";
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade. [/INST]
SELECT grade , count(DISTINCT classroom) , count(*) FROM list GROUP BY grade;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: For each grade, return the grade number, the number of classrooms used for the grade, and the total number of students enrolled in the grade. [/INST]
SELECT grade , count(DISTINCT classroom) , count(*) FROM list GROUP BY grade;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: For each classroom, report the classroom number and the number of grades using it. [/INST]
SELECT classroom , count(DISTINCT grade) FROM list GROUP BY classroom;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: For each classroom, show the classroom number and count the number of distinct grades that use the room. [/INST]
SELECT classroom , count(DISTINCT grade) FROM list GROUP BY classroom;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which classroom has the most students? [/INST]
SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the classroom that the most students use. [/INST]
SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Report the number of students in each classroom. [/INST]
SELECT classroom , count(*) FROM list GROUP BY classroom;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: For each classroom, show the classroom number and find how many students are using it. [/INST]
SELECT classroom , count(*) FROM list GROUP BY classroom;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: For each grade 0 classroom, report the total number of students. [/INST]
SELECT classroom , count(*) FROM list WHERE grade = "0" GROUP BY classroom;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: For each grade 0 classroom, return the classroom number and the count of students. [/INST]
SELECT classroom , count(*) FROM list WHERE grade = "0" GROUP BY classroom;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Report the total number of students for each fourth-grade classroom. [/INST]
SELECT classroom , count(*) FROM list WHERE grade = "4" GROUP BY classroom;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: For each fourth-grade classroom, show the classroom number and the total number of students using it. [/INST]
SELECT classroom , count(*) FROM list WHERE grade = "4" GROUP BY classroom;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the name of the teacher who teaches the largest number of students. [/INST]
SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname , T2.lastname ORDER BY count(*) DESC LIMIT 1;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Which teacher teaches the most students? Give me the first name and last name of the teacher. [/INST]
SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname , T2.lastname ORDER BY count(*) DESC LIMIT 1;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: Find the number of students in one classroom. [/INST]
SELECT count(*) , classroom FROM list GROUP BY classroom;
Tables: list, teachers Columns: list.LastName, list.FirstName, list.Grade, list.Classroom, teachers.LastName, teachers.FirstName, teachers.Classroom Question: How many students does one classroom have? [/INST]
SELECT count(*) , classroom FROM list GROUP BY classroom;
Tables: people, company, employment Columns: people.People_ID, people.Age, people.Name, people.Nationality, people.Graduation_College, company.Company_ID, company.Name, company.Headquarters, company.Industry, company.Sales_in_Billion, company.Profits_in_Billion, company.Assets_in_Billion, company.Market_Value_in_Billion, employment.Company_ID, employment.People_ID, employment.Year_working Question: How many companies are headquartered in the US? [/INST]
SELECT count(*) FROM company WHERE Headquarters = 'USA';
Tables: people, company, employment Columns: people.People_ID, people.Age, people.Name, people.Nationality, people.Graduation_College, company.Company_ID, company.Name, company.Headquarters, company.Industry, company.Sales_in_Billion, company.Profits_in_Billion, company.Assets_in_Billion, company.Market_Value_in_Billion, employment.Company_ID, employment.People_ID, employment.Year_working Question: List the names of companies by ascending number of sales. [/INST]
SELECT Name FROM company ORDER BY Sales_in_Billion ASC;
Tables: people, company, employment Columns: people.People_ID, people.Age, people.Name, people.Nationality, people.Graduation_College, company.Company_ID, company.Name, company.Headquarters, company.Industry, company.Sales_in_Billion, company.Profits_in_Billion, company.Assets_in_Billion, company.Market_Value_in_Billion, employment.Company_ID, employment.People_ID, employment.Year_working Question: What are the headquarters and industries of all companies? [/INST]
SELECT Headquarters , Industry FROM company;
Tables: people, company, employment Columns: people.People_ID, people.Age, people.Name, people.Nationality, people.Graduation_College, company.Company_ID, company.Name, company.Headquarters, company.Industry, company.Sales_in_Billion, company.Profits_in_Billion, company.Assets_in_Billion, company.Market_Value_in_Billion, employment.Company_ID, employment.People_ID, employment.Year_working Question: Show the names of companies in the banking or retailing industry? [/INST]
SELECT Name FROM company WHERE Industry = "Banking" OR Industry = "Retailing";