Question: Can you give me the nationalities and birth dates of people who meet both of these conditions: first, their ID is 2 or less, or their height isn't 205, they're Russian, and their name isn't Aleksey Ostapenko, or their birth date isn't May 26, 1986; and second, their height isn't 207, or they're Russian, their name isn't Yevgeni Sivozhelez, their ID is less than 4, and their birth date is April 17, 1987?

SELECT Nationality, Birth_Date FROM people WHERE "People_ID" <= 2 OR "Height" != 205.0 AND Nationality = "Russia" AND Name != "Aleksey Ostapenko" OR Birth_Date != "May 26, 1986" INTERSECT SELECT Nationality, Birth_Date FROM people WHERE "Height" != 207.0 OR Nationality = "Russia" AND Name <> "Yevgeni Sivozhelez" AND "People_ID" < 4 AND Birth_Date = "April 17, 1987"


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


Question: Could you give me the Player IDs of players who either have 14355 votes, or are female named Judy Wasylycia-Leis, or don't live in Brandon and aren't ranked 2nd and have a Player ID other than 6 and don't work as a Design Coordinator, excluding any Player IDs that are in the player_coach table where the Player ID is less than or equal to 1 and the Starting year is less than or equal to 2010, or the Coach ID is less than 1?

SELECT Player_ID FROM player WHERE "Votes" = 14355 OR Gender = "F" AND Player_name = "Judy Wasylycia-Leis" OR Residence <> "Brandon" AND Rank != "2nd" AND "Player_ID" <> 6 AND Occupation <> "Design Coordinator" EXCEPT SELECT Player_ID FROM player_coach WHERE "Player_ID" <= 1 AND "Starting_year" <= 2010 OR "Coach_ID" < 1


Question: Can you give me the minimum principal activity, group equity shareholding, name, minimum incorporation location, maximum ID, and total type for companies, excluding those with a principal activity of "Cargo" and a type of "Subsidiary", or those incorporated in "Hong Kong", but then remove any companies not incorporated in "Taiwan", or with a group equity shareholding of 100, or with a principal activity other than "Airline" and a type of "Subsidiary" and an ID other than 6 and a name other than "Air Hong Kong"?

SELECT MIN(Principal_activities), Group_Equity_Shareholding, name, MIN(Incorporated_in), MAX(id), SUM(Type) FROM operate_company WHERE Principal_activities != "Cargo" AND Type = "Subsidiary" OR Incorporated_in = "Hong Kong" EXCEPT SELECT MIN(Principal_activities), Group_Equity_Shareholding, name, MIN(Incorporated_in), MAX(id), SUM(Type) FROM operate_company WHERE Incorporated_in <> "Taiwan" OR "Group_Equity_Shareholding" = 100.0 OR Principal_activities != "Airline" AND Type = "Subsidiary" AND "id" != 6 AND name != "Air Hong Kong"


Question: Can you give me a list of aircraft IDs, first from the aircraft table excluding aircraft ID 5, and then from the airport_aircraft table including only aircraft IDs greater than 2, 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 > 2


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

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


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

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

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 1 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, combining those from the driver table excluding driver ID 5, with those from the school bus table excluding driver ID 7?

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


Question: Can you list the aircraft IDs from the aircraft table that are less than or equal to 4, excluding any aircraft IDs from the airport_aircraft table that are 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 the IDs of drivers, up to ID 5, excluding the IDs of school bus drivers up to ID 9?

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


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

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


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

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 driver IDs, including those from the driver table where the ID is greater than 3, and those from the school bus table where the ID is less than or equal to 10?

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: Can you give me a list of Branch IDs, Member IDs, and Register Years for all memberships, excluding those from Branch 8 unless the Register Year is 2016, but then remove from that list any memberships that are not from Branch 4 and also not registered in 2016?

SELECT Branch_ID, Member_ID, Register_Year FROM membership_register_branch WHERE Branch_ID <> "8" OR Register_Year = "2016" EXCEPT SELECT Branch_ID, Member_ID, Register_Year FROM membership_register_branch WHERE Branch_ID != "4" AND Register_Year <> "2016"


Question: Could you list the vehicle IDs from the lessons, excluding those associated with cancelled lessons, or lessons with a price greater than 231, a vehicle ID not equal to 2, a staff ID of 11, a lesson ID less than or equal to 14, or a customer ID not equal to 8, but then remove any vehicle IDs that are associated with cars and have a vehicle ID greater than 1?

SELECT vehicle_id FROM Lessons WHERE lesson_status_code != "Cancelled" OR "price" > 231.0 AND "vehicle_id" != 2 AND "staff_id" = 11 OR "lesson_id" <= 14 OR "customer_id" != 8 EXCEPT SELECT vehicle_id FROM Vehicles WHERE vehicle_details = "Car" AND "vehicle_id" > 1


Question: Can you give me the Club IDs that are associated with clubs named "Pen and Paper Gaming" or clubs that are not Club ID 3 and don't have the description "Play pen and paper games on campus." and are not located in "HHH", but only if those Club IDs are also associated with members where the Club ID is less than or equal to 1 or the position is not "CTO"?

SELECT ClubID FROM Club WHERE ClubName = "Pen and Paper Gaming" OR "ClubID" != 3 AND ClubDesc != "Play pen and paper games on campus." AND ClubLocation <> "HHH" INTERSECT SELECT ClubID FROM Member_of_club WHERE "ClubID" <= 1 OR Position <> "CTO"


Question: Can you give me a list of driver IDs, excluding driver ID 3, from the driver table, but only those IDs that are not also in the school bus table where the driver ID is less than 4?

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 tell me, for each issue, how many writers there are and how many books there are, but only if there's more than one writer and either not exactly two books or at least one book, and also if there are more than three writers and at least one book?

SELECT COUNT(Writer), Issues, COUNT(Book_ID) FROM book GROUP BY Issues HAVING COUNT(Book_ID) <> 2 AND COUNT(Writer) > 1 UNION SELECT COUNT(Writer), Issues, COUNT(Book_ID) FROM book GROUP BY Issues HAVING COUNT(Book_ID) >= 1 AND COUNT(Writer) > 3


Question: Can you give me a list of document IDs for documents that either have a template ID of 21 or less, or have a document ID greater than 80, a template ID greater than 1, a document name that is not "Understanding DB", other details that are not "None", and a document description that is "b"?

SELECT Document_ID FROM Documents WHERE "Template_ID" <= 21 UNION SELECT Document_ID FROM Documents WHERE "Document_ID" > 80 OR "Template_ID" > 1 AND Document_Name != "Understanding DB" AND Other_Details != "None" AND Document_Description = "b"


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

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 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 greater than 3?

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 the IATA, ICAO, country, and city for Schiphol Airport, as well as for any airport with an ID less than 1 or named Akureyri Airport?

SELECT IATA, ICAO, Country, City FROM airport WHERE name = "Schiphol Airport" UNION ALL SELECT IATA, ICAO, Country, City FROM airport WHERE "id" < 1 OR name = "Akureyri Airport"


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

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: What continents, excluding Asia, are not continents with at least 5 countries?

SELECT Continent FROM continents WHERE Continent != "asia" EXCEPT SELECT Continent FROM countries WHERE "Continent" >= 5


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

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


Question: Can you give me the smallest School ID, the total Years Working, whether they are full-time, and the total Driver ID for all school bus drivers who either have more than 2 years of experience or whose School ID is less than 5, combined with the same information for all drivers where the Driver ID is at least 9, or they have less than 6 years of experience, or they are full-time?

SELECT MIN(School_ID), SUM(Years_Working), If_full_time, SUM(Driver_ID) FROM school_bus WHERE "Years_Working" > 2 OR "School_ID" < 5 UNION SELECT MIN(School_ID), SUM(Years_Working), If_full_time, SUM(Driver_ID) FROM school_bus WHERE "Driver_ID" >= 9 OR "Years_Working" < 6 OR If_full_time = "T"


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

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


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

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


