Question: Can you give me a list of employee IDs from the evaluation table where the ID is not "7", or the bonus is at least $3200, or the year awarded is "2015", combined with a list of employee IDs from the hiring table where the employee is full-time, or the shop ID is less than 1 and the start year is not "2009", or the employee ID is not 5?

SELECT Employee_ID FROM evaluation WHERE Employee_ID != "7" OR "Bonus" >= 3200.0 OR Year_awarded = "2015" UNION SELECT Employee_ID FROM hiring WHERE Is_full_time = "T" OR "Shop_ID" < 1 AND Start_from != "2009" OR "Employee_ID" <> 5


Question: Can you give me the profits, number of companies with the same sales, company ID, headquarters, number of companies in the same industry, assets, and number of companies with the same name for companies where profits are greater than 14.2 and the company isn't "China Construction Bank", or the headquarters isn't in China, or the market value is 294.7, or the company ID isn't 16 and assets are 328.7 and sales are 68.7, but exclude those companies where the company ID is greater than 1, or the name isn't "Agricultural Bank of China", or profits are greater than 20.6 and assets are less than or equal to 209.5 and the headquarters isn't in the USA and the industry is banking?

SELECT Profits_in_Billion, COUNT(Sales_in_Billion), Company_ID, Headquarters, COUNT(Industry), Assets_in_Billion, COUNT(Name) FROM company WHERE "Profits_in_Billion" > 14.2 AND Name != "China Construction Bank" OR Headquarters != "China" OR "Market_Value_in_Billion" = 294.7 OR "Company_ID" <> 16.0 AND "Assets_in_Billion" = 328.7 AND "Sales_in_Billion" = 68.7 EXCEPT SELECT Profits_in_Billion, COUNT(Sales_in_Billion), Company_ID, Headquarters, COUNT(Industry), Assets_in_Billion, COUNT(Name) FROM company WHERE "Company_ID" > 1.0 OR Name <> "Agricultural Bank of China" OR "Profits_in_Billion" > 20.6 AND "Assets_in_Billion" <= 209.5 AND Headquarters != "USA" AND Industry = "Banking"


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

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


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

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


Question: Can you give me a list of driver IDs, combining those from the driver table that aren't 12 with those from the school bus table that are less than 7, removing any duplicates?

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 list the address details and address IDs for all addresses, including those with an address ID of 5 or less, and also those where the address details are not "IE" or the address ID is less than 5?

SELECT address_details, address_id FROM Addresses WHERE "address_id" <= 5 UNION ALL SELECT address_details, address_id FROM Addresses WHERE address_details != "IE" OR "address_id" < 5


Question: Can you give me a list of driver IDs that appear in the driver table, excluding driver ID 10, but only if they don't appear in the school bus table with a driver ID of 10 or less?

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 all the positions held by members, including those who aren't student 1001, and also including positions from any member if their club ID is 4 or less, or if they aren't student 1007, or if their position is Vice-President?

SELECT Position FROM Member_of_club WHERE "StuID" <> 1001 UNION ALL SELECT Position FROM Member_of_club WHERE "ClubID" <= 4 OR "StuID" <> 1007 OR Position = "Vice-President"


Question: What are the aircraft IDs that are greater than or equal to 2, excluding those aircraft IDs less than 2 that are also found in the airport aircraft list?

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


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


Question: Can you give me the total ClubID for each student who is a member of a club, but only for clubs where the president isn't part of "Hopkins Student Enterprises"?

SELECT SUM(T1.ClubID), T2.StuID FROM Club as T1 JOIN Member_of_club as T2 ON T1.ClubID = T2.ClubID WHERE Position = "President" AND ClubName <> "Hopkins Student Enterprises"


Question: Can you list the title and ID of all items, including those with an ID of 5 or greater, along with all items that don't have the title "cup" or don't have an ID of 2?

SELECT title, i_id FROM item WHERE "i_id" >= 5 UNION ALL SELECT title, i_id FROM item WHERE title <> "cup" OR "i_id" != 2


Question: What is the average item ID for items that are not item ID 1 or have the title "avocado", combined with the average item ID for reviews where the author ID is greater than 5?

SELECT AVG(i_id) FROM item WHERE "i_id" <> 1 OR title = "avocado" UNION ALL SELECT AVG(i_id) FROM review WHERE "a_id" > 5


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

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


Question: Can you give me a list of employee IDs that are either greater than 573284895 in the certificate table or associated with an aid greater than or equal to 12 in the certificate table, combined with a list of employee IDs from the employee table where the employee's name is not Donald King?

SELECT eid FROM certificate WHERE "eid" > 573284895 OR "aid" >= 12 UNION ALL SELECT eid FROM employee WHERE name != "Donald King"


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

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


Question: Can you give me the head IDs from the head table, excluding any head IDs from the management table where the department ID is less than 7, and only including heads who either don't have a head ID of 1, or whose name isn't Stewart Cink, are younger than 43, and weren't born in Alabama?

SELECT head_ID FROM head WHERE "head_ID" <> 1 OR name != "Stewart Cink" AND "age" < 43.0 AND born_state <> "Alabama" EXCEPT SELECT head_ID FROM management WHERE "department_ID" < 7


Question: Can you give me the state, creation date, contestant number, vote ID, and phone number from the votes table for entries where either the vote ID is not 3 and the phone number is greater than 6209222712 and the creation date is "2018-03-09 19:03:36", or the contestant number is not 3 and the state is "CA", combined with all entries from the votes table where the phone number is greater than or equal to 5112677315?

SELECT state, created, contestant_number, vote_id, phone_number FROM VOTES WHERE "vote_id" != 3 AND "phone_number" > 6209222712 AND created = "2018-03-09 19:03:36" OR "contestant_number" <> 3 AND state = "CA" UNION SELECT state, created, contestant_number, vote_id, phone_number FROM VOTES WHERE "phone_number" >= 5112677315


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

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID <= 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, where each ID is 5 or greater, but excluding any driver IDs that also appear in the school bus list, unless that ID is 7?

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


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

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


Question: Can you give me the driver ID that appears exactly once as driver in the driver table, where the ID is 8, but does not appear as a driver ID in the school_bus table if that ID is greater than 4?

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


Question: Can you give me a list of driver IDs that are 3 or greater from the driver table, excluding any driver IDs that are 7 or less from 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: Can you list the aircraft IDs, excluding aircraft ID 3, that appear in the aircraft table, but not in the airport_aircraft table where the aircraft ID is 5 or greater?

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 give me a list of ranks from match results where the Club ID is less than 2 and the rank is 4 or higher, or the gold is greater than 7, or the bronze is equal to 8, combined with a list of ranks from players where the votes are greater than 14097 and the residence is not Winnipeg, or the rank is 3rd and the player name is not Rachel Heinrichs, or the occupation is not Product Consultant - MLCC, or the gender is not female?

SELECT Rank FROM match_result WHERE "Club_ID" < 2 AND "Rank" >= 4 OR "Gold" > 7 OR "Bronze" = 8 UNION SELECT Rank FROM player WHERE "Votes" > 14097 AND Residence != "Winnipeg" OR Rank = "3rd" AND Player_name <> "Rachel Heinrichs" OR Occupation != "Product Consultant - MLCC" OR Gender != "F"


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

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


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

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


Question: What is the largest pet ID that is both less than or equal to 2003 and not owned by student 1002, and also the largest pet ID of a pet weighing less than 13.4 that isn't a dog?

