Question: What are the driver IDs greater than 3 that are not also driver IDs less 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: Give me the shop ID, full-time status, and employee ID for employees who are not employee 2, are not full-time, and started in 2008, or for shops with an ID less than 5. Also, include the shop ID, full-time status, and employee ID for employees with an ID less than 7.

SELECT Shop_ID, Is_full_time, Employee_ID FROM hiring WHERE "Employee_ID" <> 2 AND Is_full_time = "F" AND Start_from = "2008" OR "Shop_ID" < 5 UNION ALL SELECT Shop_ID, Is_full_time, Employee_ID FROM hiring WHERE "Employee_ID" < 7


Question: What are the driver IDs greater than 3 from the driver table, combined with the driver IDs greater than 7 from the school bus table?

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


Question: What are the club IDs of Halmstads BK if they are not in the USA, have a start year of 2005 or later, and have a club ID of 6, combined with the club IDs of coaches whose rank is greater than 5 or whose club ID is not 3 and coach ID is less than or equal to 5?

SELECT Club_ID FROM club WHERE Region <> "USA" AND "Club_ID" = 6 AND Club_name = "Halmstads BK" AND "Start_year" >= 2005 UNION SELECT Club_ID FROM coach WHERE "Rank" > 5 OR "Club_ID" <> 3 AND "Coach_ID" <= 5


Question: What are the driver IDs that are either 2 or less than 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: What are the district IDs, either where the store ID is not 2 or the district ID is greater than 4, and also where the district ID is 15 or less?

SELECT District_ID FROM store_district WHERE "Store_ID" != 2 OR "District_ID" > 4 UNION ALL SELECT District_ID FROM store_district WHERE "District_ID" <= 15


Question: What are the aircraft IDs that are less than 3, but not those aircraft IDs that are greater than 5, considering only the aircraft and airport_aircraft tables?

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: What are the aircraft IDs, excluding aircraft ID 5, and also the aircraft IDs from airport-aircraft, excluding aircraft ID 1?

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


Question: What are the document IDs from the Documents_Mailed table that were mailed on April 1, 1977, at 5:03:50 PM, excluding document ID 24 or with a mailed to address ID greater than or equal to 2, combined with the document IDs from the Draft_Copies table where the draft number is greater than 20 and the copy number is greater than or equal to 5?

SELECT document_id FROM Documents_Mailed WHERE mailing_date = "1977-04-01 17:03:50" AND "document_id" <> 24 OR "mailed_to_address_id" >= 2 UNION SELECT document_id FROM Draft_Copies WHERE "draft_number" > 20 AND "copy_number" >= 5


Question: What is the highest rank from the match results where the club ID is not 4 and the points are not 139, or the gold is 6, or the small silver is not 4, combined with the highest rank from the players where the gender is female and the residence is not Oakbank, or the sponsor name is not Saint Boniface, or the occupation is retired and the rank is not 1st, or the player name is not Pat Martin and the player ID is less than 11?

SELECT MAX(Rank) FROM match_result WHERE "Club_ID" <> 4 AND "Points" <> 139 OR "Gold" = 6 OR "Small_Silver" <> 4 UNION ALL SELECT MAX(Rank) FROM player WHERE Gender = "F" AND Residence != "Oakbank" OR Sponsor_name <> "Saint Boniface" OR Occupation = "Retired" AND Rank <> "1st" OR Player_name != "Pat Martin" AND "Player_ID" < 11


Question: What are the aircraft IDs, excluding ID 3, from the aircraft table, combined with aircraft IDs greater 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: What are the aircraft IDs that are not 4 and are not present in the airport_aircraft table with an ID other than 5?

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


Question: Which driver IDs, excluding driver ID 6, are in the driver table, and which driver IDs, including driver ID 4 and above, are in 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 >= 4


Question: What are the document IDs from the Documents table that are not "Hard Drive" documents, don't have "h" in their other details, aren't shipped by "US", and weren't received on "2015-04-03 09:36:19", or have a document ID less than 24, or have a document status that is not "working", or have a receipt number of "34"? Also, what are the document IDs from the Draft_Copies table where the copy number is less than 6, the draft number is less than 8, and the document ID is 20 or less? Combine all these document IDs together.

SELECT document_id FROM Documents WHERE document_type_code <> "Hard Drive" AND other_details <> "h" AND shipping_agent_code <> "US" AND receipt_date <> "2015-04-03 09:36:19" OR "document_id" < 24 OR document_status_code <> "working" OR receipt_number = "34" UNION ALL SELECT document_id FROM Draft_Copies WHERE "copy_number" < 6 AND "draft_number" < 8 AND "document_id" <= 20


Question: Which driver IDs are greater than 11 or equal to 7, considering driver and school bus information separately?

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


Question: What is the average aircraft ID for British Aerospace Jetstream 41 aircraft that don't have a distance of 1805, excluding the average aircraft ID from certificates associated with employee ID 567354612?

SELECT AVG(aid) FROM aircraft WHERE "distance" <> 1805 AND name = "British Aerospace Jetstream 41" EXCEPT SELECT AVG(aid) FROM certificate WHERE "eid" = 567354612


Question: Which driver IDs are less than 11 but not present in the school bus table with IDs less than or equal to 9?

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


Question: What is the maximum writer and average title length for books that are not "The Black Lamb", excluding those where "Issues" is not equal to 12?

SELECT MAX(Writer), AVG(Title) FROM book WHERE Title != "The Black Lamb" EXCEPT SELECT MAX(Writer), AVG(Title) FROM book WHERE "Issues" <> 12.0


Question: What are the driver IDs that are greater than or equal to 5, excluding those driver IDs that are less than or equal to 7?

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


Question: What are the driver IDs, excluding driver ID 11, from the driver table, combined with driver IDs from the school bus table that are less than or equal to 4?

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


Question: What are the aircraft IDs that are not 4 and also appear in the airport_aircraft table with an ID of 5?

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


Question: What are the years of employment for people with IDs less than 7 and working in year 1, combined with the years of employment for those with company IDs less than or equal to 13, or working in year 2 or later, or with people IDs greater than 2?

SELECT Year_working FROM employment WHERE "People_ID" < 7 AND "Year_working" = 1 UNION ALL SELECT Year_working FROM employment WHERE "Company_ID" <= 13 OR "Year_working" >= 2 OR "People_ID" > 2


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

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


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

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


Question: Could you give me the IDs of companies that either don't have profits of 11.1 billion, or don't have a market value of 294.7 billion, or are in the Banking industry, but only if those companies also have employees with IDs greater than or equal to 2?

SELECT Company_ID FROM company WHERE "Profits_in_Billion" != 11.1 OR "Market_Value_in_Billion" != 294.7 OR Industry = "Banking" INTERSECT SELECT Company_ID FROM employment WHERE "People_ID" >= 2


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

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


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

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


Question: Can you give me the driver ID that is exactly 8, but only if that driver ID is not also 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: Which driver IDs, excluding driver ID 7, are also school bus driver IDs, excluding school bus driver ID 9?

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


Question: Can you give me the paragraph text, paragraph ID, document ID, and other details for all paragraphs where the document ID is less than 3, combined with the paragraph text, paragraph ID, document ID, and other details for paragraphs where the document ID is not 80, or the paragraph ID is greater than 510442723, or the other details are not "None"?

SELECT Paragraph_Text, Paragraph_ID, Document_ID, Other_Details FROM Paragraphs WHERE "Document_ID" < 3 UNION SELECT Paragraph_Text, Paragraph_ID, Document_ID, Other_Details FROM Paragraphs WHERE "Document_ID" != 80 OR "Paragraph_ID" > 510442723 OR Other_Details <> "None"