Question: What is the smallest template ID from documents where the other details are not "None" and the document name is not "Data base", or the document ID is greater than 3540024, excluding the smallest template ID from templates where the template ID is not 21?

SELECT MIN(Template_ID) FROM Documents WHERE Other_Details != "None" AND Document_Name <> "Data base" OR "Document_ID" > 3540024 EXCEPT SELECT MIN(Template_ID) FROM Templates WHERE "Template_ID" <> 21


Question: Can you give me a list of aircraft IDs, excluding aircraft ID 4, that appear more than once, and then remove any aircraft IDs from that list that are also in a list of aircraft IDs that appear more than once and are less than or 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 that are less than 6, excluding any driver IDs from the school bus list that are 4 or greater?

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, excluding driver ID 4 from the driver table and driver ID 7 from the school_bus table, with each ID appearing only once?

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


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

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


Question: Can you list all the template type codes, including those that are not 'AD' or have a description other than 'Presentation', and also include the template type codes from templates with an ID greater than 21?

SELECT Template_Type_Code FROM Ref_Template_Types WHERE Template_Type_Code != "AD" OR Template_Type_Description <> "Presentation" UNION ALL SELECT Template_Type_Code FROM Templates WHERE "Template_ID" > 21


Question: What is the average property type code for properties that meet certain price, feature, address, ID, offering price, name, room count, date, and vendor price criteria, but only considering those averages that also meet criteria related to property type code and description in a separate list of property types?

SELECT AVG(property_type_code) FROM Properties WHERE "agreed_selling_price" <= 2794972.2495 OR fld_feature_3 = "None" AND oth_feature_2 <> "None" AND oth_feature_1 != "None" OR property_address != "4745 Emerson Stravenue Suite 829 South Garret, IN 16772-5682" AND "property_id" >= 6 OR apt_feature_1 != "nesciunt" AND "buyer_offered_price" <= 13991131.434 OR property_name = "avalon" OR hse_feature_1 <> "None" AND shp_feature_1 = "None" AND apt_feature_3 <> "None" OR fld_feature_2 = "None" OR "room_count" != 9 OR date_on_market <> "1986-11-26 04:12:18" OR shp_feature_3 != "None" OR "vendor_requested_price" > 2219.6778 OR hse_feature_3 <> "None" AND apt_feature_2 <> "culpa" AND oth_feature_3 = "None" AND shp_feature_2 = "None" INTERSECT SELECT AVG(property_type_code) FROM Ref_Property_Types WHERE property_type_code <> "House" OR property_type_description != "Shop, Retail Outlet."


Question: Can you give me the IDs from the flight table where either the airport ID isn't 1 and the date is January 29, 1964, and the flight number is M2-F1 #70, or the pilot is Thompson, the company ID isn't 11, and the altitude is above 3650, or the velocity is above 240, or the ID isn't 8, combined with the IDs from the operate_company table where either the name isn't CLS Catering Services Limited and the incorporation location isn't Hong Kong, or the type isn't Corporate and the ID is greater than 13?

SELECT id FROM flight WHERE "airport_id" <> 1 AND Date = "January 29, 1964" AND Vehicle_Flight_number = "M2-F1 #70" OR Pilot = "Thompson" AND "company_id" <> 11 AND "Altitude" > 3650.0 OR "Velocity" > 240.0 OR "id" <> 8 UNION SELECT id FROM operate_company WHERE name <> "CLS Catering Services Limited" AND Incorporated_in != "Hong Kong" OR Type <> "Corporate" AND "id" > 13


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

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


Question: Can you give me a list of driver IDs that are 3 or greater, excluding those driver IDs from the school bus table that are not equal to 10?

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


Question: Which driver IDs are equal to 5 in the driver table, but not greater than or equal to 7 in the school_bus table?

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


Question: Can you give me a list of aircraft IDs that are both less than or equal to 4 and also not equal to 1, considering the aircraft and airport aircraft datasets?

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 a list of driver IDs that are either driver ID 10 from the driver table, or any driver ID except 7 from the school bus table?

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


Question: Which driver IDs, excluding driver ID 9, are also driver IDs less than 4 who drive school buses?

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


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

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, excluding driver ID 12, from the driver table, but only those IDs that are not also in 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 != 12 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <= 4


Question: Which driver IDs, other than 11, are also driver IDs that equal 9 in the school bus table?

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 7, excluding the driver ID 4, from the drivers and school bus records?

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 is the highest document type code that appears in both the documents table (excluding entries received on "1986-12-14 14:18:59" with shipping agent "UP", receipt number "19" with other details "w", document ID 13 with "working" status, or document type "Hard Drive") and the reference document types table (excluding entries with document type "Paper" or description "b")?

SELECT MAX(document_type_code) FROM Documents WHERE receipt_date <> "1986-12-14 14:18:59" AND shipping_agent_code = "UP" OR receipt_number <> "19" AND other_details = "w" OR "document_id" = 13 AND document_status_code = "working" OR document_type_code <> "Hard Drive" INTERSECT SELECT MAX(document_type_code) FROM Ref_Document_Types WHERE document_type_code <> "Paper" OR document_type_description <> "b"


Question: Can you list the country, maker, and ID of car makers, including those that aren't Subaru and are from country 3, combined with those that aren't from country 4, or are named Mazda and made by bmw, or have an ID of 14 or greater?

SELECT Country, Maker, Id FROM car_makers WHERE FullName != "Subaru" AND Country = "3" UNION SELECT Country, Maker, Id FROM car_makers WHERE Country != "4" OR FullName = "Mazda" AND Maker = "bmw" OR "Id" >= 14


Question: Can you list the writer, title, and number of issues for all books where the Book ID is 4 or less, combined with the writer, title, and number of issues for books titled "Cyberella" where the writer isn't Elaine Lee, or where the number of issues is 4 or more?

Garth Ennis
Bloody Mary : Lady Liberty
4

Michael Moorcock
Michael Moorcock's Multiverse
12

SELECT Writer, Title, Issues FROM book WHERE "Book_ID" <= 4 UNION SELECT Writer, Title, Issues FROM book WHERE Title = "Cyberella" AND Writer != "Elaine Lee" OR "Issues" >= 4.0


Question: Can you give me the student IDs from the allergy list where the ID is 1010 or higher, or the allergy is to dogs, but exclude any student IDs from the student list where the city code isn't HOU or the ID is greater than 1015?

SELECT StuID FROM Has_Allergy WHERE "StuID" >= 1010 OR Allergy = "Dog" EXCEPT SELECT StuID FROM Student WHERE city_code != "HOU" OR "StuID" > 1015


Question: Can you give me a list of driver IDs from the driver table where each ID is less than or equal to 8, combined with a list of driver IDs from the school_bus table where the ID is 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 from the driver table that are greater than or equal to 3, excluding any driver IDs from the school_bus table that are equal to 4?

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: Which aircraft are turboshaft utility helicopters and also listed in the airport aircraft table, excluding those with ID 1 and aircraft ID 3?

SELECT Aircraft_ID FROM aircraft WHERE Description = "Turboshaft utility helicopter" INTERSECT SELECT Aircraft_ID FROM airport_aircraft WHERE "ID" <> 1 AND "Aircraft_ID" <> 3


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


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

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 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 a list of driver IDs, excluding driver ID 8, that are not also driver ID 7 in the school bus list?

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


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

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


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

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


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

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


Question: Can you give me a list of driver IDs, removing driver ID 4 from the driver table and driver ID 3 from the school bus table, and combining the results?

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


Question: 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 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 list the city area, headquartered city, and district ID for districts, excluding those where the city area is at least 25, the city population is no more than 219254, and the headquartered city isn't Bhakkar City, or where the district name is Kasur District, or the district ID isn't 7, but including only those districts where the district name isn't Attock District, or the city population is 2793721 and the headquartered city isn't Bahawalnagar City?

SELECT City_Area, Headquartered_City, District_ID FROM district WHERE District_name <> "Attock District" OR "City_Population" = 2793721.0 AND Headquartered_City != "Bahawalnagar City" EXCEPT SELECT City_Area, Headquartered_City, District_ID FROM district WHERE "City_Area" >= 25.0 AND "City_Population" <= 219254.0 AND Headquartered_City != "Bhakkar City" OR District_name = "Kasur District" OR "District_ID" <> 7


