Question: Can you give me a list of driver IDs that are less than or equal to 4 from the driver table, but only include those IDs that are also not equal to 3 in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 4 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 3


Question: Which aircraft IDs, excluding aircraft ID 4, are also aircraft IDs less than or equal to 2 that are associated with airports?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 4 INTERSECT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 2


Question: Can you give me a list of driver IDs, excluding driver ID 10, that are not also driver IDs greater than 9 found in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 10 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 9


Question: Can you give me the Club IDs and Ranks from the coach table, excluding female coaches or those with a Coach ID of 4 or higher and a Rank of 3 or lower, and then remove any Club IDs and Ranks that also appear in the match_result table where the Club ID is not 2 and Bronze is 7, or the Rank is 3 or lower, or Gold is not 5 and Points is 168 or lower and Big Silver is 9 or lower, or Small Silver is not 16?

SELECT Club_ID, Rank FROM coach WHERE Gender <> "F" OR "Coach_ID" >= 4 AND "Rank" <= 3 EXCEPT SELECT Club_ID, Rank FROM match_result WHERE "Club_ID" <> 2 AND "Bronze" = 7 OR "Rank" <= 3 OR "Gold" != 5 AND "Points" <= 168 AND "Big_Silver" <= 9 OR "Small_Silver" != 16


Question: Can you give me the endowment ID, amount, and school ID for all endowments that don't have an endowment ID of 9, combined with the endowment ID, amount, and school ID for endowments where the donator's name isn't Duarte, the school ID is less than 3, and the endowment ID is 5 or greater?

SELECT endowment_id, amount, School_id FROM endowment WHERE "endowment_id" <> 9 UNION SELECT endowment_id, amount, School_id FROM endowment WHERE donator_name <> "Duarte" AND "School_id" < 3 AND "endowment_id" >= 5


Question: Which driver has an ID of 8, excluding any drivers who also have an ID of 10 in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 8 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 10


Question: Can you list the aircraft IDs that are less than or equal to 2, combining the lists from both the aircraft and airport aircraft tables, removing any duplicates?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 2 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 2


Question: Can you give me a list of driver IDs, excluding driver ID 1, from the driver table, but remove any driver IDs from that list that are also in the school bus table, excluding driver ID 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 1 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 3


Question: Which driver IDs are both greater than or equal to 5 in the driver table and equal to 9 in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 5 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 9


Question: Can you list all the driver IDs from the driver table that are greater than or equal to 3, and combine that with a list of all driver IDs from the school_bus table that are less than 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 3 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 3


Question: Can you give me a list of employee names where the employee is 30 years old or younger, combined with a list of shop names that are either not located in Valkeakoski but are in the Finnair Stadium district, or have a manager other than Kai Nyyssönen and are not named KuPS and have 6000 or fewer products, or have a shop ID greater than 3?

SELECT Name FROM employee WHERE "Age" <= 30 UNION SELECT Name FROM shop WHERE Location != "Valkeakoski" AND District = "Finnair Stadium" OR Manager_name != "Kai Nyyssönen" AND Name <> "KuPS" AND "Number_products" <= 6000 OR "Shop_ID" > 3


Question: Which driver has an ID of 9 and is also a driver for a school bus with a driver ID of 3 or greater?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 9 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 3


Question: Can you give me a list of driver IDs, including those from the driver table that are not 10, and those from the school bus table that are less than 7?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 10 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 7


Question: Could you give me a list of document IDs that either have draft details marked as "w" with a draft number of 10 and a document ID less than 1, or were mailed on January 1st, 2007 at 10:32 PM, or were mailed to an address ID of 7 or less?

SELECT document_id FROM Document_Drafts WHERE draft_details = "w" AND "draft_number" = 10 AND "document_id" < 1 UNION SELECT document_id FROM Documents_Mailed WHERE mailing_date = "2007-01-01 22:32:11" OR "mailed_to_address_id" <= 7


Question: Which driver IDs are greater than 4 and also not equal to 3, considering only unique driver IDs from both the driver and school bus lists?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 4 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 3


Question: What are the total budget percentages budgeted that appear in both of these sets: one where the total budget percentage invested isn't 2.7, the year is before 2005, or the budgeted amount is at least 74849 and the total budget percentage budgeted isn't 2.0; and another where the total budget percentage invested is greater than 2.7, or the total budget percentage budgeted is greater than 2.0 and the invested amount is not 8335, or the year is 2004 or later?

SELECT total_budget_percent_budgeted FROM budget WHERE "total_budget_percent_invested" <> 2.7 OR "Year" < 2005 OR "Budgeted" >= 74849 AND "total_budget_percent_budgeted" != 2.0 INTERSECT SELECT total_budget_percent_budgeted FROM budget WHERE "total_budget_percent_invested" > 2.7 OR "total_budget_percent_budgeted" > 2.0 AND "Invested" != 8335 OR "Year" >= 2004


Question: Can you give me the IDs of airports that either don't have the IATA code "BLL", or don't have the ICAO code "EBBR", or are not in Amsterdam and Norway, and also have an ID of 9, but exclude the IDs of flights that either have an airport ID greater than or equal to 2 and an ID of 5, or have a pilot named Peterson, or have a velocity greater than 240 and a vehicle flight number that is not "M2-F1 #33" and a company ID that is not 4, or have a date of May 19, 1964?

SELECT id FROM airport WHERE IATA <> "BLL" OR ICAO != "EBBR" OR City <> "Amsterdam" AND Country <> "Norway" AND "id" = 9 EXCEPT SELECT id FROM flight WHERE "airport_id" >= 2 AND "id" = 5 OR Pilot = "Peterson" OR "Velocity" > 240.0 AND Vehicle_Flight_number <> "M2-F1 #33" AND "company_id" <> 4 OR Date = "May 19, 1964"


Question: Can you give me a list of aircraft IDs that are both less than or equal to 5 and also not equal to 1, considering only aircraft IDs that appear in both the aircraft and airport_aircraft tables?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 5 INTERSECT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID != 1


Question: Which driver IDs, excluding driver ID 6, are also bus driver IDs, excluding bus driver ID 4?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 6 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 4


Question: Can you give me a list of driver IDs less than or equal to 9, excluding those driver IDs that appear in the school bus list where the driver ID is not 7?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 9 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 7


Question: Can you give me a list of driver IDs, where each ID is greater than 2, but not if that same ID is also in a list of driver IDs from the school bus table where those IDs are greater than 10?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 2 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 10


Question: Can you list the driver IDs that are less than or equal to 12 from the driver table, combined with the driver ID 7 from the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 12 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 7


Question: Which driver IDs are not equal to 4 and are also equal to 7?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 4 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 7


Question: Can you give me the Aircraft ID, specifically if it's 5, from the aircraft table, but only if that same ID is not less than 1 in the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID = 5 EXCEPT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID < 1


Question: Can you give me the driver IDs that are less than or equal to 1, excluding any driver IDs from the school bus table that are not equal to 10?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 1 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 10


Question: Can you list all aircraft IDs that are equal to 3 from the aircraft table, and combine that with a list of all aircraft IDs that are not equal to 1 from the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID = 3 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID != 1


Question: What aircraft IDs are both greater than or equal to 1 in the aircraft table and greater than or equal to 2 in the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID >= 1 INTERSECT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID >= 2


Question: Can you list the pilot, velocity, and altitude for all flights, excluding those flown by Thompson, belonging to companies other than company 11, and with an ID less than 13, but then remove any flights from that list that have a non-zero altitude and belong to company 2?

SELECT Pilot, Velocity, Altitude FROM flight WHERE Pilot != "Thompson" AND "company_id" <> 11 AND "id" < 13 EXCEPT SELECT Pilot, Velocity, Altitude FROM flight WHERE "Altitude" != 0.0 AND "company_id" = 2


Question: Could you give me a list of People IDs, including those of people whose height is at least 207, and also those of poker players whose ID is greater than 1 and money rank is 154, or whose best finish is 1 or less?

SELECT People_ID FROM people WHERE "Height" >= 207.0 UNION ALL SELECT People_ID FROM poker_player WHERE "Poker_Player_ID" > 1 AND "Money_Rank" = 154.0 OR "Best_Finish" <= 1.0


Question: Can you give me a list of driver IDs from the driver table that are greater than or equal to 8, excluding any driver IDs that appear in the school_bus table where the driver ID is not equal to 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 8 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 3


Question: Can you give me a list of driver IDs from the driver table that are less than or equal to 10, excluding driver ID 4 if it appears in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 10 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 4


Question: Can you give me the staff IDs that are both associated with lessons that weren't cancelled or didn't occur on March 7, 2018 at 11:53:32 AM, or had a lesson ID of 3 and didn't occur at 9 AM, and who also joined the staff on October 21, 2017 at 5:20:57 PM?

SELECT staff_id FROM Lessons WHERE lesson_status_code <> "Cancelled" OR lesson_date != "2018-03-07 11:53:32" OR "lesson_id" = 3 AND lesson_time != "9" INTERSECT SELECT staff_id FROM Staff WHERE date_joined_staff = "2017-10-21 17:20:57"


