Question: Can you list the property type codes and descriptions for apartments, flats, condos, and anything that isn't a field or described as a house or bungalow?

SELECT property_type_code, property_type_description FROM Ref_Property_Types WHERE property_type_description = "Apartment, Flat, Condo, etc." UNION SELECT property_type_code, property_type_description FROM Ref_Property_Types WHERE property_type_code <> "Field" OR property_type_description != "House, Bungalow, etc."


Question: Can you give me a list of driver IDs that are less than 5, excluding any driver IDs found in the school bus list that are not equal to 10?

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 != 10


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

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 <= 3


Question: Can you give me a list of property type codes from properties where either oth_feature_3 is not "None" and the property name is "the cole", or fld_feature_2 is not "None", the date sold is not "1997-11-07 20:22:05", hse_feature_3 is "None", and hse_feature_2 is "None", or fld_feature_1 is not "None", or the room count is not 7, combined with a list of property type codes from property types where the property type description is not "Other, to be determined."?

SELECT property_type_code FROM Properties WHERE oth_feature_3 <> "None" AND property_name = "the cole" OR fld_feature_2 <> "None" AND date_sold != "1997-11-07 20:22:05" AND hse_feature_3 = "None" AND hse_feature_2 = "None" OR fld_feature_1 != "None" OR "room_count" != 7 UNION ALL SELECT property_type_code FROM Ref_Property_Types WHERE property_type_description <> "Other, to be determined."


Question: Can you give me a list of driver IDs that are not 1 from the driver table, but also not 9 from the school bus table?

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 != 9


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

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 > 4


Question: Can you list all the school locations, including those from schools that aren't Punahou School and don't have a School ID of 2, and also including locations from schools that don't have a grade level of Freshman–Sophomore year?

SELECT Location FROM school WHERE "School_ID" <> 2 AND School != "Punahou School" UNION SELECT Location FROM school WHERE Grade != "Freshman–Sophomore year"


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

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 aircraft IDs from the aircraft table that are less than or equal to 3, excluding any aircraft IDs from the airport_aircraft table that are greater than 1?

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 > 1


Question: Can you give me a list of driver IDs, including driver ID 8 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 = 8 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 3


Question: Can you give me all the lesson times, vehicle IDs, lesson dates, staff IDs, prices, lesson status codes, customer IDs, and lesson IDs from the Lessons table where the lesson time is not "4", or the lesson ID is greater than or equal to 9 and the price is not 223.0, or the staff ID is not 5 and the lesson date is "2018-03-12 00:41:59", or the vehicle ID is not 2, combined with all the lesson times, vehicle IDs, lesson dates, staff IDs, prices, lesson status codes, customer IDs, and lesson IDs from the Lessons table where the lesson time is "6", or the price is greater than or equal to 352.0 and the staff ID is greater than 8, or the lesson ID is 6 and the vehicle ID is less than 1 and the lesson date is "2018-03-08 16:05:05", or the customer ID is less than 10 and the lesson status code is "Cancelled"?

SELECT lesson_time, vehicle_id, lesson_date, staff_id, price, lesson_status_code, customer_id, lesson_id FROM Lessons WHERE lesson_time <> "4" OR "lesson_id" >= 9 AND "price" <> 223.0 OR "staff_id" != 5 AND lesson_date = "2018-03-12 00:41:59" OR "vehicle_id" != 2 UNION ALL SELECT lesson_time, vehicle_id, lesson_date, staff_id, price, lesson_status_code, customer_id, lesson_id FROM Lessons WHERE lesson_time = "6" OR "price" >= 352.0 AND "staff_id" > 8 OR "lesson_id" = 6 AND "vehicle_id" < 1 AND lesson_date = "2018-03-08 16:05:05" OR "customer_id" < 10 AND lesson_status_code = "Cancelled"


Question: What is the sum of album IDs where the artist ID is not 150, or the title is "The Best of Beethoven", or the ID is not 219, combined with the sum of media type IDs where the name is "Protected MPEG-4 video file" or the ID is not 2?

SELECT SUM(id) FROM albums WHERE "artist_id" <> 150 OR title = "The Best of Beethoven" OR "id" <> 219 UNION SELECT SUM(id) FROM media_types WHERE name = "Protected MPEG-4 video file" OR "id" != 2


Question: Can you give me a list of driver IDs that are less than 3 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 < 3 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 4


Question: Can you give me the distances and aircraft IDs for aircraft that aren't Boeing 727s and have an aircraft ID greater than 14, but exclude the distances and aircraft IDs for flights where the aircraft ID is 5 and the flight number is less than 99, or the distance isn't 2308, or the destination isn't Tokyo, or the departure date isn't 04/12/2005 09:15, and the price is greater than 278.56, and the origin isn't Los Angeles?

SELECT distance, aid FROM aircraft WHERE name <> "Boeing 727" AND "aid" > 14 EXCEPT SELECT distance, aid FROM flight WHERE "aid" = 5 AND "flno" < 99 OR "distance" <> 2308 OR destination <> "Tokyo" OR departure_date <> "04/12/2005 09:15" AND "price" > 278.56 AND origin != "Los Angeles"


Question: Could you list the shipping agent codes from the Documents table, excluding those codes that also appear in the Ref_Shipping_Agents table where the shipping agent description isn't "w" or the shipping agent code isn't "AL", and considering only documents that are not "Hard Drive" type, or were not received on "2008-04-21 20:42:25", or don't have a document ID of 10 and are not in "working" status, or have other details that are not "u", or don't have a shipping agent code of "US", or have a receipt number of "37"?

SELECT shipping_agent_code FROM Documents WHERE document_type_code != "Hard Drive" OR receipt_date <> "2008-04-21 20:42:25" OR "document_id" <> 10 AND document_status_code != "working" OR other_details <> "u" OR shipping_agent_code != "US" OR receipt_number = "37" EXCEPT SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_description <> "w" OR shipping_agent_code != "AL"


Question: Can you give me a list of employee IDs from the evaluation table, excluding those awarded in 2011, combined with a list of employee IDs from the hiring table where the employee ID is 4 and either the shop ID is less than 6 and they are full-time, or their start date is 2011?

SELECT Employee_ID FROM evaluation WHERE Year_awarded != "2011" UNION ALL SELECT Employee_ID FROM hiring WHERE "Employee_ID" = 4 AND "Shop_ID" < 6 AND Is_full_time = "T" OR Start_from = "2011"


Question: Can you list all aircraft IDs, including those from the aircraft table excluding ID 2, and those from the airport_aircraft table with IDs greater than or equal to 2?

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 list the aircraft IDs, first from the aircraft table excluding aircraft ID 2, and then from the airport_aircraft table including only aircraft IDs that are 5 or greater?

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: Which driver IDs are greater than 2 and also appear as driver IDs in the school bus table, excluding driver ID 10?

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 != 10


Question: Can you give me the Driver ID if it's 7, looking at both the driver and school bus lists?

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 = 7


Question: Can you give me a list of branch IDs from the membership register, including those that are not "1" or were registered in a year other than 2016, and also including those registered in a year other than 2016 or have a member ID less than 7?

SELECT Branch_ID FROM membership_register_branch WHERE Branch_ID <> "1" OR Register_Year != "2016" UNION SELECT Branch_ID FROM membership_register_branch WHERE Register_Year != "2016" OR "Member_ID" < 7


Question: Can you list the aircraft IDs that are less than or equal to 3 from the aircraft table, combined with the aircraft IDs that are greater than 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: Which driver IDs are less than 8 and also greater 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 aircraft IDs that are less than 5, but also not equal to 2, based on the aircraft and airport aircraft data?

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: Can you give me the IDs of aircraft that are both among the aircraft with an ID of 1 or less, and among the airport aircraft with an ID less than 2?

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 give me a list of driver IDs that are either exactly 8 from the driver table, or less than or equal to 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 give me a list of aircraft IDs that are less than 2, excluding any aircraft IDs greater than 2 that are also associated with airports?

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 list all aircraft IDs less than 5, combining those from the aircraft table and the airport_aircraft table, removing any duplicates?

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 < 5


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

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 the IATA code, ICAO code, name, and ID for all airports that are either in Baltimore, or have an ICAO code that isn't PANC, or an IATA code that isn't ANC, or a name that isn't Ted Stevens Airport and are not in the United States, or have an ID greater than 1, combined with airports that are not in Brussels and are not named Billund Airport?