SELECT MAX(PetID) FROM Has_Pet WHERE "PetID" <= 2003 AND "StuID" <> 1002 INTERSECT SELECT MAX(PetID) FROM Pets WHERE "weight" < 13.4 AND PetType != "dog"


Question: How many students with ID 1031 have allergies, and how many students have an ID greater than 1001, are older than 20, have a major other than 50 and a first name of Andy, have an advisor other than 8722 and a city code other than PHL, or are not male?

SELECT COUNT(StuID) FROM Has_Allergy WHERE "StuID" = 1031 UNION SELECT COUNT(StuID) FROM Student WHERE "StuID" > 1001 OR "Age" > 20 OR "Major" <> 50 AND Fname = "Andy" OR "Advisor" != 8722 AND city_code != "PHL" OR Sex != "M"


Question: Can you give me the IDs of drivers with an ID of 2 or less, excluding those drivers whose IDs are 10 or less and are also school bus drivers?

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, excluding driver ID 3, from the driver table, but then remove any driver IDs that are also driver ID 10 in the school bus table?

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


Question: Can you give me the Aircraft IDs that are less than 5 when grouped in the aircraft table, and also greater than 2 when grouped in the airport_aircraft table?

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


Question: Can you give me a list of student IDs, including those with allergy ID 1027, and also those who are male, not advised by 8722, whose first name isn't Michael, or whose last name is Schultz, or who are not 19 years old and don't have a major of 600?

SELECT StuID FROM Has_Allergy WHERE "StuID" = 1027 UNION SELECT StuID FROM Student WHERE "Advisor" <> 8722 AND Sex = "M" AND Fname != "Michael" OR LName = "Schultz" OR "Age" <> 19 AND "Major" != 600


Question: Can you give me a list of driver IDs that are greater than or equal to 9, excluding the driver ID 9 if it appears in the school bus assignments?

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


Question: Could you list the names of documents that have a description other than "n", excluding those documents that have a description other than "f", a Template ID less than 4, and Other Details not equal to "None"?

SELECT Document_Name FROM Documents WHERE Document_Description != "n" NOT IN (SELECT Document_Name FROM Documents WHERE Document_Description <> "f" AND "Template_ID" < 4 AND Other_Details <> "None")


Question: Which driver IDs, excluding driver ID 3, are also driver IDs that are greater than or equal to 4 in the school bus list?

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


Question: Can you give me a list of driver IDs, excluding driver ID 3, that are not also driver IDs less than 9 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: Can you give me a list of driver IDs that are less than 8, excluding any driver IDs that are also equal to 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: What aircraft IDs, excluding ID 3, are also aircraft IDs greater than 1 found in the airport aircraft list?

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


Question: Can you give me a list of Template IDs from documents where the description isn't "h" or the Template ID is less than 1, combined with a list of Template IDs from templates where the details aren't empty?

SELECT Template_ID FROM Documents WHERE Document_Description != "h" OR "Template_ID" < 1 UNION SELECT Template_ID FROM Templates WHERE Template_Details != ""


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

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


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


Question: Can you give me the IDs of drivers, up to and including ID 5, excluding the IDs of school bus drivers that are ID 4 or higher?

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


Question: Can you list the head IDs and temporary acting status for management where the department ID is greater than 2, the head ID is 4, and temporary acting is "Yes", combined with the head IDs and temporary acting status for management where the department ID is 7 and either the head ID is less than 5 or temporary acting is "No"?

SELECT head_ID, temporary_acting FROM management WHERE "department_ID" > 2 AND temporary_acting = "Yes" AND "head_ID" = 4 UNION SELECT head_ID, temporary_acting FROM management WHERE "department_ID" = 7 AND "head_ID" < 5 OR temporary_acting = "No"


Question: Can you give me the ID, principal activities, and place of incorporation for all companies where the ID is 8, or the principal activity is not "Travel agency", or the name is not "Cathay Pacific Catering Services (HK) Limited", combined with companies where the ID is 13 or greater, or are not incorporated in Hong Kong and do laundry, or are a subsidiary?

SELECT id, Principal_activities, Incorporated_in FROM operate_company WHERE "id" = 8 OR Principal_activities <> "Travel agency" OR name <> "Cathay Pacific Catering Services (HK) Limited" UNION SELECT id, Principal_activities, Incorporated_in FROM operate_company WHERE "id" >= 13 OR Incorporated_in != "Hong Kong" AND Principal_activities = "Laundry" OR Type = "Subsidiary"


Question: Could you give me the publisher, price, publication date, and publication ID for all publications from Wiley or those with a price of at least 4,100,000, excluding those that have a price of exactly 2,000,000, a publication ID that is not 4, and a book ID of 5 or greater?

SELECT Publisher, Price, Publication_Date, Publication_ID FROM publication WHERE Publisher = "Wiley" OR "Price" >= 4100000.0 EXCEPT SELECT Publisher, Price, Publication_Date, Publication_ID FROM publication WHERE "Price" = 2000000.0 AND "Publication_ID" != 4 AND "Book_ID" >= 5


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

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


Question: Can you give me a list of aircraft IDs that are greater than 3, excluding those aircraft IDs from the airport aircraft list that are greater than or equal to 2?

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: Which driver has an ID of 8, excluding any drivers who have an ID other than 3 in the school bus table?

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


Question: Can you give me a list of driver IDs, combining those from the driver table excluding driver ID 9, and those from the school bus table excluding driver ID 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: Can you give me the creation date, state, phone number, and vote ID for votes that have a vote ID other than 1, and also meet at least one of these conditions: a vote ID less than 2, a phone number different from 6209222712 with a contestant number greater than 5, a state other than NY, or a creation date of March 9th, 2018 at 7:03:36 PM?

SELECT created, state, phone_number, vote_id FROM VOTES WHERE "vote_id" <> 1 INTERSECT SELECT created, state, phone_number, vote_id FROM VOTES WHERE "vote_id" < 2 OR "phone_number" <> 6209222712 AND "contestant_number" > 5 OR state != "NY" OR created = "2018-03-09 19:03:36"


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

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


Question: Which driver IDs are less than 8 and also greater than or equal to 4?

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: Which aircraft IDs are both greater than or equal to 3 and also not equal to 1?

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


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


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

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


Question: For each aircraft, what is the highest airport ID associated with it?

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


Question: Which driver has an ID of 5, excluding any drivers with an ID other than 9 who are associated with a school bus?

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


Question: What bonuses were given to employees other than employee 4, excluding any bonuses that were not exactly 2900 or were not awarded in 2016?

SELECT Bonus FROM evaluation WHERE Employee_ID != "4" EXCEPT SELECT Bonus FROM evaluation WHERE "Bonus" <> 2900.0 OR Year_awarded != "2016"


Question: Can you show me the number of issues and book IDs, grouped by the number of issues, but only for publishers that are not "Bertelsmann" or have a price of 2,000,000 or less?

SELECT T1.Issues, T2.Book_ID FROM book as T1 JOIN publication as T2 ON T1.Book_ID == T2.Book_ID GROUP BY Issues HAVING Publisher <> "Bertelsmann" OR Price <= 2000000.0


Question: Can you list the aircraft IDs that are greater than 4 from the aircraft table, and combine that with a list of aircraft IDs that are less than 3 from the airport_aircraft table?

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


Question: What are the total store ID and highest product ID for products where the store ID is at least 2 and the product ID is less than 3, combined with the total store ID and highest product ID for products where the store ID is greater than 5 and the product ID is at least 2?