Question: Can you give me a list of driver IDs that are less than 8 from the driver table, combined with a list of driver IDs that are not equal to 4 from the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 8 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 4


Question: Can you give me the rank and item ID from the reviews, including those where the author ID is not 2 and the item ID is 7 or less, along with the rank and item ID from reviews where the item ID is not 1 or the rating is greater than 7?

SELECT rank, i_id FROM review WHERE "a_id" != 2 AND "i_id" <= 7 UNION ALL SELECT rank, i_id FROM review WHERE "i_id" != 1 OR "rating" > 7


Question: Which driver IDs are both greater than or equal to 2 and present in the driver table, and also greater than 7 and present in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 2 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 7


Question: Which driver IDs are present in both the list of drivers excluding driver 9 and the list of school bus drivers with ID 7?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 9 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 7


Question: Can you list the aircraft IDs from the aircraft table that are less than or equal to 2, and combine that with a list of aircraft IDs from the airport_aircraft table that are less than or equal to 3, removing any duplicates?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 2 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 3


Question: Which aircraft IDs are both less than or equal to 2 when grouped in the aircraft table and less than or equal to 5 when grouped in the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 2 INTERSECT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 5


Question: Can you give me a list of driver IDs, including those less than 7 from the driver list and those greater than 3 from the school bus list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 7 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 3


Question: Can you list all driver IDs from the driver table that are less than or equal to 4, and combine that with a list of all driver IDs from the school_bus table that are less than or equal to 9, removing any duplicates?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 4 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 9


Question: Can you give me the driver ID that is equal to 4, excluding any driver IDs from the school bus table that are greater than 10?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 4 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 10


Question: Can you give me a list of driver IDs, including those from the driver table excluding driver ID 1, and those from the school bus table with driver IDs greater than or equal to 9?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 1 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 9


Question: Could you give me the property type codes that are both from properties matching a complex set of criteria regarding features, prices, addresses, dates, and IDs, and also from property types that are not described as apartments, flats, or condos?

SELECT property_type_code FROM Properties WHERE apt_feature_2 <> "aut" AND "agreed_selling_price" = 3344706.5755 AND oth_feature_1 <> "None" OR other_property_details = "None" AND apt_feature_1 <> "aut" OR "vendor_requested_price" <> 1337.0 OR hse_feature_3 <> "None" AND property_address != "084 Lakin Vista Apt. 394 Fishertown, MA 16876" AND shp_feature_1 != "None" AND apt_feature_3 = "None" OR date_sold <> "1971-04-14 03:23:49" OR shp_feature_2 <> "None" AND hse_feature_2 = "None" AND hse_feature_1 = "None" OR shp_feature_3 != "None" AND "property_id" != 3 INTERSECT SELECT property_type_code FROM Ref_Property_Types WHERE property_type_description <> "Apartment, Flat, Condo, etc."


Question: Can you list the aircraft IDs, excluding ID 1, from the aircraft table, and combine that with a list of aircraft ID 5 from the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 1 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID = 5


Question: Can you list all aircraft IDs, excluding aircraft ID 1 from the aircraft table and excluding aircraft ID 2 from the airport_aircraft table, combining the results into a single list?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 1 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 2


Question: Can you give me a list of driver IDs, excluding driver ID 10, that are not also driver IDs less than or equal to 7 in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 10 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 7


Question: Could you list the driver IDs that are both greater than or equal to 1 and less than or equal to 10, considering only unique driver IDs from the driver and school bus tables?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 1 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 10


Question: Can you give me a list of driver IDs that appear in the driver table, excluding driver ID 3, but also excluding any driver IDs that appear in the school_bus table with an ID less than or equal to 9?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 3 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 9


Question: Can you give me the last name, advisor, highest student ID, major, city code, first name, average age, and sex of students, excluding those who are male and whose last name is Nelson, or whose advisor is 8722 or higher, or whose major is 600 and age is 18 or older, but then remove the students who are not from PIT and not female, or whose first name is not Tracy, or whose student ID is 1003 or lower and last name is Han, or whose major is less than 600 and advisor is not 2311?

LName Advisor MAX(StuID) Major city_code Fname AVG(Age) Sex

SELECT LName, Advisor, MAX(StuID), Major, city_code, Fname, AVG(Age), Sex FROM Student WHERE Sex <> "M" AND LName = "Nelson" AND "StuID" < 1001 OR "Advisor" >= 8722 OR "Major" = 600 AND "Age" >= 18 EXCEPT SELECT LName, Advisor, MAX(StuID), Major, city_code, Fname, AVG(Age), Sex FROM Student WHERE city_code <> "PIT" AND Sex != "F" OR Fname != "Tracy" OR "StuID" <= 1003 AND LName = "Han" OR "Major" < 600 AND "Advisor" <> 2311


Question: Can you give me the Driver ID that appears exactly once with the value 2 in the driver table, but only if it doesn't appear in the school_bus table with a value greater than 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 2 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 3


Question: Can you give me a list of driver IDs, including driver ID 2 from the driver table and driver ID 9 from the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 2 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 9


Question: Can you list the aircraft IDs that are less than or equal to 4, excluding the aircraft ID 3 if it exists?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 4 EXCEPT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID = 3


Question: Which driver IDs are greater than 1 and also not equal to 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 1 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 3


Question: Can you give me a list of employee IDs, combining those from the employee table who are at least 29 years old and not from Sale, with those from the hiring table where the employee ID is not 3, and either the start date isn't 2010 or they are full-time?

SELECT Employee_ID FROM employee WHERE "Age" >= 29 AND City <> "Sale" UNION SELECT Employee_ID FROM hiring WHERE "Employee_ID" != 3 AND Start_from != "2010" OR Is_full_time = "T"


Question: Can you give me a list of driver IDs that are less than 6, excluding any driver IDs that are also greater than 4 and associated with a school bus?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 6 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 4


Question: Which driver IDs are both greater than or equal to 1 and also equal to 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 1 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 3


Question: Which driver has an ID of 8, but is not a driver with an ID other than 7 in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 8 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 7


Question: Can you give me a list of driver IDs that are 12 or greater, excluding the driver ID 3 if it's in the school bus driver list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 12 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 3


Question: Can you give me a list of aircraft IDs, including those that are not equal to 1 from the aircraft table, and those that are equal to 2 from the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 1 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID = 2


Question: Can you give me a list of driver IDs from the driver table that are less than or equal to 5, excluding any driver IDs that are also in the school_bus table and are greater than or equal to 9?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 5 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 9


Question: Can you give me a list of aircraft IDs that are both greater than or equal to 1 and also not equal to 5?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID >= 1 INTERSECT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID != 5


Question: Can you give me a list of driver IDs, including those from the driver table excluding driver ID 4, and those from the school_bus table with driver IDs less than or equal to 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 4 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 3


Question: Could you give me the IDs of documents that either have a template ID of 20 or less, or have a document description of "h" and are not document ID 3, but excluding any document IDs that also appear in paragraphs with a paragraph ID that is not 1104059, a document ID greater than 80, and the paragraph text "UK"?

SELECT Document_ID FROM Documents WHERE "Template_ID" <= 20 OR Document_Description = "h" AND "Document_ID" <> 3 EXCEPT SELECT Document_ID FROM Paragraphs WHERE "Paragraph_ID" != 1104059 AND "Document_ID" > 80 AND Paragraph_Text = "UK"


Question: Which driver IDs appear exactly once in the driver table with the ID being 2, but do not appear in the school bus table with IDs less than 9?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 2 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 9


Question: Can you list all aircraft IDs, including those from the aircraft table that are 5 or greater, and those from the airport_aircraft table that are not equal to 1?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID >= 5 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID != 1


Question: Can you list all the aid values from the certificate table where aid is less than 1 and eid is less than 567354612, and also list all the aid values from the flight table where the departure date is not "04/12/2005 08:45" and the destination and origin are not "Los Angeles"?

SELECT aid FROM certificate WHERE "aid" < 1 AND "eid" < 567354612 UNION ALL SELECT aid FROM flight WHERE departure_date != "04/12/2005 08:45" AND destination <> "Los Angeles" AND origin <> "Los Angeles"


Question: Could you list the incorporation location, ID, type, name, principal activities, and group equity shareholding for all companies where the name is "China Pacific Laundry Services" or the ID is not 5 or the group equity shareholding is greater than 100, combined with all companies where the incorporation location is not "Hong Kong" or the ID is 1 and the type is not "Subsidiary" or the name is "CLS Catering Services Limited" or the group equity shareholding is greater than or equal to 18.77?

Canada
14
Joint Venture
CLS Catering Services Limited
Catering services
30.0

China
1
Corporate
Air China
Airline
18.77

China
2
Joint Venture
Air China Cargo
Cargo airline
49.0

Hong Kong
3
Joint Venture
Air Hong Kong
Cargo airline
60.0

Hong Kong
4
Subsidiary
Dragonair
Airline
100.0

Hong Kong
5
Subsidiary
Cathay Pacific Cargo
Cargo airline
100.0

Cathay Pacific Catering Services (HK) Limited

