SQL
stringlengths
18
577
question
stringlengths
317
11.5k
SELECT Name FROM journalist WHERE Nationality = "England" OR Nationality = "Wales"
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. Show the names of journalists from "England" or "Wales".
SELECT avg(Years_working) FROM journalist
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. What is the average number of years spent working as a journalist?
SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. What is the nationality of the journalist with the largest number of years working?
SELECT Nationality , COUNT(*) FROM journalist GROUP BY Nationality
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. Show the different nationalities and the number of journalists of each nationality.
SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. Show the most common nationality for journalists.
SELECT Nationality FROM journalist WHERE Years_working > 10 INTERSECT SELECT Nationality FROM journalist WHERE Years_working < 3
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working.
SELECT Date , Name , venue FROM event ORDER BY Event_Attendance DESC
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. Show the dates, places, and names of events in descending order of the attendance.
SELECT T3.Name , T2.Date FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. Show the names of journalists and the dates of the events they reported.
SELECT T3.Name , T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance ASC
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. Show the names of journalists and the names of the events they reported in ascending order
SELECT T3.Name , COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. Show the names of journalists and the number of events they reported.
SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. Show the names of journalists that have reported more than one event.
SELECT Name FROM journalist WHERE journalist_ID NOT IN (SELECT journalist_ID FROM news_report)
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. List the names of journalists who have not reported any event.
SELECT avg(Event_Attendance) , max(Event_Attendance) FROM event
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. what are the average and maximum attendances of all events?
SELECT avg(t1.age) , avg(Years_working) , t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. Find the average age and experience working length of journalists working on different role type.
SELECT venue , name FROM event ORDER BY Event_Attendance DESC LIMIT 2
Given the Table event having columns as Event_ID has datatype number, Date has datatype text, Venue has datatype text, Name has datatype text, Event_Attendance has datatype number which has Event_ID and Given the Table journalist having columns as journalist_ID has datatype number, Name has datatype text, Nationality has datatype text, Age has datatype text, Years_working has datatype number which has journalist_ID and Given the Table news report having columns as journalist_ID has datatype number, Event_ID has datatype number, Work_Type has datatype text which has journalist_ID. Answer the question by writing the appropriate SQL code. List the event venues and names that have the top 2 most number of people attended.
SELECT ResName FROM Restaurant;
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show me all the restaurants.
SELECT Address FROM Restaurant WHERE ResName = "Subway";
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the address of the restaurant Subway?
SELECT Rating FROM Restaurant WHERE ResName = "Subway";
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the rating of the restaurant Subway?
SELECT ResTypeName FROM Restaurant_Type;
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List all restaurant types.
SELECT ResTypeDescription FROM Restaurant_Type WHERE ResTypeName = "Sandwich";
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the description of the restaurant type Sandwich?
SELECT ResName , Rating FROM Restaurant ORDER BY Rating DESC LIMIT 1;
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which restaurants have highest rating? List the restaurant name and its rating.
SELECT Age FROM Student WHERE Fname = "Linda" AND Lname = "Smith";
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the age of student Linda Smith?
SELECT Sex FROM Student WHERE Fname = "Linda" AND Lname = "Smith";
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the gender of the student Linda Smith?
SELECT Fname , Lname FROM Student WHERE Major = 600;
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List all students' first names and last names who majored in 600.
SELECT city_code FROM Student WHERE Fname = "Linda" AND Lname = "Smith";
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which city does student Linda Smith live in?
SELECT count(*) FROM Student WHERE Advisor = 1121;
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Advisor 1121 has how many students?
SELECT Advisor , count(*) FROM Student GROUP BY Advisor ORDER BY count(Advisor) DESC LIMIT 1;
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which Advisor has most of students? List advisor and the number of students.
SELECT Major , count(*) FROM Student GROUP BY Major ORDER BY count(Major) ASC LIMIT 1;
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which major has least number of students? List the major and the number of students.
SELECT Major , count(*) FROM Student GROUP BY Major HAVING count(Major) BETWEEN 2 AND 30;
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which major has between 2 and 30 number of students? List major and the number of students.
SELECT Fname , Lname FROM Student WHERE Age > 18 AND Major = 600;
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which student's age is older than 18 and is majoring in 600? List each student's first and last name.
SELECT Fname , Lname FROM Student WHERE Age > 18 AND Major != 600 AND Sex = 'F';
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List all female students age is older than 18 who is not majoring in 600. List students' first name and last name.
SELECT count(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich'
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many restaurant is the Sandwich type restaurant?
SELECT sum(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith";
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How long does student Linda Smith spend on the restaurant in total?
SELECT count(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway";
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many times has the student Linda Smith visited Subway?
SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway";
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. When did Linda Smith visit Subway?
SELECT Restaurant.ResName , sum(Visits_Restaurant.Spent) FROM Visits_Restaurant JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID GROUP BY Restaurant.ResID ORDER BY sum(Visits_Restaurant.Spent) ASC LIMIT 1;
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total.
SELECT Student.Fname , Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY count(*) DESC LIMIT 1;
Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has StuID and Given the Table restaurant having columns as ResID has datatype number, ResName has datatype text, Address has datatype text, Rating has datatype number which has ResID and Given the Table type of restaurant having columns as ResID has datatype number, ResTypeID has datatype number which has ResTypeID and Given the Table restaurant type having columns as ResTypeID has datatype number, ResTypeName has datatype text, ResTypeDescription has datatype text which has NO_PRIMARY_KEY and Given the Table visits restaurant having columns as StuID has datatype number, ResID has datatype number, Time has datatype time, Spent has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which student visited restaurant most often? List student's first name and last name.
SELECT actual_order_id FROM actual_orders WHERE order_status_code = 'Success'
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the ids of orders whose status is 'Success'.
SELECT t1.product_name , t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY count(*) DESC LIMIT 1
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the name and price of the product that has been ordered the greatest number of times.
SELECT count(*) FROM customers
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the number of customers in total.
SELECT count(DISTINCT payment_method) FROM customers
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many different payment methods are there?
SELECT truck_details FROM trucks ORDER BY truck_licence_number
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show the details of all trucks in the order of their license number.
SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the name of the most expensive product.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the names of customers who are not living in the state of California.
SELECT customer_email , customer_name FROM customers WHERE payment_method = 'Visa'
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List the names and emails of customers who payed by Visa card.
SELECT t1.customer_name , t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the names and phone numbers of customers living in California state.
SELECT state_province_county FROM addresses WHERE address_id NOT IN (SELECT employee_address_id FROM Employees)
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the states which do not have any employee in their record.
SELECT customer_name , customer_phone , customer_email FROM Customers ORDER BY date_became_customer
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List the names, phone numbers, and emails of all customers sorted by their dates of becoming customers.
SELECT customer_name FROM Customers ORDER BY date_became_customer LIMIT 5
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the name of the first 5 customers.
SELECT payment_method FROM Customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the payment method that is used most frequently.
SELECT route_name FROM Delivery_Routes ORDER BY route_name
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List the names of all routes in alphabetic order.
SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY count(*) DESC LIMIT 1
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the name of route that has the highest number of deliveries.
SELECT t2.state_province_county , count(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county
Given the Table products having columns as product_id has datatype number, product_name has datatype text, product_price has datatype number, product_description has datatype text which has product_id and Given the Table addresses having columns as address_id has datatype number, address_details has datatype text, city has datatype text, zip_postcode has datatype text, state_province_county has datatype text, country has datatype text which has address_id and Given the Table customers having columns as customer_id has datatype number, payment_method has datatype text, customer_name has datatype text, customer_phone has datatype text, customer_email has datatype text, date_became_customer has datatype time which has customer_id and Given the Table regular orders having columns as regular_order_id has datatype number, distributer_id has datatype number which has regular_order_id and Given the Table regular order products having columns as regular_order_id has datatype number, product_id has datatype number which has actual_order_id and Given the Table actual orders having columns as actual_order_id has datatype number, order_status_code has datatype text, regular_order_id has datatype number, actual_order_date has datatype time which has route_id and Given the Table actual order products having columns as actual_order_id has datatype number, product_id has datatype number which has location_code and Given the Table customer addresses having columns as customer_id has datatype number, address_id has datatype number, date_from has datatype time, address_type has datatype text, date_to has datatype time which has truck_id and Given the Table delivery routes having columns as route_id has datatype number, route_name has datatype text, other_route_details has datatype text which has employee_id and Given the Table delivery route locations having columns as location_code has datatype text, route_id has datatype number, location_address_id has datatype number, location_name has datatype text which has NO_PRIMARY_KEY and Given the Table trucks having columns as truck_id has datatype number, truck_licence_number has datatype text, truck_details has datatype text which has NO_PRIMARY_KEY and Given the Table employees having columns as employee_id has datatype number, employee_address_id has datatype number, employee_name has datatype text, employee_phone has datatype text which has NO_PRIMARY_KEY and Given the Table order deliveries having columns as location_code has datatype text, actual_order_id has datatype number, delivery_status_code has datatype text, driver_employee_id has datatype number, truck_id has datatype number, delivery_date has datatype time which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List the state names and the number of customers living in each state.
SELECT count(*) FROM authors
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. How many authors are there?
SELECT count(*) FROM authors
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Count the number of authors.
SELECT count(*) FROM inst
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. How many institutions are there?
SELECT count(*) FROM inst
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Count the number of institutions.
SELECT count(*) FROM papers
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. How many papers are published in total?
SELECT count(*) FROM papers
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Count the number of total papers.
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Jeremy" AND t1.lname = "Gibbons"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. What are the titles of papers published by "Jeremy Gibbons"?
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Jeremy" AND t1.lname = "Gibbons"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the titles of all the papers written by "Jeremy Gibbons"
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Aaron" AND t1.lname = "Turon"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find all the papers published by "Aaron Turon".
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Aaron" AND t1.lname = "Turon"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the titles of all the papers written by "Aaron Turon".
SELECT count(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Atsushi" AND t1.lname = "Ohori"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. How many papers have "Atsushi Ohori" published?
SELECT count(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Atsushi" AND t1.lname = "Ohori"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. How many papers are "Atsushi Ohori" the author of?
SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Matthias" AND t1.lname = "Blume"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. What is the name of the institution that "Matthias Blume" belongs to?
SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Matthias" AND t1.lname = "Blume"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Which institution is the author "Matthias Blume" belong to? Give me the name of the institution.
SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Katsuhiro" AND t1.lname = "Ueno"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Which institution does "Katsuhiro Ueno" belong to?
SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Katsuhiro" AND t1.lname = "Ueno"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. What is the name of the institution the author "Katsuhiro Ueno" belongs to?
SELECT DISTINCT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Oxford"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Who belong to the institution "University of Oxford"? Show the first names and last names.
SELECT DISTINCT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Oxford"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the first names and last names of the authors whose institution affiliation is "University of Oxford".
SELECT DISTINCT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Which authors belong to the institution "Google"? Show the first names and last names.
SELECT DISTINCT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the first names and last names of the authors whose institution affiliation is "Google".
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Binders Unbound"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. What are the last names of the author of the paper titled "Binders Unbound"?
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Binders Unbound"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Who is the author of the paper titled "Binders Unbound"? Give me the last name.
SELECT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Nameless , Painless"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the first and last name of the author(s) who wrote the paper "Nameless, Painless".
SELECT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Nameless , Painless"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. What are the first and last name of the author who published the paper titled "Nameless, Painless"?
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Indiana University"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. What are the papers published under the institution "Indiana University"?
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Indiana University"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. List the titles of the papers whose authors are from the institution "Indiana University".
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find all the papers published by the institution "Google".
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Which papers were written by authors from the institution "Google"?
SELECT count(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Tokohu University"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. How many papers are published by the institution "Tokohu University"?
SELECT count(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Tokohu University"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the number of papers published by authors from the institution "Tokohu University".
SELECT count(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the number of papers published by the institution "University of Pennsylvania".
SELECT count(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. How many papers are written by authors from the institution "University of Pennsylvania"?
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the papers which have "Olin Shivers" as an author.
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Which papers did the author "Olin Shivers" write? Give me the paper titles.
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Stephanie" AND t1.lname = "Weirich"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Which papers have "Stephanie Weirich" as an author?
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Stephanie" AND t1.lname = "Weirich"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the titles of the papers the author "Stephanie Weirich" wrote.
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "USA" AND t2.authorder = 2 AND t1.lname = "Turon"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Which paper is published in an institution in "USA" and have "Turon" as its second author?
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "USA" AND t2.authorder = 2 AND t1.lname = "Turon"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find papers whose second author has last name "Turon" and is affiliated with an institution in the country "USA".
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "Japan" AND t2.authorder = 1 AND t1.lname = "Ohori"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the titles of papers whose first author is affiliated with an institution in the country "Japan" and has last name "Ohori"?
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "Japan" AND t2.authorder = 1 AND t1.lname = "Ohori"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Which papers' first author is affiliated with an institution in the country "Japan" and has last name "Ohori"? Give me the titles of the papers.
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname , t1.lname ORDER BY count(*) DESC LIMIT 1
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. What is the last name of the author that has published the most papers?
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname , t1.lname ORDER BY count(*) DESC LIMIT 1
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Which author has written the most papers? Find his or her last name.
SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY count(*) DESC LIMIT 1
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Retrieve the country that has published the most papers.
SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY count(*) DESC LIMIT 1
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the country that the most papers are affiliated with.
SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY count(*) DESC LIMIT 1
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the name of the organization that has published the largest number of papers.
SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY count(*) DESC LIMIT 1
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Which institution has the most papers? Find the name of the institution.
SELECT title FROM papers WHERE title LIKE "%ML%"
Given the Table institution having columns as instID has datatype number, name has datatype text, country has datatype text which has instID and Given the Table authors having columns as authID has datatype number, lname has datatype text, fname has datatype text which has authID and Given the Table papers having columns as paperID has datatype number, title has datatype text which has paperID and Given the Table authorship count having columns as authID has datatype number, instID has datatype number, paperID has datatype number, authOrder has datatype number which has authID. Answer the question by writing the appropriate SQL code. Find the titles of the papers that contain the word "ML".