Question: How many people are there who are named K. J. Choi with a head ID of 8 or less, or are at least 69 years old, or were born in Alabama, plus how many people are there who were not born in California with a head ID less than 1, or are not 69 years old and are named K. J. Choi?

SELECT COUNT(age) FROM head WHERE name = "K. J. Choi" AND "head_ID" <= 8 OR "age" >= 69.0 OR born_state = "Alabama" UNION ALL SELECT COUNT(age) FROM head WHERE born_state <> "California" AND "head_ID" < 1 OR "age" <> 69.0 AND name = "K. J. Choi"


Question: Can you list the IDs and titles of all albums with an ID greater than 97, along with the IDs and titles of all employees who don't report to employee number 1?

A TempestadeTempestade Ou O Livro Dos Dias

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

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

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

From The Muddy Banks Of The Wishkah live

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

My Generation - The Very Best Of The Who

Battlestar Galactica (Classic), Season 1

Instant Karma: The Amnesty International Campaign to Save Darfur

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

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

Adorate Deum: Gregorian Chant from the Proper of the Mass

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

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

Beethoven Piano Sonatas: Moonlight & Pastorale

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

Elgar: Cello Concerto & Vaughan Williams: Fantasias

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

Palestrina: Missa Papae Marcelli & Allegri: Miserere

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

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

Armada: Music from the Courts of England and Spain

Beethoven: Symphony No. 6 'Pastoral' Etc.

Charpentier: Divertissements, Airs & Concerts

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

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

Great Recordings of the Century: Paganini's 24 Caprices

Liszt - 12 Études D'Execution Transcendante

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

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

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

Koyaanisqatsi (Soundtrack from the Motion Picture)

SELECT id, title FROM albums WHERE "id" > 97 UNION ALL SELECT id, title FROM employees WHERE "reports_to" != 1.0


Question: Can you give me a list of driver IDs where the driver ID is greater than 8 from the driver table, combined with a list of driver IDs where the driver ID is not equal to 9 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 <> 9


Question: Can you give me a list of student and pet IDs, including those where the student ID is 1002 or less, and also those where the pet ID is 2001 or less?

SELECT StuID, PetID FROM Has_Pet WHERE "StuID" <= 1002 UNION SELECT StuID, PetID FROM Has_Pet WHERE "PetID" <= 2001


Question: Can you give me a list of aircraft IDs, excluding aircraft ID 1, where each ID appears more than once in the aircraft table, but is not an aircraft ID that appears more than once in the airport_aircraft table, excluding aircraft ID 2?

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: Could you give me the sum of heights, the smallest People ID, the earliest Nationality, the latest Name, and the number of birth dates for people born on May 26, 1986, and then combine that with the same information for people whose height is not 207?

SELECT SUM(Height), MIN(People_ID), MIN(Nationality), MAX(Name), COUNT(Birth_Date) FROM people WHERE Birth_Date = "May 26, 1986" UNION ALL SELECT SUM(Height), MIN(People_ID), MIN(Nationality), MAX(Name), COUNT(Birth_Date) FROM people WHERE "Height" != 207.0


Question: Can you list the aircraft IDs that are less than or equal to 3, excluding those aircraft IDs that are also greater than or equal to 5 in the airport aircraft list?

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


Question: Which driver IDs are equal to 2 in the driver table, but not less than or equal to 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 give me a list of driver IDs that are less than 11 and also less than 7, considering only the unique driver IDs from the driver and school bus lists?

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


Question: Can you show me the earnings, money rank, and best finish for poker players, including those with a best finish of 2.0 or better, a money rank less than 58, earnings not equal to 189233, a player ID of 4 or greater, or final tables made less than 19, along with those with a money rank of 166 or greater and a player ID not equal to 4, or earnings not equal to 596462 and a people ID of 6 or less?

SELECT Earnings, Money_Rank, Best_Finish FROM poker_player WHERE "Best_Finish" >= 2.0 AND "Money_Rank" < 58.0 OR "Earnings" <> 189233.0 OR "Poker_Player_ID" >= 4 OR "Final_Table_Made" < 19.0 UNION ALL SELECT Earnings, Money_Rank, Best_Finish FROM poker_player WHERE "Money_Rank" >= 166.0 AND "Poker_Player_ID" != 4 OR "Earnings" <> 596462.0 AND "People_ID" <= 6


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

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


Question: Which driver IDs are equal to 5 in the driver table, but not less than 7 in the school_bus table?

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


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

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


Question: Could you list the city area and store ID for stores where the store ID is greater than 1 and either the city population is 134936, or the headquarters city isn't "Khanewal City" and the district name isn't "Khanewal District"?

SELECT T1.City_Area, T2.Store_ID FROM district as T1 JOIN store_district as T2 ON T1.District_ID == T2.District_ID GROUP BY Store_ID HAVING Store_ID > 1 AND City_Population = 134936.0 OR Headquartered_City <> "Khanewal City" AND District_name <> "Khanewal District"


Question: Can you give me a list of aircraft IDs that are less than 5, excluding those aircraft IDs from airport aircraft that are not equal to 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: Which driver IDs are both less than or equal to 5 in the driver table and greater than 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: Could you give me a list of birth dates from the people table, including those where either the People ID is not 2, the nationality is not Russia, the name is not Roman Bragin, the height is greater than 205, or the birth date is not February 8, 1981; and also include birth dates where either the nationality is not Russia, the name is Teodor Salparov, the People ID is not 5, or the birth date is not August 8, 1986?

SELECT Birth_Date FROM people WHERE "People_ID" != 2 OR Nationality <> "Russia" OR Name != "Roman Bragin" OR "Height" > 205.0 OR Birth_Date != "February 8, 1981" UNION SELECT Birth_Date FROM people WHERE Nationality <> "Russia" OR Name = "Teodor Salparov" OR "People_ID" <> 5 OR Birth_Date <> "August 8, 1986"


Question: Can you give me a list of driver IDs, including those from the driver table excluding driver ID 10, and those from the school bus table excluding driver ID 7?

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


Question: Can you give me a list of driver IDs, excluding driver ID 10, that are greater than 10 and appear more than once in the driver table but not in the school bus table?

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


Question: Can you give me a list of driver IDs that are not 11, and are also not driver IDs that are less than 7 and associated with a school bus?

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


Question: What is the average airport ID associated with each aircraft ID?