Question: Could you list the staff IDs from the Lessons table where the lesson time isn't "2", or the vehicle ID isn't 2 and the customer ID is 13, or the price is at least 223 and the lesson ID is greater than 12, or the staff ID is at most 11 and the lesson status code isn't "Cancelled", and also include all staff IDs from the Staff table where the middle name is "Duane"?

SELECT staff_id FROM Lessons WHERE lesson_time <> "2" OR "vehicle_id" != 2 AND "customer_id" = 13 OR "price" >= 223.0 AND "lesson_id" > 12 OR "staff_id" <= 11 AND lesson_status_code != "Cancelled" UNION ALL SELECT staff_id FROM Staff WHERE middle_name = "Duane"


Question: Can you give me the total School IDs for schools in Elkhart that are not in the AAA football class, or don't have the mascot "Lancers", aren't in "75 Starke" county, and aren't in the AAA class, combined with the total School IDs from the budget table where the budget invested percent is 42.9, or the year isn't 2003, or the budgeted amount is less than or equal to 3666, or the School ID is 5, or the invested amount is less than or equal to 2134?

SELECT SUM(School_id) FROM School WHERE IHSAA_Football_Class <> "AAA" OR Mascot != "Lancers" AND County <> "75 Starke" AND IHSAA_Class <> "AAA" AND Location = "Elkhart" UNION SELECT SUM(School_id) FROM budget WHERE Budget_invested_percent = "42.9" OR "Year" != 2003 AND "Budgeted" <= 3666 OR "School_id" = 5 OR "Invested" <= 2134


Question: What aircraft IDs are greater than 2 when grouped, excluding aircraft IDs greater than 1 when grouped in the airport aircraft table?

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


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


Question: Could you show me the receipt number, other details, receipt date, document status code, shipping agent code, document ID, and document type code for all documents where the receipt number is 37, or the shipping agent code is UP and the document status is overdue, along with the same information for documents where the other details are "w" and the receipt date is September 15, 1976 at 7:24 PM?

SELECT receipt_number, other_details, receipt_date, document_status_code, shipping_agent_code, document_id, document_type_code FROM Documents WHERE receipt_number = "37" OR shipping_agent_code = "UP" AND document_status_code = "overdue" UNION SELECT receipt_number, other_details, receipt_date, document_status_code, shipping_agent_code, document_id, document_type_code FROM Documents WHERE other_details = "w" AND receipt_date = "1976-09-15 19:24:17"


Question: Can you list all vehicle details, excluding "Truck", and also list vehicle details excluding "Car" or where the vehicle ID is not 3?

SELECT vehicle_details FROM Vehicles WHERE vehicle_details != "Truck" UNION SELECT vehicle_details FROM Vehicles WHERE vehicle_details != "Car" OR "vehicle_id" <> 3


Question: Could you give me the IDs that are both album IDs with an artist ID less than or equal to 90, and media type IDs that are either 3 or have a name that isn't "MPEG audio file"?

SELECT id FROM albums WHERE "artist_id" <= 90 INTERSECT SELECT id FROM media_types WHERE "id" = 3 OR name <> "MPEG audio file"


Question: Can you give me a list of driver IDs that are less than or equal to 2, and also a list of driver IDs from the school bus table that are greater than 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: Can you list the names of companies with sales of at least 145.9 billion or a Company ID of 15, or that are not in the Banking industry, along with the names of people who didn't graduate from Northeastern or whose People ID is not 6?

SELECT Name FROM company WHERE "Sales_in_Billion" >= 145.9 AND "Company_ID" = 15.0 OR Industry != "Banking" UNION ALL SELECT Name FROM people WHERE Graduation_College <> "Northeastern" OR "People_ID" <> 6


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

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


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

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


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

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


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

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


Question: Can you give me a list of driver IDs that are less than 8 from the driver table, combined with a list of driver IDs that are less than 4 from the school bus table, making sure to only include each driver ID once?

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


Question: Could you list the titles and IDs of items with ID 4 that are not named "pear", excluding any items with titles of "blue hoodie" and IDs other than 3?

SELECT title, i_id FROM item WHERE "i_id" = 4 AND title != "pear" EXCEPT SELECT title, i_id FROM item WHERE "i_id" <> 3 AND title = "blue hoodie"


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

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


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

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: For aircraft that are not Airbus A319 and have an employee ID of 142519864, can you list the aircraft IDs from both the aircraft and certificate tables, grouping by employee ID?

SELECT T1.aid, T2.aid FROM aircraft as T1 JOIN certificate as T2 ON T1.aid == T2.aid GROUP BY eid HAVING name <> "Airbus A319" AND eid = 142519864


Question: Can you give me a list of driver IDs that are 12 or less, excluding any driver IDs that appear in the school bus list, except for driver ID 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 appear in the driver table, excluding driver ID 12, and also appear as driver ID 3 in the school bus table?

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


Question: Which driver IDs are not 9 and are also not 3?

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


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

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

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


Question: Can you give me a list of all the driver IDs, excluding driver ID 7, that appear in either the driver list or the school bus list?

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


Question: What is the average club ID and the student ID for members of the "Bootup Baltimore" club, grouped by club location, specifically for clubs located in "AKW"?

SELECT AVG(T1.ClubID), T2.StuID FROM Club as T1 JOIN Member_of_club as T2 ON T1.ClubID = T2.ClubID WHERE ClubName = "Bootup Baltimore" GROUP BY ClubLocation HAVING ClubLocation = "AKW"


Question: Can you list all the feature type codes from the Other_Available_Features table where the feature description is not "Swimming Pool.", or the feature name is "Pool", or the feature type code is not "Security", or the feature ID is greater than 3, combined with all the feature type codes from the Ref_Feature_Types table that are not "Security"?

SELECT feature_type_code FROM Other_Available_Features WHERE feature_description <> "Swimming Pool." OR feature_name = "Pool" OR feature_type_code <> "Security" OR "feature_id" > 3 UNION SELECT feature_type_code FROM Ref_Feature_Types WHERE feature_type_code <> "Security"


Question: Which driver IDs, excluding driver ID 7, are in the driver table but not 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 <> 7


Question: Can you give me a list of driver IDs less than or equal to 10 from the driver table, excluding any driver IDs greater than 10 that are 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 list the aircraft IDs that are greater than 4, excluding those aircraft IDs that are less than or equal to 3 and also appear 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 <= 3


Question: What are the average district IDs for each store, considering only stores with IDs of 1 or higher, or districts with an ID of 3, combined with the average district IDs for each store, considering only districts that don't have an ID of 15?

SELECT Store_ID, AVG(District_ID) FROM store_district WHERE "Store_ID" >= 1 OR "District_ID" = 3 UNION SELECT Store_ID, AVG(District_ID) FROM store_district WHERE "District_ID" != 15


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

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


Question: Which driver IDs are both not equal to 6 and greater 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: Can you give me a list of driver IDs from the driver table where the driver ID is greater than 12, combined with a list of driver IDs from the school_bus table where the driver ID is 9?

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


Question: What is the smallest aircraft ID associated with each airport ID, excluding airport ID 9?

SELECT MIN(T1.Aircraft_ID), T2.Airport_ID FROM aircraft as T1 JOIN airport_aircraft as T2 ON T1.Aircraft_ID = T2.Aircraft_ID WHERE "Airport_ID" <> 9


Question: Which aircraft IDs, excluding aircraft ID 3, are also aircraft IDs less than 5 that are associated with airports?

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