Hong Kong
7
Subsidiary
Cathay Pacific Services Limited
Cargo
100.0

Hong Kong
8
Subsidiary
Cathay Pacific Holidays
Travel agency
100.0

Hong Kong
9
Subsidiary
Dragonair Holidays
Travel agency
100.0

Hong Kong
10
Subsidiary
Hong Kong Airport Services
Ground handling
100.0

Hong Kong
11
Subsidiary
Vogue Laundry Service Limited
Laundry
100.0

Taiwan
12
Joint Venture
China Pacific Laundry Services
Laundry
45.0

Vietnam
13
Joint Venture
VN/CX Catering Services Limited
Catering services
40.0

SELECT Incorporated_in, id, Type, name, Principal_activities, Group_Equity_Shareholding FROM operate_company WHERE name = "China Pacific Laundry Services" OR "id" != 5 OR "Group_Equity_Shareholding" > 100.0 UNION SELECT Incorporated_in, id, Type, name, Principal_activities, Group_Equity_Shareholding FROM operate_company WHERE Incorporated_in <> "Hong Kong" OR "id" = 1 AND Type <> "Subsidiary" OR name = "CLS Catering Services Limited" OR "Group_Equity_Shareholding" >= 18.77


Question: Can you list the student and pet IDs from the Has_Pet table where the pet ID is less than 2002 or the student ID is not 1001, but exclude any student and pet IDs where the student ID is less than 1001?

SELECT StuID, PetID FROM Has_Pet WHERE "PetID" < 2002 OR "StuID" != 1001 EXCEPT SELECT StuID, PetID FROM Has_Pet WHERE "StuID" < 1001


Question: Can you list the aircraft IDs, excluding ID 5, that appear more than once in the aircraft table, but only if they are not aircraft IDs, excluding ID 3, that appear more than once in the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID != 5 EXCEPT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 3


Question: Can you give me a list of People IDs from the employment table where either the working year is less than or equal to 4, or the Company ID is 15 and the People ID is 1, combined with a list of People IDs from the people table where the nationality is not the United Kingdom and the name is not Reggie Lewis and the People ID is not 1, or the graduation college is Virginia and the age is not 34?

SELECT People_ID FROM employment WHERE "Year_working" <= 4 OR "Company_ID" = 15 AND "People_ID" = 1 UNION SELECT People_ID FROM people WHERE Nationality <> "United Kindom" AND Name <> "Reggie Lewis" AND "People_ID" <> 1 OR Graduation_College = "Virginia" AND "Age" != 34


Question: Can you give me a list of driver IDs, excluding driver ID 12, that are not also driver ID 3 in the school bus list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 12 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 3


Question: Which driver IDs are both not equal to 8 and less than or equal to 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 8 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 3


Question: Can you give me a list of driver IDs, including those from the driver table excluding driver ID 4, and those from the school_bus table with driver IDs up to 7?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 4 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 7


Question: Can you give me a list of driver IDs, where each ID is less than or equal to 9, but excluding driver ID 7?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 9 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 7


Question: What is the highest branch ID and corresponding card number for branches and members, considering only those where the city is not London, the address road is Oaks Crescent, the branch ID is 2 or higher with an average level of 2 or higher and the hometown is Columbia, South Carolina, or the open year is not 2013 and the card number is not RE95?

SELECT MAX(T1.Branch_ID), T2.Card_Number FROM branch as T1 JOIN member as T2 ON T1.Name = T2.Name WHERE City <> "London" OR Address_road = "Oaks Crescent" OR Branch_ID >= 2 AND AVG(Level) >= 2 AND Hometown = "Columbia, South Carolina" OR Open_year <> "2013" AND Card_Number <> "RE95"


Question: Can you list all the aircraft IDs, including those that are equal to 1 from the aircraft table and those that are greater than or equal to 1 from the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID = 1 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID >= 1


Question: Can you give me the major and last name of students, combining those who are not named Lee or Bruce, whose advisor isn't 7712, whose major isn't 100, and who aren't female, or are 19 or younger and not from Hong Kong, with those who are not named Lee, or whose first name isn't Tracy and major is 600, or whose student ID is less than 1016, are male, not from Chicago, and whose advisor isn't 7723?

SELECT Major, LName FROM Student WHERE LName != "Lee" AND Fname <> "Bruce" AND "Advisor" != 7712 AND "Major" <> 100 AND Sex <> "F" OR "Age" <= 19 AND city_code <> "HKG" UNION SELECT Major, LName FROM Student WHERE LName <> "Lee" OR Fname <> "Tracy" AND "Major" = 600 OR "StuID" < 1016 AND Sex = "M" AND city_code != "CHI" AND "Advisor" <> 7723


Question: Which driver IDs are greater than or equal to 9, but are not driver ID's that are not equal to 9 in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 9 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 9


Question: Can you list all aircraft IDs from both the aircraft and airport_aircraft tables, excluding aircraft ID 2, and showing each aircraft ID only once?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID != 2 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 2


Question: Which driver IDs are both greater than or equal to 3 and also not equal to 3, considering drivers and school buses separately?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 3 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 3


Question: Can you list all the aircraft IDs, excluding 5, from the aircraft table, and combine that with a list of aircraft IDs less than 2 from the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 5 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID < 2


Question: Could you give me a list of Store IDs for all Village Stores or stores with a ranking of 9, excluding those stores located in any district other than District 11?

SELECT Store_ID FROM store WHERE Type = "Village Store" OR "Ranking" = 9 EXCEPT SELECT Store_ID FROM store_district WHERE "District_ID" != 11


Question: Can you give me the maximum staff ID, maximum price, vehicle ID, lesson status code, average lesson date, customer ID, and the number of lessons from the Lessons table, excluding those where the vehicle ID is 3 or greater and the price is not 277, and including only those lessons where the staff ID is less than 11, or the lesson status is not cancelled and the price is less than or equal to 223, or the lesson ID is less than or equal to 2 and the customer ID is less than or equal to 8, or the lesson time is not 6, or the lesson date is not 2018-02-28 10:55:36 and the vehicle ID is not 2?

SELECT MAX(staff_id), MAX(price), vehicle_id, lesson_status_code, AVG(lesson_date), customer_id, COUNT(lesson_id) FROM Lessons WHERE "staff_id" < 11 OR lesson_status_code <> "Cancelled" AND "price" <= 223.0 OR "lesson_id" <= 2 AND "customer_id" <= 8 OR lesson_time != "6" OR lesson_date <> "2018-02-28 10:55:36" AND "vehicle_id" <> 2 EXCEPT SELECT MAX(staff_id), MAX(price), vehicle_id, lesson_status_code, AVG(lesson_date), customer_id, COUNT(lesson_id) FROM Lessons WHERE "vehicle_id" >= 3 AND "price" <> 277.0


Question: Can you show me the Big Silver, the lowest Small Silver, Bronze, Club ID, and Points from the match results, considering two sets of criteria: first, where Bronze is 7, Rank is greater than 5, Gold is at least 13, or Big Silver is greater than 14 while Club ID is 5 and Small Silver is 9; and second, where Points is not 89 and Club ID is not 2, or Bronze is greater than 10, or Rank is not 4, or Big Silver is not 7 while Gold is not 20, or Small Silver is 6?

SELECT Big_Silver, MIN(Small_Silver), Bronze, Club_ID, Points FROM match_result WHERE "Bronze" = 7 OR "Rank" > 5 OR "Gold" >= 13 OR "Big_Silver" > 14 AND "Club_ID" = 5 AND "Small_Silver" = 9 UNION ALL SELECT Big_Silver, MIN(Small_Silver), Bronze, Club_ID, Points FROM match_result WHERE "Points" != 89 AND "Club_ID" != 2 OR "Bronze" > 10 OR "Rank" <> 4 OR "Big_Silver" <> 7 AND "Gold" <> 20 OR "Small_Silver" = 6


Question: Can you give me a list of document IDs that either have at least 5 copies, aren't document ID 10, and have a draft number greater than 1, or are from documents where the other details aren't "u" and the shipping agent code isn't "US", or the receipt number isn't "69"?

SELECT document_id FROM Circulation_History WHERE "copy_number" >= 5 AND "document_id" != 10 AND "draft_number" > 1 UNION SELECT document_id FROM Documents WHERE other_details != "u" AND shipping_agent_code <> "US" OR receipt_number != "69"


Question: Can you list all the parties from the election table where the district is not 4, combined with a list of parties from the party table where either the Party ID is 2 or greater and the Attorney General is not Eliot Spitzer and the year is after 1998, or the Comptroller is not Carl McCall, or the US Senator is Hillary Rodham Clinton and the Lieutenant Governor is David Paterson, or the party is not Independence?

SELECT Party FROM election WHERE "District" <> 4 UNION SELECT Party FROM party WHERE "Party_ID" >= 2 AND Attorney_General <> "Eliot Spitzer" AND "Year" > 1998.0 OR Comptroller <> "Carl McCall" OR US_Senate = "Hillary Rodham Clinton" AND Lieutenant_Governor = "David Paterson" OR Party <> "Independence"