SELECT SUM(Store_ID), MAX(Product_ID) FROM store_product WHERE "Store_ID" >= 2 AND "Product_ID" < 3 UNION ALL SELECT SUM(Store_ID), MAX(Product_ID) FROM store_product WHERE "Store_ID" > 5 AND "Product_ID" >= 2


Question: Which driver IDs are both greater than 3 and also less than or equal to 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 that are greater than or equal to 2, excluding those driver IDs that are not equal to 3 and are found in the school bus table?

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


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

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 that are less than 3 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 < 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 from the driver table where the ID is 4 or greater, combined with a list of driver IDs from the school_bus table where the ID is not 10?

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


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

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


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


Question: Could you list the company IDs from the company table that meet either of these conditions: having profits of at least 25.7 billion and being headquartered in the USA and having a market value not equal to 202.2 billion, or having a name other than Chevron and a company ID greater than 5, but excluding any company IDs that are also found in the employment table where the people ID is less than or equal to 7?

SELECT Company_ID FROM company WHERE "Profits_in_Billion" >= 25.7 AND Headquarters = "USA" AND "Market_Value_in_Billion" <> 202.2 OR Name <> "Chevron" AND "Company_ID" > 5.0 EXCEPT SELECT Company_ID FROM employment WHERE "People_ID" <= 7


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

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


Question: Which driver IDs are equal to 1 in the driver table, but not equal to 9 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 = 9


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

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


Question: What is the highest feature ID from the Other_Available_Features table where the feature ID is less than or equal to 2, the feature name is not "BurglarAlarm", and the feature type code is not "Amenity", combined with the highest feature ID from the Other_Property_Features table where the property feature description is not "autem", the feature ID is not 2, and the property ID is 15?

SELECT MAX(feature_id) FROM Other_Available_Features WHERE "feature_id" <= 2 AND feature_name <> "BurglarAlarm" AND feature_type_code != "Amenity" UNION ALL SELECT MAX(feature_id) FROM Other_Property_Features WHERE property_feature_description <> "autem" AND "feature_id" != 2 AND "property_id" = 15


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

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


Question: Can you give me a list of driver IDs, where each ID is greater than 6, and is not a driver ID from the school bus list, excluding driver ID 9?

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


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

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


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

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


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

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


Question: Can you list all aircraft IDs, first from the aircraft table excluding aircraft ID 5, and then from the airport_aircraft table including only those greater than 5?

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


Question: Can you give me a list of aircraft IDs that are less than or equal to 4, and also appear in a list of aircraft IDs that are not equal to 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: Can you give me a list of driver IDs that are not 10 and also appear as driver IDs for school buses, where those school bus driver IDs are at least 7?

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


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

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


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

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


Question: Can you list the district name, ID, headquartered city, and city population for districts headquartered in Gujrat City, along with all districts that are not named Chiniot District, or have a city area less than 10, or a city population less than 134936 and are not headquartered in Chakwal City, and also don't have a district ID of 8?

SELECT District_name, District_ID, Headquartered_City, City_Population FROM district WHERE Headquartered_City = "Gujrat City" UNION ALL SELECT District_name, District_ID, Headquartered_City, City_Population FROM district WHERE District_name != "Chiniot District" OR "City_Area" < 10.0 OR "City_Population" < 134936.0 AND Headquartered_City <> "Chakwal City" AND "District_ID" != 8


Question: Can you list the aircraft IDs, excluding aircraft ID 2, that appear in the aircraft table but not in the airport_aircraft table where the aircraft ID is less than or equal to 1?

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


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

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


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

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


Question: What are the average donor names, minimum endowment IDs, count of school IDs, and amounts from the endowment table where either the amount is not 8.99 or the school ID is greater than 5, excluding those where the amount is greater than 9.83 or the school ID is 5 and the endowment ID is less than 8?

SELECT AVG(donator_name), MIN(endowment_id), COUNT(School_id), amount FROM endowment WHERE "amount" <> 8.99 OR "School_id" > 5 EXCEPT SELECT AVG(donator_name), MIN(endowment_id), COUNT(School_id), amount FROM endowment WHERE "amount" > 9.83 OR "School_id" = 5 AND "endowment_id" < 8


Question: Can you give me the Driver ID of drivers with ID 11, excluding any driver IDs greater than 3 that are also 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: Can you give me a list of driver IDs, excluding driver ID 5, that are in the driver table but not in the school bus table where the driver ID is less than 3?

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


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

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


Question: What is the difference between the number of clubs that don't have a Club ID of 3 and didn't start in 2009, and the number of coaches who either have a Coach ID of 3, a Club ID less than 1, a name other than Robert Chen with a rank greater than 1, or are male?

SELECT COUNT(Club_ID) FROM club WHERE "Club_ID" != 3 AND "Start_year" <> 2009 EXCEPT SELECT COUNT(Club_ID) FROM coach WHERE "Coach_ID" = 3 OR "Club_ID" < 1 OR Coach_name != "Robert Chen" AND "Rank" > 1 OR Gender = "M"


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


Question: Can you give me a list of driver IDs, including those from the driver table that are greater than or equal to 1, and also including driver ID 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 list the hometowns of members who either have a level greater than 6 and are from Fort Campbell, Kentucky, or whose name isn't Jeremy Jarmon, or whose member ID is 10, or whose card number isn't FS10, combined with the hometowns of members whose card number isn't RT91 and whose level is 2?

SELECT Hometown FROM member WHERE "Level" > 6 AND Hometown = "Fort Campbell, Kentucky" OR Name != "Jeremy Jarmon" OR "Member_ID" = 10 OR Card_Number != "FS10" UNION SELECT Hometown FROM member WHERE Card_Number != "RT91" AND "Level" = 2


Question: Could you give me the effective-to date, version number, effective-from date, and template details from the templates, excluding those where the template details are not empty, the version number is 9 or greater, the template ID is 20 or less, or the effective-to date is July 8th, 1999 at 3:31 AM and the effective-from date is October 7th, 1993 at 2:33 AM, and only including templates where the effective-from date is not April 5th, 2012 at 7:11 AM and the version number is not 6, or the template details are empty, or the template type code is not PP and the effective-to date is not December 7th, 1994 at 1:26 PM?

SELECT Date_Effective_To, Version_Number, Date_Effective_From, Template_Details FROM Templates WHERE Date_Effective_From <> "2012-04-05 07:11:42" AND "Version_Number" <> 6 OR Template_Details = "" OR Template_Type_Code <> "PP" AND Date_Effective_To <> "1994-12-07 13:26:23" EXCEPT SELECT Date_Effective_To, Version_Number, Date_Effective_From, Template_Details FROM Templates WHERE Template_Details != "" OR "Version_Number" >= 9 OR "Template_ID" <= 20 OR Date_Effective_To = "1999-07-08 03:31:04" AND Date_Effective_From = "1993-10-07 02:33:04"


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

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


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

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


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

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


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


Question: Can you give me a list of driver IDs that are not equal to 6, excluding any driver IDs that are less than 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: Can you give me a list of driver IDs that are less than 12 from the driver table, combined with a list of driver IDs that are 10 or less from the school bus table, removing any duplicates?

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 feature type codes are present in both the available features list (excluding features with ID 2 or named "BurglarAlarm" or described as "Burglar Alarm" and not of type "Amenity") and the reference feature types list (excluding those named "Amenity, eg Pool.")?