Question: Can you list the aircraft IDs that appear more than once in the aircraft table, excluding aircraft ID 1, but then remove any aircraft IDs from that list that also appear more than once in the airport_aircraft table with an aircraft ID greater than 3?

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


Question: Could you give me a list of shipping agent codes from the Documents table where either the other details are not "p", the document status is not "done", the receipt date is not "1996-07-27 03:30:40", the document ID is 17, and the document type is not "Paper", and the shipping agent code is "FE", but excluding any shipping agent codes that are also in the Ref_Shipping_Agents table where the shipping agent name is not "UPS"?

SELECT shipping_agent_code FROM Documents WHERE other_details != "p" OR document_status_code <> "done" AND receipt_date != "1996-07-27 03:30:40" AND "document_id" = 17 AND document_type_code != "Paper" AND shipping_agent_code = "FE" EXCEPT SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name <> "UPS"


Question: Can you give me the rank, rating, and i_id from the review table for all entries where the rank is exactly 6, combined with all entries where the rank is less than 7?

SELECT rank, rating, i_id FROM review WHERE "rank" = 6 UNION SELECT rank, rating, i_id FROM review WHERE "rank" < 7


Question: Which aircraft IDs belong to both Airbus A320 aircraft and certificates that are not certificate ID 2?

SELECT aid FROM aircraft WHERE name = "Airbus A320" INTERSECT SELECT aid FROM certificate WHERE "aid" <> 2


Question: What is the highest club ID and the gender of coaches, considering only coaches who are male, or clubs that are not named "Gefle IF", or coaches named "James Wong" where the average start year is no more than 2011 and the region is the "UK" and the minimum rank is no more than 1, or coaches with an ID of 4 or greater?

SELECT MAX(T1.Club_ID), T2.Gender FROM club as T1 JOIN coach as T2 ON T1.Club_ID = T2.Club_ID WHERE Gender = "M" OR Club_name <> "Gefle IF" OR Coach_name = "James Wong" AND AVG(Start_year) <= 2011 AND Region = "UK" AND MIN(Rank) <= 1 OR Coach_ID >= 4


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


Question: Can you give me a list of driver IDs, excluding driver ID 12 from the driver table and excluding driver ID 7 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 != 7


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

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


Question: Could you list the County IDs for counties named Manning, excluding those with a population less than 21,000 and a zip code of D21?

SELECT County_Id FROM county WHERE County_name = "Manning" NOT IN (SELECT County_Id FROM county WHERE "Population" < 21000.0 AND Zip_code = "D21")


Question: Can you give me the branch IDs for branches that either opened in 2013, are located on Cecilia Avenue, have a membership amount other than 11, or have a Branch ID greater than 1 and are located in London, excluding any branch IDs from the membership register that were registered in 2016 and have a Branch ID of 1?

SELECT Branch_ID FROM branch WHERE Open_year = "2013" OR Address_road = "Cecilia Avenue" OR membership_amount != "11" OR "Branch_ID" > 1 AND City = "London" EXCEPT SELECT Branch_ID FROM membership_register_branch WHERE Register_Year = "2016" AND Branch_ID = "1"


Question: Which driver IDs, that are less than 10, are present in both the driver list and the school bus list?

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


Question: For books published by Thomson Reuters, can you show me each book's ID and its price, grouped by the writer?

SELECT T1.Book_ID, T2.Price FROM book as T1 JOIN publication as T2 ON T1.Book_ID == T2.Book_ID GROUP BY Writer HAVING Publisher = "Thomson Reuters"


Question: Can you list all aircraft IDs that are greater than or equal to 3, considering both the aircraft and airport aircraft datasets?

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


Question: Can you give me a list of driver IDs that are not equal to 4, but exclude any driver IDs that are less than 10 and are also in the school bus driver list?

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: Which driver IDs are equal to 5, but not less than or equal to 7 in the school bus list?

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


Question: Can you show me the description, total disk area, aircraft ID, and max disk loading for aircraft that are either Robinson R-22s with an aircraft ID of 5 or less, or have a description that isn't "Turboshaft utility helicopter", combined with aircraft that either have a description that isn't "Turboshaft utility helicopter", or are Bell 206B3 JetRangers with an aircraft ID greater than 5, a max disk loading that isn't "14.5 lb/ft² (71 kg/m²)", and a total disk area that isn't "8,495 ft² (789 m²)", or have a max gross weight that isn't "1,370 lb (635 kg)"?

Heavy-lift helicopter
4,900 ft² (460 m²)
5
15 lb/ft² (72 kg/m²)

Heavy-lift helicopter
8,495 ft² (789 m²)
4
14.5 lb/ft² (71 kg/m²)

Light utility helicopter
497 ft² (46.2 m²)
1
2.6 lb/ft² (14 kg/m²)

Tandem rotor helicopter
5,655 ft² (526 m²)
3
8.8 lb/ft² (43 kg/m²)

Turboshaft utility helicopter
872 ft² (81.1 m²)
2
3.7 lb/ft² (18 kg/m²)

SELECT Description, Total_disk_area, Aircraft_ID, Max_disk_Loading FROM aircraft WHERE "Aircraft_ID" <= 5 AND Aircraft = "Robinson R-22" OR Description != "Turboshaft utility helicopter" UNION SELECT Description, Total_disk_area, Aircraft_ID, Max_disk_Loading FROM aircraft WHERE Description != "Turboshaft utility helicopter" OR "Aircraft_ID" > 5 AND Aircraft = "Bell 206B3 JetRanger" AND Max_disk_Loading != "14.5 lb/ft² (71 kg/m²)" AND Total_disk_area <> "8,495 ft² (789 m²)" OR Max_Gross_Weight != "1,370 lb (635 kg)"


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

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 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: Can you list the continent and country ID for countries where either the continent number is less than 4 or the country name is "uk" and the country ID is less than 4, and also list the continent and country ID for countries where the country name is "germany" or the continent number is 2 or greater?

SELECT Continent, CountryId FROM countries WHERE "Continent" < 4 OR CountryName = "uk" AND "CountryId" < 4 UNION ALL SELECT Continent, CountryId FROM countries WHERE CountryName = "germany" OR "Continent" >= 2


Question: Which driver IDs are both greater than 7 in the driver table and greater than 4 in the school_bus table?

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


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

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: Could you list the document IDs and draft numbers from the circulation history for entries where the draft number is less than 1, the copy number is 5, the employee ID is 2 or greater, or the document ID is 2 or greater, combined with a list of document IDs and draft numbers from the document drafts where the draft number is less than 9 and the draft details are not "r"?

SELECT document_id, draft_number FROM Circulation_History WHERE "draft_number" < 1 OR "copy_number" = 5 OR "employee_id" >= 2 OR "document_id" >= 2 UNION ALL SELECT document_id, draft_number FROM Document_Drafts WHERE "draft_number" < 9 AND draft_details <> "r"


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

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 list the aircraft IDs that are greater than or equal to 2, and also list the aircraft IDs from the airport aircraft table that are not equal to 5?

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


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

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


Question: Can you give me the ID of aircraft that has an ID of 3, excluding any aircraft that has an ID of 2 and is associated with an airport?

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


Question: Can you list all the role descriptions, including those that are not "Photo" or have a role code of "PR", and also include any role descriptions that are not "Editor"?

SELECT role_description FROM Roles WHERE role_description != "Photo" OR role_code = "PR" UNION SELECT role_description FROM Roles WHERE role_description <> "Editor"