Question: Which aircraft have an ID of 1 and are also associated with airports, but not with an airport that has an ID of 3?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID = 1 INTERSECT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 3


Question: Can you list the aircraft IDs that appear more than twice in the aircraft table, excluding those aircraft IDs that appear less than three times in the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID > 2 EXCEPT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID < 3


Question: Can you give me a list of aircraft IDs that are not equal to 2, excluding any aircraft IDs that are also in the airport aircraft list and are greater than or equal to 2?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID != 2 EXCEPT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID >= 2


Question: Can you give me a list of source user IDs that satisfy both of these conditions: first, the trust value is less than or equal to 1 or the source user ID is not 1; and second, the trust value is less than 10, or the target user ID is not 6, or the source user ID is not 3?

SELECT source_u_id FROM trust WHERE "trust" <= 1 OR "source_u_id" <> 1 INTERSECT SELECT source_u_id FROM trust WHERE "trust" < 10 OR "target_u_id" <> 6 OR "source_u_id" != 3


Question: Could you give me the Driver IDs that are equal to 9 from the driver table, combined with the Driver IDs that are equal to 4 from the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 9 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 4


Question: Can you give me a list of driver IDs from the driver table where each ID is less than or equal to 9, combined with a list of driver IDs from the school_bus table where each ID is not equal to 4?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 9 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 4


Question: Which driver IDs are equal to 6 in the driver table, but not less than or equal to 9 in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 6 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 9


Question: Can you give me a list of driver IDs from the driver table that are greater than 7, excluding any driver IDs that also appear in the school_bus table and are greater than or equal to 4?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 7 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 4


Question: Can you give me a list of driver IDs, excluding driver ID 2, that are not also driver IDs, excluding driver ID 7, in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 2 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 7


Question: Which driver IDs, excluding driver ID 2, are also driver IDs that are equal to 7 in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 2 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 7


Question: Can you list the aircraft IDs that are 3 or greater, excluding those aircraft IDs that are 2 or less from the airport aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID >= 3 EXCEPT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 2


Question: Can you list the aircraft IDs from the aircraft table that are less than or equal to 3, and combine that with a list of aircraft IDs from the airport_aircraft table that are not equal to 5?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 3 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 5


Question: Can you give me a list of driver IDs that are greater than 4, excluding any driver IDs from the school bus table that are less than 4?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 4 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 4


Question: What is the average branch ID for branches that meet certain criteria, excluding the average branch ID for purchases that meet other criteria?

SELECT AVG(Branch_ID) FROM branch WHERE "Branch_ID" > 8 AND Name = "Zytogorski" AND Address_road != "Concord Road" AND membership_amount = "31" OR City != "London" EXCEPT SELECT AVG(Branch_ID) FROM purchase WHERE Year <> "2018" AND Branch_ID = "3" OR "Member_ID" < 1 AND "Total_pounds" <> 20.99


Question: Can you give me a list of driver IDs less than or equal to 8, excluding any driver IDs greater than 4 that are also in the school bus list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 8 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 4


Question: Can you give me a list of driver IDs, including those from the driver table that are 12 or greater, and those from the school bus table that are 7 or less?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 12 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 7


Question: Can you give me a list of driver IDs that are not 11 and are also greater than 4, considering only the unique driver IDs from both the driver and school bus tables?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 11 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 4


Question: Could you list the driver IDs that are both less than or equal to 9 in the driver table and less than 10 in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 9 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 10


Question: Which driver IDs, other than 3, are present in both the driver and school bus tables?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 3 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 3


Question: Can you give me a list of book IDs, titles, number of issues, and writers for all books where the writer is not Timothy Truman and the number of issues is 4, combined with a list of book IDs, titles, number of issues, and writers for all books where the title is not Sheva's War or the number of issues is greater than 5?

SELECT Book_ID, Title, Issues, Writer FROM book WHERE Writer <> "Timothy Truman" AND "Issues" = 4.0 UNION ALL SELECT Book_ID, Title, Issues, Writer FROM book WHERE Title != "Sheva's War" OR "Issues" > 5.0


Question: Can you list all animal allergies except for egg allergies, and also list all allergies for student ID 1005?

SELECT Allergy FROM Allergy_Type WHERE AllergyType = "animal" AND Allergy != "Eggs" UNION SELECT Allergy FROM Has_Allergy WHERE "StuID" = 1005


Question: Could you list the driver IDs that are both greater than or equal to 7 and also less than or equal to 10, considering only the drivers that appear in both the driver and school bus records?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 7 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 10


Question: Can you give me a list of driver IDs that are less than 10 and also appear in the list of school bus driver IDs, excluding driver ID 7?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 10 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 7


Question: Can you give me a list of driver IDs, including those from the driver table that are 8 or higher, and those from the school bus table that are 10 or lower?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 8 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 10


Question: Can you give me a list of driver IDs that are less than 10, excluding any driver ID that is equal to 10 and also appears in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 10 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 10


Question: Can you give me a list of property type codes that meet certain criteria from the Properties table and also meet other criteria from the Ref_Property_Types table? Specifically, from the Properties table, I need properties where the shp_feature_3 is not "None", the date_on_market is not "1978-05-15 10:53:37", or the property_address is "986 Hagenes Drives Draketon, UT 83411-3393", or the hse_feature_2 is not "None", or the apt_feature_3 is "None" and the oth_feature_1 is not "None", or the apt_feature_1 is "quos" and the shp_feature_2 is "None" and the fld_feature_3 is not "None", or the fld_feature_2 is not "None", or the "vendor_requested_price" is less than or equal to 1337.0, and from the Ref_Property_Types table, I need property types where the property_type_code is not "Shop" or the property_type_description is "Other, to be determined."?

SELECT property_type_code FROM Properties WHERE shp_feature_3 != "None" AND date_on_market != "1978-05-15 10:53:37" OR property_address = "986 Hagenes Drives Draketon, UT 83411-3393" OR hse_feature_2 != "None" OR apt_feature_3 = "None" AND oth_feature_1 <> "None" OR apt_feature_1 = "quos" AND shp_feature_2 = "None" AND fld_feature_3 <> "None" OR fld_feature_2 <> "None" OR "vendor_requested_price" <= 1337.0 INTERSECT SELECT property_type_code FROM Ref_Property_Types WHERE property_type_code != "Shop" OR property_type_description = "Other, to be determined."


Question: Can you give me a list of driver IDs, including those from the driver table that are greater than 12, and those from the school bus table that are not equal to 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 12 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 3


Question: Can you give me a list of driver IDs that are less than 1 from the driver table, combined with a list of driver IDs that are not equal to 9 from the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 1 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 9


Question: Could you list the District IDs from the district table where the City Area isn't 22, the Headquartered City is Bhakkar City, the District name isn't Jhang District, and the City Population is 328512, combined with the District IDs from the store_district table where the District ID is less than 15 and the Store ID is greater than 2?

SELECT District_ID FROM district WHERE "City_Area" <> 22.0 AND Headquartered_City = "Bhakkar City" AND District_name != "Jhang District" AND "City_Population" = 328512.0 UNION SELECT District_ID FROM store_district WHERE "District_ID" < 15 AND "Store_ID" > 2


Question: Can you give me a list of driver IDs, including those from the driver table that are 11 or greater, and those from the school bus table that are 7 or less?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 11 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 7


Question: Can you give me a list of driver IDs that are 12 or greater, excluding those driver IDs that are not equal to 4 and are also in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 12 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 4


Question: Can you give me a list of driver IDs that are not equal to 12 from the driver table, excluding any driver IDs greater than 3 that are in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 12 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 3


Question: Can you give me a list of driver IDs that are less than or equal to 3 and also not equal to 4, considering only the driver IDs that appear in both the driver and school bus records?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 3 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 4


Question: Can you list the aircraft IDs that are greater than 4 from the aircraft table, and also list the aircraft IDs that are less than or equal to 5 from the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID > 4 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 5


Question: Can you give me a list of driver IDs that are both less than 6 and also less than or equal to 3, considering only unique driver IDs from the driver and school_bus tables?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 6 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 3


Question: Can you give me the School ID, full-time status, and Driver ID for all school bus records where either the driver is not full-time and has worked for 2 years or less and the School ID is not 7, or where the Driver ID is 3, combined with all school bus records where the School ID is not 3, or the driver has worked for 6 years or less, or the driver is not full-time?

SELECT School_ID, If_full_time, Driver_ID FROM school_bus WHERE If_full_time <> "T" AND "Years_Working" <= 2 AND "School_ID" <> 7 OR "Driver_ID" = 3 UNION ALL SELECT School_ID, If_full_time, Driver_ID FROM school_bus WHERE "School_ID" != 3 OR "Years_Working" <= 6 OR If_full_time <> "T"


Question: Could you list the branch names that meet either of these conditions: they weren't opened in 2015 and aren't on Oaks Crescent, or their Branch ID is less than 5, or their membership amount is 56, they're in London, and their name isn't Taverner, but exclude any names that are also member names where the member isn't from Simpsonville, South Carolina, or their level is 6?