SELECT IATA, ICAO, name, id FROM airport WHERE City = "Baltimore" OR ICAO != "PANC" OR IATA != "ANC" OR name != "Ted Stevens Airport" AND Country <> "United States" OR "id" > 1 UNION SELECT IATA, ICAO, name, id FROM airport WHERE City != "Brussels" AND name <> "Billund Airport"


Question: Can you list the aircraft IDs that are less than 2 from the aircraft table, and also list the aircraft IDs that are less than or equal to 3 from the airport_aircraft table, 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: Can you give me a list of driver IDs that are not equal to 1 from the driver table, but only include the driver IDs that are also not equal to 3 from the school bus table?

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 the IDs of drivers that are less than 5, excluding the IDs of school bus drivers that are less than or equal to 7?

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 the IDs of drivers that are both less than or equal to 10 and not equal to 4, considering only unique driver IDs from 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 <> 4


Question: Can you give me a list of driver IDs, excluding driver ID 6, that are not also driver IDs greater than 7 found 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 > 7


Question: Which driver IDs, excluding driver ID 12, are also driver IDs of school buses specifically with driver ID 7?

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 = 7


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

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: Can you give me a list of driver IDs, excluding driver ID 7, that are not also driver IDs greater than 4 in the school bus table?

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: What aircraft IDs appear exactly once in the aircraft table with an ID of 2, but do not appear exactly once in the airport_aircraft table with an ID of 1?

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 = 1


Question: Can you give me a list of aircraft IDs, excluding aircraft ID 2, that are not also aircraft IDs greater than 3 found in the airport aircraft list?

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 the IDs of drivers that are both less than or equal to 7 and not equal to 7, considering only drivers that appear in both the driver and school_bus tables?

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 != 7


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

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 = 2


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

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: Can you give me a list of driver IDs, including those from the driver table where the ID is greater than 9, and those from the school bus table where the ID is greater than 7?

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 > 7


Question: Can you give me the party affiliation, home city, name, average age, and driver ID for all drivers, combining those who either don't have a Driver ID of 8, don't live in Hartford, or are affiliated with the Dem party, along with those whose name is not Brandon McGee?

SELECT Party, Home_city, Name, AVG(Age), Driver_ID FROM driver WHERE "Driver_ID" <> 8 OR Home_city <> "Hartford" OR Party = "Dem" UNION ALL SELECT Party, Home_city, Name, AVG(Age), Driver_ID FROM driver WHERE Name <> "Brandon McGee"


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

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 <> 2


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

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 >= 10


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 4?

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 <= 4


Question: Can you give me a list of driver IDs that are 9 or less, but only include those that are not also driver IDs greater than 7 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 > 7


Question: Can you give me a list of driver IDs, excluding driver ID 2, that are not also driver IDs greater than 9 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 > 9


Question: What are the average feature type names and feature type codes for entries where the feature type name is "Securiyt, eg Burglar Alarm." and the feature type code is not "Security", combined with the average feature type name and feature type code for entries where the feature type code is "Security"?

SELECT AVG(feature_type_name), feature_type_code FROM Ref_Feature_Types WHERE feature_type_name = "Securiyt, eg Burglar Alarm." AND feature_type_code != "Security" UNION SELECT AVG(feature_type_name), feature_type_code FROM Ref_Feature_Types WHERE feature_type_code = "Security"


Question: Can you list all environmental allergies, and also list all allergies other than Ragweed for students with an ID of 1010 or less?

SELECT Allergy FROM Allergy_Type WHERE AllergyType = "environmental" UNION SELECT Allergy FROM Has_Allergy WHERE Allergy != "Ragweed" AND "StuID" <= 1010


Question: Can you give me a list of employee IDs that are either greater than 574489456 from the certificate table, or are not equal to 141582651, have a name other than "Patricia Jones", and have a salary less than or equal to 43723 from the employee table?

SELECT eid FROM certificate WHERE "eid" > 574489456 UNION SELECT eid FROM employee WHERE "eid" <> 141582651 AND name != "Patricia Jones" AND "salary" <= 43723


Question: Which driver has an ID of 5, excluding any drivers who have an ID other than 10 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 <> 10


Question: Could you list all the endowment IDs, including those where the donator's name is not "San Cristóbal", and also those where the amount isn't 9.83, the School ID isn't 3, the donator's name isn't "San José de Ocoa", and the endowment ID is greater than 6?

SELECT endowment_id FROM endowment WHERE donator_name != "San Cristóbal" UNION ALL SELECT endowment_id FROM endowment WHERE "amount" <> 9.83 AND "School_id" <> 3 AND donator_name <> "San José de Ocoa" AND "endowment_id" > 6


Question: Can you give me a list of vehicle IDs from the lessons table where either the staff ID is greater than 1 or the price is less than or equal to 231.0 and the lesson time is not "9", but exclude any vehicle IDs from the vehicles table where the vehicle ID is less than 2 or the vehicle details are "Van"?

SELECT vehicle_id FROM Lessons WHERE "staff_id" > 1 OR "price" <= 231.0 AND lesson_time != "9" EXCEPT SELECT vehicle_id FROM Vehicles WHERE "vehicle_id" < 2 OR vehicle_details = "Van"


Question: Could you give me the house feature 2, buyer offered price, other feature 1, house feature 1, field feature 1, field feature 2, date on market, agreed selling price, date sold, apartment feature 1, vendor requested price, room count, property type code, other property details, other feature 3, shop feature 2, shop feature 1, house feature 3, apartment feature 2, apartment feature 3, property address, other feature 2, and property ID for properties that meet these two sets of criteria: first, properties where other feature 1 is "None" and either house feature 2 is not "None", shop feature 2 is not "None", the property ID is not 11, or the property type is "Field" and shop feature 3 is "None"; and second, properties where either the date sold is "2003-02-27 18:17:11", or house feature 2 is not "None", shop feature 3 is not "None", the date on market is not "1976-06-10 20:25:38", the vendor requested price is at most 331.0, apartment feature 2 is not "culpa", and the property name is "high line"?

49578 Ayden Mountains
New Russellhaven, UT 46626

SELECT hse_feature_2, buyer_offered_price, oth_feature_1, hse_feature_1, fld_feature_1, fld_feature_2, date_on_market, agreed_selling_price, date_sold, apt_feature_1, vendor_requested_price, room_count, property_type_code, other_property_details, oth_feature_3, shp_feature_2, shp_feature_1, hse_feature_3, apt_feature_2, apt_feature_3, property_address, oth_feature_2, property_id FROM Properties WHERE oth_feature_1 = "None" AND hse_feature_2 != "None" OR shp_feature_2 <> "None" OR "property_id" != 11 OR property_type_code = "Field" AND shp_feature_3 = "None" INTERSECT SELECT hse_feature_2, buyer_offered_price, oth_feature_1, hse_feature_1, fld_feature_1, fld_feature_2, date_on_market, agreed_selling_price, date_sold, apt_feature_1, vendor_requested_price, room_count, property_type_code, other_property_details, oth_feature_3, shp_feature_2, shp_feature_1, hse_feature_3, apt_feature_2, apt_feature_3, property_address, oth_feature_2, property_id FROM Properties WHERE date_sold = "2003-02-27 18:17:11" OR hse_feature_2 <> "None" AND shp_feature_3 != "None" AND date_on_market != "1976-06-10 20:25:38" AND "vendor_requested_price" <= 331.0 AND apt_feature_2 != "culpa" AND property_name = "high line"


Question: Can you give me a list of driver IDs, excluding driver ID 2, that are not also driver IDs less than or equal to 4 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 <= 4


Question: Can you give me a list of driver IDs, including those from the driver table excluding driver ID 7, and those from the school bus table with driver IDs less than 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 school IDs from the School table where either the enrollment is greater than 287 and the football class is AAAA but not AAA, or the location isn't Bremen, or the school ID isn't 1 and the school name is Jimtown, or the county isn't 20 Elkhart and the mascot isn't Falcons, and also include all school IDs from the Budget table where the budget invested percentage isn't 71.3?

SELECT School_id FROM School WHERE "Enrollment" > 287 AND IHSAA_Football_Class = "AAAA" AND IHSAA_Class <> "AAA" OR Location <> "Bremen" OR School_id != "1" AND School_name = "Jimtown" OR County != "20 Elkhart" AND Mascot != "Falcons" UNION ALL SELECT School_id FROM budget WHERE Budget_invested_percent != "71.3"