Question: Which driver has an ID of 9 and also drives a school bus, but not one with an ID of 3?

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


Question: What is the earliest city name among employees who live in Wasps, and also the earliest city name among all employees except those with ID 10 or those not living in Bath or those not named Matt Stevens?

SELECT MIN(City) FROM employee WHERE City = "Wasps" UNION ALL SELECT MIN(City) FROM employee WHERE "Employee_ID" != 10 OR City != "Bath" OR Name != "Matt Stevens"


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

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


Question: Can you give me a list of driver IDs, first from the driver table excluding driver ID 3, and then from the school bus table excluding driver ID 4, combining the two lists and removing any duplicates?

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


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

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


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

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: What role codes are assigned to employees with "v" in their other details or an employee ID of 2 or greater, but are not associated with the role description "Photo"?

SELECT role_code FROM Employees WHERE other_details = "v" OR "employee_id" >= 2 INTERSECT SELECT role_code FROM Roles WHERE role_description != "Photo"


Question: Can you give me the student IDs that are both in the club member list where the club ID is greater than 1 or the student ID is less than 1008 or the position is Vice-President, and also in the student list where the age is not 21 or the first name is Bruce?

SELECT StuID FROM Member_of_club WHERE "ClubID" > 1 AND "StuID" < 1008 OR Position = "Vice-President" INTERSECT SELECT StuID FROM Student WHERE "Age" != 21 OR Fname = "Bruce"


Question: Could you give me a list of cities that appear both in a list of employee cities excluding Andrew Sheridan and employees who are not 23 years old, or are from Bristol and have an employee ID greater than 2, and in a list of employee cities where employees are from Bristol and are 30 years old?

SELECT City FROM employee WHERE Name <> "Andrew Sheridan" AND "Age" != 23 OR City = "Bristol" AND "Employee_ID" > 2 INTERSECT SELECT City FROM employee WHERE City = "Bristol" AND "Age" = 30


Question: Can you give me the IDs of documents that were mailed, either with document ID 2, a non-zero mailing address ID, or mailed on January 27, 2013, but excluding those documents that have a copy number less than 5 or a document ID greater than or equal to 12 in the draft copies?

SELECT document_id FROM Documents_Mailed WHERE "document_id" = 2 OR "mailed_to_address_id" != 0 OR mailing_date = "2013-01-27 03:29:31" EXCEPT SELECT document_id FROM Draft_Copies WHERE "copy_number" < 5 OR "document_id" >= 12


Question: Can you give me the IDs of drivers who are not driver 11 and who also have IDs less than or equal to 9?

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 from the driver table that are less than 5, combined with a list of driver IDs from the school_bus table that are not equal to 7, removing any duplicates?

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: Which driver IDs, excluding driver ID 1, are present in the driver table and also present in the school_bus table, excluding driver ID 10?

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


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


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

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


Question: What is the total enrollment and total budget percentage budgeted for schools named "New Prairie 1" or schools where the total budget percentage invested is less than or equal to 2.0, excluding schools with the mascot "Lions"?

SELECT SUM(T1.Enrollment), T2.total_budget_percent_budgeted FROM School as T1 JOIN budget as T2 ON T1.School_id = T2.School_id WHERE Mascot <> "Lions" AND School_name = "New Prairie 1" OR total_budget_percent_invested <= 2.0


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

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 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 or equal to 3, excluding any driver IDs greater than 9 that are also 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 > 9


Question: Which driver IDs less than 8 are also driver IDs equal to 7 in the school bus list?

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 smallest first name and the total date of birth for customers, considering those who don't have a customer ID of 15, or whose last name isn't Terry and have an amount outstanding of 2099, or whose customer date isn't October 5, 2017 at 2:15 PM and have the email kitty.hand@example.net, or whose birthdate isn't February 10, 1991 at 12:42 AM, combined with the smallest first name and total date of birth for staff, considering those who didn't leave on March 8, 2018 at 4:23 AM and have a staff address ID of 7 or higher, or whose nickname is ledner.jamie and whose first name isn't Eulalia, or whose birthdate isn't June 13, 2000 at 6:09 PM?

SELECT MIN(first_name), SUM(date_of_birth) FROM Customers WHERE "customer_id" <> 15 OR last_name != "Terry" AND "amount_outstanding" = 2099.0 OR date_became_customer != "2017-10-05 14:15:46" AND email_address = "kitty.hand@example.net" OR date_of_birth != "1991-02-10 00:42:17" UNION SELECT MIN(first_name), SUM(date_of_birth) FROM Staff WHERE date_left_staff <> "2018-03-08 04:23:14" AND "staff_address_id" >= 7 OR nickname = "ledner.jamie" AND first_name <> "Eulalia" OR date_of_birth != "2000-06-13 18:09:11"


Question: Can you list the driver IDs, including those from the driver table that are 10 or greater, and those from the school bus table that are 10 or less?

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


Question: Which driver has an ID of 5, but is not a driver with an ID less than 10 in the school bus table?

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


Question: Can you give me a list of driver IDs that are less than 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, including those from the driver table that are 8 or higher, and those from the school bus table that are 4 or lower?

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


Question: Can you give me a list of all the 'other details' from documents that aren't document ID 24, combined with a list of 'other details' from employees, excluding those that are "f" and those belonging to employees named "Jordyn"?

SELECT other_details FROM Documents WHERE "document_id" != 24 UNION ALL SELECT other_details FROM Employees WHERE other_details != "f" AND employee_name <> "Jordyn"


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

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 5 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, where each ID is 3 or greater, but excluding any driver IDs that also appear in the school bus table, unless that ID is 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 driver IDs are both less than 12 and also equal to 7?

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


Question: Can you give me a list of driver IDs from the driver table that are greater than or equal to 1, excluding the driver ID 10 if it appears 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: Could you give me a list of driver IDs, including driver ID 3 from the driver table and any driver IDs greater than or equal to 4 from the school bus table?

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


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


Question: Could you list the Aircraft IDs that are greater than 2 and also less than or equal to 3?

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


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

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


Question: Which driver IDs, excluding driver ID 7, are present in the driver table but not 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 != 7


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

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


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


Question: Can you show me the year and invested amount from the budget table where the total budget percent budgeted is greater than 1.3, and also show me the year and invested amount where the total budget percent budgeted is 2.0, the school ID is not 2, the budgeted amount is not 61283, and the total budget percent invested is 2.0, or where the invested amount is greater than or equal to 8335 and the year is less than or equal to 2005, or where the budget invested percent is not equal to 159.3?

SELECT Year, Invested FROM budget WHERE "total_budget_percent_budgeted" > 1.3 UNION ALL SELECT Year, Invested FROM budget WHERE "total_budget_percent_budgeted" = 2.0 AND "School_id" != 2 AND "Budgeted" != 61283 AND "total_budget_percent_invested" = 2.0 OR "Invested" >= 8335 AND "Year" <= 2005 OR Budget_invested_percent <> "159.3"


Question: Which driver IDs, excluding driver ID 2, are also driver IDs less than 9 in the school bus list?

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


Question: Which driver IDs are both less than or equal to 7 and also equal to 4?

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


Question: Can you list the Aircraft IDs from the aircraft table where the Aircraft ID is 1, and also list the Aircraft IDs from the airport_aircraft table where the Aircraft ID is greater than 2?

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


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

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


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

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 list all the feature type names, excluding "Amenity, eg Pool." when the feature type code is not "Security", and also include feature type names that are not "Securiyt, eg Burglar Alarm." or have a feature type code that is not "Amenity"?