SELECT Name FROM branch WHERE Open_year <> "2015" AND Address_road <> "Oaks Crescent" OR "Branch_ID" < 5 OR membership_amount = "56" AND City = "London" AND Name <> "Taverner" EXCEPT SELECT Name FROM member WHERE Hometown != "Simpsonville, South Carolina" OR "Level" = 6


Question: Can you give me a list of driver IDs that are greater than 11, excluding any driver IDs that are less than or equal to 10 and are also associated with a school bus?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 11 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 10


Question: Can you give me a list of property type codes from properties that meet a long list of criteria related to features, dates, names, prices, addresses, and other details, combined with a list of property type codes from the property types reference table that are not "Apartment" and have the description "House, Bungalow, etc."?

SELECT property_type_code FROM Properties WHERE fld_feature_1 <> "None" OR "property_id" = 13 AND date_on_market = "2003-12-25 16:13:19" OR fld_feature_3 = "None" OR apt_feature_2 <> "odio" OR fld_feature_2 <> "None" AND oth_feature_1 <> "None" AND shp_feature_1 <> "None" OR property_type_code = "Other" OR apt_feature_1 != "fuga" OR hse_feature_1 <> "None" AND hse_feature_3 <> "None" AND date_sold <> "1971-04-14 03:23:49" OR property_name = "avalon" AND "room_count" <= 7 OR "vendor_requested_price" <> 661536468.4429 AND property_address <> "098 Tremaine Highway Suite 569 South Wilford, NJ 46587-3537" AND oth_feature_2 = "None" AND shp_feature_2 = "None" OR "buyer_offered_price" >= 11375259.502 OR "agreed_selling_price" <> 456840888.16 OR shp_feature_3 <> "None" AND other_property_details <> "None" AND hse_feature_2 != "None" OR apt_feature_3 != "None" UNION ALL SELECT property_type_code FROM Ref_Property_Types WHERE property_type_code <> "Apartment" AND property_type_description = "House, Bungalow, etc."


Question: Can you give me a list of driver IDs that are greater than 10 from the driver table, excluding any driver IDs greater than 7 that are also in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 10 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 7


Question: Which driver IDs are both less than or equal to 8 in the driver table and less than or equal to 4 in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 8 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 4


Question: Can you give me a list of driver IDs that are greater than 1, but not including any driver IDs from the school bus list that are 7 or higher?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 1 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 7


Question: What security features are available, excluding those that are also classified as amenities?

SELECT feature_type_code FROM Other_Available_Features WHERE feature_type_code = "Security" EXCEPT SELECT feature_type_code FROM Ref_Feature_Types WHERE feature_type_code = "Amenity"


Question: Can you give me a list of driver IDs less than or equal to 10, excluding those driver IDs that are also in the school bus list and less than or equal to 7?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 10 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 7


Question: Can you give me a list of customer IDs from the Customers table where either the first name is not Sigrid, the amount outstanding is not 9443, or the date they became a customer wasn't March 18, 2016 at 6:14 AM, and their customer address ID is 9, or their last name isn't Schmeler and their customer ID is 4, combined with a list of customer IDs from the Lessons table where the price is less than or equal to 492, the vehicle ID isn't 2, and the staff ID is less than or equal to 4, or the lesson status code isn't Cancelled, or the lesson ID is less than 11 and the customer ID isn't 8, or the lesson time isn't 5, or the lesson date isn't March 7, 2018 at 11:53 AM?

SELECT customer_id FROM Customers WHERE first_name <> "Sigrid" OR "amount_outstanding" != 9443.0 OR date_became_customer != "2016-03-18 06:14:18" AND "customer_address_id" = 9 OR last_name <> "Schmeler" AND "customer_id" = 4 UNION ALL SELECT customer_id FROM Lessons WHERE "price" <= 492.0 AND "vehicle_id" != 2 AND "staff_id" <= 4 OR lesson_status_code != "Cancelled" OR "lesson_id" < 11 AND "customer_id" != 8 OR lesson_time <> "5" OR lesson_date <> "2018-03-07 11:53:32"


Question: Can you give me the customer ID, status code, phone number, date of birth, average date they became a customer, first name, sum of last names, sum of customer address IDs, and mobile phone number for all customers with an outstanding amount not equal to 9500, excluding those customers whose information doesn't match records where the birthdate is not December 15, 1998, the address ID is less than 1, the first name is Genevieve, the email address is nichole59@example.com, and the status code is not "Bad Customer," or where the last name is not Ortiz, the phone number is not (729)396-4354x3576, or the outstanding amount is not 2099?

SELECT customer_id, customer_status_code, phone_number, date_of_birth, AVG(date_became_customer), first_name, SUM(last_name), SUM(customer_address_id), cell_mobile_phone_number FROM Customers WHERE "amount_outstanding" <> 9500.0 EXCEPT SELECT customer_id, customer_status_code, phone_number, date_of_birth, AVG(date_became_customer), first_name, SUM(last_name), SUM(customer_address_id), cell_mobile_phone_number FROM Customers WHERE date_of_birth != "1998-12-15 13:24:40" AND "customer_address_id" < 1 AND first_name = "Genevieve" AND email_address = "nichole59@example.com" AND customer_status_code != "Bad Customer" OR last_name != "Ortiz" AND phone_number <> "(729)396-4354x3576" OR "amount_outstanding" != 2099.0


Question: Could you give me a list of driver IDs, including driver ID 7 from the driver table and driver ID 3 from the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 7 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 3


Question: Can you give me a list of aircraft IDs that are greater than 4, and are also not equal to 2 in the airport aircraft list?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID > 4 INTERSECT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 2


Question: Can you list the aircraft IDs, including those from the aircraft table that are greater than or equal to 2, and those from the airport_aircraft table that are less than or equal to 5?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID >= 2 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 5


Question: Can you give me a list of driver IDs, including those that are not 11 from the driver table, and those that are less than or equal to 4 from the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 11 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 4


Question: Can you give me a list of driver IDs that are either greater than or equal to 6 from the driver table, or equal to 10 from the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 6 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 10


Question: Can you list the aircraft IDs, including those from the aircraft table that are greater than or equal to 4, and also those from the airport_aircraft table that are not equal to 5?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID >= 4 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 5


Question: Can you show me the age of drivers and their driver IDs, grouped by their political party, but only for those where the school ID is 7, or the driver's name isn't Douglas McCrory and they've worked for 2 years or less and are full-time, or they belong to the Democratic party, or they don't live in East Hartford, or they are 42 or older?

SELECT T1.Age, T2.Driver_ID FROM driver as T1 JOIN school_bus as T2 ON T1.Driver_ID == T2.Driver_ID GROUP BY Party HAVING School_ID = 7 OR Name <> "Douglas McCrory" AND Years_Working <= 2 AND If_full_time = "T" OR Party = "Dem" OR Home_city <> "East Hartford" OR Age >= 42


Question: Can you give me a list of driver IDs that are less than 12 and also not equal to 3, considering only unique driver IDs from both the driver and school bus lists?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 12 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 3


Question: What is the smallest branch ID for branches that are not named Stanley, excluding the smallest branch IDs from the membership register that either have a member ID of 2 or a register year that is not 2016?

SELECT MIN(Branch_ID) FROM branch WHERE Name != "Stanley" EXCEPT SELECT MIN(Branch_ID) FROM membership_register_branch WHERE "Member_ID" = 2 OR Register_Year <> "2016"


Question: Can you list the model and maker for all entries, excluding those with ModelId 26, and also include the model and maker for all entries where the model is not "buick"?

SELECT Model, Maker FROM model_list WHERE "ModelId" != 26 UNION SELECT Model, Maker FROM model_list WHERE Model <> "buick"


Question: Which driver IDs are both greater than 6 and also equal to 10?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 6 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 10


Question: Can you give me a list of driver IDs that are greater than 7, but not including any driver IDs that are greater than or equal to 7 and also appear in the school bus list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 7 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 7


Question: What aircraft IDs, excluding ID 2, are present in the aircraft table but not in the airport_aircraft table, also excluding ID 3 from the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID != 2 EXCEPT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID != 3


Question: Could you give me a list of driver IDs from the driver table that are greater than or equal to 1, excluding any driver IDs that also appear in the school_bus table and are greater than 9?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 1 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 9


Question: Can you give me a list of aircraft IDs, including aircraft ID 1 from the aircraft table and all aircraft IDs except 3 from the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID = 1 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 3


Question: Can you give me a list of driver IDs, including those from the driver table that are greater than 7, and those from the school bus table that are greater than or equal to 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 7 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 3


Question: Could you list the names and user IDs for everyone named Terry, and also include the names and user IDs for everyone who isn't named Roxi or whose user ID is 3 or less?

SELECT name, u_id FROM useracct WHERE name = "Terry" UNION ALL SELECT name, u_id FROM useracct WHERE name != "Roxi" OR "u_id" <= 3


Question: Can you give me the Driver ID that appears exactly once in the driver table, specifically Driver ID 1, but is not a Driver ID less than 3 that appears exactly once in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 1 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 3


Question: What are the IDs of all certificates that are not associated with event ID 269734834, excluding the IDs of all flights that departed on "04/12/2005 05:30"?