SELECT feature_type_code FROM Other_Available_Features WHERE "feature_id" != 2 OR feature_name <> "BurglarAlarm" AND feature_type_code <> "Amenity" AND feature_description <> "Burglar Alarm" INTERSECT SELECT feature_type_code FROM Ref_Feature_Types WHERE feature_type_name <> "Amenity, eg Pool."


Question: Can you give me a list of driver IDs that are less than or equal to 1, excluding any driver IDs that are greater than 7 and are also 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 > 7


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

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


Question: Which driver IDs, that are at least 7, are not also school bus driver IDs that are at least 10?

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: Which driver IDs appear in both the driver table, excluding driver ID 5, and the school_bus table, including only driver IDs greater than or equal to 7?

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 from the driver table that are greater than or equal to 9, excluding any 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 >= 9 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 greater than 10 from the driver table, excluding any driver IDs from the school_bus table that are not equal to 4?

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


Question: Can you give me the Aircraft ID from the aircraft table that is equal to 2, excluding any Aircraft IDs from the airport_aircraft table that are less than 1?

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


Question: Can you list all the driver IDs from the driver table that are 11 or greater, combined with all the driver IDs from the school bus table that are less than 10?

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


Question: Can you give me 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 10?

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


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

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


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

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


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

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


Question: Can you give me a list of all driver IDs, combining those from the driver table excluding ID 11 with those from the school bus table excluding ID 3, removing any duplicates?

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, combining those from the driver table that aren't 12 with those from the school bus table that are less than 10, removing any duplicates?

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


Question: Can you give me the age, name, and birth state of people in the head table who are either named Billy Mayfair, not born in California, or not 43 years old, but only if they are also either older than 67 and born in Delaware, not named Dudley Hart, or have a head ID that isn't 1?

SELECT age, name, born_state FROM head WHERE name = "Billy Mayfair" OR born_state != "California" OR "age" != 43.0 INTERSECT SELECT age, name, born_state FROM head WHERE "age" > 67.0 AND born_state = "Delaware" OR name <> "Dudley Hart" OR "head_ID" <> 1


Question: Which aircraft have an ID of 2 and are also associated with airports having an aircraft ID greater than 1?

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


Question: Can you give me a list of driver IDs, combining those from the driver table excluding ID 2, and those from the school bus table excluding ID 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 product IDs that are less than or equal to 2, and also list the product IDs that are not equal to 6?

SELECT Product_ID FROM store_product WHERE "Product_ID" <= 2 UNION SELECT Product_ID FROM store_product WHERE "Product_ID" <> 6


Question: Can you give me the receipt date, document ID, shipping agent code, document status code, and receipt number from the Documents table where either the shipping agent code is "SH" or the receipt date is not "2017-07-02 17:39:09" and the document ID is less than 13 and the receipt number is not "83", but only if they also appear in the Documents table where the receipt date is not "1973-11-05 21:48:53" or the receipt number is not "37" and the shipping agent code is not "FE" or the other details are "j" or the document ID is 4 or the document status code is not "done"?

SELECT receipt_date, document_id, shipping_agent_code, document_status_code, receipt_number FROM Documents WHERE shipping_agent_code = "SH" OR receipt_date <> "2017-07-02 17:39:09" AND "document_id" < 13 AND receipt_number != "83" INTERSECT SELECT receipt_date, document_id, shipping_agent_code, document_status_code, receipt_number FROM Documents WHERE receipt_date != "1973-11-05 21:48:53" OR receipt_number <> "37" AND shipping_agent_code <> "FE" OR other_details = "j" OR "document_id" = 4 OR document_status_code <> "done"


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


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

SELECT Driver_ID FROM driver GROUP BY Driver_ID HAVING Driver_ID < 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, combining those from the driver table excluding ID 11, with those from the school bus table that are less than 3?

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


Question: Can you list all the parties from the election table where either 13 counties are represented, the delegate isn't Shane E. Shane Pendergrass, the first election wasn't in 2003, or the committee is Appropriations and the party is less than 7 and the election ID isn't 5, combined with all the parties from the party table where the party isn't Independence, or the party ID is 6, or the governor is Peter Vallone and the comptroller is Carl McCall and the lieutenant governor isn't Mary Donohue?

SELECT Party FROM election WHERE Counties_Represented = "13" OR Delegate <> "Pendergrass, Shane E. Shane Pendergrass" OR "First_Elected" != 2003.0 OR Committee = "Appropriations" AND "Party" < 7 AND "Election_ID" != 5 UNION ALL SELECT Party FROM party WHERE Party <> "Independence" OR "Party_ID" = 6 OR Governor = "Peter Vallone" AND Comptroller = "Carl McCall" AND Lieutenant_Governor != "Mary Donohue"


Question: Can you list the aircraft IDs that are less than 4, excluding any aircraft IDs that appear in the airport aircraft list and are equal to 1?

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


Question: What aircraft IDs appear in the aircraft table, specifically aircraft ID 1, but do not appear in the airport_aircraft table for aircraft IDs less than 1?

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


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

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


Question: Can you give me the Driver ID from the driver table, specifically if the Driver ID is 11, but only if that Driver ID is not also in the school_bus table where the Driver ID is greater than 7?

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


Question: Can you find the minimum age and name, along with the head ID, for heads where either the age is less than 52, the birth state isn't Connecticut, the head ID is 6 or greater, or the name isn't Nick Faldo, combined with the minimum age and name, along with the head ID, for heads where either the name isn't Jeff Maggert, the age is 43 and the head ID is 1 or less, or the birth state is Florida?

SELECT MIN(age), MIN(name), head_ID FROM head WHERE "age" < 52.0 OR born_state <> "Connecticut" OR "head_ID" >= 6 OR name <> "Nick Faldo" UNION SELECT MIN(age), MIN(name), head_ID FROM head WHERE name <> "Jeff Maggert" AND "age" = 43.0 AND "head_ID" <= 1 OR born_state = "Florida"


Question: What is the number of pets that either don't have an ID of 2003 or belong to student 1001, and also the number of pets that are not dogs, or don't have an ID of 2003, or have a weight of 12.0 but are not 3 years old?

SELECT COUNT(PetID) FROM Has_Pet WHERE "PetID" <> 2003 OR "StuID" = 1001 INTERSECT SELECT COUNT(PetID) FROM Pets WHERE PetType != "dog" OR "PetID" <> 2003 OR "weight" = 12.0 AND "pet_age" <> 3


Question: Could you give me the IDs that are both from car makers that aren't Volkswagen or don't have the full name Mazda, or don't have an ID of 16, or are from country 8, and also from cars made in years other than 1978?

SELECT Id FROM car_makers WHERE Maker <> "volkswagen" OR FullName != "Mazda" OR "Id" <> 16 OR Country = "8" INTERSECT SELECT Id FROM cars_data WHERE "Year" <> 1978


Question: Can you give me a list of driver IDs, including those from the driver table that are less than or equal to 11, and those from the school bus table that are greater than 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: Could you give me a list of car maker names and their countries, including only those that satisfy these two conditions: first, the maker isn't 'kia' or the country isn't '2' and the name isn't 'Honda' or the ID is less than 8; and second, the country isn't '1' or the name isn't 'Peugeaut' or the ID isn't 22?

SELECT FullName, Country FROM car_makers WHERE Maker <> "kia" OR Country <> "2" AND FullName <> "Honda" OR "Id" < 8 INTERSECT SELECT FullName, Country FROM car_makers WHERE Country <> "1" OR FullName != "Peugeaut" OR "Id" != 22


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

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


Question: Can you give me a list of driver IDs that are 8 or greater, from the driver table, excluding any driver IDs that are 4 or greater from 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 >= 4