Question: Can you give me the IDs of drivers, where each ID is less than or equal to 5, excluding the IDs of school bus drivers where each ID is greater than or equal to 7?

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, including those from the driver table that are greater than 10, and those from the school bus table that are equal to 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 give me a list of driver IDs that are not equal to 1 from the driver table, excluding any driver IDs less than 4 that are 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 < 4


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

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 >= 7


Question: Can you list the assets in billions, industry, headquarters, and name for all companies that are not headquartered in the USA, combined with a list of companies whose sales are greater than 433.5 billion, or whose name is not Wells Fargo, or whose company ID is less than 11 and are not in the Conglomerate industry?

Assets_in_Billion Industry Headquarters Name

340.5
Oil and gas
Netherlands
Royal Dutch Shell

2039.1
Banking
China
Industrial and Commercial Bank of China

1637.8
Banking
China
China Construction Bank

328.7
Automotive
Germany
Volkswagen Group

1563.9
Banking
China
Agricultural Bank of China

340.5
Oil and gas
Netherlands
Royal Dutch Shell

2039.1
Banking
China
Industrial and Commercial Bank of China

392.6
Conglomerate
USA
Berkshire Hathaway

1637.8
Banking
China
China Construction Bank

328.7
Automotive
Germany
Volkswagen Group

1563.9
Banking
China
Agricultural Bank of China

SELECT Assets_in_Billion, Industry, Headquarters, Name FROM company WHERE Headquarters <> "USA" UNION ALL SELECT Assets_in_Billion, Industry, Headquarters, Name FROM company WHERE "Sales_in_Billion" > 433.5 OR Name <> "Wells Fargo" OR "Company_ID" < 11.0 AND Industry <> "Conglomerate"


Question: What are the average product IDs and store IDs for stores that aren't store 2, excluding the average product IDs and store IDs for stores that aren't store 2 and don't have product 6?

SELECT AVG(Product_ID), Store_ID FROM store_product WHERE "Store_ID" != 2 EXCEPT SELECT AVG(Product_ID), Store_ID FROM store_product WHERE "Store_ID" != 2 AND "Product_ID" <> 6


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 less than 7 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 < 7


Question: Can you list the aircraft IDs, first those from the aircraft table excluding aircraft ID 1, and then 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 != 1 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <= 5


Question: Could you list the names of aircraft that either have a distance of at least 2128 and an aid greater than 4, or have a distance not equal to 520?

SELECT name FROM aircraft WHERE "distance" >= 2128 AND "aid" > 4 UNION SELECT name FROM aircraft WHERE "distance" <> 520


Question: Can you list the Aircraft IDs for aircraft that either don't have a max gross weight of "123,500 lb (56,000 kg)" and don't have a total disk area of "872 ft² (81.1 m²)", or don't have a description of "Light utility helicopter", along with the Aircraft IDs from the airport_aircraft table where the Airport ID is less than or equal to 2, or the ID is less than 1 and the Aircraft ID is greater than 5?

SELECT Aircraft_ID FROM aircraft WHERE Max_Gross_Weight <> "123,500 lb (56,000 kg)" AND Total_disk_area != "872 ft² (81.1 m²)" OR Description <> "Light utility helicopter" UNION ALL SELECT Aircraft_ID FROM airport_aircraft WHERE "Airport_ID" <= 2 OR "ID" < 1 AND "Aircraft_ID" > 5


Question: Which driver IDs are both greater than or equal to 2 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 >= 2 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID = 9


Question: Can you give me a list of aircraft IDs, excluding aircraft ID 5, that are in the aircraft table, but not in the airport_aircraft table where the aircraft ID is less than 5?

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 give me a list of driver IDs, excluding driver ID 12 from the driver table and driver ID 3 from the school_bus table, combining both lists into one?

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 3, excluding any driver IDs that are also greater than 4 in the school bus records?

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 > 4


Question: Can you give me a list of driver IDs, including those from the driver table that are greater than 11, and also including driver ID 9 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 = 9


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

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 <> 9


Question: What is the total i_id for all items titled "blue hoodie", and what is the total i_id for all items titled "cup" with an i_id less than 1?

SELECT SUM(i_id) FROM item WHERE title = "blue hoodie" UNION ALL SELECT SUM(i_id) FROM item WHERE title = "cup" AND "i_id" < 1


Question: Can you list all driver IDs that are greater than 9 from the driver table, combined with all driver IDs that are less than 10 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 < 10


Question: Can you give me a list of driver IDs, including those from the driver table excluding driver ID 3, and those from the school bus table with driver IDs up to and including 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: What template type descriptions and codes are common between records that are either for template type code "BK" or not for the description "Book", and records that are neither for the description "Book" nor for the template type code "BK"?

SELECT Template_Type_Description, Template_Type_Code FROM Ref_Template_Types WHERE Template_Type_Code = "BK" OR Template_Type_Description <> "Book" INTERSECT SELECT Template_Type_Description, Template_Type_Code FROM Ref_Template_Types WHERE Template_Type_Description != "Book" AND Template_Type_Code != "BK"


Question: Can you list all driver IDs that are less than or equal to 10 from the driver table, and also list all driver IDs that are less than 10 from the school_bus table, combining the two lists into one?

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: What are the average property feature descriptions, feature IDs, and largest property IDs for features with IDs less than 3, combined with the same information for properties where the feature description is not "corrupti"?

SELECT AVG(property_feature_description), feature_id, MAX(property_id) FROM Other_Property_Features WHERE "feature_id" < 3 UNION ALL SELECT AVG(property_feature_description), feature_id, MAX(property_id) FROM Other_Property_Features WHERE property_feature_description <> "corrupti"


Question: Can you give me a list of driver IDs that are not 11, and also are greater than or equal to 4, considering only drivers who have driven both a regular driver vehicle and a school bus?

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: Which student IDs, excluding 1002, are also associated with pet ID 2001 or have a student ID less than 1002?

SELECT StuID FROM Has_Pet WHERE "StuID" != 1002 INTERSECT SELECT StuID FROM Has_Pet WHERE "PetID" = 2001 OR "StuID" < 1002


Question: Can you give me a list of 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 not equal to 2?

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: Could you give me the payment amount, payment date and time, payment method code, and customer ID for all payments that are both less than $6782.84 and also either made with a credit card by a customer other than customer 13, or are less than or equal to $9886.62 and not made on 2018-02-06 13:35:58?

SELECT amount_payment, datetime_payment, payment_method_code, customer_id FROM Customer_Payments WHERE "amount_payment" < 6782.84 INTERSECT SELECT amount_payment, datetime_payment, payment_method_code, customer_id FROM Customer_Payments WHERE payment_method_code = "Credit Card" AND "customer_id" != 13 OR "amount_payment" <= 9886.62 AND datetime_payment != "2018-02-06 13:35:58"


Question: Which aircraft IDs are less than 4 and appear in the aircraft table, and are also less than 5 and appear in the airport_aircraft table?

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 < 5


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

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 > 4


Question: Can you give me a list of IDs, combining album IDs where the artist ID is 91 or greater and the album ID is greater than 28, with media type IDs that are greater than 5 and the media type name is not "Purchased AAC audio file"?

SELECT id FROM albums WHERE "artist_id" >= 91 AND "id" > 28 UNION ALL SELECT id FROM media_types WHERE "id" > 5 AND name != "Purchased AAC audio file"


Question: Can you give me the Aircraft IDs that are not equal to 2 when looking at the aircraft table, and are also less than or equal to 1 when looking at 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 <= 1


Question: Can you give me the smallest ID from car makers that are either from country "1" and not Renault, or whose full name isn't Renault and whose ID is at least 21, combined with the smallest ID from cars that have more than 8 cylinders or an engine displacement less than 455?

SELECT MIN(Id) FROM car_makers WHERE Country = "1" AND Maker <> "renault" OR FullName != "Renault" AND "Id" >= 21 UNION SELECT MIN(Id) FROM cars_data WHERE "Cylinders" > 8 OR "Edispl" < 455.0


Question: Can you give me a list of aircraft IDs, including aircraft ID 4 from the aircraft table and aircraft ID 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: Which aircraft IDs are common to both the aircraft and airport_aircraft tables, considering only those aircraft IDs that are greater than 2 in each 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 > 2