SELECT aid FROM certificate WHERE "eid" != 269734834 EXCEPT SELECT aid FROM flight WHERE departure_date = "04/12/2005 05:30"


Question: Which driver has an ID of 6, but is not a driver with an ID of 4 in the school bus list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 6 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 4


Question: Can you list the aircraft IDs that are greater than 4 from the aircraft table, and also list the aircraft IDs that are less than 2 from the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID > 4 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID < 2


Question: What is the smallest property type code for properties where both shp_feature_2 and oth_feature_3 are "None", excluding the smallest property type codes from the property type reference table where the description is "Other, to be determined." or the code is not "Other"?

SELECT MIN(property_type_code) FROM Properties WHERE shp_feature_2 = "None" AND oth_feature_3 = "None" EXCEPT SELECT MIN(property_type_code) FROM Ref_Property_Types WHERE property_type_description = "Other, to be determined." OR property_type_code != "Other"


Question: Can you give me a list of driver IDs from the driver table that are greater than or equal to 2, excluding any driver IDs that are less than or equal to 9 from the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 2 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 9


Question: Could you give me a list of head IDs, including those from the head table where the ID is 3 or greater, and also those from the management table where the temporary acting status is not "Yes"?

SELECT head_ID FROM head WHERE "head_ID" >= 3 UNION SELECT head_ID FROM management WHERE temporary_acting != "Yes"


Question: Can you give me a list of driver IDs, including all driver IDs from the driver table that are not 11, and also including driver ID 4 from the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 11 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 4


Question: Can you give me a list of driver IDs that are both greater than or equal to 1 and are not equal to 10, considering all drivers and school bus drivers?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 1 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 10


Question: Which aircraft have an ID of 5 and are also associated with airports that don't have an aircraft ID of 1?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID = 5 INTERSECT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 1


Question: What is the average continent value, considering only continents that are not Asia, and also considering only continents where the ContId is not 1?

SELECT AVG(Continent) FROM continents WHERE Continent <> "asia" INTERSECT SELECT AVG(Continent) FROM continents WHERE "ContId" <> 1


Question: Which driver IDs are not equal to 3 and are also not equal to 7 in the school bus list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 3 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 7


Question: Can you give me the origin, latest arrival date, departure date, shortest distance, aid, earliest destination, and average price for flights, combining two sets of results: first, flights that either don't go to Chicago, don't depart on "04/12/2005 09:15", have a price greater than 278.56, don't originate in Los Angeles, don't have a flight number of 33, and have a distance less than 2551; and second, flights that either don't arrive on "04/12/2005 12:02" or have a price of 220.98 and go to Honolulu?

origin MAX(arrival_date) departure_date MIN(distance) aid MIN(destination) AVG(price)

SELECT origin, MAX(arrival_date), departure_date, MIN(distance), aid, MIN(destination), AVG(price) FROM flight WHERE destination <> "Chicago" OR departure_date != "04/12/2005 09:15" OR "price" > 278.56 AND origin <> "Los Angeles" AND "flno" <> 33 AND "distance" < 2551 UNION ALL SELECT origin, MAX(arrival_date), departure_date, MIN(distance), aid, MIN(destination), AVG(price) FROM flight WHERE arrival_date != "04/12/2005 12:02" OR "price" = 220.98 AND destination = "Honolulu"


Question: Can you list the aircraft IDs from the aircraft table that are less than or equal to 4, excluding any aircraft IDs from the airport_aircraft table that are less than 1?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 4 EXCEPT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID < 1


Question: Could you give me a list of student IDs, including those who are members of clubs with a ClubID less than 1, as well as students who either don't have the last name Goldman and aren't male, or don't have the first name Bruce and are under 20, or are from the city code BAL, or have an advisor with an ID of 8772 or less?

SELECT StuID FROM Member_of_club WHERE "ClubID" < 1 UNION ALL SELECT StuID FROM Student WHERE LName != "Goldman" AND Sex != "M" OR Fname != "Bruce" AND "Age" < 20 OR city_code = "BAL" OR "Advisor" <= 8772


Question: Which driver IDs are both greater than 1 and also equal to 4?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 1 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 4


Question: Could you give me a list of driver IDs that are not 12 from the driver table, but only include those driver IDs that are also not 4 from the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 12 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 4


Question: Which driver IDs are both less than or equal to 9 and present in the driver table, and also greater than or equal to 4 and present in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 9 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 4


Question: Can you give me a list of driver IDs, including those from the driver table that are greater than 10, and those from the school bus table that are less than or equal to 9?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 10 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 9


Question: Can you give me a list of driver IDs, excluding driver ID 5, that are not also driver IDs, excluding driver ID 7, found in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 5 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 7


Question: Can you give me a list of driver IDs that are not equal to 3, excluding any driver IDs that are also greater than 9 and associated with a school bus?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 3 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 9


Question: Can you give me a list of driver IDs that are 12 or less from the driver table, excluding those driver IDs that are less than 9 from the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 12 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 9


Question: Which aircraft IDs, excluding ID 1, are present in the aircraft table and also, excluding ID 5, in the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 1 INTERSECT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 5


Question: Can you give me a list of driver IDs, including those from the driver table that are greater than or equal to 9, and those from the school bus table that are less than or equal to 4?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 9 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 4


Question: Which driver has an ID of 7 and also drives a school bus with a driver ID that is not 10?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 7 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 10


Question: Can you give me a list of aircraft IDs that are either greater than or equal to 15, or have a distance greater than or equal to 2128, combined with a list of aircraft IDs from certificates that have an eid greater than 355548984?

SELECT aid FROM aircraft WHERE "aid" >= 15 OR "distance" >= 2128 UNION SELECT aid FROM certificate WHERE "eid" > 355548984


Question: Could you give me the total number of ClubIDs and the individual ClubIDs for clubs that are not located in HHH, or are named "Tennis Club", or don't have "Teaching Coordinator" as a position?

SELECT SUM(T1.ClubID), T2.ClubID FROM Club as T1 JOIN Member_of_club as T2 ON T1.ClubID = T2.ClubID WHERE ClubLocation <> "HHH" OR ClubName = "Tennis Club" OR Position <> "Teaching Coordinator"


Question: Can you list the driver IDs, first from the driver table excluding driver ID 1, and then from the school bus table including only driver IDs of 3 or higher?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 1 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 3


Question: Can you give me a list of driver IDs from the driver table where the ID is less than or equal to 4, combined with a list of driver IDs from the school_bus table where the ID is greater than or equal to 10?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 4 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 10


Question: Which aircraft IDs are both less than or equal to 5 when considering all aircraft, and less than 2 when considering aircraft at airports?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 5 INTERSECT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID < 2


Question: What is the average role code for roles that are not photo roles or do not have the role code "MG", excluding the average role code for roles that are not manager roles and have the role code "MG"?

SELECT AVG(role_code) FROM Roles WHERE role_description <> "Photo" OR role_code <> "MG" EXCEPT SELECT AVG(role_code) FROM Roles WHERE role_description <> "Manager" AND role_code = "MG"


Question: Can you give me a list of driver IDs, including those from the driver table where the ID is not 1, and those from the school bus table where the ID is less than 9?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 1 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 9


Question: Can you give me a list of driver IDs that are less than 3, excluding any driver IDs that are also greater than 10 in the school bus list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 3 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 10


Question: Can you tell me the age, the maximum name, and city for employees where either their employee ID is 9 or greater, or their age is 29 or greater, combined with the age, the maximum name, and city for employees where either their employee ID is not 7, or their age is greater than 29 and their name is Louis Deacon?

SELECT Age, MAX(Name), City FROM employee WHERE "Employee_ID" >= 9 OR "Age" >= 29 UNION ALL SELECT Age, MAX(Name), City FROM employee WHERE "Employee_ID" != 7 OR "Age" > 29 AND Name = "Louis Deacon"


Question: Can you give me the IDs that are both in flights on July 16, 1965 with airport IDs less than 9 and an altitude of 3650 or an ID greater than 5 or a Vehicle_Flight_number not equal to "M2-F1 #1", and also in operate_companies that are subsidiaries or have principal activities other than cargo airline or a name other than "Air China" or were not incorporated in Vietnam and have a Group Equity Shareholding of 30.0?

SELECT id FROM flight WHERE Date = "July 16, 1965" AND "airport_id" < 9 AND "Altitude" = 3650.0 OR "id" > 5 OR Vehicle_Flight_number != "M2-F1 #1" INTERSECT SELECT id FROM operate_company WHERE Type = "Subsidiary" OR Principal_activities <> "Cargo airline" OR name <> "Air China" OR Incorporated_in != "Vietnam" AND "Group_Equity_Shareholding" = 30.0


Question: Can you show me, for each street address, the number of branches, membership amounts, opening years, branch IDs, and cities, but only for addresses where there's at least one opening year and more than one branch ID, and the number of branch names isn't one; also, include the same counts for addresses where there's at least one city or branch ID, or where the opening year isn't one, the number of branch names is exactly one, and the number of membership amounts isn't one?