Question: Which driver has an ID of 9, excluding any drivers with IDs less than 4 who are also school bus drivers?

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


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

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: Can you give me a list of aircraft IDs that are not equal to 2, excluding any aircraft IDs found in the airport aircraft list that are not equal to 1?

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


Question: Can you list the draft numbers and their highest document IDs, excluding those with a highest document ID of 1 from the circulation history, and combine that with a list of draft numbers and their highest document IDs, excluding those with a highest document ID of 13 from the document drafts?

SELECT draft_number, MAX(document_id) FROM Circulation_History GROUP BY draft_number HAVING MAX(document_id) != 1 UNION SELECT draft_number, MAX(document_id) FROM Document_Drafts GROUP BY draft_number HAVING MAX(document_id) != 13


Question: What aircraft IDs, excluding aircraft ID 3, are also aircraft IDs less than 5 that are used at 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 give me a list of aircraft IDs, including those from the aircraft table where the ID is 1 or greater, and those from the airport_aircraft table where the ID is not 5?

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


Question: Can you give me the draft number, draft details, and document ID for all document drafts that have a draft number other than 14, but only if they also have a document ID greater than 1, a draft number of 9 or more, or draft details equal to "v"?

SELECT draft_number, draft_details, document_id FROM Document_Drafts WHERE "draft_number" != 14 INTERSECT SELECT draft_number, draft_details, document_id FROM Document_Drafts WHERE "document_id" > 1 OR "draft_number" >= 9 OR draft_details = "v"


Question: What is the smallest feature ID for amenities, excluding those named "AirCon" or described as "Burglar Alarm", or where the feature ID isn't 3, combined with the smallest feature ID from property features where the ID is 3 or less and the description isn't "odio"?

SELECT MIN(feature_id) FROM Other_Available_Features WHERE feature_type_code = "Amenity" AND feature_name <> "AirCon" AND feature_description <> "Burglar Alarm" OR "feature_id" != 3 UNION ALL SELECT MIN(feature_id) FROM Other_Property_Features WHERE "feature_id" <= 3 AND property_feature_description <> "odio"


Question: Which driver IDs, that are at least 6, are not also school bus driver IDs that are at least 10?

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


Question: How many property types are there for each description, excluding "Field, Meadow." and "House, Bungalow, etc."?

SELECT COUNT(property_type_code), property_type_description FROM Ref_Property_Types WHERE property_type_description <> "Field, Meadow." UNION SELECT COUNT(property_type_code), property_type_description FROM Ref_Property_Types WHERE property_type_description <> "House, Bungalow, etc."


Question: Can you give me a list of shipping agent codes from the Documents table where either the other details are "u", the document type code isn't "CD", the shipping agent code isn't "SH" and the document ID is less than or equal to 15, the document status code isn't "done", the receipt date is "1973-11-05 21:48:53", or the receipt number isn't "37", combined with a list of shipping agent codes from the Ref_Shipping_Agents table where the shipping agent code isn't "AL" and the shipping agent description isn't "k"?

SELECT shipping_agent_code FROM Documents WHERE other_details = "u" OR document_type_code <> "CD" OR shipping_agent_code != "SH" AND "document_id" <= 15 OR document_status_code != "done" OR receipt_date = "1973-11-05 21:48:53" OR receipt_number != "37" UNION SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_code <> "AL" AND shipping_agent_description <> "k"


Question: Can you give me a list of document status codes from the Documents table, including those where the document type is not "CD" and the other details are not "u", or where the document ID is greater than 12 and the receipt number is not "83", or where the shipping agent code is not "AL", or where the document status code is "done" and the receipt date is not "1996-07-27 03:30:40", combined with a list of document status codes from the Ref_Document_Status table where the document status description is not "currently working on"?

SELECT document_status_code FROM Documents WHERE document_type_code <> "CD" AND other_details != "u" OR "document_id" > 12 AND receipt_number <> "83" OR shipping_agent_code != "AL" OR document_status_code = "done" AND receipt_date <> "1996-07-27 03:30:40" UNION SELECT document_status_code FROM Ref_Document_Status WHERE document_status_description != "currently working on"


Question: Which driver IDs are both greater than or equal to 10 in the driver table and greater than or 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 give me a list of driver IDs that are not 10, where each ID appears only once, excluding any driver IDs that are less than or equal to 3 and appear 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 <= 3


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

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


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

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


Question: Can you list the country name, continent, and country ID for the UK, and also list the country name, continent, and country ID for all countries that are not Sweden or have a continent value greater than or equal to 1?

SELECT CountryName, Continent, CountryId FROM countries WHERE CountryName = "uk" UNION SELECT CountryName, Continent, CountryId FROM countries WHERE CountryName <> "sweden" OR "Continent" >= 1


Question: Can you list the aircraft ID and distance for aircraft where the distance is 520 or less, or the name is not Airbus A319, combined with the aircraft ID and distance for flights where the aircraft ID is not 7, or the arrival date is not December 4th, 2005 at 3:55 AM, and the distance is less than 2551, and the departure date is December 4th, 2005 at 9:00 AM?

SELECT aid, distance FROM aircraft WHERE "distance" <= 520 OR name <> "Airbus A319" UNION SELECT aid, distance FROM flight WHERE "aid" <> 7 OR arrival_date != "04/12/2005 03:55" AND "distance" < 2551 AND departure_date = "04/12/2005 09:00"


Question: Can you give me a list of aircraft IDs, excluding aircraft ID 5, that appear more than once, and then remove any aircraft IDs from that list that also appear more than once in the airport aircraft table, excluding aircraft ID 3?

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


Question: Can you give me a list of driver IDs, including driver ID 4 from the driver table and all driver IDs except 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, excluding driver ID 2, that are not also driver IDs, excluding driver ID 7, found in the school bus table?

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


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

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


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

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


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


Question: Can you list all driver IDs less than or equal to 10 from the driver table, and combine that with a list of all driver IDs less than 10 from the school bus table, removing any duplicates?

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 show me the total budget percentage budgeted and the budgeted amount from the budget table, combining two sets of results: first, where the year isn't 1999 and the invested amount isn't 85249, or the school ID is greater than 2 and the budgeted amount is 113531, or the total budget percentage budgeted isn't 1.3 and the total budget percentage invested is 2.2; and second, where the total budget percentage budgeted is 2.4?

SELECT total_budget_percent_budgeted, Budgeted FROM budget WHERE "Year" <> 1999 AND "Invested" != 85249 OR "School_id" > 2 AND "Budgeted" = 113531 OR "total_budget_percent_budgeted" <> 1.3 AND "total_budget_percent_invested" = 2.2 UNION ALL SELECT total_budget_percent_budgeted, Budgeted FROM budget WHERE "total_budget_percent_budgeted" = 2.4


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

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


Question: Can you give me a list of driver IDs from the driver table where the ID is less than 8, combined with a list of driver IDs from the school_bus table where the ID is exactly 10?

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


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

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


Question: Could you list the advisor, age, city code, sex, major, first name, and last name for all students who either live in Chicago and have a student ID less than 1007, or are older than 18, combined with the same information for students who don't have major 550, are named Jun, have an advisor number less than 7723, and are not 18 years old?

Advisor Age city_code Sex Major Fname LName