SELECT feature_type_name FROM Ref_Feature_Types WHERE feature_type_name != "Amenity, eg Pool." AND feature_type_code <> "Security" UNION SELECT feature_type_name FROM Ref_Feature_Types WHERE feature_type_name <> "Securiyt, eg Burglar Alarm." OR feature_type_code != "Amenity"


Question: Which driver IDs are both not equal to 5 and also less than or equal to 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: Can you give me a list of driver IDs that are not 7 and are also less than or equal to 9, considering only the driver IDs that appear in both the driver and school bus tables?

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


Question: Can you give me a list of member IDs from the member table, excluding those with card number RT91, or a hometown other than Collierville, Tennessee, or a name other than Matt Lentz, and whose member ID is less than or equal to 4, but excluding any member IDs that appear in the membership register branch table for the year 2017?

SELECT Member_ID FROM member WHERE Card_Number != "RT91" OR Hometown <> "Collierville, Tennessee" AND Name <> "Matt Lentz" AND "Member_ID" <= 4 EXCEPT SELECT Member_ID FROM membership_register_branch WHERE Register_Year = "2017"


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

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 12 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 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 that are also in the school_bus table with a driver ID of 7?

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: Can you give me a list of Driver IDs, including Driver ID 10 from the driver table and Driver ID 9 from the school_bus table?

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


Question: Can you give me a list of aircraft IDs that are greater than 1 and also not equal to 2, considering only the unique aircraft IDs from 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 != 2


Question: Can you give me the average road address, latest opening year, name, average branch ID, and average city for branches that opened in 2001 in London, excluding Zytogorski and branches on Oaks Crescent, or those with a branch ID not equal to 7 or membership amount not equal to 91, but then remove any results that also include branches not on Concord Road and not opened in 2001, or those in Oxford?

SELECT AVG(Address_road), MAX(Open_year), Name, AVG(Branch_ID), AVG(City) FROM branch WHERE "Branch_ID" != 7 OR membership_amount != "91" AND Address_road != "Oaks Crescent" AND Open_year = "2001" AND Name != "Zytogorski" AND City = "London" EXCEPT SELECT AVG(Address_road), MAX(Open_year), Name, AVG(Branch_ID), AVG(City) FROM branch WHERE Address_road <> "Concord Road" AND Open_year <> "2001" OR City = "Oxford"


Question: Can you give me a list of driver IDs, where each ID is 12 or greater, but only include those IDs that are not also in the list of school bus driver IDs, excluding driver ID 9 from that list?

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


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

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


Question: Can you give me a list of driver IDs that are greater than or equal to 7, combining results from both the driver and school bus tables?

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 list all tree pollen allergies, excluding those also listed in the Has_Allergy table where either the allergy is tree pollen or the student ID is not 1031, from the Allergy_Type table where the allergy type is not animal?

SELECT Allergy FROM Allergy_Type WHERE Allergy = "Tree Pollen" OR AllergyType <> "animal" EXCEPT SELECT Allergy FROM Has_Allergy WHERE Allergy = "Tree Pollen" OR "StuID" != 1031


Question: What are the average employee ID, role code, and employee name for employees with other details marked as "u", combined with the average employee ID, role code, and employee name for employees whose employee ID is less than or equal to 1 or whose name is not "Kenyon" and other details are marked as "u"?

SELECT AVG(employee_id), role_code, employee_name FROM Employees WHERE other_details = "u" UNION SELECT AVG(employee_id), role_code, employee_name FROM Employees WHERE "employee_id" <= 1 OR employee_name != "Kenyon" AND other_details = "u"


Question: Which driver IDs are both less than 8 and greater than 4, considering only unique driver IDs from the driver and school_bus tables?

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


Question: Can you give me a list of driver IDs from the driver table where the driver ID is 12 or greater, combined with a list of driver IDs from the school_bus table where the driver ID is exactly 7?

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


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

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


Question: Which driver IDs are greater than 3 and also not equal to 3, considering only the driver IDs that appear in both the driver and school_bus tables?

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


Question: What is the maximum value of "temporary_acting" in the management table when either the department ID is not 15, the head ID is at least 10, or temporary_acting is "No", combined with the maximum value of "temporary_acting" when the department ID is 2 and temporary_acting is not "Yes"?

SELECT MAX(temporary_acting) FROM management WHERE "department_ID" != 15 OR "head_ID" >= 10 OR temporary_acting = "No" UNION SELECT MAX(temporary_acting) FROM management WHERE "department_ID" = 2 AND temporary_acting != "Yes"


Question: Can you give me a list of driver IDs that are both less than or equal to 8 and appear in the driver table, and also less than 7 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 < 7


Question: Can you give me a list of driver IDs that appear in the driver table, excluding driver ID 8, but also excluding any driver IDs that appear in the school_bus table with a driver ID greater than 9?

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 a list of driver IDs, including those from the driver table that are greater than 7, and those from the school bus table that are not equal to 4?

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


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


Question: Can you give me a list of feature IDs from the available features table where the ID is less than 2 and the description is not "Swimming Pool," combined with a list of feature IDs from the property features table where the property ID is less than 13, the feature ID is less than 3, and the feature description is "ad"?

SELECT feature_id FROM Other_Available_Features WHERE "feature_id" < 2 AND feature_description <> "Swimming Pool." UNION SELECT feature_id FROM Other_Property_Features WHERE "property_id" < 13 AND "feature_id" < 3 AND property_feature_description = "ad"


Question: Which driver IDs, excluding driver ID 7, are present in the driver table but not in the school_bus table, excluding driver ID 3 from 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 != 3


Question: Could you list the template type codes that are either "PPT" with the description "Paper", or "PP" with a description that is not "CV"?

SELECT Template_Type_Code FROM Ref_Template_Types WHERE Template_Type_Code = "PPT" AND Template_Type_Description = "Paper" UNION SELECT Template_Type_Code FROM Ref_Template_Types WHERE Template_Type_Code = "PP" AND Template_Type_Description <> "CV"


Question: Which store IDs are both not equal to 2 in the district store table and either greater than or equal to 2 in the store product table, or have a product ID greater than 1 in the store product table?

SELECT Store_ID FROM store_district WHERE "Store_ID" != 2 INTERSECT SELECT Store_ID FROM store_product WHERE "Store_ID" >= 2 OR "Product_ID" > 1


Question: Can you show me the aircraft movements from the airport table along with the corresponding ID from the airport_aircraft table, matching them by airport ID?

SELECT T1.Aircraft_Movements, T2.ID FROM airport as T1 JOIN airport_aircraft as T2 ON T1.Airport_ID = T2.Airport_ID


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

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 driver IDs less than 7 from the driver table, excluding any driver IDs less than 10 that are also 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: For clubs located in AKW, what are the club IDs and the member of club IDs?

SELECT T1.ClubID, T2.ClubID FROM Club as T1 JOIN Member_of_club as T2 ON T1.ClubID == T2.ClubID GROUP BY ClubLocation HAVING ClubLocation = "AKW"


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

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


Question: Could you list all document status codes, including those from documents that aren't of type "Paper" and weren't received on "2005-09-30 00:10:02", along with status codes from the document status reference table that are either not "overdue" or have a description of "currently working on"?

SELECT document_status_code FROM Documents WHERE document_type_code != "Paper" AND receipt_date != "2005-09-30 00:10:02" UNION ALL SELECT document_status_code FROM Ref_Document_Status WHERE document_status_code != "overdue" OR document_status_description = "currently working on"