SELECT Address_road, COUNT(Name), COUNT(membership_amount), COUNT(Open_year), COUNT(Branch_ID), COUNT(City) FROM branch GROUP BY Address_road HAVING COUNT(Open_year) >= 1 AND COUNT(Branch_ID) > 1 AND COUNT(Name) <> 1 UNION ALL SELECT Address_road, COUNT(Name), COUNT(membership_amount), COUNT(Open_year), COUNT(Branch_ID), COUNT(City) FROM branch GROUP BY Address_road HAVING COUNT(City) >= 1 OR COUNT(Branch_ID) >= 1 OR COUNT(Open_year) != 1 AND COUNT(Name) = 1 AND COUNT(membership_amount) <> 1


Question: Which driver IDs, excluding 10, are also driver IDs of school buses where those IDs are 9 or greater?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 10 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 9


Question: Can you list all Driver IDs, including those from the driver table that are greater than or equal to 10, and those from the school_bus table that are less than or equal to 10?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 10 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 10


Question: Can you give me a list of driver IDs, including those from the driver table that are not 8, and also including driver ID 10 from the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 8 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 10


Question: Can you list the parties from the election table, excluding those parties from the party table where either the governor isn't Eliot Spitzer, the party isn't Democratic, there's no US Senate election, the year is after 2006, the party ID is 4 or less and the lieutenant governor is Jonathan Reiter, or the attorney general isn't Andrew Cuomo, but including only those parties from the election table where the party is greater than 2, the first elected year isn't 2006, the counties represented are "09.1 9A", or the election ID isn't 3 and the committee is "Environmental Matters"?

SELECT Party FROM election WHERE "Party" > 2 OR "First_Elected" != 2006.0 OR Counties_Represented = "09.1 9A" OR "Election_ID" != 3 AND Committee = "Environmental Matters" EXCEPT SELECT Party FROM party WHERE Governor <> "Eliot Spitzer" AND Party <> "Democratic" OR US_Senate = "(no election)" OR "Year" > 2006.0 OR "Party_ID" <= 4 AND Lieutenant_Governor = "Jonathan Reiter" OR Attorney_General != "Andrew Cuomo"


Question: Which driver IDs are both greater than 4 and present in the driver table, and also greater than 3 and present in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 4 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 3


Question: What is the smallest shop ID from the hiring table where the employee ID is less than or equal to 6, and also, what is the smallest shop ID from the shop table where the manager's name is not Olli Huttunen?

SELECT MIN(Shop_ID) FROM hiring WHERE "Employee_ID" <= 6 UNION ALL SELECT MIN(Shop_ID) FROM shop WHERE Manager_name != "Olli Huttunen"


Question: Can you give me a list of aircraft IDs that are greater than 1, excluding any aircraft IDs from the airport aircraft list that are less than 1?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID > 1 EXCEPT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID < 1


Question: How many allergies, excluding rodent allergies or including animal allergies, are listed in the allergy type table, plus how many allergies, excluding shellfish allergies, are listed in the has allergy table?

SELECT COUNT(Allergy) FROM Allergy_Type WHERE Allergy != "Rodent" OR AllergyType = "animal" UNION SELECT COUNT(Allergy) FROM Has_Allergy WHERE Allergy != "Shellfish"


Question: What is the sum of player IDs for players not residing in Winnipeg, combined with the sum of player IDs from the player-coach table where the coach ID is 5 or greater, the starting year is 2010 or earlier, or the player ID is not 10?

SELECT SUM(Player_ID) FROM player WHERE Residence != "Winnipeg" UNION ALL SELECT SUM(Player_ID) FROM player_coach WHERE "Coach_ID" >= 5 OR "Starting_year" <= 2010 OR "Player_ID" != 10


Question: Which driver IDs are greater than 4 and also not equal to 3, considering drivers and school buses separately?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 4 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 3


Question: Can you give me a list of driver IDs that are not 6 and are also less than 7, considering only the driver IDs that appear in both the driver and school bus tables?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 6 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 7


Question: Can you give me the Paragraph ID, Paragraph Text, and Document ID for all paragraphs where either the Other Details are not "None" or the Document ID is greater than or equal to 3540024 and the Paragraph ID is greater than 3708, combined with all paragraphs where the Paragraph ID is greater than 3708, or the Document ID is 16514113, or the Other Details are "None"?

SELECT Paragraph_ID, Paragraph_Text, Document_ID FROM Paragraphs WHERE Other_Details <> "None" OR "Document_ID" >= 3540024 AND "Paragraph_ID" > 3708 UNION SELECT Paragraph_ID, Paragraph_Text, Document_ID FROM Paragraphs WHERE "Paragraph_ID" > 3708 OR "Document_ID" = 16514113 OR Other_Details = "None"


Question: Can you give me a list of driver IDs that are both less than or equal to 10 and appear in the driver table, and also less than 9 and appear in the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 10 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 9


Question: Which driver IDs are not equal to 2 and are also not equal to 9 in the school bus list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 2 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 9


Question: Which driver IDs, that are 3 or greater, are in the driver table but not in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 3 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 3


Question: Which aircraft have an ID of 5 and also appear in the airport aircraft list with an ID of 5 or greater?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID = 5 INTERSECT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID >= 5


Question: Can you give me a list of driver IDs, combining those from the driver table excluding ID 9, with those from the school bus table that are 3 or greater?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 9 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 3


Question: Can you give me a list of driver IDs, including those from the driver table excluding driver ID 8, and those from the school bus table with driver IDs 9 or higher?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 8 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID >= 9


Question: Can you give me the head IDs of people who are not named Billy Mayfair and weren't born in Florida, or whose age is less than 43, combined with the head IDs from the management table where the head ID is less than 3 and they are temporarily acting?

SELECT head_ID FROM head WHERE name <> "Billy Mayfair" AND born_state <> "Florida" OR "age" < 43.0 UNION ALL SELECT head_ID FROM management WHERE "head_ID" < 3 AND temporary_acting = "Yes"


Question: Can you give me a list of Coach IDs from the coach table where the coach's name is not Joe Fabbri, or the coach is male, or their rank is 2 and their Coach ID is greater than 3 and their Club ID is greater than or equal to 3, combined with a list of Coach IDs from the player_coach table where the Coach ID is 1?

SELECT Coach_ID FROM coach WHERE Coach_name <> "Joe Fabbri" OR Gender = "M" OR "Rank" = 2 AND "Coach_ID" > 3 AND "Club_ID" >= 3 UNION ALL SELECT Coach_ID FROM player_coach WHERE "Coach_ID" = 1


Question: Can you find the smallest flight ID and the corresponding company ID, considering flights associated with airports that are not Billund, or flights on January 29, 1964, or flights where the altitude is not more than 3650 and the ICAO code is not EBBR, the airport ID is greater than 2, and the airport name is Billund Airport, grouped by ICAO code, only including groups where the city is Akureyri, the company ID is less than 2, the airport name is not Ted Stevens Airport, the IATA code is BCN, the vehicle flight number is M2-F1 #61, or the velocity is at least 240 and the airport ID is not 3, or the pilot is Thompson and the altitude is not more than 3650, or the country is Netherlands and the ICAO code is LEBL?

SELECT MIN(T1.id), T2.company_id FROM airport as T1 JOIN flight as T2 ON T1.id = T2.id WHERE IATA <> "BLL" OR Date = "January 29, 1964" OR "Altitude" <= 3650.0 AND ICAO <> "EBBR" AND "airport_id" > 2 AND name = "Billund Airport" GROUP BY ICAO HAVING City = "Akureyri" AND company_id < 2 AND name <> "Ted Stevens Airport" AND IATA = "BCN" AND Vehicle_Flight_number = "M2-F1 #61" OR Velocity >= 240.0 AND airport_id <> 3 OR Pilot = "Thompson" AND Altitude <= 3650.0 OR Country = "Netherlands" AND ICAO = "LEBL"


Question: Can you give me the IDs of drivers with IDs less than or equal to 3, excluding the IDs of school bus drivers with IDs less than or equal to 9?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 3 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 9


Question: Can you give me a list of driver IDs from the driver table, but only those IDs that are 6 or greater, excluding any driver IDs that also appear in the school_bus table where those IDs are not equal to 4?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 6 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 4


Question: Which driver IDs, excluding driver ID 12, are not also driver IDs excluding driver ID 4 that are associated with a school bus?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 12 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 4


Question: Can you give me the IDs of drivers with IDs less than 8, excluding those drivers who also have IDs other than 10 in the school bus list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 8 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 10


Question: Can you give me a list of driver IDs that are less than 6 from the driver table, combined with a list of driver IDs that are exactly 3 from the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 6 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 3


Question: Which driver IDs are both greater than 5 and present in the driver table, and also less than 10 and present in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 5 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 10


Question: Can you give me the creation dates that appear in both of these sets of votes: first, votes where either the phone number is at least 6209222712 or the contestant number isn't 2 and the creation date is "2018-03-09 19:03:36", and second, votes where either the contestant number is at least 3, or the state isn't "CA" and the creation date isn't "2018-03-09 19:03:39", or the phone number is at least 7148407040 and the vote ID isn't 3?