SELECT Advisor, Age, city_code, Sex, Major, Fname, LName FROM Student WHERE city_code = "CHI" AND "StuID" < 1007 OR "Age" > 18 UNION ALL SELECT Advisor, Age, city_code, Sex, Major, Fname, LName FROM Student WHERE "Major" <> 550 AND Fname = "Jun" AND "Advisor" < 7723 AND "Age" != 18


Question: Can you give me a list of driver IDs that are less than 7 from the driver table, combined with a list of 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: Can you list the enrollment, location, and county for all schools that are in IHSAA Class AAA, excluding school ID 1, combined with the enrollment, location, and county for all schools that are not in IHSAA Football Class A and are not located in New Carlisle?

852
New Carlisle
46 LaPorte 71 St. Joseph

SELECT Enrollment, Location, County FROM School WHERE IHSAA_Class = "AAA" AND School_id != "1" UNION SELECT Enrollment, Location, County FROM School WHERE IHSAA_Football_Class != "A" AND Location <> "New Carlisle"


Question: Can you list the driver IDs that are less than or equal to 1 from the driver table, and also list the driver IDs that are greater than or equal to 9 from the school_bus table, combining both lists into one?

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


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

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


Question: Can you give me the total of the club descriptions, the club ID, and the number of club locations for clubs where the location is not "AKW" and the description is "Play pen and paper games on campus," or where the club ID is greater than 4, combined with the total of the club descriptions, the club ID, and the number of club locations for clubs where the name is not "Tennis Club" and the club ID is greater than or equal to 1, or where the description is not "Venture capital fund for student business" and the location is not "HHH"?

SELECT SUM(ClubDesc), ClubID, COUNT(ClubLocation) FROM Club WHERE ClubLocation != "AKW" AND ClubDesc = "Play pen and paper games on campus." OR "ClubID" > 4 UNION SELECT SUM(ClubDesc), ClubID, COUNT(ClubLocation) FROM Club WHERE ClubName <> "Tennis Club" AND "ClubID" >= 1 OR ClubDesc <> "Venture capital fund for student business." AND ClubLocation <> "HHH"


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

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


Question: Can you give me a list of driver IDs, combining those from the driver table where the ID is not 2, and those from the school bus table where the ID is not 4, making sure to list each ID only once?

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


Question: Can you give me the city population and district ID for each district, but only for districts where the city area isn't 12 or the city population is 2793721?

SELECT T1.City_Population, T2.District_ID FROM district as T1 JOIN store_district as T2 ON T1.District_ID == T2.District_ID GROUP BY District_name HAVING City_Area <> 12.0 OR City_Population = 2793721.0


Question: Can you give me a list of customer IDs from payments made on February 19, 2018, at 1:49:59 AM, or paid with a credit card, where the customer ID is 14 or higher, combined with a list of customer IDs from lessons that cost something other than $231 and are not completed, where the staff ID is 4 or higher?

SELECT customer_id FROM Customer_Payments WHERE "customer_id" >= 14 AND datetime_payment = "2018-02-19 01:49:59" OR payment_method_code = "Credit Card" UNION SELECT customer_id FROM Lessons WHERE "price" <> 231.0 AND "staff_id" >= 4 AND lesson_status_code != "Completed"


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


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

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: Which driver IDs, excluding driver ID 4, are not also driver IDs of school buses, excluding school bus driver ID 9?

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


Question: What is the difference between the average feature ID of all available features excluding "AirCon", and the average feature ID of property features described as "modi" with a feature ID of 4 and a property ID not equal to 11?

SELECT AVG(feature_id) FROM Other_Available_Features WHERE feature_name != "AirCon" EXCEPT SELECT AVG(feature_id) FROM Other_Property_Features WHERE property_feature_description = "modi" AND "feature_id" = 4 AND "property_id" <> 11


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

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


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

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


Question: Can you list the aircraft IDs that appear more than once, both from the aircraft table and the airport_aircraft table?

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


Question: Can you list all aircraft IDs that are greater than 4 from the aircraft table, combined with all aircraft IDs that are greater than 2 from the airport_aircraft table?

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


Question: Can you list all the driver IDs that are greater than 10 from the driver table, combined with all the driver IDs that are not equal to 10 from the school_bus table?

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


Question: Which driver IDs, other than 11, appear in the driver table and are also greater than 4 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 > 4


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

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


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

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


Question: Can you give me the driver ID that appears exactly once as 7 in the driver table, but is not a driver ID that appears as 10 or greater 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: Could you list the names of employees who either don't live in Bristol or are older than 23 and aren't named Phil Vickery, excluding the names of shop employees who either have a Shop ID less than 6 and are managed by Olli Huttunen, or aren't named FF Jaro, have fewer than 6000 products, and are located in Kuopio?

SELECT Name FROM employee WHERE City != "Bristol" OR "Age" > 23 AND Name != "Phil Vickery" EXCEPT SELECT Name FROM shop WHERE "Shop_ID" < 6 AND Manager_name = "Olli Huttunen" OR Name <> "FF Jaro" AND "Number_products" < 6000 AND Location = "Kuopio"


Question: Can you list the driver IDs that are less than 5 from the driver table, and also list the driver IDs that are less than 4 from the school_bus table, combining the two lists into one?

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 a list of driver IDs, excluding driver ID 7 from the driver table and driver ID 9 from the school_bus table, making sure to list each driver ID only once?

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


Question: How many aircraft have a distance less than 2128 or are named "Airbus A319", and what are the corresponding eid values for those aircraft?

SELECT COUNT(T1.distance), T2.eid FROM aircraft as T1 JOIN certificate as T2 ON T1.aid = T2.aid WHERE AVG(distance) < 2128 OR name = "Airbus A319"


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


Question: Could you list the ICAO codes and IDs for airports that meet either of these conditions: either the airport is named "Schiphol Airport" but is not in Brussels, or the airport's IATA code isn't "BCN" and its ID is 8 or greater, or the airport is not in Iceland?

SELECT ICAO, id FROM airport WHERE name = "Schiphol Airport" AND City != "Brussels" UNION SELECT ICAO, id FROM airport WHERE IATA != "BCN" AND "id" >= 8 OR Country <> "Iceland"


Question: Could you please retrieve the Paragraph ID, Document ID, Paragraph Text, and Other Details from the Paragraphs table, combining results from two different sets of criteria: the first set includes paragraphs where the text is not "UK" and the other details are "None", or where the Paragraph ID is 280120913, or where the Document ID is not 2394; and the second set includes paragraphs where the other details are not "None", or the Document ID is greater than 2394, or the Paragraph ID is less than or equal to 608931827 and the paragraph text is "Micronesia"?

SELECT Paragraph_ID, Document_ID, Paragraph_Text, Other_Details FROM Paragraphs WHERE Paragraph_Text != "UK" AND Other_Details = "None" OR "Paragraph_ID" = 280120913 OR "Document_ID" != 2394 UNION SELECT Paragraph_ID, Document_ID, Paragraph_Text, Other_Details FROM Paragraphs WHERE Other_Details <> "None" OR "Document_ID" > 2394 OR "Paragraph_ID" <= 608931827 AND Paragraph_Text = "Micronesia"


Question: Can you give me the street addresses of branches that either aren't branch number 5 and aren't on Oaks Crescent, or didn't open in 2014 and are also on a street where a branch opened in 2001?

SELECT Address_road FROM branch WHERE "Branch_ID" != 5 AND Address_road <> "Oaks Crescent" OR Open_year <> "2014" IN (SELECT Address_road FROM branch WHERE Open_year = "2001")