Question: Can you show me the weight, age, type, and ID of pets that are either older than 3 years or weigh 12 pounds or less, or have an ID of 2002 or higher, along with the weight, age, type, and ID of pets that weigh exactly 9.3 pounds or are dogs older than 3 years?

SELECT weight, pet_age, PetType, PetID FROM Pets WHERE "pet_age" > 3 OR "weight" <= 12.0 OR "PetID" >= 2002 UNION SELECT weight, pet_age, PetType, PetID FROM Pets WHERE "weight" = 9.3 OR PetType = "dog" AND "pet_age" > 3


Question: Which stores are located in districts other than district 15 and also sell product number 2?

SELECT Store_ID FROM store_district WHERE "District_ID" != 15 INTERSECT SELECT Store_ID FROM store_product WHERE "Product_ID" = 2


Question: Can you give me a list of driver IDs, excluding driver ID 5 from the driver table and driver ID 10 from the school_bus table, making sure to list each driver ID only once?

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 != 10


Question: Can you give me a list of airports, showing the average name, city, sum of IDs, country, and IATA code, combining two sets of results: one where the ID is not 1, and another where the city isn't Amsterdam, the airport name is "El Prat Airport," and the ID isn't 5?

SELECT AVG(name), City, SUM(id), Country, IATA FROM airport WHERE "id" != 1 UNION ALL SELECT AVG(name), City, SUM(id), Country, IATA FROM airport WHERE City <> "Amsterdam" AND name = "El Prat Airport" AND "id" <> 5


Question: How many vehicles are associated with lessons that are not completed, or have a price less than or equal to 306, or have a staff ID greater than or equal to 12, combined with the number of vehicles that have details other than "Car"?

SELECT COUNT(vehicle_id) FROM Lessons WHERE lesson_status_code != "Completed" OR "price" <= 306.0 OR "staff_id" >= 12 UNION SELECT COUNT(vehicle_id) FROM Vehicles WHERE vehicle_details != "Car"


Question: Could you give me a list of album titles and IDs, excluding album ID 136 or including albums by artist ID 245, but then remove any employee titles and IDs where the postal code is "T2P 5G3" and their reports_to value is less than or equal to 2, or their title isn't "Sales Support Agent", or their email isn't "nancy@chinookcorp.com", or their first name isn't "Margaret" and they're from Canada, or their ID isn't 2 and their phone number isn't "+1 (403) 262-3443" and their last name isn't "Edwards", or their city is "Calgary" and their birth date isn't "1973-08-29 00:00:00" and their hire date isn't "2002-08-14 00:00:00", or their state isn't "AB", or their address isn't "11120 Jasper Ave NW"?

20th Century Masters - The Millennium Collection: The Best of Scorpions

A TempestadeTempestade Ou O Livro Dos Dias

Adorate Deum: Gregorian Chant from the Proper of the Mass

Alcohol Fueled Brewtality Live! [Disc 1]

Alcohol Fueled Brewtality Live! [Disc 2]

Armada: Music from the Courts of England and Spain

Battlestar Galactica (Classic), Season 1

Beethoven Piano Sonatas: Moonlight & Pastorale

Beethoven: Symphony No. 6 'Pastoral' Etc.

Charpentier: Divertissements, Airs & Concerts

Cássia Eller - Coleção Sem Limite [Disc 2]

Elgar: Cello Concerto & Vaughan Williams: Fantasias

From The Muddy Banks Of The Wishkah live

Great Performances - Barber's Adagio and Other Romantic Favorites for Strings

Great Recordings of the Century - Mahler: Das Lied von der Erde

Great Recordings of the Century - Shubert: Schwanengesang, 4 Lieder

Great Recordings of the Century: Paganini's 24 Caprices

Grieg: Peer Gynt Suites & Sibelius: Pelléas et Mélisande

Handel: Music for the Royal Fireworks (Original Version 1749)

Holst: The Planets, Op. 32 & Vaughan Williams: Fantasies

Instant Karma: The Amnesty International Campaign to Save Darfur

J.S. Bach: Chaconne, Suite in E Minor, Partita in E Major & Prelude, Fugue and Allegro

Knocking at Your Back Door: The Best Of Deep Purple in the 80's

Koyaanisqatsi (Soundtrack from the Motion Picture)

Liszt - 12 Études D'Execution Transcendante

Locatelli: Concertos for Violin, Strings and Continuo, Vol. 3

Lulu Santos - RCA 100 Anos De Música - Álbum 01

Lulu Santos - RCA 100 Anos De Música - Álbum 02

My Generation - The Very Best Of The Who

My Way: The Best Of Frank Sinatra [Disc 1]

Palestrina: Missa Papae Marcelli & Allegri: Miserere

Prokofiev: Symphony No.5 & Stravinksy: Le Sacre Du Printemps

Pure Cult: The Best Of The Cult (For Rockers, Ravers, Lovers & Sinners) UK

Quanta Gente Veio ver--Bônus De Carnaval

Radio Brasil (O Som da Jovem Vanguarda) - Seleccao de Henrique Amaro