Question: Can you list all aircraft IDs that are equal to 3 from the aircraft table, and combine that with a list of all aircraft IDs that are not equal to 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 greater than 1, and those from the school_bus table where the ID is greater than 7?

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID > 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 that are less than 8, but exclude 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 < 8 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID < 3


Question: Could you give me the document IDs that are both from document drafts with draft numbers greater than 4, document IDs of 7 or higher, and draft details not equal to "x", and also from documents mailed where the mailing date isn't "1977-04-01 17:03:50" or the mailed-to address ID is 4 or less and the document ID is 14?

SELECT document_id FROM Document_Drafts WHERE "draft_number" > 4 AND "document_id" >= 7 AND draft_details != "x" INTERSECT SELECT document_id FROM Documents_Mailed WHERE mailing_date <> "1977-04-01 17:03:50" OR "mailed_to_address_id" <= 4 AND "document_id" = 14


Question: Which aircraft IDs, that are less than or equal to 1, are present in both the aircraft and airport_aircraft lists?

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


Question: Can you give me a list of driver IDs that appear in the driver table, excluding driver ID 2, but also excluding any driver IDs that appear in the school_bus table with a driver ID of 3?

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


Question: Which driver IDs are both less than or equal to 7 and also equal to 4?

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


Question: Can you list all aircraft IDs less than 2 from both the aircraft and airport_aircraft tables, removing any duplicates?

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


Question: Which driver IDs are both not equal to 5 and also greater than 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 give me a list of driver IDs that are less than or equal to 11, excluding any driver IDs that are not equal to 10 from the school bus list?

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


Question: Can you list the years of working for all school bus drivers who either aren't driver number 7, or work full time, or have more than 3 years of experience, combined with the years of working for all school bus drivers who don't work full time?

SELECT Years_Working FROM school_bus WHERE "Driver_ID" <> 7 OR If_full_time = "T" OR "Years_Working" > 3 UNION SELECT Years_Working FROM school_bus WHERE If_full_time <> "T"


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

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


Question: Can you give me a list of driver IDs that are greater than 6, excluding any driver IDs that are less than or equal to 4 and also appear 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: Which driver IDs, excluding driver ID 11, are also school bus driver IDs, excluding driver ID 10?

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


Question: For each aircraft, what is the average aircraft ID associated with it in the airport aircraft table?

SELECT T1.Aircraft_ID, AVG(T2.Aircraft_ID) FROM aircraft as T1 JOIN airport_aircraft as T2 ON T1.Aircraft_ID = T2.Aircraft_ID


Question: Can you give me a list of driver IDs, first from the driver table excluding driver ID 8, and then from the school bus table including only driver IDs less than 9, removing any duplicates?

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 driver IDs, including driver ID 9 from the driver table and any driver IDs less than 4 from the school bus table?

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


Question: Can you give me a list of driver IDs, combining those that are not equal to 1 from the driver table with those less than 10 from the school bus table, removing any duplicates?

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


Question: Can you list the Book IDs and Publishers from the publication table, excluding Wiley, where the Book ID is not 1, the Publication ID is not 5, the Price is not 15000000, and the Publication Date is June 2006, but then remove any results where the Publication ID is 1 or the Price is 4100000?

SELECT Book_ID, Publisher FROM publication WHERE Publisher <> "Wiley" OR "Book_ID" != 1 AND "Publication_ID" != 5 AND "Price" != 15000000.0 AND Publication_Date = "June 2006" EXCEPT SELECT Book_ID, Publisher FROM publication WHERE "Publication_ID" = 1 OR "Price" = 4100000.0


Question: Could you show me the total disk area of each aircraft along with its corresponding ID from the airport aircraft table?

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


Question: What document type codes are both "Hard Drive" or not described as "b", and also not described as "b"?

SELECT document_type_code FROM Ref_Document_Types WHERE document_type_code = "Hard Drive" OR document_type_description != "b" INTERSECT SELECT document_type_code FROM Ref_Document_Types WHERE document_type_description <> "b"


Question: Can you give me the member IDs of members who either are named Matt Lentz, or have a card number that isn't LCB7 and a level of 6 or higher, or are from Fort Campbell, Kentucky, or have a member ID less than 9, combined with the member IDs of members who are not named Matt Lentz, have a member ID of 4, are from Red Jacket, West Virginia, and have a card number that isn't RT91?

SELECT Member_ID FROM member WHERE Name = "Matt Lentz" OR Card_Number != "LCB7" AND "Level" >= 6 OR Hometown = "Fort Campbell, Kentucky" OR "Member_ID" < 9 UNION SELECT Member_ID FROM member WHERE Name != "Matt Lentz" AND "Member_ID" = 4 AND Hometown = "Red Jacket, West Virginia" AND Card_Number <> "RT91"


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

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


Question: Which driver IDs are greater than 9 and also greater than 7 in the school bus records?

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

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


Question: Which driver IDs, excluding driver ID 9, are in the driver table but not in the school bus table where the driver ID is greater than 3?

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


Question: Which driver has an ID of 6, but is not a driver with an ID other than 3 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 <> 3


Question: What is the highest user ID from reviews with a rating of 7, an article ID not equal to 5, and an item ID of 7 or higher, combined with the highest user ID from user accounts where the user ID is 3 or higher and the name is not Emily?

SELECT MAX(u_id) FROM review WHERE "rating" = 7 AND "a_id" <> 5 AND "i_id" >= 7 UNION SELECT MAX(u_id) FROM useracct WHERE "u_id" >= 3 AND name != "Emily"


Question: Can you find the maximum aircraft ID, the number of aircraft, the description, the number of maximum disk loading values, and the number of total disk area values for aircraft where the total disk area is 872 ft² (81.1 m²), the maximum gross weight is 73,500 lb (33,300 kg), or the maximum disk loading is 14.5 lb/ft² (71 kg/m²), grouped by description, only including groups with fewer than two aircraft, and then find the intersection of those results with the maximum aircraft ID, the number of aircraft, the description, the number of maximum disk loading values, and the number of total disk area values for aircraft that are not a Robinson R-22, grouped by description, only including groups where the number of maximum disk loading values is not equal to one, or the number of total disk area values is greater than or equal to one, and the number of aircraft is one, and the maximum aircraft ID is less than three?

SELECT MAX(Aircraft_ID), COUNT(Aircraft), Description, COUNT(Max_disk_Loading), COUNT(Total_disk_area) FROM aircraft WHERE Total_disk_area = "872 ft² (81.1 m²)" OR Max_Gross_Weight = "73,500 lb (33,300 kg)" OR Max_disk_Loading = "14.5 lb/ft² (71 kg/m²)" GROUP BY Description HAVING COUNT(Aircraft) < 2 INTERSECT SELECT MAX(Aircraft_ID), COUNT(Aircraft), Description, COUNT(Max_disk_Loading), COUNT(Total_disk_area) FROM aircraft WHERE Aircraft <> "Robinson R-22" GROUP BY Description HAVING COUNT(Max_disk_Loading) <> 1 OR COUNT(Total_disk_area) >= 1 AND COUNT(Aircraft) = 1 AND MAX(Aircraft_ID) < 3


Question: Can you give me a list of driver IDs from the driver table where the ID is 9 or greater, combined with a list of driver IDs from the school_bus table where the ID is exactly 4?

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


Question: Which driver ID is both equal to 10 in the driver table and not equal to 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 list the Room ID, bed type, and room name for all rooms that are either modern, not room MWC, have a maximum occupancy of two or less, and are named "Thrift and accolade" or have a number of beds not equal to one, along with all rooms that have a base price of 175 or more?