Question: Could you give me the school IDs from the budget table where either the budgeted amount is greater than 6803, or the invested amount is 140102 and the school ID is less than or equal to 5, or the total budget percent budgeted is not 2.0 and the budget invested percent is not 228.6, or the total budget percent invested is less than 2.2, combined with the school IDs from the endowment table where either the endowment ID is greater than or equal to 6 and the donator name is Duarte, or the amount is less than 9.73?

SELECT School_id FROM budget WHERE "Budgeted" > 6803 OR "Invested" = 140102 AND "School_id" <= 5 OR "total_budget_percent_budgeted" != 2.0 AND Budget_invested_percent <> "228.6" OR "total_budget_percent_invested" < 2.2 UNION ALL SELECT School_id FROM endowment WHERE "endowment_id" >= 6 AND donator_name = "Duarte" OR "amount" < 9.73


Question: What is the difference between the number of documents with an ID less than or equal to 76, no other details, and a description of "y", and the number of paragraphs with an ID not equal to 3830, or containing the text "Ukraine" and having an ID of 16615, or having other details that are not "None"?

SELECT COUNT(Document_ID) FROM Documents WHERE "Document_ID" <= 76 AND Other_Details = "None" AND Document_Description = "y" EXCEPT SELECT COUNT(Document_ID) FROM Paragraphs WHERE "Document_ID" != 3830 OR Paragraph_Text = "Ukraine" AND "Paragraph_ID" = 16615 OR Other_Details <> "None"


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

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


Question: Can you give me a list of driver IDs, including those from the driver table that are greater than 12, and those from the school bus table that are 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: Can you give me a list of company names that either aren't headquartered in the USA and have assets under 340.5 billion, or aren't in the oil and gas industry, or don't have a market value of 213.7 billion and have sales under 143.7 billion, along with a list of people's names who aren't Tom Sheehey and aren't from the United Kingdom?

SELECT Name FROM company WHERE Headquarters <> "USA" AND "Assets_in_Billion" < 340.5 OR Industry != "Oil and gas" OR "Market_Value_in_Billion" <> 213.7 AND "Sales_in_Billion" < 143.7 UNION ALL SELECT Name FROM people WHERE Name != "Tom Sheehey" AND Nationality <> "United Kindom"


Question: Can you list the document IDs and draft numbers from the circulation history for entries where the employee ID is 8 or higher, the draft number is 20 or lower, or the document ID is 10 or higher, combined with a list of document IDs and draft numbers where the copy number is 5 or higher, the draft number is less than 17, or the employee ID is not 1 and the document ID is 1?

SELECT document_id, draft_number FROM Circulation_History WHERE "employee_id" >= 8 OR "draft_number" <= 20 OR "document_id" >= 10 UNION ALL SELECT document_id, draft_number FROM Circulation_History WHERE "copy_number" >= 5 OR "draft_number" < 17 OR "employee_id" != 1 AND "document_id" = 1


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

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


Question: Could you give me a list of player IDs, including those of players who don't work as "Product Consultant - MLCC" and also those of players or coaches who started in 2012 or have a coach ID of 1 or less?

SELECT Player_ID FROM player WHERE Occupation <> "Product Consultant - MLCC" UNION ALL SELECT Player_ID FROM player_coach WHERE "Starting_year" = 2012 OR "Coach_ID" <= 1


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


Question: Can you tell me the arrival date, the latest origin, the average flight number, the airline ID, the departure date, the latest destination, and the highest price for flights with a distance of 2606 and flight number 13, combined with the same information for flights that don't originate in Los Angeles?

arrival_date MAX(origin) AVG(flno) aid departure_date MAX(destination) MAX(price)

SELECT arrival_date, MAX(origin), AVG(flno), aid, departure_date, MAX(destination), MAX(price) FROM flight WHERE "distance" = 2606 AND "flno" = 13 UNION ALL SELECT arrival_date, MAX(origin), AVG(flno), aid, departure_date, MAX(destination), MAX(price) FROM flight WHERE origin != "Los Angeles"


Question: Can you give me the highest maker name and its ID, but only for those that are either not "peugeaut" or have an ID that isn't 13, and also are either "triumph" with an ID of 4 or less, or have a full name that isn't "Fiat"?

SELECT MAX(Maker), Id FROM car_makers WHERE Maker != "peugeaut" OR "Id" <> 13 INTERSECT SELECT MAX(Maker), Id FROM car_makers WHERE Maker = "triumph" AND "Id" <= 4 OR FullName != "Fiat"


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

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


Question: What are the common average of feature type names and sum of feature type codes in the Ref_Feature_Types table, excluding rows where the feature type code is "Security" and the feature type name is "Securiyt, eg Burglar Alarm.", and also excluding rows where the feature type name is "Amenity, eg Pool."?

SELECT AVG(feature_type_name), SUM(feature_type_code) FROM Ref_Feature_Types WHERE feature_type_code <> "Security" AND feature_type_name <> "Securiyt, eg Burglar Alarm." INTERSECT SELECT AVG(feature_type_name), SUM(feature_type_code) FROM Ref_Feature_Types WHERE feature_type_name <> "Amenity, eg Pool."


Question: Can you list the district, delegate, party, first elected year, committee, counties represented, and election ID for all elections where the committee is Appropriations and the election ID is 5, or the party is less than 3, or the counties represented are not "09.1 9A", but exclude any elections with an election ID of 8?

DeBoy, Steven J. Sr. Steven J. DeBoy, Sr.

Malone, James E. Jr. James E. Malone, Jr.

SELECT District, Delegate, Party, First_Elected, Committee, Counties_Represented, Election_ID FROM election WHERE Committee = "Appropriations" AND "Election_ID" = 5 OR "Party" < 3 OR Counties_Represented <> "09.1 9A" EXCEPT SELECT District, Delegate, Party, First_Elected, Committee, Counties_Represented, Election_ID FROM election WHERE "Election_ID" = 8


Question: What are the earliest date of birth and the alphabetically first last name for customers with the cell phone number 1-197-686-2849x8761 and an amount outstanding greater than 255, or a customer address ID less than or equal to 13, combined with the earliest date of birth and alphabetically first last name for staff members who either have the nickname santos45, or a staff ID less than or equal to 10 and a date joined staff not equal to 2016-05-01 02:22:45 and a staff address ID less than or equal to 2, or a date left staff equal to 2018-03-05 18:30:12 and a last name of Jast, or a date of birth equal to 1998-04-27 12:55:05?

SELECT MIN(last_name), MAX(date_of_birth) FROM Customers WHERE cell_mobile_phone_number = "1-197-686-2849x8761" AND "amount_outstanding" > 255.0 OR "customer_address_id" <= 13 UNION SELECT MIN(last_name), MAX(date_of_birth) FROM Staff WHERE nickname = "santos45" OR "staff_id" <= 10 AND date_joined_staff != "2016-05-01 02:22:45" AND "staff_address_id" <= 2 OR date_left_staff = "2018-03-05 18:30:12" AND last_name = "Jast" OR date_of_birth = "1998-04-27 12:55:05"


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


Question: Can you give me the Driver ID of drivers with ID 5, excluding the Driver IDs of school bus drivers with ID 10?

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


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


Question: Can you give me the document type codes from the Documents table where either the receipt date is April 21, 2008 at 8:42:25 PM, the shipping agent code is "SH" and the document type code is not "Paper", or the document status code is not "done", or the other details are not "x", or the receipt number is "79", or the document ID is not 14, combined with the document type codes from the Ref_Document_Types table where the document type description is not "u" and the document type code is "CD"?