SELECT created FROM VOTES WHERE "phone_number" >= 6209222712 OR "contestant_number" <> 2 AND created = "2018-03-09 19:03:36" INTERSECT SELECT created FROM VOTES WHERE "contestant_number" >= 3 OR state <> "CA" AND created != "2018-03-09 19:03:39" OR "phone_number" >= 7148407040 AND "vote_id" != 3


Question: Can you give me a list of People IDs, combining those from the people table where the birth date is not April 17, 1987 and the height is at least 205 cm, with those from the poker_player table where the Poker Player ID is 3, the number of final tables made is not 26, the earnings are no more than $189,233, and the People ID is greater than 5?

SELECT People_ID FROM people WHERE Birth_Date <> "April 17, 1987" AND "Height" >= 205.0 UNION ALL SELECT People_ID FROM poker_player WHERE "Poker_Player_ID" = 3 AND "Final_Table_Made" <> 26.0 AND "Earnings" <= 189233.0 AND "People_ID" > 5


Question: Can you give me the writer, number of issues, and book ID for all books where either the number of issues is 1 and the book ID is 10 or greater, or the writer is not Dave Gibbons, combined with all books where either the title is not "Bloody Mary : Lady Liberty", the book ID is 5 or less, or the number of issues is greater than 12 and the writer is not Timothy Truman?

SELECT Writer, Issues, Book_ID FROM book WHERE "Issues" = 1.0 AND "Book_ID" >= 10 OR Writer <> "Dave Gibbons" UNION ALL SELECT Writer, Issues, Book_ID FROM book WHERE Title <> "Bloody Mary : Lady Liberty" OR "Book_ID" <= 5 OR "Issues" > 12.0 AND Writer != "Timothy Truman"


Question: Can you give me a list of driver IDs that are not equal to 3 and are also less than or equal to 7, considering only the driver IDs that appear in both the driver and school bus tables?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 3 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 7


Question: Can you give me the Book IDs from the book table, excluding those where the title is "Gemini Blood" and the Book ID is not 7, or where the writer is not "Christopher Hinz", except for those Book IDs found in the publication table where the price is less than or equal to 15000000 and the publisher is "Bertelsmann" and the Publication ID is 4 and the Book ID is less than 3, or the publication date is not "March 2008"?

SELECT Book_ID FROM book WHERE Title != "Gemini Blood" AND "Book_ID" <> 7 OR Writer != "Christopher Hinz" EXCEPT SELECT Book_ID FROM publication WHERE "Price" <= 15000000.0 AND Publisher = "Bertelsmann" AND "Publication_ID" = 4 AND "Book_ID" < 3 OR Publication_Date <> "March 2008"


Question: Can you give me a list of driver IDs, including all driver IDs from the driver table that are not 8, and also including driver ID 4 from the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <> 8 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 4


Question: Can you give me a list of driver IDs, where each ID is greater than 9, but exclude any driver IDs greater than 7 that are also in the school bus list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 9 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 7


Question: How many school IDs are associated with each driver whose ID is less than 10, who has worked for 10 years or less, and is not full-time, where the school ID is 4 or greater, excluding the counts and driver IDs for those who have worked less than 8 years?

SELECT COUNT(School_ID), Driver_ID FROM school_bus WHERE "Years_Working" <= 10 AND If_full_time <> "T" AND "Driver_ID" < 10 AND "School_ID" >= 4 EXCEPT SELECT COUNT(School_ID), Driver_ID FROM school_bus WHERE "Years_Working" < 8


Question: Can you give me a list of driver IDs that are less than 12 from the driver table, combined with a list of driver IDs that are not equal to 9 from the school bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 12 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 9


Question: Which driver IDs are both greater than or equal to 7 in the driver table and less than 10 in the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 7 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 10


Question: Can you give me a list of driver IDs that are not equal to 5, excluding any driver IDs that are less than or equal to 3 and also appear in the school bus driver list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 5 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 3


Question: Can you give me a list of driver IDs, including those from the driver table that are less than 10, and those from the school bus table that are greater than 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 10 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 3


Question: Can you tell me the street address and highest branch ID for branches that either have a branch ID of 7 and aren't on Brampton Road and aren't named Brooke Greville, or are in Oxford, or didn't open in 2014 and have a membership amount of 7, combined with the street address and highest branch ID for branches that either opened in 2012 and have a branch ID of 8 or higher, or aren't on Valleys Place, or don't have a membership amount of 56 and aren't named Brooke Greville?

SELECT Address_road, MAX(Branch_ID) FROM branch WHERE "Branch_ID" = 7 AND Address_road <> "Brampton Road" AND Name <> "Brooke Greville" OR City = "Oxford" OR Open_year <> "2014" AND membership_amount = "7" UNION SELECT Address_road, MAX(Branch_ID) FROM branch WHERE Open_year = "2012" AND "Branch_ID" >= 8 OR Address_road <> "Valleys Place" OR membership_amount <> "56" AND Name != "Brooke Greville"


Question: Can you give me the Club IDs that are both from clubs in Korea or clubs not named Djurgårdens IF that started after 2001 or have an ID greater than 2, and also associated with coaches having an ID of 5 or greater?

SELECT Club_ID FROM club WHERE Region = "Korea" OR Club_name != "Djurgårdens IF" AND "Start_year" > 2001 OR "Club_ID" > 2 INTERSECT SELECT Club_ID FROM coach WHERE "Coach_ID" >= 5


Question: Can you give me a list of driver IDs, excluding driver ID 11, that are not also driver ID 10 in the school bus list?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 11 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 10


Question: Can you give me a list of ranks from match results, combined with a list of ranks from players who are not sponsored by Churchill, are retired, or have a different number of votes than 7190, are not female, don't live in Winnipeg, aren't named Fiona Shiells, or have a player ID other than 1, and whose rank is "2nd"?

SELECT Rank FROM match_result WHERE "Big_Silver" >= 7 UNION SELECT Rank FROM player WHERE Rank = "2nd" AND Sponsor_name <> "Churchill" AND Occupation = "Retired" OR "Votes" != 7190 OR Gender != "F" AND Residence <> "Winnipeg" OR Player_name != "Fiona Shiells" AND "Player_ID" != 1


Question: Can you list the Aircraft IDs that are greater than 3 from the aircraft table, and combine that with a list of Aircraft IDs that are not equal to 5 from the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID > 3 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 5


Question: What is the sum of document IDs from the Documents table where the document type code is not "CD" or the receipt number is not "37", combined with the sum of document IDs from the Draft_Copies table where the copy number is greater than or equal to 6, or the document ID is not 12, or the draft number is 9?

SELECT SUM(document_id) FROM Documents WHERE document_type_code != "CD" OR receipt_number <> "37" UNION ALL SELECT SUM(document_id) FROM Draft_Copies WHERE "copy_number" >= 6 OR "document_id" != 12 OR "draft_number" = 9


Question: Can you give me a list of aircraft IDs that are less than 5, excluding any aircraft IDs greater than 5 that are associated with an airport?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID < 5 EXCEPT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID > 5


Question: Can you list all the driver IDs from the driver table that are less than or equal to 5, combined with all the driver IDs from the school_bus table that are not equal to 3?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 5 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 3


Question: Can you list all driver IDs from the driver table that are less than or equal to 2, and combine that with a list of all driver IDs from the school_bus table that are less than 4?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 2 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 4


Question: Can you give me the phone number, vote ID, and creation date from the votes table, including entries where the vote ID is not 2 or the contestant number is less than 5, combined with entries where the creation date is not 2018-03-09 19:03:36, the phone number is at least 5112677315 and the vote ID is 1, or the contestant number is 2 and the state is not NJ?

SELECT phone_number, vote_id, created FROM VOTES WHERE "vote_id" <> 2 OR "contestant_number" < 5 UNION ALL SELECT phone_number, vote_id, created FROM VOTES WHERE created != "2018-03-09 19:03:36" AND "phone_number" >= 5112677315 AND "vote_id" = 1 OR "contestant_number" = 2 AND state != "NJ "


Question: Can you give me a list of driver IDs, including driver ID 9 from the driver table, and all driver IDs except 3 from the school_bus table?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID = 9 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 3


Question: Can you give me the driver IDs that are both less than 10 and also equal to 7, considering only the driver IDs that appear in both the driver and school_bus tables?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 10 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 7


Question: Can you give me a list of driver IDs from the driver table that are less than 5, combined with a list of driver IDs from the school_bus table that are not equal to 9?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 5 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 9


Question: Can you give me a list of driver IDs that are both not equal to 5 and also less than 10, considering only those IDs that appear in both the driver and school bus tables?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID != 5 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 10


Question: Can you give me a list of driver IDs, including those from the driver table that are 2 or greater, and those from the school bus table that are less than 4?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 2 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 4


Question: Can you give me the Aircraft IDs that are equal to 5 in the aircraft table, excluding any Aircraft IDs less than or equal to 1 that appear in the airport_aircraft table?

SELECT Aircraft_ID FROM aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID = 5 EXCEPT SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 1