SELECT RoomId, bedType, roomName FROM Rooms WHERE decor = "modern" AND RoomId <> "MWC" AND "maxOccupancy" <= 2 AND roomName = "Thrift and accolade" OR "beds" <> 1 UNION SELECT RoomId, bedType, roomName FROM Rooms WHERE "basePrice" >= 175


Question: Can you list the aircraft IDs that appear in the aircraft table, excluding aircraft ID 3, but then remove any of those IDs that also appear in the airport_aircraft table with an ID of 3 or less?

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


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

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


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


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

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


Question: Which customer IDs are both not 10 and have the phone number 753.921.0871, and also have a lesson time of 9, a price not equal to 340, a customer ID greater than 8, a lesson ID of 4, a lesson date not equal to 2018-03-04 06:55:46, or a lesson status code that is not completed?

SELECT customer_id FROM Customers WHERE "customer_id" <> 10 AND phone_number = "753.921.0871" INTERSECT SELECT customer_id FROM Lessons WHERE lesson_time = "9" OR "price" <> 340.0 OR "customer_id" > 8 OR "lesson_id" = 4 OR lesson_date != "2018-03-04 06:55:46" OR lesson_status_code <> "Completed"


Question: Could you give me the document IDs that are both greater than or equal to 1 and also have a draft number less than 2, or draft details that are not "v" and a document ID that is not 7?

SELECT document_id FROM Document_Drafts WHERE "document_id" >= 1 INTERSECT SELECT document_id FROM Document_Drafts WHERE "draft_number" < 2 OR draft_details != "v" AND "document_id" != 7


Question: What are the average PetID and minimum StuID for pets with a PetID of 2003 or higher, and also the average PetID and minimum StuID for pets with a StuID less than 1001?

SELECT AVG(PetID), MIN(StuID) FROM Has_Pet WHERE "PetID" >= 2003 UNION ALL SELECT AVG(PetID), MIN(StuID) FROM Has_Pet WHERE "StuID" < 1001


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

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


Question: Could you give me a list of all documents, showing their ID, shipping agent code, other details, receipt number, receipt date, document type code, and document status code, including those that either have a receipt date other than September 15, 1976, and a document ID less than or equal to 4, and a document status code that isn't "working", and a document type code that isn't "Hard Drive", or a shipping agent code that isn't "FE", or other details that aren't "x", along with all documents that either have a document status code that isn't "overdue", and a receipt date that isn't April 21, 2008, and a document type code that isn't "CD", and a shipping agent code of "UP", or a document ID of 4?

SELECT document_id, shipping_agent_code, other_details, receipt_number, receipt_date, document_type_code, document_status_code FROM Documents WHERE receipt_date <> "1976-09-15 19:24:17" AND "document_id" <= 4 AND document_status_code != "working" AND document_type_code != "Hard Drive" OR shipping_agent_code != "FE" OR other_details <> "x" UNION ALL SELECT document_id, shipping_agent_code, other_details, receipt_number, receipt_date, document_type_code, document_status_code FROM Documents WHERE document_status_code != "overdue" AND receipt_date != "2008-04-21 20:42:25" AND document_type_code <> "CD" AND shipping_agent_code = "UP" OR "document_id" = 4


Question: Can you give me the driver IDs that are less than 5 from the driver table and also greater than or equal to 4 from 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: Which driver IDs are both greater than 3 and used by school buses with driver IDs less than 10?

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


Question: Can you give me a list of driver IDs, including those from the driver table that are 5 or greater, and those from the school bus table that are not equal to 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 give me a list of branch names for branches that either opened in 2009 or are not located in London, combined with a list of member names for members who either don't have a Member ID of 7 and aren't from Louisville, Kentucky, or whose name isn't Ventrell Jenkins, whose card number isn't MLB4, and whose level is 4 or below?

SELECT Name FROM branch WHERE Open_year = "2009" OR City != "London" UNION ALL SELECT Name FROM member WHERE "Member_ID" != 7 AND Hometown != "Louisville, Kentucky" OR Name != "Ventrell Jenkins" AND Card_Number <> "MLB4" AND "Level" <= 4


Question: Can you list all the aircraft IDs, excluding aircraft ID 2, from both the aircraft and airport_aircraft 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 give me a list of aircraft IDs that are both less than or equal to 1 and not equal to 5?

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


Question: Can you give me a list of album IDs that are greater than 46, have an artist ID less than or equal to 90, and don't have the title "A Real Dead One", combined with a list of playlist IDs that are greater than or equal to 2 or don't have the name "Classical 101 - Deep Cuts"?

SELECT id FROM albums WHERE "id" > 46 AND "artist_id" <= 90 AND title != "A Real Dead One" UNION SELECT id FROM playlists WHERE "id" >= 2 OR name <> "Classical 101 - Deep Cuts"


Question: Could you list the shop IDs from the hiring records where employee ID is 6, or where the employee is not full-time, didn't start in 2012, and the shop ID is less than 5, combined with the shop IDs from the shop records where the name isn't KuPS, the district isn't Finnair Stadium, and the manager is Kai Nyyssönen, or where the location isn't Espoo?

SELECT Shop_ID FROM hiring WHERE "Employee_ID" = 6 OR Is_full_time != "T" AND Start_from != "2012" AND "Shop_ID" < 5 UNION ALL SELECT Shop_ID FROM shop WHERE Name <> "KuPS" AND District <> "Finnair Stadium" AND Manager_name = "Kai Nyyssönen" AND "Number_products" <> 3516 OR Location != "Espoo"


Question: Can you give me a list of driver IDs from the driver table where the ID is 11 or greater, combined with a list of driver IDs from the school_bus table where the ID is 7 or greater?

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


Question: Can you give me a list of driver IDs, including those from the driver table that are 4 or greater, and those from the school bus table that are 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: Which driver has an ID of 4 and also has a driver ID greater than 3 in the school bus table?

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


Question: Can you give me the branch IDs of branches that either have a membership amount of 1418, are located in London on Oaks Crescent, are named Zytogorski, or opened in 2009 with a branch ID of 3 or less, but excluding any branch IDs that appear in the membership register for the year 2016 with a member ID of 1 or greater?

SELECT Branch_ID FROM branch WHERE membership_amount = "1418" OR City = "London" AND Address_road = "Oaks Crescent" OR Name = "Zytogorski" OR Open_year = "2009" AND "Branch_ID" <= 3 EXCEPT SELECT Branch_ID FROM membership_register_branch WHERE Register_Year = "2016" AND "Member_ID" >= 1


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

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


Question: Can you give me a list of driver IDs that are greater than or equal to 6 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 >= 6 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, excluding driver ID 12, that are not also driver IDs greater than 10 found in the school bus table?

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


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

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


Question: Can you give me a list of aircraft names where the distance is not 3383, combined with a list of employee names where the employee ID is less than or equal to 574489456?

SELECT name FROM aircraft WHERE "distance" <> 3383 UNION SELECT name FROM employee WHERE "eid" <= 574489456


Question: Which driver IDs, excluding driver ID 11, appear in the driver table but not in the school_bus table, also excluding driver ID 3 from the school_bus table?

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


Question: Could you list the item IDs that either don't have the title "cup" or have an item ID of 3, and are also associated with reviews that have a rank of 1 or higher?

SELECT i_id FROM item WHERE title != "cup" OR "i_id" = 3 INTERSECT SELECT i_id FROM review WHERE "rank" >= 1


Question: Which driver IDs, excluding driver ID 7, 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 <> 7 EXCEPT SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID > 10