SELECT document_type_code FROM Documents WHERE receipt_date = "2008-04-21 20:42:25" AND shipping_agent_code = "SH" AND document_type_code != "Paper" OR document_status_code <> "done" OR other_details != "x" OR receipt_number = "79" OR "document_id" <> 14 UNION SELECT document_type_code FROM Ref_Document_Types WHERE document_type_description != "u" AND document_type_code = "CD"


Question: Which aircraft IDs are less than 4 and also equal to 1?

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


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

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


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

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


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

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


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

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


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

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


Question: Can you give me the apartment feature 2, other feature 1, shop feature 1, apartment feature 1, property address, field feature 3, and other feature 3 from properties that meet both of these conditions: first, properties where apartment feature 1 is "qui" and the property address is not "6837 Darien Views Apt. 475 South Maraview, KS 77770" or field feature 3 is not "None" or apartment feature 2 is "autem" or other feature 3 is "None" or the room count is greater than 2 or the property type code is not "Apartment" or other property details is not "None" and house feature 3 is "None" and shop feature 2 is not "None" or apartment feature 3 is not "None"; and second, properties where the date on market is not "1994-02-14 02:27:13" and house feature 2 is not "None" or the property address is not "2088 Bashirian Fork Suite 337 Faustinoport, MT 16771-9320" or field feature 2 is not "None" or other feature 2 is "None" or the vendor requested price is not 983.8596 or other property details is not "None" and apartment feature 3 is not "None" or the room count is greater than 8 and house feature 1 is not "None" or shop feature 3 is not "None" or shop feature 2 is "None" and the buyer offered price is less than 3520911.5258 and the agreed selling price is less than or equal to 244353758.1824 and other feature 1 is "None" and field feature 3 is not "None" and the date sold is not "1981-06-26 21:28:28" or other feature 3 is "None" and the property ID is less than or equal to 1 or the property type code is not "Other" or the property name is "longacre" and apartment feature 2 is not "eos" and house feature 3 is "None" and apartment feature 1 is not "sed" or field feature 1 is not "None"?

49578 Ayden Mountains
New Russellhaven, UT 46626

60845 Else Highway Apt. 826
South Dougfort, CO 43200-4258

743 Ephraim Greens
Anniemouth, HI 47084-3853

6837 Darien Views Apt. 475
South Maraview, KS 77770

1474 Dibbert Fields Suite 055
South Renee, IN 58286-3097

098 Tremaine Highway Suite 569
South Wilford, NJ 46587-3537

2088 Bashirian Fork Suite 337
Faustinoport, MT 16771-9320

092 Paucek Highway Apt. 772
East Erika, IA 61358

062 Micaela Court Apt. 707
Margretville, WV 51628-3617

986 Hagenes Drives
Draketon, UT 83411-3393

24365 Ulices Run
Homenicktown, MD 88485-6198

2765 Schulist Stream
Lindmouth, UT 03391-3817

107 Roob Courts
Erdmanburgh, IA 42926-0873

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

084 Lakin Vista Apt. 394
Fishertown, MA 16876

SELECT apt_feature_2, oth_feature_1, shp_feature_1, apt_feature_1, property_address, fld_feature_3, oth_feature_3 FROM Properties WHERE apt_feature_1 = "qui" AND property_address <> "6837 Darien Views Apt. 475 South Maraview, KS 77770" OR fld_feature_3 <> "None" OR apt_feature_2 = "autem" OR oth_feature_3 = "None" OR "room_count" > 2 OR property_type_code != "Apartment" OR other_property_details != "None" AND hse_feature_3 = "None" AND shp_feature_2 != "None" OR apt_feature_3 != "None" INTERSECT SELECT apt_feature_2, oth_feature_1, shp_feature_1, apt_feature_1, property_address, fld_feature_3, oth_feature_3 FROM Properties WHERE date_on_market != "1994-02-14 02:27:13" AND hse_feature_2 != "None" OR property_address <> "2088 Bashirian Fork Suite 337 Faustinoport, MT 16771-9320" OR fld_feature_2 != "None" OR oth_feature_2 = "None" OR "vendor_requested_price" != 983.8596 OR other_property_details <> "None" AND apt_feature_3 <> "None" OR "room_count" > 8 AND hse_feature_1 != "None" OR shp_feature_3 <> "None" OR shp_feature_2 = "None" AND "buyer_offered_price" < 3520911.5258 AND "agreed_selling_price" <= 244353758.1824 AND oth_feature_1 = "None" AND fld_feature_3 <> "None" AND date_sold <> "1981-06-26 21:28:28" OR oth_feature_3 = "None" AND "property_id" <= 1 OR property_type_code <> "Other" OR property_name = "longacre" AND apt_feature_2 <> "eos" AND hse_feature_3 = "None" AND apt_feature_1 <> "sed" OR fld_feature_1 <> "None"


Question: Which driver IDs are both greater than or equal to 3 and also not equal to 3, considering driver IDs from both the driver and school_bus lists?

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


Question: Can you give me a list of driver IDs, excluding driver ID 3 from the driver list and excluding driver ID 9 from the school bus list, combining both lists into one?

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 from the driver table where each ID is less than or equal to 4, combined with a list of driver IDs from the school_bus table where each ID is less than 9?

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: What are the number of ModelIds and the average Maker value for entries in the model list where either the ModelId is 4 or the Maker is greater than 6 and the Model is "fiat", combined with the number of ModelIds and average Maker value for entries where either the Maker is less than 4 or the ModelId is less than 17?

SELECT COUNT(ModelId), AVG(Maker) FROM model_list WHERE "ModelId" = 4 OR "Maker" > 6 AND Model = "fiat" UNION SELECT COUNT(ModelId), AVG(Maker) FROM model_list WHERE "Maker" < 4 OR "ModelId" < 17


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

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


Question: Can you give me a list of driver IDs, excluding driver ID 5, that appear in the driver table but not in the school_bus table, where driver ID 9 is also excluded from 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 != 9


Question: What are the average lesson date, earliest lesson status code, staff ID, and number of lessons for staff IDs greater than 4 or vehicle IDs not equal to 1, combined with the same information for staff IDs less than 12?

SELECT AVG(lesson_date), MIN(lesson_status_code), staff_id, COUNT(lesson_id) FROM Lessons WHERE "staff_id" > 4 OR "vehicle_id" != 1 UNION SELECT AVG(lesson_date), MIN(lesson_status_code), staff_id, COUNT(lesson_id) FROM Lessons WHERE "staff_id" < 12


Question: Can you give me a list of driver IDs, combining those from the driver table that are not 11 with those from the school bus table that are 4 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 >= 4


Question: Which aircraft IDs are less than 4 and also greater than 2, considering only the aircraft IDs that appear in both the aircraft and airport_aircraft tables?

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


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


Question: Can you tell me the alphabetically first employee name among those younger than 43, with an employee ID of 1 or less, and not from Leicester, combined with the alphabetically first shop name that's "KuPS" with fewer than 10770 products, located in the Arto Tolsa Areena district, not in Kuopio, and has a shop ID greater than 1, or a manager other than Olli Huttunen?

SELECT MIN(Name) FROM employee WHERE "Age" < 43 AND "Employee_ID" <= 1 AND City <> "Leicester" UNION SELECT MIN(Name) FROM shop WHERE Name = "KuPS" AND "Number_products" < 10770 AND District = "Arto Tolsa Areena" AND Location != "Kuopio" AND "Shop_ID" > 1 OR Manager_name <> "Olli Huttunen"


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

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