SELECT T1.Aircraft_ID, AVG(T2.Airport_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, including those from the driver table excluding driver ID 4, and those from the school bus table with driver IDs greater than 7?

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


Question: Can you give me a list of driver IDs, including those from the driver table where the ID is not 4, and those from the school_bus table where the ID is less than 7?

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


Question: Can you give me the name, equity shareholding, place of incorporation, principal activities, and ID for all companies where either the principal activity isn't laundry, or they're incorporated in Hong Kong, or their equity shareholding is greater than 18.77, or they're a subsidiary and their name isn't Cathay Pacific Cargo and their ID is less than 1; along with the name, equity shareholding, place of incorporation, principal activities, and ID for all companies where the principal activity is cargo, or their ID is 1, or they're not incorporated in Taiwan and their equity shareholding is 40.0?

Cathay Pacific Catering Services (HK) Limited

SELECT name, Group_Equity_Shareholding, Incorporated_in, Principal_activities, id FROM operate_company WHERE Principal_activities <> "Laundry" OR Incorporated_in = "Hong Kong" OR "Group_Equity_Shareholding" > 18.77 OR Type = "Subsidiary" AND name <> "Cathay Pacific Cargo" AND "id" < 1 UNION ALL SELECT name, Group_Equity_Shareholding, Incorporated_in, Principal_activities, id FROM operate_company WHERE Principal_activities = "Cargo" OR "id" = 1 OR Incorporated_in != "Taiwan" AND "Group_Equity_Shareholding" = 40.0


Question: Can you give me a list of driver IDs from the driver table where the ID is 2 or greater, combined with a list of driver IDs from the school bus table where the ID is exactly 10?

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


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

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: Which driver IDs are less than 9 and also greater than or equal to 7?

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


Question: Can you give me a list of driver IDs, including those from the driver table where the ID is greater than 4, and those from the school bus table where the ID is greater than 10?

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


Question: Can you list the writer and book ID for all books where the book ID is 4 or greater, or the writer is not Christopher Moeller and the number of issues is 4 or greater, or the title is not Bloody Mary, combined with the writer and book ID for books where the book ID is greater than 9 or the title is BrainBanx?

SELECT Writer, Book_ID FROM book WHERE "Book_ID" >= 4 OR Writer <> "Christopher Moeller" AND "Issues" >= 4.0 OR Title <> "Bloody Mary" UNION SELECT Writer, Book_ID FROM book WHERE "Book_ID" > 9 OR Title = "BrainBanx"


Question: Can you list all the aircraft IDs, including those that appear only once in the aircraft table with an ID of 1, and those that appear in the airport_aircraft table with IDs not 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: Can you list all the aircraft IDs, excluding aircraft ID 3 from the aircraft table, and combine that with a list of all aircraft IDs, excluding aircraft ID 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: Can you give me a list of driver IDs, including those from the driver table where the ID is 4 or greater, and those from the school bus table where the ID is 9 or greater?

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


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


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


Question: What is the average head ID for heads born in Alabama, excluding those named Dudley Hart, combined with the average head ID for management where the head ID is 5 or greater and they are temporarily acting?

SELECT AVG(head_ID) FROM head WHERE born_state = "Alabama" AND name != "Dudley Hart" UNION ALL SELECT AVG(head_ID) FROM management WHERE "head_ID" >= 5 AND temporary_acting = "Yes"


Question: Which driver IDs, excluding driver ID 10, are also driver IDs less than 7 in the school bus table?

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


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

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


Question: Can you give me the IDs of coaches who are either not named Robert Chen, are not female, or have a rank of 5 or higher, but only for those coaches who are also not coach ID 3 in the player_coach table and either started in a year other than 2013 or have a player ID greater than 6?

SELECT Coach_ID FROM coach WHERE Coach_name <> "Robert Chen" OR Gender != "F" OR "Rank" >= 5 INTERSECT SELECT Coach_ID FROM player_coach WHERE "Coach_ID" <> 3 AND "Starting_year" != 2013 OR "Player_ID" > 6


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

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


Question: Can you give me a combined list of property information, including maximum date on market, maximum property type code, other property details, count of hse_feature_1, oth_feature_2, maximum hse_feature_2, agreed selling price, apt_feature_1, minimum oth_feature_3, sum of property name, minimum date sold, fld_feature_1, minimum vendor requested price, minimum fld_feature_2, maximum apt_feature_3, count of shp_feature_3, minimum buyer offered price, property ID, average room count, property address, oth_feature_1, count of hse_feature_3, maximum shp_feature_2, apt_feature_2, and shp_feature_1, first for properties where hse_feature_2 is "None", and then for properties where hse_feature_1 is not "None" and fld_feature_2 is not "None", or shp_feature_3 is not "None" and date_on_market is "1978-05-15 10:53:37", or "agreed_selling_price" is not 2794972.2495 and other_property_details is not "None", or fld_feature_1 is not "None" and "property_id" is not 1 and property_type_code is not "Apartment", or hse_feature_2 is not "None" and property_address is not "986 Hagenes Drives Draketon, UT 83411-3393" and apt_feature_3 is not "None" and shp_feature_1 is not "None" and "vendor_requested_price" is 77172926.3?

SELECT MAX(date_on_market), MAX(property_type_code), other_property_details, COUNT(hse_feature_1), oth_feature_2, MAX(hse_feature_2), agreed_selling_price, apt_feature_1, MIN(oth_feature_3), SUM(property_name), MIN(date_sold), fld_feature_1, MIN(vendor_requested_price), MIN(fld_feature_2), MAX(apt_feature_3), COUNT(shp_feature_3), MIN(buyer_offered_price), property_id, AVG(room_count), property_address, oth_feature_1, COUNT(hse_feature_3), MAX(shp_feature_2), apt_feature_2, shp_feature_1 FROM Properties WHERE hse_feature_2 = "None" UNION ALL SELECT MAX(date_on_market), MAX(property_type_code), other_property_details, COUNT(hse_feature_1), oth_feature_2, MAX(hse_feature_2), agreed_selling_price, apt_feature_1, MIN(oth_feature_3), SUM(property_name), MIN(date_sold), fld_feature_1, MIN(vendor_requested_price), MIN(fld_feature_2), MAX(apt_feature_3), COUNT(shp_feature_3), MIN(buyer_offered_price), property_id, AVG(room_count), property_address, oth_feature_1, COUNT(hse_feature_3), MAX(shp_feature_2), apt_feature_2, shp_feature_1 FROM Properties WHERE hse_feature_1 <> "None" AND fld_feature_2 <> "None" OR shp_feature_3 != "None" AND date_on_market = "1978-05-15 10:53:37" OR "agreed_selling_price" != 2794972.2495 AND other_property_details <> "None" OR fld_feature_1 != "None" AND "property_id" != 1 AND property_type_code <> "Apartment" OR hse_feature_2 <> "None" AND property_address <> "986 Hagenes Drives Draketon, UT 83411-3393" AND apt_feature_3 <> "None" AND shp_feature_1 <> "None" AND "vendor_requested_price" = 77172926.3


Question: Can you list the driver IDs from the driver table that are less than 7, and combine that list with the driver IDs from the school_bus table that are 7 or greater, removing any duplicates?

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: Give me a list of car models, excluding Cadillacs, but then remove any models that are either Chevrolets or have a ModelId that isn't 23.

SELECT Model FROM model_list WHERE Model <> "cadillac" EXCEPT SELECT Model FROM model_list WHERE "ModelId" != 23 OR Model = "chevrolet"


Question: Can you list all the template type codes, including those that are not "BK" from the template types reference table, and those that are "CV" or have a version number not equal to 5 from the templates table?

SELECT Template_Type_Code FROM Ref_Template_Types WHERE Template_Type_Code != "BK" UNION ALL SELECT Template_Type_Code FROM Templates WHERE Template_Type_Code = "CV" OR "Version_Number" <> 5


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

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


Question: Could you list the description and ID of clubs that are located in AKW and have a description different from "Refurbish computers; teach kids and adults about computer basics.", but only include those clubs whose description is also different from "Refurbish computers; teach kids and adults about computer basics." and whose ClubID is greater than or equal to 3?

SELECT ClubDesc, ClubID FROM Club WHERE ClubDesc <> "Refurbish computers; teach kids and adults about computer basics." AND ClubLocation = "AKW" INTERSECT SELECT ClubDesc, ClubID FROM Club WHERE ClubDesc != "Refurbish computers; teach kids and adults about computer basics." AND "ClubID" >= 3


Question: Can you list the aircraft IDs that are less than 4 from the aircraft table, and also list the aircraft IDs that are less than 3 from the airport_aircraft table, combining the two lists into one?

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


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

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


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


Question: What are the aircraft IDs that are not equal to 1 and are also not equal to 2 in the airport aircraft?

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


Question: Which driver IDs are greater than 5 and appear in the driver table, and are also greater than 4 and appear 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: Can you give me a list of driver IDs, excluding driver ID 12 from the driver table and excluding driver ID 3 from the school_bus table, combining the results into a single list?

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 list the aircraft IDs that are less than 5 from the aircraft table, and also include aircraft ID 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: Which driver IDs are greater than 1, but not less than 10 and also present 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 < 10


Question: Which driver IDs are both greater than 4 and also not equal to 4, considering drivers from both the driver and school bus tables?

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


Question: Can you give me the smallest item ID from the item table, along with the item ID from the review table, but only for cases where the sum of a_id is greater than 3, the average of u_id is equal to 1, the title is "blue hoodie", or the sum of rank is greater than 6?

SELECT MIN(T1.i_id), T2.i_id FROM item as T1 JOIN review as T2 ON T1.i_id = T2.i_id WHERE SUM(a_id) > 3 OR AVG(u_id) = 1 OR title = "blue hoodie" OR SUM(rank) > 6


Question: How many airports are associated with each aircraft?

SELECT T1.Aircraft_ID, COUNT(T2.Airport_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, excluding driver ID 8, that 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 != 8 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 10


Question: Can you list all aircraft IDs, first those that appear in the aircraft table excluding ID 5, and then those from the airport_aircraft table with IDs greater than 5?

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 the aircraft IDs that are greater than or equal to 5 from the aircraft table, and also include aircraft ID 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: How many lessons meet either of these sets of criteria: staff ID is 8 or less, lesson time is not 6, price is less than 306, and lesson ID is not 9; or customer ID is greater than 11 and the lesson status is not cancelled; or vehicle ID is 1 or less, or the lesson date is not March 7, 2018 at 4:12:36 PM? Also, how many lessons meet any of these criteria: lesson time is not 2, staff ID is greater than 14, lesson ID is 1 or greater, or the lesson date is not March 21, 2018 at 6:48:45 AM?

SELECT COUNT(lesson_date) FROM Lessons WHERE "staff_id" <= 8 AND lesson_time != "6" AND "price" < 306.0 AND "lesson_id" <> 9 OR "customer_id" > 11 AND lesson_status_code <> "Cancelled" OR "vehicle_id" <= 1 OR lesson_date != "2018-03-07 16:12:36" UNION ALL SELECT COUNT(lesson_date) FROM Lessons WHERE lesson_time != "2" OR "staff_id" > 14 OR "lesson_id" >= 1 OR lesson_date != "2018-03-21 06:48:45"


Question: Can you list all the aircraft IDs, first from the aircraft table excluding aircraft ID 5, and then from the airport_aircraft table including only aircraft IDs up to 3, 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 <= 3


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

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


Question: Can you list the aircraft IDs that appear more than once in the aircraft table, where the ID is greater than 1, and combine that with a list of aircraft IDs that appear more than once in the airport_aircraft table, where the ID is greater than or 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 has an ID of 8, but is not a driver with an ID other than 9 who drives a school bus?

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


Question: Can you give me the highest branch ID, member ID, and register year for members registered in years other than 2017, but only if they also have the highest branch ID, member ID, and register year for members registered in 2016, or for members with an ID other than 7 and a branch ID other than 5?

SELECT MAX(Branch_ID), Member_ID, Register_Year FROM membership_register_branch WHERE Register_Year != "2017" INTERSECT SELECT MAX(Branch_ID), Member_ID, Register_Year FROM membership_register_branch WHERE Register_Year = "2016" OR "Member_ID" != 7 AND Branch_ID != "5"


Question: Can you give me the total bonus and average employee ID for each award year, first for employees who aren't employee 2 or didn't get the award in 2015, and then separately for employees who aren't employee 10 and have a bonus less than 3200?

SELECT Year_awarded, SUM(Bonus), AVG(Employee_ID) FROM evaluation WHERE Employee_ID != "2" OR Year_awarded <> "2015" UNION SELECT Year_awarded, SUM(Bonus), AVG(Employee_ID) FROM evaluation WHERE Employee_ID != "10" AND "Bonus" < 3200.0


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

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: Could you list the document IDs from the drafts table where the draft number is less than zero and the draft details are not "k", combined with the document IDs from the documents table where the shipping agent code is not "US" and either the document ID is greater than or equal to 1, the document type code is not "Paper", or the receipt date is not September 15, 1976 at 7:24 PM?

SELECT document_id FROM Document_Drafts WHERE "draft_number" < 0 AND draft_details <> "k" UNION ALL SELECT document_id FROM Documents WHERE shipping_agent_code != "US" AND "document_id" >= 1 OR document_type_code <> "Paper" OR receipt_date <> "1976-09-15 19:24:17"


Question: Which aircraft has an ID of 5 in the aircraft table, but does not have an ID other than 5 in the airport_aircraft table?

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


Question: Can you give me a list of driver IDs less than or equal to 9, excluding driver ID 9 if it's also a school bus driver?

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: Which aircraft IDs are both greater than or equal to 2 when grouped in the aircraft table, and equal to 5 when grouped in the airport_aircraft table?

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


Question: Can you give me a list of aircraft IDs that appear in the aircraft table, excluding aircraft ID 5, but only if they are not also aircraft IDs greater than or equal to 2 that appear in the airport_aircraft table?

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


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

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


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

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


Question: Which driver IDs are greater than or equal to 6, but not less than or equal to 4, considering only the driver and school bus tables?

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 airport names that are not in Billund, or don't have an ICAO code of EBBR, or don't have an IATA code of BLL, or aren't named "Billund Airport", combined with a list of operating company names that aren't "CLS Catering Services Limited" and whose principal activity is ground handling, or whose type is not "Subsidiary", or that are not incorporated in Vietnam?

Cathay Pacific Catering Services (HK) Limited

SELECT name FROM airport WHERE City <> "Billund" AND ICAO != "EBBR" OR IATA <> "BLL" AND name != "Billund Airport" UNION ALL SELECT name FROM operate_company WHERE name <> "CLS Catering Services Limited" AND Principal_activities = "Ground handling" OR Type <> "Subsidiary" OR Incorporated_in <> "Vietnam"


Question: Can you list all document status codes from documents where the other details are "z", the status code is not "done", the document type is not "Paper", the document ID is greater than or equal to 23, the receipt number is "61", or the shipping agent code is not "UP", along with all document status codes from document statuses where the description is "mailed"?

SELECT document_status_code FROM Documents WHERE other_details = "z" OR document_status_code <> "done" OR document_type_code != "Paper" OR "document_id" >= 23 OR receipt_number = "61" OR shipping_agent_code != "UP" UNION ALL SELECT document_status_code FROM Ref_Document_Status WHERE document_status_description = "mailed"


Question: Can you give me the driver ID of drivers with ID 10, excluding the driver IDs of school bus drivers with IDs up to 7?

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


Question: Can you list all car makers that are not from country code 1 and have the full name "Chrysler", and also list all car makers from the model list where the maker is not 13 or the model ID is 10 or greater?

SELECT Maker FROM car_makers WHERE Country != "1" AND FullName = "Chrysler" UNION ALL SELECT Maker FROM model_list WHERE "Maker" != 13 OR "ModelId" >= 10


Question: Could you give me the document IDs from the Documents table, excluding any document IDs that are also in the Draft_Copies table, where in Documents the other details are "y", the receipt number is "114", the receipt date is "2008-04-21 20:42:25", the document status code is "working" and the shipping agent code is "US" and the document type code is not "Hard Drive", or the document ID is not 14, and in Draft_Copies the document ID is 4 or the draft number is less than or equal to 12?

SELECT document_id FROM Documents WHERE other_details = "y" OR receipt_number = "114" OR receipt_date = "2008-04-21 20:42:25" OR document_status_code = "working" AND shipping_agent_code = "US" AND document_type_code <> "Hard Drive" OR "document_id" != 14 EXCEPT SELECT document_id FROM Draft_Copies WHERE "document_id" = 4 OR "draft_number" <= 12


Question: What is the total school ID for schools that meet at least one of these conditions: are not in St. Joseph County and are located in Bourbon, are in IHSAA Class AA and have a school ID other than 2 and an enrollment of at least 605 and are not named Glenn, or are not in IHSAA Football Class AAA, excluding the total school ID from endowments with an amount not equal to 8.33?

SELECT SUM(School_id) FROM School WHERE County <> "71 St. Joseph" AND Location = "Bourbon" OR IHSAA_Class = "AA" AND School_id <> "2" AND "Enrollment" >= 605 AND School_name != "Glenn" OR IHSAA_Football_Class <> "AAA" EXCEPT SELECT SUM(School_id) FROM endowment WHERE "amount" <> 8.33


Question: Can you give me a list of driver IDs that are less than 8 and also appear as driver IDs for school buses, excluding driver ID 7?

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


Question: Can you give me the Driver ID from the driver table, but only if that Driver ID is 11, and exclude any Driver IDs from the school_bus table that are less than or equal to 10?

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


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

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


Question: What is the largest store ID from the store district table, excluding those with district ID 15 and store ID 4, after removing the largest store IDs from the store product table where the store ID is greater than 5 and product ID is not 4?

SELECT MAX(Store_ID) FROM store_district WHERE "District_ID" <> 15 AND "Store_ID" <> 4 EXCEPT SELECT MAX(Store_ID) FROM store_product WHERE "Store_ID" > 5 AND "Product_ID" != 4


Question: Which driver IDs are equal to 5 in the driver table, but are not greater than 7 in the school bus table?

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


Question: Can you give me the total IHSAA football class size, the number of schools, the average location value, and the total school name value for schools that either have an IHSAA class of AA or don't have an IHSAA football class of A and aren't school ID 4, combined with the same information for schools named Jimtown located in New Carlisle?

SELECT SUM(IHSAA_Football_Class), COUNT(School_id), AVG(Location), SUM(School_name) FROM School WHERE IHSAA_Class = "AA" OR IHSAA_Football_Class != "A" AND School_id <> "4" UNION SELECT SUM(IHSAA_Football_Class), COUNT(School_id), AVG(Location), SUM(School_name) FROM School WHERE School_name = "Jimtown" AND Location = "New Carlisle"


Question: Can you give me the driver IDs that are equal to 6, but only if they are not also driver IDs that are greater 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, excluding driver ID 2, that are not also driver ID 10 in the school bus list?

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 aircraft IDs that are greater than or equal to 4 from the aircraft table, and also list the aircraft IDs that are less than 3 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 < 3


Question: Can you list the aircraft IDs that are less than or equal to 5, but only include those that are also not equal to 3 and are present in the airport aircraft list?

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


Question: Which driver IDs, excluding driver ID 1, are also driver ID 9 in the school bus records?

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: What document type codes are used in documents, excluding "Paper", and are also document type codes with descriptions other than "b"?

SELECT document_type_code FROM Documents WHERE document_type_code != "Paper" INTERSECT SELECT document_type_code FROM Ref_Document_Types WHERE document_type_description <> "b"


Question: Can you give me a list of driver IDs where the ID is 5 or greater from the driver table, combined with a list of driver IDs that are exactly 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: Can you give me the sum of Branch IDs, the earliest Register Year, and the Member ID for all entries in the membership register, combining two sets of results: first, those where the Member ID is 7 or higher, or the Branch ID isn't 5, or the Register Year isn't 2016; and second, those where the Register Year is 2017, or the Branch ID is 2 and the Member ID isn't 3?

SELECT SUM(Branch_ID), MIN(Register_Year), Member_ID FROM membership_register_branch WHERE "Member_ID" >= 7 OR Branch_ID <> "5" OR Register_Year != "2016" UNION ALL SELECT SUM(Branch_ID), MIN(Register_Year), Member_ID FROM membership_register_branch WHERE Register_Year = "2017" OR Branch_ID = "2" AND "Member_ID" != 3


Question: Which driver IDs, less than or equal to 12, are in the driver list but not in the school bus list where the driver ID is 4?

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


Question: Can you give me a list of driver IDs that are less than 4, excluding any 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 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID <> 10


Question: How many employees, excluding Tim Payne and employee ID 2, who are under 40 are there, minus the number of shops in Jakobstad that are not KuPS, or have a manager other than Olli Huttunen, or are not in the Arto Tolsa Areena district?

SELECT COUNT(Name) FROM employee WHERE Name != "Tim Payne" AND "Age" < 40 AND "Employee_ID" <> 2 EXCEPT SELECT COUNT(Name) FROM shop WHERE Location = "Jakobstad" AND Name != "KuPS" OR Manager_name != "Olli Huttunen" OR District <> "Arto Tolsa Areena"


Question: Can you list all the driver IDs from the driver table that are greater than or equal to 1, combined with all the driver IDs from the school_bus table that are less than or equal to 7?

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


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

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID >= 10 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 greater from the driver table, excluding any driver IDs less than 9 that are in the school bus table?

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


Question: Can you give me the template IDs that are used in documents where the document description is not "y" or the other details are "None", but only for templates with a version number of 2 or higher?

SELECT Template_ID FROM Documents WHERE Document_Description <> "y" OR Other_Details = "None" INTERSECT SELECT Template_ID FROM Templates WHERE "Version_Number" >= 2


Question: Can you list the aircraft IDs, excluding aircraft ID 4, from the aircraft table, and also include aircraft ID 1 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 = 1


Question: Can you give me a list of driver IDs that are not equal to 2 from the driver table, excluding any driver IDs less than 10 that are 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 give me a list of driver IDs that are not 12 and are also less than or equal to 10, considering only drivers who appear in both the driver and school bus records?

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


Question: Can you give me the number of ranks, the average club ID, the gender, the number of coach names, and the lowest coach ID for coaches where either the coach's name is Robert Chen and their coach ID is 3 or higher, or their rank isn't 4, their gender isn't male, and their club ID is 3 or lower, but excluding those coaches where either their gender isn't female and their name is Robert Chen, or their coach ID is 5 or lower and their club ID isn't 3?

SELECT COUNT(Rank), AVG(Club_ID), Gender, COUNT(Coach_name), MIN(Coach_ID) FROM coach WHERE Coach_name = "Robert Chen" AND "Coach_ID" >= 3 OR "Rank" <> 4 AND Gender != "M" AND "Club_ID" <= 3 EXCEPT SELECT COUNT(Rank), AVG(Club_ID), Gender, COUNT(Coach_name), MIN(Coach_ID) FROM coach WHERE Gender <> "F" AND Coach_name = "Robert Chen" OR "Coach_ID" <= 5 AND "Club_ID" <> 3


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

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


Question: Can you give me a list of driver IDs that are 10 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 <= 10 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 where the ID is not 1, and those from the school_bus table where the ID is 4 or greater?

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


Question: Can you list each store ID along with its smallest district ID, considering only stores that either aren't store 5 or are in a district other than 15, and combine that with a list of each store ID and its smallest district ID, but only for stores with an ID greater than 2 and in a district greater than 3?

SELECT Store_ID, MIN(District_ID) FROM store_district WHERE "Store_ID" <> 5 OR "District_ID" != 15 UNION SELECT Store_ID, MIN(District_ID) FROM store_district WHERE "Store_ID" > 2 AND "District_ID" > 3


Question: Can you give me a list of driver IDs that are less than 6, excluding any driver IDs that are not 9, considering each driver ID only once?

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


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

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


Question: Can you list the aircraft IDs that are equal to 2 from the aircraft table, and then also list the aircraft IDs that are less than 3 from the airport_aircraft table?

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, including driver ID 6 from the driver table and any driver IDs less than or equal to 9 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: Which customers both made payments of at least 6782.84 using a method other than Direct Debit and also have lessons that either cost something other than 352.0, are scheduled for 3 o'clock, are taught by a staff member other than staff member 11, or are not marked as completed?

SELECT customer_id FROM Customer_Payments WHERE "amount_payment" >= 6782.84 AND payment_method_code <> "Direct Debit" INTERSECT SELECT customer_id FROM Lessons WHERE "price" <> 352.0 OR lesson_time = "3" OR "staff_id" <> 11 OR lesson_status_code <> "Completed"


Question: Could you give me a list of member IDs for members who are level 6 or higher, or whose ID is 10 and don't live in Fort Campbell, Kentucky, excluding those members who are registered at any branch other than branch 1?

SELECT Member_ID FROM member WHERE "Level" >= 6 OR "Member_ID" = 10 AND Hometown != "Fort Campbell, Kentucky" EXCEPT SELECT Member_ID FROM membership_register_branch WHERE Branch_ID <> "1"


Question: Could you show me the effective dates, template ID, template details, template type code, version number, and end dates for all templates where the version number is less than 6 and the template details are empty, combined with the same information for templates where the template ID is 19, the version number is less than 7, and either the end date is not January 5th, 2008 at 2:19 PM or the template details are empty?

SELECT Date_Effective_From, Template_ID, Template_Details, Template_Type_Code, Version_Number, Date_Effective_To FROM Templates WHERE "Version_Number" < 6 AND Template_Details = "" UNION ALL SELECT Date_Effective_From, Template_ID, Template_Details, Template_Type_Code, Version_Number, Date_Effective_To FROM Templates WHERE "Template_ID" = 19 AND "Version_Number" < 7 AND Date_Effective_To <> "2008-01-05 14:19:28" OR Template_Details = ""


Question: Can you give me a list of aircraft IDs, up to and including 2, that appear in the aircraft table, but are not in the airport_aircraft table where the aircraft ID is less than 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 driver IDs that are less than 5 and also appear as driver IDs in the school bus table, excluding driver ID 9?

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


Question: Can you list all the driver IDs that are less than or equal to 3, combining the IDs from both the driver and school_bus lists, but only showing each ID once?

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


Question: Can you give me the middle name, staff address ID, and date joined for staff members, combining two sets of results: first, those named Maiya who didn't leave on March 4, 2018 and aren't named Macejkovic; and second, those who aren't named Clarabelle, or whose staff address ID is greater than 3, or who joined on June 4, 2017 at 2:30 PM with a staff ID of 6 and last name Durgan, or who didn't leave on March 8, 2018 at 5:16 AM, or whose first name isn't Eulalia and were born on January 16, 2003 at 6:29 AM, or whose nickname is sbrown?

SELECT middle_name, staff_address_id, date_joined_staff FROM Staff WHERE date_left_staff <> "2018-03-04 17:13:53" AND middle_name = "Maiya" AND last_name != "Macejkovic" UNION SELECT middle_name, staff_address_id, date_joined_staff FROM Staff WHERE middle_name <> "Clarabelle" AND "staff_address_id" > 3 OR date_joined_staff = "2017-06-04 14:30:41" AND "staff_id" = 6 AND last_name = "Durgan" OR date_left_staff != "2018-03-08 05:16:29" OR first_name != "Eulalia" AND date_of_birth = "2003-01-16 06:29:11" OR nickname = "sbrown"


Question: What is the total number of employees and their corresponding bonuses, excluding those who are 28 years old?

SELECT SUM(T1.Employee_ID), T2.Bonus FROM employee as T1 JOIN evaluation as T2 ON T1.Employee_ID = T2.Employee_ID WHERE "Age" <> 28


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

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


Question: Can you give me the date of birth, earliest last name, nickname, date left staff, average first name, and date joined staff for all staff members, combining two sets of results: the first set excludes staff ID 10 and those named Margie with a staff address ID less than 1, and the second set includes staff meeting any of these conditions: a nickname other than "lsenger", a join date other than "2016-05-01 02:22:45" combined with a birth date of "1996-03-09 08:19:49" and a last name other than "Hermann", a first name other than "Camylle" combined with a staff address ID less than 5, or a leave date of "2018-03-24 10:11:08", or a staff ID less than 7?

SELECT date_of_birth, MIN(last_name), nickname, date_left_staff, AVG(first_name), date_joined_staff FROM Staff WHERE "staff_id" != 10 AND first_name <> "Margie" AND "staff_address_id" < 1 UNION ALL SELECT date_of_birth, MIN(last_name), nickname, date_left_staff, AVG(first_name), date_joined_staff FROM Staff WHERE nickname <> "lsenger" OR date_joined_staff <> "2016-05-01 02:22:45" AND date_of_birth = "1996-03-09 08:19:49" AND last_name != "Hermann" OR first_name <> "Camylle" AND "staff_address_id" < 5 OR date_left_staff = "2018-03-24 10:11:08" OR "staff_id" < 7


Question: Can you give me a list of school IDs, including those from schools that aren't Private Catholic and have an ID of 6 or higher, as well as those from the school bus table where either the school ID isn't 1 and the driver ID is 7 or less, or the years working are more than 3 and the driver is full-time?

SELECT School_ID FROM school WHERE Type <> "Private Catholic" AND "School_ID" >= 6 UNION ALL SELECT School_ID FROM school_bus WHERE "School_ID" <> 1 AND "Driver_ID" <= 7 OR "Years_Working" > 3 AND If_full_time = "T"


Question: Can you give me a list of contestant numbers, including those for Allie Rogalski or any contestant with a number greater than 1, combined with contestant numbers from votes where the vote ID is less than 3, or the vote was not created on March 9, 2018 at 7:03:36 PM, or the phone number is less than 6209222712, the state is not NY, and the contestant number is 5?

SELECT contestant_number FROM CONTESTANTS WHERE contestant_name = "Allie Rogalski" OR "contestant_number" > 1 UNION ALL SELECT contestant_number FROM VOTES WHERE "vote_id" < 3 OR created != "2018-03-09 19:03:36" OR "phone_number" < 6209222712 AND state <> "NY" AND "contestant_number" = 5


Question: Can you give me the number of properties, the average of hse_feature_3, the sum of fld_feature_2, the property address, fld_feature_3, and the agreed selling price for properties that meet certain criteria, specifically where shp_feature_2 is not "None" or the property address is not "092 Paucek Highway Apt. 772 East Erika, IA 61358" and hse_feature_2 is not "None" or shp_feature_1 is not "None" or fld_feature_3 is "None", combined with the same information for properties where the vendor requested price is less than or equal to 2573 and apt_feature_2 is "est" or apt_feature_1 is not "consequatur" and the property address is not "084 Lakin Vista Apt. 394 Fishertown, MA 16876" or the property type code is not "Other" or oth_feature_2 is not "None" and the date on market is not "1978-05-15 10:53:37" or the property name is "riverside" or fld_feature_3 is not "None" and apt_feature_3 is not "None" or the property ID is not 4 or the date sold is not "1995-01-31 11:18:42" and hse_feature_1 is not "None" or fld_feature_2 is "None" and fld_feature_1 is not "None"?

4745 Emerson Stravenue Suite 829
South Garret, IN 16772-5682

SELECT COUNT(property_id), AVG(hse_feature_3), SUM(fld_feature_2), property_address, fld_feature_3, agreed_selling_price FROM Properties WHERE shp_feature_2 <> "None" OR property_address <> "092 Paucek Highway Apt. 772 East Erika, IA 61358" AND hse_feature_2 <> "None" OR shp_feature_1 <> "None" OR fld_feature_3 = "None" UNION ALL SELECT COUNT(property_id), AVG(hse_feature_3), SUM(fld_feature_2), property_address, fld_feature_3, agreed_selling_price FROM Properties WHERE "vendor_requested_price" <= 2573.0 AND apt_feature_2 = "est" OR apt_feature_1 != "consequatur" AND property_address != "084 Lakin Vista Apt. 394 Fishertown, MA 16876" OR property_type_code <> "Other" OR oth_feature_2 <> "None" AND date_on_market != "1978-05-15 10:53:37" OR property_name = "riverside" OR fld_feature_3 <> "None" AND apt_feature_3 <> "None" OR "property_id" != 4 OR date_sold != "1995-01-31 11:18:42" AND hse_feature_1 <> "None" OR fld_feature_2 = "None" AND fld_feature_1 != "None"


Question: Can you give me the driver IDs that are both less than 7 and also less than or equal to 3?

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


Question: Can you give me a list of driver IDs that are less than 12, and also include driver ID 3?

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


Question: Can you give me a list of driver IDs that are greater than 11, excluding any driver IDs that are also greater than or equal to 7 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: What is the difference between the total Coach IDs of coaches who are not ranked 1, or whose name is not Joe Fabbri, or whose Coach ID is 4, and the total Coach IDs of player coaches who did not start in 2010, whose Coach ID is less than or equal to 1, and whose Player ID is greater than 10?

SELECT SUM(Coach_ID) FROM coach WHERE "Rank" != 1 OR Coach_name != "Joe Fabbri" OR "Coach_ID" = 4 EXCEPT SELECT SUM(Coach_ID) FROM player_coach WHERE "Starting_year" <> 2010 AND "Coach_ID" <= 1 AND "Player_ID" > 10


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

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 list all the driver IDs that are less than 9 from the driver table, and combine that with a list of 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 list the aircraft IDs that are less than or equal to 3 and appear in both the aircraft and airport_aircraft tables, considering only aircraft IDs less than 3 in the airport_aircraft table?

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


Question: Can you give me the Lieutenant Governor, Comptroller, Year, Attorney General, Party ID, and Governor from the party table, excluding any entries where the Comptroller isn't Alan Hevesi or the US Senate result was no election, but including only those where the year is 2006 or later, or the Attorney General isn't Eliot Spitzer and the Party ID is 6 or greater, or the Lieutenant Governor isn't Jonathan Reiter, or the Governor is Tom Golisano and the US Senate result is Charles Schumer, or the Comptroller is Alan Hevesi?

David Paterson
Alan Hevesi
2006
Andrew Cuomo
5
Eliot Spitzer

David Paterson
Alan Hevesi
2006
Andrew Cuomo
7
Eliot Spitzer

David Paterson
Alan Hevesi
2006
Jeanine Pirro
6
Eliot Spitzer

SELECT Lieutenant_Governor, Comptroller, Year, Attorney_General, Party_ID, Governor FROM party WHERE "Year" >= 2006.0 OR Attorney_General <> "Eliot Spitzer" AND "Party_ID" >= 6 OR Lieutenant_Governor != "Jonathan Reiter" OR Governor = "Tom Golisano" AND US_Senate = "Charles Schumer" OR Comptroller = "Alan Hevesi" EXCEPT SELECT Lieutenant_Governor, Comptroller, Year, Attorney_General, Party_ID, Governor FROM party WHERE Comptroller != "Alan Hevesi" OR US_Senate = "(no election)"


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


Question: Can you list the aircraft IDs, first from the aircraft table excluding ID 2, and then from the airport_aircraft table including only those greater than 2, combining the two lists?

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 registration years from the membership register, including those that are not 2016 where the member ID is at least 7 or the branch ID is not 8, and also including those that are 2017 where the branch ID is not 1 and the member ID is greater than 4?

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


Question: Can you give me a list of driver IDs, up to 10, that are in the driver table but not in the school_bus table where the driver ID is greater than 7?

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


Question: Can you list the aircraft IDs that appear in the aircraft table, excluding aircraft ID 1, but are not found in the airport_aircraft table, also excluding aircraft ID 1?

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


Question: Can you list the aircraft IDs, first from the aircraft table excluding aircraft ID 3, and then from the airport_aircraft table including only aircraft IDs up to 3, removing 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: Could you give me a list of driver IDs, including those of drivers who are not 46 years old, as well as those of school bus drivers with a school ID of 3 or higher who have worked for a number of years other than 6 and whose driver ID is not 3?

SELECT Driver_ID FROM driver WHERE "Age" <> 46 UNION ALL SELECT Driver_ID FROM school_bus WHERE "School_ID" >= 3 AND "Years_Working" != 6 AND "Driver_ID" != 3


Question: Which driver IDs, excluding 11, are also driver IDs greater than 7 that are used in school buses?

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


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 exactly 4 from the school bus table?

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


Question: Can you list the aircraft IDs that are greater than or equal to 3 from the aircraft table, and also list the aircraft IDs that are less than or equal to 2 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 <= 2


Question: Can you list the aid values from the certificate table where the eid is not 550156548 or the aid is less than 2, and also list the aid values from the flight table where the arrival date is "04/12/2005 03:55" and the price is no more than 425.98?

SELECT aid FROM certificate WHERE "eid" != 550156548 OR "aid" < 2 UNION ALL SELECT aid FROM flight WHERE arrival_date = "04/12/2005 03:55" AND "price" <= 425.98


Question: Can you list the aircraft IDs that are less than 5, but exclude any aircraft IDs from the airport aircraft list that are 5 or greater?

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: Which aircraft IDs, not exceeding 5, are present in both the aircraft and airport_aircraft datasets?

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


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

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 a list of driver IDs that are less than 11, excluding those driver IDs that are 3 or less, based on the drivers and school bus tables?

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


Question: Can you give me a list of Club IDs, combining those from clubs named "BK Häcken" that either have a Club ID less than 3 and started in 2009, or are not from the USA, with those from match results where Big Silver is 14, Bronze is less than or equal to 7, the Club ID is not 4, Small Silver is less than 10, and Gold is less than or equal to 20?

SELECT Club_ID FROM club WHERE Club_name = "BK Häcken" AND "Club_ID" < 3 AND "Start_year" = 2009 OR Region != "USA" UNION SELECT Club_ID FROM match_result WHERE "Big_Silver" = 14 AND "Bronze" <= 7 AND "Club_ID" <> 4 AND "Small_Silver" < 10 AND "Gold" <= 20


Question: Can you tell me the smallest club location and club ID for clubs named "Hopkins Student Enterprises" located in "HHH" or for any club that doesn't have the description "A competitive tennis club," along with the smallest club location and club ID for any club that doesn't have the description "Play pen and paper games on campus"?

SELECT MIN(ClubLocation), ClubID FROM Club WHERE ClubLocation = "HHH" AND ClubName = "Hopkins Student Enterprises" OR ClubDesc != "A competitive tennis club." UNION ALL SELECT MIN(ClubLocation), ClubID FROM Club WHERE ClubDesc <> "Play pen and paper games on campus."


Question: Can you give me a list of customer IDs for customers who either became customers on "2016-09-04 23:08:20", were born on "1998-12-15 13:24:40", don't have the last name "Ortiz", have a "Bad Customer" status, are not customer ID 7, have an amount outstanding of at least 9443.0, or have an email address other than "nichole59@example.com", a cell phone number other than "739-333-6966x187", a phone number other than "192-395-2411", or a customer address ID of 10 or less, along with a list of customer IDs from lessons that didn't occur on "2018-03-04 06:55:46"?

SELECT customer_id FROM Customers WHERE date_became_customer = "2016-09-04 23:08:20" AND date_of_birth = "1998-12-15 13:24:40" AND last_name <> "Ortiz" AND customer_status_code = "Bad Customer" AND "customer_id" <> 7 AND "amount_outstanding" >= 9443.0 OR email_address <> "nichole59@example.com" OR cell_mobile_phone_number != "739-333-6966x187" OR phone_number <> "192-395-2411" OR "customer_address_id" <= 10 UNION ALL SELECT customer_id FROM Lessons WHERE lesson_date != "2018-03-04 06:55:46"


Question: Can you list the aircraft IDs that are greater than or equal to 4, excluding those aircraft IDs that are less than or equal to 1 and are also found in the airport aircraft list?

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: Can you give me the driver IDs that are equal to 10, but excluding those driver IDs that are equal to 7 in the school bus table?

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


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

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


Question: Can you give me a list of driver IDs, including those from the driver table where the ID is greater than 7, and those from the school bus table where the ID is 4 or greater?

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 a list of driver IDs that are less than 4 and also appear as driver IDs in the school bus table, excluding driver ID 7?

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


Question: 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: Can you give me a list of driver IDs less than 10, excluding those driver IDs that are also greater than 3 in the school bus list?

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 list all the aircraft IDs, excluding aircraft ID 5, and also list all the aircraft IDs from the airport aircraft list, excluding aircraft ID 2?

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: Which driver IDs, excluding driver ID 9, are also driver ID 10 in the school bus list?

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


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

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


Question: Can you list the aircraft IDs, including aircraft ID 1 from the aircraft table and any aircraft IDs greater than 2 from the airport_aircraft table?

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


Question: Can you give me a list of driver IDs, including those from the driver table that are greater than or equal to 1, combined with those from the school_bus table that are greater than 10?

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