Schubert: The Late String Quartets & String Quintet (3 CD's)

Seek And Shall Find: More Of The Best (1963-1981)

Tchaikovsky: 1812 Festival Overture, Op.49, Capriccio Italien & Beethoven: Wellington's Victory

The Best Of Buddy Guy - The Millenium Collection

SELECT title, id FROM albums WHERE "id" != 136 OR "artist_id" = 245 EXCEPT SELECT title, id FROM employees WHERE postal_code = "T2P 5G3" AND "reports_to" <= 2.0 OR title != "Sales Support Agent" OR email <> "nancy@chinookcorp.com" OR first_name != "Margaret" AND country = "Canada" OR "id" <> 2 AND phone <> "+1 (403) 262-3443" AND last_name <> "Edwards" OR city = "Calgary" AND birth_date <> "1973-08-29 00:00:00" AND hire_date != "2002-08-14 00:00:00" OR state != "AB" OR address != "11120 Jasper Ave NW"


Question: Which driver IDs, excluding driver ID 9, are not also driver IDs in the school bus table, excluding driver ID 3?

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 != 3


Question: Can you give me a list of driver IDs that are less than 11, excluding the driver ID 9, considering only the drivers that appear in the driver table and school_bus table?

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 = 9


Question: Can you give me a list of all aircraft IDs, excluding aircraft ID 5, from both the aircraft and airport_aircraft lists?

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 != 5


Question: Can you give me a list of driver IDs that are 11 or less, excluding those driver IDs that are 7 or greater and are also 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 >= 7


Question: Can you give me a list of driver IDs, greater than 9, that are in the driver table but not 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: Could you give me the Template ID and Version Number for templates where either the Template ID is 16, the Version Number is not 6, the Template Details are empty, the Date Effective To is not 2006-02-06 23:52:04, or the Date Effective From is not 1979-12-24 10:28:16, combined with templates where the Version Number is less than or equal to 5 or the Date Effective From is not 2002-03-02 14:39:49 and the Template Type Code is "AD"?

SELECT Template_ID, Version_Number FROM Templates WHERE "Template_ID" = 16 OR "Version_Number" <> 6 OR Template_Details = "" OR Date_Effective_To != "2006-02-06 23:52:04" OR Date_Effective_From <> "1979-12-24 10:28:16" UNION SELECT Template_ID, Version_Number FROM Templates WHERE "Version_Number" <= 5 OR Date_Effective_From <> "2002-03-02 14:39:49" AND Template_Type_Code = "AD"


Question: Which driver IDs, excluding driver ID 6, are not also driver IDs greater than 10 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 > 10


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 the alphabetically first branch name from London that isn't Taverner and opened in 2015, or where the branch ID isn't 1, combined with the alphabetically first member name where their level is 6 or higher, or their name isn't Trevard Lindley?

SELECT MIN(Name) FROM branch WHERE Name <> "Taverner" AND Open_year = "2015" AND City = "London" OR "Branch_ID" <> 1 UNION ALL SELECT MIN(Name) FROM member WHERE "Level" >= 6 OR Name <> "Trevard Lindley"


Question: What document status codes are found in documents with receipt numbers other than 55, and also have a document status description that is not "currently working on"?

SELECT document_status_code FROM Documents WHERE receipt_number != "55" INTERSECT SELECT document_status_code FROM Ref_Document_Status WHERE document_status_description != "currently working on"


Question: Can you list the aircraft IDs that are less than 4 when grouped, excluding any aircraft IDs that are equal to 5 when grouped in the airport aircraft table?

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 = 5


Question: Can you give me a list of driver IDs from the driver table that are 5 or greater, excluding any driver IDs from the school bus table that are less than 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: What is the earliest state alphabetically, excluding New Jersey, among area codes less than 727, and also the earliest state alphabetically from California?

SELECT MIN(state) FROM AREA_CODE_STATE WHERE state <> "NJ" AND "area_code" < 727 UNION SELECT MIN(state) FROM VOTES WHERE state = "CA"


Question: Can you give me a list of driver IDs, combining those from the driver table excluding ID 8 with those from the school_bus table excluding ID 10?

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 the school IDs from the School table where either the school name is "New Prairie 1" and the IHSAA class isn't "AAA", or the county is "20 Elkhart" and the IHSAA football class isn't "AAA", or the location is "Elkhart", or the mascot isn't "Cavaliers", the school ID is "6", and the enrollment is at least 316; and also give me the school IDs from the Budget table where either the total budget percent budgeted is at least 1.3 and the school ID is less than 2, or the year isn't 2001, or the budget invested percent isn't "146.9" and the total budget percent invested is less than 2.2?

SELECT School_id FROM School WHERE School_name = "New Prairie 1" AND IHSAA_Class <> "AAA" OR County = "20 Elkhart" AND IHSAA_Football_Class <> "AAA" OR Location = "Elkhart" OR Mascot != "Cavaliers" AND School_id = "6" AND "Enrollment" >= 316 UNION ALL SELECT School_id FROM budget WHERE "total_budget_percent_budgeted" >= 1.3 AND "School_id" < 2 OR "Year" != 2001 OR Budget_invested_percent <> "146.9" AND "total_budget_percent_invested" < 2.2


Question: Can you give me a list of district IDs from the district table, excluding those that are also in the store_district table where the district ID is 11 or less and the store ID is not 4, and where the districts are either in city area 22, or have a city population of 134936 and are not headquartered in Attock City, or are not named Chakwal District?

SELECT District_ID FROM district WHERE "City_Area" = 22.0 OR "City_Population" = 134936.0 AND Headquartered_City != "Attock City" OR District_name <> "Chakwal District" EXCEPT SELECT District_ID FROM store_district WHERE "District_ID" <= 11 AND "Store_ID" != 4


Question: What is the smallest city name for employees who are not employee ID 3 and live in Sale, combined with the smallest city name for employees who are employee ID 3 or less and either younger than 36, live in Wasps, or are not named Jason Hobson?

SELECT MIN(City) FROM employee WHERE "Employee_ID" <> 3 AND City = "Sale" UNION SELECT MIN(City) FROM employee WHERE "Employee_ID" <= 3 AND "Age" < 36 OR City = "Wasps" OR Name <> "Jason Hobson"


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

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 not 8, and are also not driver IDs less than 4 that are associated with school buses?

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: What is the sum of feature type codes where the feature type name is not "Securiyt, eg Burglar Alarm.", plus the sum of feature type codes that are equal to "Security"?

SELECT SUM(feature_type_code) FROM Ref_Feature_Types WHERE feature_type_name <> "Securiyt, eg Burglar Alarm." UNION SELECT SUM(feature_type_code) FROM Ref_Feature_Types WHERE feature_type_code = "Security"


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 that are not 11 and are also less than 9, considering all drivers and school bus drivers?

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 < 9


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

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: Can you list the aircraft IDs from the aircraft table that are less than or equal to 1, and combine that with a list of aircraft IDs from the airport_aircraft table that are less than 2?

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: What is the highest item ID and the average title for items where the item ID is not 3, and also, what is the highest item ID and average title for items where the item ID is less than 6 and the title is not "apple"?

SELECT MAX(i_id), AVG(title) FROM item WHERE "i_id" <> 3 UNION ALL SELECT MAX(i_id), AVG(title) FROM item WHERE "i_id" < 6 AND title <> "apple"


Question: Can you give me the major, student ID, first name, last name, age, and advisor for all students, including those whose last name isn't Leighton, combined with those whose student ID is less than 1024 and are not male and whose first name isn't Dinesh, or whose last name isn't Lee and whose major is less than 540, or whose age isn't 17, or who live in PHL and have an advisor number greater than 9172?

SELECT Major, StuID, Fname, LName, Age, Advisor FROM Student WHERE LName != "Leighton" UNION ALL SELECT Major, StuID, Fname, LName, Age, Advisor FROM Student WHERE "StuID" < 1024 AND Sex <> "M" AND Fname != "Dinesh" OR LName <> "Lee" AND "Major" < 540 OR "Age" <> 17 OR city_code = "PHL" AND "Advisor" > 9172


Question: Could you give me a list of shop IDs from the hiring shop where the starting year isn't 2011 and the shop ID isn't 2, combined with a list of shop IDs from the shop table where the manager's name isn't Ilkka Mäkelä and the district isn't Finnair Stadium?

SELECT Shop_ID FROM hiring WHERE Start_from <> "2011" AND "Shop_ID" != 2 UNION SELECT Shop_ID FROM shop WHERE Manager_name != "Ilkka Mäkelä" AND District <> "Finnair Stadium"


Question: Can you give me the draft numbers from the circulation history where the draft number isn't 17, the copy number is 10 or less, the document ID isn't 20, or the employee ID is less than 2, but excluding any draft numbers from the document drafts that are 12 or less and have a document ID that isn't 23?

SELECT draft_number FROM Circulation_History WHERE "draft_number" != 17 OR "copy_number" <= 10 OR "document_id" != 20 OR "employee_id" < 2 EXCEPT SELECT draft_number FROM Document_Drafts WHERE "draft_number" <= 12 AND "document_id" != 23


Question: How many parties are there in elections where either the counties represented aren't 13, the first elected year wasn't 2003, or the delegate isn't Elizabeth Elizabeth Bobo, or the election ID is less than 7 and the district isn't 2, combined with the number of parties where the comptroller is Alan Hevesi, the lieutenant governor isn't David Paterson, and the attorney general isn't Eliot Spitzer?

SELECT COUNT(Party) FROM election WHERE Counties_Represented != "13" OR "First_Elected" != 2003.0 AND Delegate != "Bobo, Elizabeth Elizabeth Bobo" OR "Election_ID" < 7 AND "District" <> 2 UNION ALL SELECT COUNT(Party) FROM party WHERE Comptroller = "Alan Hevesi" AND Lieutenant_Governor <> "David Paterson" AND Attorney_General != "Eliot Spitzer"


Question: Can you give me a list of aircraft IDs that are greater than 3, including those from the aircraft table and the airport_aircraft table, without any duplicates?

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 > 3


Question: Can you give me a list of aircraft IDs that are less than 1, and also a list of aircraft IDs from the airport aircraft table that are not equal to 2?

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: Which driver IDs are both greater than or equal to 2 and also not equal to 7, considering only unique driver IDs from the driver and school_bus tables?

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 give me a list of driver IDs that are not equal to 4 from the driver table, excluding any driver IDs from the school bus table that are greater than or equal to 9?

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 >= 9


Question: Can you give me a list of aircraft IDs, including aircraft ID 1 from the aircraft table, and all aircraft IDs except 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: Which driver IDs are not equal to 2 and are also not equal to 7 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 != 7


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

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 >= 9


Question: Can you give me a list of driver IDs, including those from the driver table that aren't 3, and those from the school bus table that are less than 10, removing any duplicates?

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 < 10


Question: Which aircraft have an ID of 4 in the aircraft table, excluding those aircraft IDs that are not equal to 1 in the airport_aircraft table?

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: Which driver IDs are both less than 9 and present in the driver table, and also less than 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 list the aircraft IDs that are less than 5 from the aircraft table and also list the aircraft IDs that are greater than 3 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 > 3


Question: Which driver IDs are both not equal to 7 and greater than or equal to 9?

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 >= 9


Question: Can you give me a list of member IDs for members with a level of 6 or lower and a member ID of 4 or higher, excluding those named Myron Pryor, combined with a list of member IDs from the membership register branch for all entries not registered in 2016 at branch number 2?

SELECT Member_ID FROM member WHERE "Level" <= 6 AND "Member_ID" >= 4 AND Name != "Myron Pryor" UNION ALL SELECT Member_ID FROM membership_register_branch WHERE Register_Year <> "2016" AND Branch_ID = "2"


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 1, 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 <= 1


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

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 a list of driver IDs that are both less than or equal to 6 and also greater than 3, considering only unique driver IDs from the driver and school bus lists?

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 list the aircraft IDs that are less than 5 from the aircraft table, combined with the 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 < 5 UNION SELECT Aircraft_ID FROM airport_aircraft GROUP BY Aircraft_ID HAVING Aircraft_ID <> 1


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

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 <= 3


Question: Which driver IDs are greater than or equal to 7, but not also greater than or equal to 3 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 >= 3


Question: What are the total disk area and aircraft ID for each aircraft?

SELECT T1.Total_disk_area, T2.Aircraft_ID FROM aircraft as T1 JOIN airport_aircraft as T2 ON T1.Aircraft_ID = T2.Aircraft_ID


Question: Can you give me a list of driver IDs that are greater than 5, but only those that are not also school bus driver IDs greater than or equal to 3?

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: What are the average area sizes and types of stores, considering both stores with an area size greater than 28.74 or a type that isn't "City Mall" and a ranking of at least 1, as well as stores with a number of product categories not equal to 793 or a store ID greater than 2?

SELECT AVG(Area_size), Type FROM store WHERE "Area_size" > 28.74 OR Type != "City Mall" AND "Ranking" >= 1 UNION SELECT AVG(Area_size), Type FROM store WHERE "Number_of_product_category" <> 793.0 OR "Store_ID" > 2


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

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, including those from the driver table that are greater than or equal to 7, 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 >= 7 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 4


Question: Can you give me the number of distances, the number of destinations, the departure date, the average origin, and the average flight number for flights that don't originate in Chicago but do go to Chicago, where the distance is not 5478, the arrival date isn't 04/12/2005 05:03, and the flight number is less than 387, combined with the same information for flights where the flight number isn't 68 or the aid is greater than 2?

COUNT(distance) COUNT(destination) departure_date AVG(origin) AVG(flno)

SELECT COUNT(distance), COUNT(destination), departure_date, AVG(origin), AVG(flno) FROM flight WHERE origin != "Chicago" AND destination = "Chicago" AND "distance" != 5478 AND arrival_date != "04/12/2005 05:03" AND "flno" < 387 UNION ALL SELECT COUNT(distance), COUNT(destination), departure_date, AVG(origin), AVG(flno) FROM flight WHERE "flno" <> 68 OR "aid" > 2


Question: Can you give me a list of vehicle IDs that are not cars and have an ID less than 2, combined with a list of vehicle IDs that are not trucks?

SELECT vehicle_id FROM Vehicles WHERE vehicle_details != "Car" AND "vehicle_id" < 2 UNION SELECT vehicle_id FROM Vehicles WHERE vehicle_details <> "Truck"


Question: Can you give me the height and birth date of people named Teodor Salparov who are not 194 cm tall, or who were born on January 22, 1987, but exclude anyone taller than 182 cm who wasn't born on May 26, 1986, isn't Russian, and isn't named Roman Bragin?

SELECT Height, Birth_Date FROM people WHERE Name = "Teodor Salparov" AND "Height" <> 194.0 OR Birth_Date = "January 22, 1987" EXCEPT SELECT Height, Birth_Date FROM people WHERE "Height" > 182.0 AND Birth_Date <> "May 26, 1986" AND Nationality <> "Russia" AND Name != "Roman Bragin"


Question: What are the earliest document IDs, earliest draft numbers, and draft details for documents with IDs greater than 7 and draft details not equal to "a", excluding those with draft numbers less than or equal to 2 and draft details not equal to "r"?

SELECT MIN(document_id), MIN(draft_number), draft_details FROM Document_Drafts WHERE "document_id" > 7 AND draft_details <> "a" EXCEPT SELECT MIN(document_id), MIN(draft_number), draft_details FROM Document_Drafts WHERE "draft_number" <= 2 AND draft_details != "r"


Question: Can you tell me the earliest Governor and Comptroller, along with the Attorney General, for cases where the Lieutenant Governor was David Paterson, the Comptroller wasn't Alan Hevesi, the year was 2006 or earlier, the US Senator wasn't Hillary Rodham Clinton, the party wasn't Democratic, and the Governor wasn't Peter Vallone, combined with the earliest Governor and Comptroller, and Attorney General, for cases where the year was 1998 or the Attorney General wasn't Eliot Spitzer?

Betsy McCaughey Ross
Andrew Cuomo
Alan Hevesi

SELECT MIN(Governor), Attorney_General, MIN(Comptroller) FROM party WHERE Lieutenant_Governor = "David Paterson" AND Comptroller <> "Alan Hevesi" AND "Year" <= 2006.0 AND US_Senate <> "Hillary Rodham Clinton" AND Party != "Democratic" AND Governor <> "Peter Vallone" UNION ALL SELECT MIN(Governor), Attorney_General, MIN(Comptroller) FROM party WHERE "Year" = 1998.0 OR Attorney_General <> "Eliot Spitzer"


Question: Can you give me a list of driver IDs from the driver table that are less than or equal to 1, combined with a list of driver IDs from the school_bus table that are 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: Can you give me a list of driver IDs, excluding driver ID 2, from the driver table, but remove any driver IDs that are also driver ID 10 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 = 10


Question: Can you list the publication date, price, book ID, and publication ID for all publications where the publisher is not Pearson, the book ID is 5 or less, the price is greater than 2,000,000, and the publication date is not March 2007, combined with all publications where the book ID is 9 or greater?

SELECT Publication_Date, Price, Book_ID, Publication_ID FROM publication WHERE Publisher <> "Pearson" AND "Book_ID" <= 5 AND "Price" > 2000000.0 AND Publication_Date <> "March 2007" UNION SELECT Publication_Date, Price, Book_ID, Publication_ID FROM publication WHERE "Book_ID" >= 9


Question: Can you give me a list of PetIDs that either are not 2002 or have a StuID less than 1002, combined with a list of PetIDs for pets that are not cats, are older than 2, weigh 13.4, and have a PetID of 2002 or less?

SELECT PetID FROM Has_Pet WHERE "PetID" <> 2002 OR "StuID" < 1002 UNION SELECT PetID FROM Pets WHERE PetType != "cat" AND "pet_age" > 2 AND "weight" = 13.4 AND "PetID" <= 2002


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

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 = 2


Question: Could you list the feature type names that are either "Securiyt, eg Burglar Alarm." or have a feature type code of "Amenity", along with any feature type names that have a feature type code of "Security"?

SELECT feature_type_name FROM Ref_Feature_Types WHERE feature_type_name = "Securiyt, eg Burglar Alarm." OR feature_type_code = "Amenity" UNION SELECT feature_type_name FROM Ref_Feature_Types WHERE feature_type_code = "Security"


Question: Can you give me a list of driver IDs that are greater than 6, excluding any driver IDs from the school bus list that 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: Can you give me a list of driver IDs, including those from the driver table that are greater than 6, 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 > 6 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 4


Question: Can you give me the full name, ID, maker, and country of all car makers, including those where the country isn't "3", the ID is less than 2, or the full name isn't "Mazda", combined with those where the country isn't "4", the ID is greater than 7, or the maker isn't "volvo"?

SELECT FullName, Id, Maker, Country FROM car_makers WHERE Country != "3" OR "Id" < 2 OR FullName != "Mazda" UNION SELECT FullName, Id, Maker, Country FROM car_makers WHERE Country != "4" OR "Id" > 7 OR Maker <> "volvo"


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

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 a list of customer IDs from the Customers table where either the first name is Jordy and the birthdate isn't 1993-07-09 11:11:36, or the date they became a customer is 2015-06-24 03:50:04, or the amount outstanding is greater than 3751.0, or the cell phone number is 577-584-4864 and the last name isn't Grant, or the customer status code isn't "Bad Customer", or the customer ID isn't 12, or the phone number isn't 1-875-045-0806, or the customer address ID is less than or equal to 10 and the email address isn't ehowell@example.com, combined with a list of customer IDs from the Lessons table where the lesson ID is 4?

SELECT customer_id FROM Customers WHERE first_name = "Jordy" AND date_of_birth <> "1993-07-09 11:11:36" OR date_became_customer = "2015-06-24 03:50:04" OR "amount_outstanding" > 3751.0 OR cell_mobile_phone_number = "577-584-4864" AND last_name <> "Grant" OR customer_status_code != "Bad Customer" OR "customer_id" != 12 OR phone_number != "1-875-045-0806" OR "customer_address_id" <= 10 AND email_address != "ehowell@example.com" UNION SELECT customer_id FROM Lessons WHERE "lesson_id" = 4


Question: Which aircraft IDs are both greater than 4 when grouped in the aircraft table and greater than or equal to 1 when grouped in the airport_aircraft table?

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 >= 1


Question: Can you tell me the average registration year for each branch, excluding branch 5 and members with IDs less than 1, combined with the average registration year for each branch, excluding branch 5 or registrations in 2016?

SELECT Branch_ID, AVG(Register_Year) FROM membership_register_branch WHERE Branch_ID <> "5" AND "Member_ID" < 1 UNION SELECT Branch_ID, AVG(Register_Year) FROM membership_register_branch WHERE Branch_ID != "5" OR Register_Year != "2016"


Question: Can you give me a list of driver IDs, including those with the ID 6 from the driver table and those with IDs 9 or greater 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 >= 9


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

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 >= 3


Question: What document type codes are associated with the description "f", excluding the code "CD"?

SELECT document_type_code FROM Ref_Document_Types WHERE document_type_description = "f" INTERSECT SELECT document_type_code FROM Ref_Document_Types WHERE document_type_code != "CD"


Question: Can you give me a list of driver IDs, excluding driver ID 2, that are not also driver IDs greater than 3 found 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 > 3


Question: Which driver IDs are both less than or equal to 6 and also equal to 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: Could you give me the document IDs that are not shipped by "UP" and are greater than 1, but only for documents that were not mailed on "2010-11-04 04:00:16"?

SELECT document_id FROM Documents WHERE shipping_agent_code != "UP" AND "document_id" > 1 INTERSECT SELECT document_id FROM Documents_Mailed WHERE mailing_date <> "2010-11-04 04:00:16"


Question: Can you list all address details that are "ES", and also include any address details where the address ID is less than or equal to 4, or the address details are not "PT"?

SELECT address_details FROM Addresses WHERE address_details = "ES" UNION SELECT address_details FROM Addresses WHERE "address_id" <= 4 OR address_details <> "PT"


Question: Which driver IDs are both greater than or equal to 5 in the driver table and greater than or equal to 10 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: Which aircraft IDs, excluding aircraft ID 2, are also aircraft ID 3 in the airport aircraft list?

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 = 3


Question: Can you give me a list of driver IDs that are less than 2 from the driver table, combined with a list of driver IDs that are not equal to 7 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 <> 7


Question: Which driver IDs are both less than or equal to 5 in the driver table and greater than or equal to 3 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 >= 3


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 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, including those from the driver table where the ID is less than or equal to 2, and those from the school_bus table where the ID is less than 3?

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 < 3


Question: What are the maximum city area, minimum headquartered city, district name, minimum district ID, and total city population for districts where the city area is not 22, excluding those districts where the headquartered city is not "Khanewal City" and the city area is not 38 and the city population is not 134936, or where the district name is not "Attock District" and the district ID is less than 15?

SELECT MAX(City_Area), MIN(Headquartered_City), District_name, MIN(District_ID), SUM(City_Population) FROM district WHERE "City_Area" <> 22.0 EXCEPT SELECT MAX(City_Area), MIN(Headquartered_City), District_name, MIN(District_ID), SUM(City_Population) FROM district WHERE Headquartered_City <> "Khanewal City" AND "City_Area" <> 38.0 AND "City_Population" != 134936.0 OR District_name != "Attock District" AND "District_ID" < 15


Question: Can you give me a list of driver IDs that are both greater than or equal to 1 and not equal to 10, considering only the driver IDs present in both 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 are not equal to 1 from the driver table, but only include those that are also less than 7 from the school bus table?

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 < 7


Question: How many people from Bulgaria, or those with a final table made not equal to 26, or a best finish of 1, or a money rank not equal to 68, or a birth date other than April 17, 1987, who also have a Poker_Player_ID of 1 and a height less than 196, are there, and what are their Poker Player IDs?

SELECT COUNT(T1.People_ID), T2.Poker_Player_ID FROM people as T1 JOIN poker_player as T2 ON T1.People_ID = T2.People_ID WHERE Nationality = "Bulgaria" OR "Final_Table_Made" <> 26.0 OR "Best_Finish" = 1.0 OR "Money_Rank" <> 68.0 OR Birth_Date <> "April 17, 1987" AND "Poker_Player_ID" = 1 AND "Height" < 196.0


Question: Can you give me a list of driver IDs from the driver table that are less than or equal to 1, combined with a list of driver IDs from the school_bus table that are 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: Can you give me a list of driver IDs that are not equal to 1 from the driver table, but only include those driver IDs that are also less than 7 from the school bus table?

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 < 7


Question: Which driver IDs are both not equal to 11 and less than 4?

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: Can you give me a list of driver IDs, excluding driver ID 6, that are not also driver ID 10 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 = 10


Question: Can you tell me, for each date, how many lessons there were where either the vehicle ID wasn't 2 or the lesson time wasn't 9, combined with the number of lessons for each date that were either cancelled or didn't happen on March 7th, 2018 at 11:53:32?

SELECT lesson_date, COUNT(lesson_status_code) FROM Lessons WHERE "vehicle_id" != 2 OR lesson_time != "9" UNION SELECT lesson_date, COUNT(lesson_status_code) FROM Lessons WHERE lesson_status_code = "Cancelled" OR lesson_date <> "2018-03-07 11:53:32"


Question: Can you give me a list of driver IDs, including driver ID 6 from the driver table and any driver IDs less than 7 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 < 7


Question: Can you give me a list of aircraft IDs that are greater than 1, and also include aircraft IDs from the airport aircraft list that are greater than or equal to 1?

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: What aircraft IDs, excluding ID 3, are present in the aircraft table but not in the airport_aircraft table, also excluding aircraft ID 1 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 != 1


Question: Can you give me a list of driver IDs that are less than 8 and also not equal to 9, 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 < 8 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 9


Question: Can you give me the driver ID that appears exactly once as driver in the driver table, is equal to 6, and does not appear as a driver ID less than or equal to 7 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 <= 7


Question: Can you give me a list of driver IDs that are not 6 and are also less than or equal to 9, 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 <= 9


Question: Can you give me a list of aircraft IDs that are less than 5 from the aircraft table, combined with a list of aircraft IDs that are not equal to 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: Can you give me a list of driver IDs, combining those from the driver table where the ID is not 2, with those from the school bus table where the ID is less than 3, making sure to list each ID only once?

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 < 3


Question: Can you tell me the average employee ID and other details for employees, combining two sets of results: first, those where the other details are not "b", and second, those where the employee name isn't "Clemens" and the other details are "u", or where the role code is "PR" and the employee ID is 1 or greater?

SELECT other_details, AVG(employee_id) FROM Employees WHERE other_details <> "b" UNION ALL SELECT other_details, AVG(employee_id) FROM Employees WHERE employee_name <> "Clemens" AND other_details = "u" OR role_code = "PR" AND "employee_id" >= 1


Question: Which driver IDs are both greater than or equal to 4 in the driver table and greater than or 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: Can you tell me the earliest home city and party from the driver list, excluding driver ID 5, and then combine that with the earliest home city and party from drivers who either live in Bethel and aren't driver ID 4, or don't have the name Angel Acre, or aren't in the Dem party and are at least 30 years old?

SELECT MIN(Home_city), MIN(Party) FROM driver WHERE "Driver_ID" != 5 UNION ALL SELECT MIN(Home_city), MIN(Party) FROM driver WHERE Home_city = "Bethel" AND "Driver_ID" <> 4 OR Name <> "Angel Acre" OR Party <> "Dem" AND "Age" >= 30


Question: What is the minimum weight for each pet type, considering only pets whose weight is not 12 and age is not 2, and also considering only dogs with a pet ID of 2001 or higher?

SELECT PetType, MIN(weight) FROM Pets WHERE "weight" <> 12.0 AND "pet_age" <> 2 UNION SELECT PetType, MIN(weight) FROM Pets WHERE PetType = "dog" AND "PetID" >= 2001


Question: Can you give me a list of driver IDs, where each ID is 9 or greater, excluding those driver IDs that appear in the school bus table where the ID is not 4?

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 <> 4


Question: Can you give me the last name, count of customer address IDs, amount outstanding, count of customer IDs, sum of customer status codes, email address, date of birth, and count of phone numbers for customers, excluding those where the email is mayert.judy@example.com, the last name is Tromp, the amount outstanding is greater than 2099, or the date of birth is 1994-05-07 01:32:16 and the first name is Dameon, but then remove from that list any customers where the customer address ID is 1, the phone number is not (297)122-0086, the first name is not Dameon, the email address is not kitty.hand@example.net, and the customer status code is Good Customer, or the cell mobile phone number is not 1-401-108-8016x078 and the date they became a customer is 2016-05-13 07:38:23 and the amount outstanding is greater than or equal to 2099, or the date of birth is not 1996-08-29 00:03:08 and the customer ID is 12, or the last name is Grant?

SELECT last_name, COUNT(customer_address_id), amount_outstanding, COUNT(customer_id), SUM(customer_status_code), email_address, date_of_birth, COUNT(phone_number) FROM Customers WHERE email_address <> "mayert.judy@example.com" OR last_name <> "Tromp" OR "amount_outstanding" > 2099.0 OR date_of_birth = "1994-05-07 01:32:16" AND first_name = "Dameon" EXCEPT SELECT last_name, COUNT(customer_address_id), amount_outstanding, COUNT(customer_id), SUM(customer_status_code), email_address, date_of_birth, COUNT(phone_number) FROM Customers WHERE "customer_address_id" = 1 AND phone_number <> "(297)122-0086" AND first_name != "Dameon" AND email_address <> "kitty.hand@example.net" AND customer_status_code = "Good Customer" OR cell_mobile_phone_number <> "1-401-108-8016x078" AND date_became_customer = "2016-05-13 07:38:23" AND "amount_outstanding" >= 2099.0 OR date_of_birth != "1996-08-29 00:03:08" AND "customer_id" = 12 OR last_name = "Grant"


Question: Can you give me a list of driver IDs where the ID is greater than 8, and also include a list of driver IDs from the school bus table where the ID is not equal to 10?

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 both in the driver table and less than or equal to 8, and also in the school_bus table 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 the Aircraft IDs that appear exactly once in the aircraft table, excluding any Aircraft IDs that appear three or more times in the airport_aircraft table?

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 >= 3


Question: Can you list the aircraft IDs from the aircraft table that are greater than or equal to 1, combined with the aircraft IDs from the airport_aircraft table that are less than or equal to 3?

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: Which District and Store IDs are associated with districts that are not district 4 and also have a district ID less than 15?

SELECT District_ID, Store_ID FROM store_district WHERE "District_ID" != 4 INTERSECT SELECT District_ID, Store_ID FROM store_district WHERE "District_ID" < 15


Question: Can you give me the middle name, last name, date they left, date of birth, staff ID, earliest date joined, earliest first name, and the number of staff address IDs for staff members, combining two groups: those who didn't leave on March 6, 2018, or join on November 5, 2016, and those with a staff address ID greater than 4, or a birthdate of January 16, 2003, or a last name other than Kuphal?

SELECT middle_name, last_name, date_left_staff, date_of_birth, staff_id, MIN(date_joined_staff), MIN(first_name), COUNT(staff_address_id) FROM Staff WHERE date_left_staff != "2018-03-06 23:17:41" AND date_joined_staff <> "2016-11-05 01:43:52" UNION SELECT middle_name, last_name, date_left_staff, date_of_birth, staff_id, MIN(date_joined_staff), MIN(first_name), COUNT(staff_address_id) FROM Staff WHERE "staff_address_id" > 4 OR date_of_birth = "2003-01-16 06:29:11" OR last_name <> "Kuphal"


Question: What is the difference between the total driver ID of drivers who don't live in East Hartford and are not affiliated with the Dem party, and the total driver ID of school bus drivers who are either full-time or have a school ID of 1 or greater?

SELECT SUM(Driver_ID) FROM driver WHERE Home_city != "East Hartford" AND Party <> "Dem" EXCEPT SELECT SUM(Driver_ID) FROM school_bus WHERE If_full_time = "T" OR "School_ID" >= 1


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

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 != 9


Question: Can you give me a list of driver IDs that are not 12 and are also greater than 7, considering only driver IDs that appear in both the driver and school_bus tables?

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 > 7


Question: Which aircraft IDs, excluding aircraft ID 4, are also aircraft ID 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 give me a list of driver IDs that are greater than 4 from the driver table, combined with a list of driver IDs that are not equal to 10 from the school bus table?

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: Can you give me a list of driver IDs that are less than 9 from the driver table, combined with a list of driver IDs that are less than 7 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 < 7


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

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 >= 4


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

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 != 4


Question: Which driver IDs, excluding driver ID 6, are not also driver IDs in the school bus table, excluding driver ID 10?

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 != 10


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

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 = 7


Question: Can you list all template type descriptions, including those with the code "BK" and also including all descriptions that are not "Presentation"?

SELECT Template_Type_Description FROM Ref_Template_Types WHERE Template_Type_Code = "BK" UNION ALL SELECT Template_Type_Description FROM Ref_Template_Types WHERE Template_Type_Description != "Presentation"


Question: Which aircraft IDs are both less than or equal to 4 and present with an aircraft ID of 1 in the airport aircraft data?

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 = 1


Question: Can you give me the employee IDs and names of employees who either have an ID greater than 574489456, or whose name is not Mark Young and salary is 20, but only if they also have a salary that isn't 205187, or an ID of 274878974, or a name of Richard Jackson?

SELECT eid, name FROM employee WHERE "eid" > 574489456 OR name != "Mark Young" AND "salary" = 20 INTERSECT SELECT eid, name FROM employee WHERE "salary" != 205187 OR "eid" = 274878974 OR name = "Richard Jackson"


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

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 <> 3


Question: Can you give me a list of driver IDs, including those from the driver table that are 6 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 >= 6 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 10


Question: What countries have airports with a minimum ID of 5 or greater, excluding those countries where the airports have a minimum ID of 6 or less?

SELECT Country, MIN(id) FROM airport GROUP BY Country HAVING MIN(id) >= 5 EXCEPT SELECT Country, MIN(id) FROM airport GROUP BY Country HAVING MIN(id) <= 6


Question: Can you give me a list of driver IDs that are less than or equal to 9 from the driver table and also include driver ID 7 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 = 7


Question: Can you give me a list of driver IDs, where each ID is greater than 4, but exclude any driver IDs that also appear in the school bus table, unless that ID is 3?

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 != 3


Question: Can you give me a list of driver IDs, combining those from the driver table where the ID is not 1, and those from the school bus table where the ID is not 3, removing any duplicates?

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: Which driver IDs are both less than or equal to 5 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 <= 5 INTERSECT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 4


Question: What is the minimum aircraft ID associated with each freight metric tonnage amount, considering only the airports and their aircraft?

SELECT T1.Freight_Metric_Tonnes, MIN(T2.Aircraft_ID) FROM airport as T1 JOIN airport_aircraft as T2 ON T1.Airport_ID = T2.Airport_ID


Question: Can you give me a list of driver IDs where each ID is greater than 5 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 > 5 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 9


Question: What is the average student ID from the Has_Pet table, excluding student ID 1002, where that average is not found within the same average?

SELECT AVG(StuID) FROM Has_Pet WHERE "StuID" <> 1002 NOT IN (SELECT AVG(StuID) FROM Has_Pet WHERE "StuID" <> 1002)


Question: Can you list the aircraft IDs that are greater than 1, excluding those aircraft IDs that are also greater than or equal to 3 and associated with an airport?

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 >= 3


Question: Can you give me a list of aircraft IDs, excluding aircraft ID 1, that are not aircraft ID 5 found in the airport aircraft list?

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 = 5


Question: Could you give me a list of coach IDs for coaches with an ID greater than 1, combined with a list of coach IDs from the player_coach table where the starting year is 2011 or later?

SELECT Coach_ID FROM coach WHERE "Coach_ID" > 1 UNION SELECT Coach_ID FROM player_coach WHERE "Starting_year" >= 2011


Question: Can you give me a list of driver IDs that are not 11 and are also less than or equal to 3, considering only driver IDs that appear in 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 <= 3