Question: Can you give me a list of all Driver IDs, including those from the driver table where the ID is 1 or greater, combined with those from the school_bus table where the ID is not 4?

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 give me a list of driver IDs that are greater than 11, excluding those driver IDs that are also greater than 3 and appear in the school bus table?

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


Question: What is the average document ID from the Documents table, considering documents where the shipping agent code is not "FE", or the receipt date is "1973-11-05 21:48:53", or the document status code is not "done" and the document type code is not "Paper", or the receipt number is "189", or the document ID is not 17 and other details are "n", combined with the average document ID from the Documents_Mailed table, considering records where the document ID is less than 2 and the mailed to address ID is greater than 7, or the mailing date is not "1999-05-22 23:21:07"?

SELECT AVG(document_id) FROM Documents WHERE shipping_agent_code <> "FE" OR receipt_date = "1973-11-05 21:48:53" OR document_status_code <> "done" AND document_type_code != "Paper" OR receipt_number = "189" OR "document_id" != 17 AND other_details = "n" UNION ALL SELECT AVG(document_id) FROM Documents_Mailed WHERE "document_id" < 2 AND "mailed_to_address_id" > 7 OR mailing_date <> "1999-05-22 23:21:07"


Question: Can you list all the vehicle details that are "Car", excluding the vehicle with ID 3, and also include the vehicle details for the vehicle with ID 3?

SELECT vehicle_details FROM Vehicles WHERE vehicle_details = "Car" AND "vehicle_id" != 3 UNION ALL SELECT vehicle_details FROM Vehicles WHERE "vehicle_id" = 3


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

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


Question: Could you list the document IDs and draft numbers for all drafts that either have draft details that are not "x" or have a draft number less than 2?

SELECT document_id, draft_number FROM Document_Drafts WHERE draft_details <> "x" UNION ALL SELECT document_id, draft_number FROM Document_Drafts WHERE "draft_number" < 2


Question: Can you give me a list of vehicle IDs that meet these conditions from the lessons table: either the customer ID is not 13 and the lesson ID is 6, or the vehicle ID is not 2, or the staff ID is 1 and the lesson status is completed, or the price is 295, or the lesson date is March 7, 2018 at 4:12:36 PM, or the lesson time is not 5; but only if those vehicle IDs also have vehicle details that are not "Truck" in the vehicles table?

SELECT vehicle_id FROM Lessons WHERE "customer_id" != 13 AND "lesson_id" = 6 OR "vehicle_id" != 2 OR "staff_id" = 1 AND lesson_status_code = "Completed" OR "price" = 295.0 OR lesson_date = "2018-03-07 16:12:36" OR lesson_time <> "5" INTERSECT SELECT vehicle_id FROM Vehicles WHERE vehicle_details <> "Truck"


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


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

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 give me the IDs of drivers whose IDs are greater than 6, excluding the IDs of school bus drivers whose IDs are greater than 4?

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


Question: Can you give me a list of driver IDs that are less than 12, excluding the driver ID 9 if it appears in the school bus records?

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


Question: Can you give me a list of driver IDs, where each ID is less than or equal to 9, excluding the driver ID 9 if it appears in the school bus records?

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 a list of driver IDs, including those from the driver table that are 4 or greater, and those from the school bus table that are 9 or less?

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 list the aircraft IDs that are greater than or equal to 4 from the aircraft table, and combine that with a list of aircraft IDs that are greater than or equal to 2 from the airport_aircraft table, removing any duplicates?

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


Question: Could you list the parties from the election table, excluding those also found in the party table where the year is 1998 or later and Charles Schumer is not a US Senator, considering only parties where either the counties represented are not 13, or the district is greater than 3 and the delegate is not Guy Guzzone, or the committee is not Ways and Means, or the party is less than or equal to 2?

SELECT Party FROM election WHERE Counties_Represented <> "13" OR "District" > 3 AND Delegate != "Guzzone, Guy Guy Guzzone" OR Committee <> "Ways and Means" OR "Party" <= 2 EXCEPT SELECT Party FROM party WHERE "Year" >= 1998.0 AND US_Senate <> "Charles Schumer"


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

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


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


Question: Can you give me the earliest start year, the number of regions, and the club name for clubs excluding "BK Häcken" or with a Club ID other than 1 and a start year other than 2009, or from a region other than "USA", combined with the earliest start year, the number of regions, and the club name for clubs named "Halmstads BK" or that started in 2011 or earlier?

SELECT MIN(Start_year), COUNT(Region), Club_name FROM club WHERE Club_name <> "BK Häcken" OR "Club_ID" <> 1 AND "Start_year" <> 2009 OR Region != "USA" UNION ALL SELECT MIN(Start_year), COUNT(Region), Club_name FROM club WHERE Club_name = "Halmstads BK" OR "Start_year" <= 2011


Question: Can you tell me, for companies not named Wells Fargo and not headquartered in China, what are the headquarters, the smallest asset value in billions, the profit in billions, the total of all company names, and the most common industry; and also, for companies not headquartered in China where either sales aren't 110.8 billion, or they're in the oil and gas industry with profits less than 41.1 billion, aren't named China Construction Bank, and have assets of 1873.9 billion, what are the headquarters, the smallest asset value in billions, the profit in billions, the total of all company names, and the most common industry?

SELECT Headquarters, MIN(Assets_in_Billion), Profits_in_Billion, SUM(Name), MAX(Industry) FROM company WHERE Name <> "Wells Fargo" AND Headquarters <> "China" UNION ALL SELECT Headquarters, MIN(Assets_in_Billion), Profits_in_Billion, SUM(Name), MAX(Industry) FROM company WHERE Headquarters <> "China" AND "Sales_in_Billion" <> 110.8 OR Industry = "Oil and gas" AND "Profits_in_Billion" < 41.1 AND Name <> "China Construction Bank" AND "Assets_in_Billion" = 1873.9


Question: What aircraft IDs are equal to 4 in the aircraft table, but not greater than 3 in the airport_aircraft table?

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


Question: Can you list all the aircraft IDs, first from the aircraft table excluding aircraft ID 4, and then from the airport_aircraft table including only aircraft IDs less than 5, removing any duplicates?

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


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

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


Question: Can you give me the velocity and the total company ID for flights, combining two sets of results? The first set includes flights where the velocity isn't 240, or the date is March 1, 1963 and the altitude isn't 0, or the company ID is greater than 4, the airport ID is greater than 9, the vehicle flight number isn't "M2-F1 #0", and the pilot isn't "Thompson". The second set includes flights where the vehicle flight number isn't "M2-F1 #73" and the altitude is at least 3650, and the company ID isn't 6, or the date isn't August 16, 1963, or the pilot isn't "Peterson", or the ID is less than 6.

SELECT Velocity, SUM(company_id) FROM flight WHERE "Velocity" <> 240.0 OR Date = "March 1, 1963" AND "Altitude" <> 0.0 OR "company_id" > 4 AND "airport_id" > 9 AND Vehicle_Flight_number != "M2-F1 #0" AND Pilot <> "Thompson" UNION ALL SELECT Velocity, SUM(company_id) FROM flight WHERE Vehicle_Flight_number != "M2-F1 #73" AND "Altitude" >= 3650.0 AND "company_id" <> 6 OR Date != "August 16, 1963" OR Pilot != "Peterson" OR "id" < 6


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

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 from the driver table that are less than or equal to 10, combined with a list of driver IDs from the school_bus table that are greater than or equal to 10?

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


Question: Can you give me a list of driver IDs that are greater than 4 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 > 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 not 11, but only include those that are not also driver IDs greater than 3 in the school bus table?

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


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