Question: What are the details, including features, prices, and dates, for properties that meet any of the following criteria: certain feature combinations, specific property names or addresses, or specific property IDs, with the results combined from two different sets of conditions?

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

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

49578 Ayden Mountains
New Russellhaven, UT 46626

2765 Schulist Stream
Lindmouth, UT 03391-3817

6837 Darien Views Apt. 475
South Maraview, KS 77770

092 Paucek Highway Apt. 772
East Erika, IA 61358

24365 Ulices Run
Homenicktown, MD 88485-6198

107 Roob Courts
Erdmanburgh, IA 42926-0873

084 Lakin Vista Apt. 394
Fishertown, MA 16876

743 Ephraim Greens
Anniemouth, HI 47084-3853

986 Hagenes Drives
Draketon, UT 83411-3393

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

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

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

49578 Ayden Mountains
New Russellhaven, UT 46626

2765 Schulist Stream
Lindmouth, UT 03391-3817

6837 Darien Views Apt. 475
South Maraview, KS 77770

092 Paucek Highway Apt. 772
East Erika, IA 61358

24365 Ulices Run
Homenicktown, MD 88485-6198

107 Roob Courts
Erdmanburgh, IA 42926-0873

084 Lakin Vista Apt. 394
Fishertown, MA 16876

2088 Bashirian Fork Suite 337
Faustinoport, MT 16771-9320

743 Ephraim Greens
Anniemouth, HI 47084-3853

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

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

986 Hagenes Drives
Draketon, UT 83411-3393

SELECT hse_feature_2, shp_feature_3, buyer_offered_price, apt_feature_1, other_property_details, fld_feature_3, hse_feature_1, property_name, shp_feature_2, property_type_code, shp_feature_1, oth_feature_1, property_address, hse_feature_3, apt_feature_2, property_id, fld_feature_1, oth_feature_3, date_sold, room_count, apt_feature_3, fld_feature_2, date_on_market, agreed_selling_price FROM Properties WHERE shp_feature_3 != "None" OR other_property_details <> "None" AND hse_feature_3 = "None" AND date_sold != "1984-02-01 19:54:54" AND "vendor_requested_price" != 2573.0 AND hse_feature_2 = "None" AND shp_feature_1 <> "None" OR fld_feature_1 <> "None" AND apt_feature_2 = "aut" AND oth_feature_1 <> "None" AND date_on_market = "1978-05-15 10:53:37" OR apt_feature_1 = "enim" OR fld_feature_3 <> "None" OR property_address != "098 Tremaine Highway Suite 569 South Wilford, NJ 46587-3537" AND fld_feature_2 != "None" AND "property_id" = 9 AND hse_feature_1 <> "None" OR property_type_code <> "Other" OR oth_feature_2 <> "None" OR property_name = "the cole" AND oth_feature_3 <> "None" UNION ALL SELECT hse_feature_2, shp_feature_3, buyer_offered_price, apt_feature_1, other_property_details, fld_feature_3, hse_feature_1, property_name, shp_feature_2, property_type_code, shp_feature_1, oth_feature_1, property_address, hse_feature_3, apt_feature_2, property_id, fld_feature_1, oth_feature_3, date_sold, room_count, apt_feature_3, fld_feature_2, date_on_market, agreed_selling_price FROM Properties WHERE hse_feature_1 <> "None" OR apt_feature_1 != "enim" AND shp_feature_2 <> "None" OR "buyer_offered_price" > 11375259.502 OR property_type_code != "Other" OR fld_feature_3 <> "None" OR shp_feature_1 != "None" OR apt_feature_2 <> "suscipit" AND property_name <> "parc coliseum" AND "room_count" < 9 AND fld_feature_1 <> "None" OR hse_feature_3 = "None" AND other_property_details = "None" OR shp_feature_3 != "None" OR oth_feature_2 <> "None" OR oth_feature_1 <> "None" AND hse_feature_2 != "None" OR date_sold != "1987-12-07 07:41:27" AND "vendor_requested_price" = 13.4715 AND apt_feature_3 = "None" OR "agreed_selling_price" < 2574.0 OR date_on_market <> "1996-09-16 22:04:27" OR property_address != "60845 Else Highway Apt. 826 South Dougfort, CO 43200-4258" AND "property_id" > 14


Question: What are the driver IDs greater than 9, and also any driver IDs from school buses that are not 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: What are the aircraft IDs that are less than 3, excluding those aircraft IDs that are not 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: What are the aircraft IDs that are less than or equal to 5, but not aircraft IDs that are greater than or equal to 3, considering only the aircraft and airport_aircraft tables?

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: What are the document IDs that meet all the following conditions: they are either not overdue, have other details as "x", or their document ID is not 24, their document type is not "CD", and their shipping agent is "US"; AND they have a draft number greater than 1 or a document ID less than 12 and a copy number of at least 15?

SELECT document_id FROM Documents WHERE document_status_code != "overdue" OR other_details = "x" OR "document_id" <> 24 AND document_type_code != "CD" AND shipping_agent_code = "US" INTERSECT SELECT document_id FROM Draft_Copies WHERE "draft_number" > 1 OR "document_id" < 12 AND "copy_number" >= 15


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

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


Question: What are the driver IDs that are both less than 12 and present in the school bus table, where the driver IDs are also less than or equal to 7?

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


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

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


Question: Which driver IDs are in the driver table but not in the school bus table, excluding driver ID 11 from the driver table and driver ID 10 from the school bus table?

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


Question: What is the average user ID and rank for reviews where the user ID is 2 or less, excluding the average user ID and rank for reviews where the item ID is not 3?

SELECT AVG(u_id), rank FROM review WHERE "u_id" <= 2 EXCEPT SELECT AVG(u_id), rank FROM review WHERE "i_id" != 3


Question: Which driver IDs are less than or equal to 8 but not greater than or equal to 10, considering driver IDs from the driver and school bus tables?

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 are the other details from the 'Documents' table where the document ID is not 16514113, or the description is not "r", or the name is not "Learning French" and the other details are not "None", combined with the other details from the 'Paragraphs' table where the document ID is not 651512 and the other details are "None", or the paragraph text is not "Brazil" and the paragraph ID is less than 7?

SELECT Other_Details FROM Documents WHERE "Document_ID" <> 16514113 OR Document_Description <> "r" OR Document_Name != "Learning French" AND Other_Details != "None" UNION SELECT Other_Details FROM Paragraphs WHERE "Document_ID" != 651512 AND Other_Details = "None" OR Paragraph_Text <> "Brazil" AND "Paragraph_ID" < 7


Question: What aircraft IDs are both aircraft ID 1 and not aircraft ID 2, considering aircraft and airport aircraft information?

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


Question: What driver IDs are both in the driver table, excluding driver ID 11, and also in the school bus table with driver ID 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: What are the aircraft IDs greater than 1 that are not present in the airport aircraft table with IDs less than 3?

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


Question: What are the driver IDs that are equal to 5 in the driver table, but not equal to 3 in the school bus table?

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


Question: Which driver IDs, excluding driver 10, are present in both the driver and school bus tables, but not driver 4?

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


Question: What are the driver IDs that are either greater than or equal to 2 in the driver table or less than 3 in the school bus table?

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


Question: Which driver IDs are greater than 11, or are driver IDs from school buses not equal to 9?

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: What are the driver IDs greater than 11 from the driver table, combined with the driver IDs less than 7 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 < 7


Question: What are the copy and draft numbers from the circulation history where the document ID isn't 20 or the employee ID is 1 or less, combined with the copy and draft numbers from the draft copies where the copy number is less than 10 or the document ID isn't 10?

SELECT copy_number, draft_number FROM Circulation_History WHERE "document_id" <> 20 OR "employee_id" <= 1 UNION SELECT copy_number, draft_number FROM Draft_Copies WHERE "copy_number" < 10 OR "document_id" != 10


Question: Give me the best finish, people ID, final table made, earnings, poker player ID, and money rank for poker players where the poker player ID is at least 3, the best finish is less than 1, and the money rank is less than 58, or the people ID is less than 7, but exclude those where the best finish is not 1, the final table made is greater than 21, the money rank is 58, and the people ID is not 1.

SELECT Best_Finish, People_ID, Final_Table_Made, Earnings, Poker_Player_ID, Money_Rank FROM poker_player WHERE "Poker_Player_ID" >= 3 AND "Best_Finish" < 1.0 AND "Money_Rank" < 58.0 OR "People_ID" < 7 EXCEPT SELECT Best_Finish, People_ID, Final_Table_Made, Earnings, Poker_Player_ID, Money_Rank FROM poker_player WHERE "Best_Finish" <> 1.0 AND "Final_Table_Made" > 21.0 AND "Money_Rank" = 58.0 AND "People_ID" != 1


Question: What are the driver IDs greater than 3, and also the driver IDs from school buses that are not 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: Which driver IDs are not equal to 1, and which driver ID is equal to 10, considering both drivers and school buses?

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: What are the aircraft IDs that are less than 5, and also the aircraft IDs from airport_aircraft that are not equal to 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: What are the driver IDs that are either greater than or equal to 11 or not equal to 4, considering both the driver and school bus information?

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 driver IDs are present in both the driver and school bus tables, excluding driver ID 5 from the driver table and driver ID 9 from the school bus table?

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


Question: What are the aircraft IDs that are greater than or equal to 3, excluding those aircraft IDs greater than 2 that are also in the airport_aircraft table?

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


Question: What are the aircraft IDs that are less than 4, and also the aircraft ID that is 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: What are the customer IDs of customers who made a payment at "2018-02-01 06:15:31" or whose payment method wasn't "Direct Debit" and the payment amount was less than 6782.84, combined with the customer IDs of customers who don't have the mobile phone number "861-638-9797" and were born on "1998-12-15 13:24:40", or became a customer on "2016-05-11 17:03:48", or have an outstanding amount greater than or equal to 255.0, or don't have the phone number "1-673-962-8158x7646", or don't have the email address "hilario.sporer@example.org", or don't have the last name "Mertz" and have a customer address ID less than 10?

SELECT customer_id FROM Customer_Payments WHERE datetime_payment = "2018-02-01 06:15:31" OR payment_method_code != "Direct Debit" AND "amount_payment" < 6782.84 UNION SELECT customer_id FROM Customers WHERE cell_mobile_phone_number <> "861-638-9797" AND date_of_birth = "1998-12-15 13:24:40" OR date_became_customer = "2016-05-11 17:03:48" AND "amount_outstanding" >= 255.0 OR phone_number != "1-673-962-8158x7646" OR email_address != "hilario.sporer@example.org" OR last_name != "Mertz" AND "customer_address_id" < 10


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

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


Question: What are the driver IDs that are either less than or equal to 4 from the driver table or less than or equal to 10 from the school bus table?

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


Question: What is the sum of sales in billions and the year of employment, considering companies not headquartered in the USA with sales less than or equal to 447 billion, or where the people ID is greater than 7, the profits in billions are not 25.7, the count of working years is greater than 1, and the count of market value in billions is greater than 237.4, or the company name is ExxonMobil and assets in billions are less than or equal to 1873.9?

SELECT SUM(T1.Sales_in_Billion), T2.Year_working FROM company as T1 JOIN employment as T2 ON T1.Company_ID = T2.Company_ID WHERE Headquarters <> "USA" AND Sales_in_Billion <= 447.0 OR People_ID > 7 AND Profits_in_Billion <> 25.7 AND COUNT(Year_working) > 1 AND COUNT(Market_Value_in_Billion) > 237.4 OR Name = "ExxonMobil" AND Assets_in_Billion <= 1873.9


Question: For documents that are not document ID 1, are done, don't have receipt number 93, or have other details that are not "j", or have a receipt date that is not "1986-12-14 14:18:59" and a shipping agent code of "FE", and also for documents that are not document ID 23, show me the document ID, the count of shipping agent codes, the document status code, the minimum receipt number, the receipt date, the sum of other details, and the count of document type codes.

SELECT document_id, COUNT(shipping_agent_code), document_status_code, MIN(receipt_number), receipt_date, SUM(other_details), COUNT(document_type_code) FROM Documents WHERE "document_id" != 1 AND document_status_code = "done" AND receipt_number <> "93" OR other_details != "j" OR receipt_date <> "1986-12-14 14:18:59" AND shipping_agent_code = "FE" UNION ALL SELECT document_id, COUNT(shipping_agent_code), document_status_code, MIN(receipt_number), receipt_date, SUM(other_details), COUNT(document_type_code) FROM Documents WHERE "document_id" != 23


Question: What are the IDs of drivers who are either in the driver table (excluding driver ID 2) or in the school bus table (excluding driver ID 3)?

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


Question: How many documents meet the criteria where the employee ID is greater than 2 and the draft number is at least 17, combined with the number of documents where the shipping agent code is not US, or the receipt number is not 69, and the document status code is not working, and other details are not p, and the receipt date is not May 8, 1974, or the document type code is not Hard Drive?

SELECT COUNT(document_id) FROM Circulation_History WHERE "employee_id" > 2 AND "draft_number" >= 17 UNION ALL SELECT COUNT(document_id) FROM Documents WHERE shipping_agent_code != "US" OR receipt_number != "69" AND document_status_code != "working" AND other_details <> "p" AND receipt_date != "1974-05-08 00:00:46" OR document_type_code <> "Hard Drive"


Question: Which coach IDs meet all of the following conditions: either the coach's name is Jameson Tomas, or their gender is not male, and their ID is less than 5, or their rank is less than 5; and also either their starting year is before or equal to 2011, or their coach ID is greater than 1?

SELECT Coach_ID FROM coach WHERE Coach_name = "Jameson Tomas" OR Gender != "M" AND "Coach_ID" < 5 OR "Rank" < 5 INTERSECT SELECT Coach_ID FROM player_coach WHERE "Starting_year" <= 2011 OR "Coach_ID" > 1


Question: What are the sum of Party, count of District, average of First_Elected, Committee, and Delegate, excluding results where Counties_Represented is "13", or Committee is "Health and Government Operations" and Election_ID is not 4, or Delegate is "Pendergrass, Shane E. Shane Pendergrass", but including results where District is not 2 or First_Elected is less than 1994, and Committee is not "Health and Government Operations", or Counties_Represented is not "09.1 9A", or Election_ID is less than or equal to 7 and Party is less than or equal to 4, from the election table?

SUM(Party) COUNT(District) AVG(First_Elected) Committee Delegate

SELECT SUM(Party), COUNT(District), AVG(First_Elected), Committee, Delegate FROM election WHERE "District" != 2 OR "First_Elected" < 1994.0 AND Committee <> "Health and Government Operations" OR Counties_Represented <> "09.1 9A" OR "Election_ID" <= 7 AND "Party" <= 4 EXCEPT SELECT SUM(Party), COUNT(District), AVG(First_Elected), Committee, Delegate FROM election WHERE Counties_Represented = "13" OR Committee = "Health and Government Operations" AND "Election_ID" != 4 OR Delegate = "Pendergrass, Shane E. Shane Pendergrass"


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


Question: What are the driver IDs, excluding driver ID 6, that are present in both the driver and school bus tables, where the school bus driver IDs are less than or equal to 7?

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


Question: What are the sum of store IDs and the minimum product IDs for products that are not product ID 2 and not in store ID 2, excluding the same calculation for store IDs less than or equal to 3?

SELECT SUM(Store_ID), MIN(Product_ID) FROM store_product WHERE "Product_ID" != 2 AND "Store_ID" <> 2 EXCEPT SELECT SUM(Store_ID), MIN(Product_ID) FROM store_product WHERE "Store_ID" <= 3


Question: Which driver IDs are either 2 or greater than or equal to 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: What are the driver IDs that are equal to 6 in the driver table, but not equal to 7 in the school bus table?

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


Question: Which driver IDs are equal to 1 but not greater than or equal to 9, considering only driver IDs from the 'driver' and 'school_bus' tables?

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: What are the document type codes for documents where the other details are not "u", or the receipt number is not "83" and the document ID is greater than or equal to 25 and the receipt date is not "1996-05-31 06:51:58", or the document status code is not "overdue", combined with the document type codes from the reference document types table that are not "Hard Drive"?

SELECT document_type_code FROM Documents WHERE other_details != "u" OR receipt_number <> "83" AND "document_id" >= 25 AND receipt_date != "1996-05-31 06:51:58" OR document_status_code != "overdue" UNION SELECT document_type_code FROM Ref_Document_Types WHERE document_type_code != "Hard Drive"


Question: What are the driver IDs that are both less than 6 in the driver table and also less than or equal to 3 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 <= 3


Question: What are the salaries and employee IDs that are not 44740, and also have an employee ID of 552455348 and a salary less than or equal to 289950?

SELECT salary, eid FROM employee WHERE "salary" != 44740 INTERSECT SELECT salary, eid FROM employee WHERE "eid" = 552455348 AND "salary" <= 289950


Question: What are the aircraft IDs that are not 3 and are present in the aircraft table, but not in the airport_aircraft table where the aircraft ID is greater than 5?

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


Question: What are the student IDs of students who are either Vice-Presidents in club 1 or not student ID 1007, combined with the student IDs of students whose major is less than or equal to 600 and student ID is less than or equal to 1006, or whose first name is Susan, live in BAL, and are not 18 years old?

SELECT StuID FROM Member_of_club WHERE "ClubID" = 1 AND Position = "Vice-President" OR "StuID" <> 1007 UNION ALL SELECT StuID FROM Student WHERE "Major" <= 600 AND "StuID" <= 1006 OR Fname = "Susan" AND city_code = "BAL" AND "Age" != 18


Question: Which driver IDs are greater than or equal to 11, and which driver ID is 7, considering both drivers and school buses?

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


Question: What are the driver IDs less than 9 that are in the driver table but not in the school bus table with driver IDs 10 or greater?

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: Which driver IDs are less than or equal to 7 but are not driver IDs that are greater than or equal to 3 in the school bus records?

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


Question: What are the minimum shp_feature_2, average buyer_offered_price, average hse_feature_2, hse_feature_1, count of agreed_selling_price, room_count, apt_feature_3, shp_feature_1, property_address, property_type_code, count of hse_feature_3, oth_feature_2, fld_feature_2, count of property_name, average oth_feature_3, sum of apt_feature_1, sum of fld_feature_3, sum of date_sold, sum of vendor_requested_price, count of oth_feature_1, sum of apt_feature_2, other_property_details, count of fld_feature_1, sum of date_on_market, shp_feature_3, and property_id for properties where hse_feature_3 is not "None" or property_type_code is not "Other" and buyer_offered_price is less than 10.1067 and room_count is greater than 2 and vendor_requested_price is 2219.6778, or apt_feature_3 is not "None"; and also for properties where property_name is not "high line" and apt_feature_3 is "None"?

SELECT MIN(shp_feature_2), AVG(buyer_offered_price), AVG(hse_feature_2), hse_feature_1, COUNT(agreed_selling_price), room_count, apt_feature_3, shp_feature_1, property_address, property_type_code, COUNT(hse_feature_3), oth_feature_2, fld_feature_2, COUNT(property_name), AVG(oth_feature_3), SUM(apt_feature_1), SUM(fld_feature_3), SUM(date_sold), SUM(vendor_requested_price), COUNT(oth_feature_1), SUM(apt_feature_2), other_property_details, COUNT(fld_feature_1), SUM(date_on_market), shp_feature_3, property_id FROM Properties WHERE hse_feature_3 <> "None" OR property_type_code != "Other" AND "buyer_offered_price" < 10.1067 AND "room_count" > 2 AND "vendor_requested_price" = 2219.6778 OR apt_feature_3 <> "None" UNION ALL SELECT MIN(shp_feature_2), AVG(buyer_offered_price), AVG(hse_feature_2), hse_feature_1, COUNT(agreed_selling_price), room_count, apt_feature_3, shp_feature_1, property_address, property_type_code, COUNT(hse_feature_3), oth_feature_2, fld_feature_2, COUNT(property_name), AVG(oth_feature_3), SUM(apt_feature_1), SUM(fld_feature_3), SUM(date_sold), SUM(vendor_requested_price), COUNT(oth_feature_1), SUM(apt_feature_2), other_property_details, COUNT(fld_feature_1), SUM(date_on_market), shp_feature_3, property_id FROM Properties WHERE property_name != "high line" AND apt_feature_3 = "None"


Question: What are the store IDs of stores that don't have an area size of 26.69, excluding those store IDs that sell product 4 and have a store ID of 5 or less?

SELECT Store_ID FROM store WHERE "Area_size" != 26.69 EXCEPT SELECT Store_ID FROM store_product WHERE "Product_ID" = 4 AND "Store_ID" <= 5


Question: How many times did players finish second and earn a different amount than 104871, or have a poker ID other than 5, excluding those with a poker ID of 2 or higher, or a money rank greater than 166?

SELECT COUNT(Best_Finish), People_ID, Earnings, Poker_Player_ID, Money_Rank FROM poker_player WHERE "Best_Finish" = 2.0 AND "Earnings" != 104871.0 OR "Poker_Player_ID" != 5 EXCEPT SELECT COUNT(Best_Finish), People_ID, Earnings, Poker_Player_ID, Money_Rank FROM poker_player WHERE "Poker_Player_ID" >= 2 OR "Money_Rank" > 166.0


Question: Which driver IDs are in either the driver table (excluding driver ID 9) or the school bus table (including driver IDs up to 4)?

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


Question: What are the driver IDs that appear in the driver table with IDs less than or equal to 1, but are not in the school bus table with IDs less than 7?

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


Question: What are the aircraft IDs that appear in the aircraft table with an ID greater than or equal to 1, but are not in the airport_aircraft table with an ID not equal to 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: Which driver IDs are in the driver table but not in the school bus table, excluding driver ID 5 from the driver table and driver ID 10 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 != 10


Question: What are the aircraft IDs greater than 3, and also any aircraft IDs that are not 1, considering both the aircraft and airport aircraft tables?

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


Question: What are the driver IDs that are greater than or equal to 8 and also appear in the school bus table, excluding driver ID 10?

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


Question: What are the driver IDs that are less than 4, but not present in the school bus table with driver IDs less than or equal to 4?

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


Question: What are the aircraft IDs that are either 5 or less than or equal to 2?

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


Question: What are the aircraft IDs that are not 1 and are in the aircraft table, but not in the airport_aircraft table with IDs less than 5?

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


Question: What are the different trust values where the target user ID is 5 or the trust value isn't 2, and also what are the trust values where the target user ID is 2 or greater?

SELECT trust FROM trust WHERE "target_u_id" = 5 OR "trust" <> 2 UNION SELECT trust FROM trust WHERE "target_u_id" >= 2


Question: Give me the building number, the sum of the country values, the zip code, the address ID, and the maximum state for addresses in the USA, or not in Buckridgehaven, or with the zip code 80376 and not in Washington, or with an address ID not equal to 5. Also, give me the same information for addresses that have an address ID not equal to 5, or are not in Ericamouth and not in the USA.

SELECT line_1_number_building, SUM(country), zip_postcode, address_id, MAX(state_province_county) FROM Addresses WHERE country = "USA" OR city <> "Buckridgehaven" AND line_1_number_building != "37698 Hahn Curve Apt. 572" OR zip_postcode = "80376" AND state_province_county != "Washington" OR "address_id" <> 5 UNION ALL SELECT line_1_number_building, SUM(country), zip_postcode, address_id, MAX(state_province_county) FROM Addresses WHERE "address_id" != 5 OR city != "Ericamouth" AND country <> "USA"


Question: What are the driver IDs that are both less than or equal to 3 in the driver table and greater than or equal to 3 in the school bus table?

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


Question: What is the alphabetically last aircraft name, excluding aircraft with ID 5, and what is the alphabetically last employee name, excluding Linda Davis?

SELECT MAX(name) FROM aircraft WHERE "aid" != 5 UNION ALL SELECT MAX(name) FROM employee WHERE name != "Linda Davis"


Question: Which driver IDs are equal to 12 but not less than 10, considering driver and school bus information?

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


Question: Which driver IDs are less than 3 but not equal to 7, considering only the driver IDs present in the driver table and excluding those in the school bus table?

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


Question: Which driver IDs are not equal to 2, but are not also driver IDs from school buses with IDs greater than 7?

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


Question: Which driver IDs are either less than or equal to 6, or are equal to 4, considering both the driver and school bus tables?

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: Which driver IDs are less than 8 but not greater than 3, considering only the driver IDs?

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: What are the IDs of drivers who are not driver ID 3 and also appear in the school bus table but are not driver ID 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: What are the employee IDs and years awarded for employee 10, and also for any evaluations from the year 2017?

SELECT Employee_ID, Year_awarded FROM evaluation WHERE Employee_ID = "10" UNION SELECT Employee_ID, Year_awarded FROM evaluation WHERE Year_awarded = "2017"


Question: What is the average student ID, club ID, and position for members where the student ID is greater than 1010, or the position is not CTO, or the club ID is less than 4? Also, what is the average student ID, club ID, and position for members who are not Vice-Presidents?

SELECT AVG(StuID), ClubID, Position FROM Member_of_club WHERE "StuID" > 1010 OR Position <> "CTO" OR "ClubID" < 4 UNION ALL SELECT AVG(StuID), ClubID, Position FROM Member_of_club WHERE Position != "Vice-President"


Question: Which club IDs and student IDs are members of a club, not as Vice-Presidents, and also not student 1001 in club 2, and also not Teaching Coordinators?

SELECT ClubID, StuID FROM Member_of_club WHERE Position != "Vice-President" OR "StuID" <> 1001 AND "ClubID" <> 2 INTERSECT SELECT ClubID, StuID FROM Member_of_club WHERE Position != "Teaching Coordinator"


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

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


Question: What are the IDs of properties that either have features other than "autem" or are not property ID 13, combined with properties that have "None" as other details, or have "None" for fld_feature_3 and a vendor requested price of 13.4715 and "None" for shp_feature_1, or were sold on "1997-01-07 19:52:45", or have a house feature 2 not equal to "None" and are apartments with at least 8 rooms, or have a house feature 3 of "None" and an apartment feature 2 not equal to "sit" and an other feature 2 not equal to "None", or have fld_feature_2 and fld_feature_1 not equal to "None", or have an other feature 3 not equal to "None" and a house feature 1 not equal to "None" and a property ID less than 7 and a buyer offered price not equal to 2449185.2 and an other feature 1 not equal to "None" and an apartment feature 1 not equal to "et", or have an agreed selling price not equal to 3344706.5755, or are named "longacre" and have an apartment feature 3 not equal to "None" and a date on market not equal to "2003-12-25 16:13:19"?

SELECT property_id FROM Other_Property_Features WHERE "property_id" != 13 OR property_feature_description != "autem" UNION ALL SELECT property_id FROM Properties WHERE other_property_details = "None" OR fld_feature_3 != "None" AND "vendor_requested_price" = 13.4715 AND shp_feature_1 = "None" OR date_sold = "1997-01-07 19:52:45" OR hse_feature_2 != "None" AND property_type_code = "Apartment" AND "room_count" >= 8 OR hse_feature_3 = "None" AND apt_feature_2 != "sit" AND oth_feature_2 <> "None" OR fld_feature_2 <> "None" AND fld_feature_1 <> "None" OR oth_feature_3 != "None" AND hse_feature_1 != "None" AND "property_id" < 7 AND "buyer_offered_price" <> 2449185.2 AND oth_feature_1 != "None" AND apt_feature_1 <> "et" OR "agreed_selling_price" <> 3344706.5755 OR property_name = "longacre" AND apt_feature_3 <> "None" AND date_on_market <> "2003-12-25 16:13:19"


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

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


Question: What are the aircraft IDs that are less than or equal to 5, excluding those aircraft IDs greater than 3 that are also present in the airport_aircraft table?

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


Question: Which driver IDs, excluding driver ID 10, are present in the driver table, and which driver IDs, excluding driver ID 4, are present in 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 <> 4


Question: What are the IDs of drivers, excluding driver 12, and the IDs of school bus drivers, excluding driver 9?

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


Question: Which driver IDs are in the driver table but not in the school bus table, excluding driver ID 11 from the driver table and driver ID 10 from the school bus table?

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


Question: What is the maximum template type description and the template type code for template types with code "AD" or description "CV", combined with the maximum template type description and the template type code for all template types except those with code "CV"?

SELECT MAX(Template_Type_Description), Template_Type_Code FROM Ref_Template_Types WHERE Template_Type_Code = "AD" OR Template_Type_Description = "CV" UNION SELECT MAX(Template_Type_Description), Template_Type_Code FROM Ref_Template_Types WHERE Template_Type_Code <> "CV"


Question: What are the driver IDs that are less than or equal to 11, but not present in the school bus table with driver IDs less than or equal to 10?

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


Question: What is the smallest model name from the car names where the MakeId is less than 195 and not "volkswagen", and also the smallest model name from the model list where the model is not "capri" and the Maker is less than or equal to 11 or the ModelId is less than 19?

SELECT MIN(Model) FROM car_names WHERE "MakeId" < 195 AND Model != "volkswagen" INTERSECT SELECT MIN(Model) FROM model_list WHERE Model <> "capri" AND "Maker" <= 11 OR "ModelId" < 19


Question: What are the aircraft IDs that are either 3 or less than or equal to 3, considering both the aircraft and airport_aircraft tables?

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


Question: What are the maximum feature IDs and feature type codes for security features, excluding feature ID 4, or features that aren't "Burglar Alarm" and don't have the name "BurglarAlarm", where the maximum feature ID is at least 3? Also, what are the maximum feature IDs and feature type codes for features that aren't "Burglar Alarm" or have a name that isn't "AirCon" and have a feature ID of 3, where the maximum feature ID is not 3? Combine the results.

SELECT MAX(feature_id), feature_type_code FROM Other_Available_Features WHERE feature_type_code = "Security" AND "feature_id" != 4 OR feature_description != "Burglar Alarm" AND feature_name <> "BurglarAlarm" GROUP BY feature_type_code HAVING MAX(feature_id) >= 3 UNION SELECT MAX(feature_id), feature_type_code FROM Other_Available_Features WHERE feature_description != "Burglar Alarm" OR feature_name != "AirCon" AND "feature_id" = 3 GROUP BY feature_type_code HAVING MAX(feature_id) <> 3


Question: What are the driver IDs greater than 9 that are present in both the driver and school bus tables, excluding driver ID 9?

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


Question: What are the aircraft IDs greater than 3, and also what are the aircraft IDs from the airport that are not 2?

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: Which driver IDs are in the driver table but not in the school bus table, excluding driver ID 10 from the driver table and driver IDs greater than 10 from the school bus table?

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


Question: What are the driver IDs that are either greater than or equal to 7 in the driver table or equal to 9 in the school bus table?

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


Question: What are the aircraft IDs that are not 5, and also the aircraft IDs that are 5 or greater, considering both the aircraft and airport_aircraft tables?

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: What are the aircraft IDs that appear in both the aircraft table with an ID greater than or equal to 1 and in the airport_aircraft table with an ID greater than 3?

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


Question: What are the aircraft IDs that are less than 1 in the aircraft table, combined with the aircraft ID that is equal to 1 in 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: What are the driver IDs that are greater than or equal to 9, and also the driver IDs that are not equal to 7, considering both the driver and school bus information?

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


Question: Which driver IDs are present in both the driver and school bus tables, excluding driver ID 4, but only considering driver IDs less than 4 in the driver table?

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


Question: What are the city, branch ID, name, and open year for branches where the membership amount is 6, or the city isn't London, or the address road is Valleys Place, or the branch ID is greater than 3 and the open year isn't 2012? Also, include the city, branch ID, name, and open year for branches where the membership amount isn't 11, or the city isn't Oxford and the address road isn't Glebe Street.

SELECT City, Branch_ID, Name, Open_year FROM branch WHERE membership_amount = "6" OR City != "London" OR Address_road = "Valleys Place" OR "Branch_ID" > 3 AND Open_year <> "2012" UNION ALL SELECT City, Branch_ID, Name, Open_year FROM branch WHERE membership_amount != "11" OR City <> "Oxford" AND Address_road <> "Glebe Street"


Question: Which driver IDs are not equal to 11, but are not found in the school bus table with driver IDs less than 10?

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


Question: What are the driver IDs greater than 8, combined with the driver IDs from school buses that are not 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: What are the aircraft IDs that are not 3 and also appear in the airport_aircraft table with an ID of 5?

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


Question: What are the country names and continents for all countries that are not in continent 2, combined with the country name and continent for New Zealand and any countries with an ID greater than 8?

SELECT CountryName, Continent FROM countries WHERE "Continent" != 2 UNION ALL SELECT CountryName, Continent FROM countries WHERE CountryName = "new zealand" OR "CountryId" > 8


Question: What are the birth states of people from California who are not 56 years old, or have a head ID less than or equal to 7, or are named Tiger Woods? Also, what are the birth states of people with a head ID greater than 4, who are not named Tiger Woods and were not born in Connecticut?

SELECT born_state FROM head WHERE born_state = "California" AND "age" <> 56.0 OR "head_ID" <= 7 OR name = "Tiger Woods" UNION ALL SELECT born_state FROM head WHERE "head_ID" > 4 AND name != "Tiger Woods" AND born_state != "Connecticut"


Question: What are the names of aircraft that are not "Airbus A340-300" and the names of employees who are not "Jennifer Thomas"?

SELECT name FROM aircraft WHERE name != "Airbus A340-300" UNION SELECT name FROM employee WHERE name <> "Jennifer Thomas"


Question: What are the aircraft IDs that are either less than or equal to 4 in the aircraft table or greater than 3 in 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 driver IDs less than 8 from the driver table, combined with the driver IDs less than 3 from the school bus table?

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


Question: What are the aircraft IDs that are both greater than or equal to 3 and not equal to 2, considering only the aircraft IDs present in both the aircraft and airport_aircraft tables?

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


Question: What are the aircraft IDs less than 3 that are not present in the airport_aircraft table with aircraft IDs greater than 1?

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


Question: What are the driver IDs that are both less than or equal to 6 and also appear in the school bus table with driver IDs less than 4?

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


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

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


Question: What are the source user IDs where the target user ID is less than or equal to 3 and the source user ID is greater than or equal to 6, or where the trust value is not 1, excluding those source user IDs where the target user ID is greater than or equal to 3 and the source user ID is less than or equal to 3?

SELECT source_u_id FROM trust WHERE "target_u_id" <= 3 AND "source_u_id" >= 6 OR "trust" != 1 EXCEPT SELECT source_u_id FROM trust WHERE "target_u_id" >= 3 AND "source_u_id" <= 3


Question: What are the IDs of drivers, excluding driver 4, and also the IDs of school bus drivers, excluding driver 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 driver IDs less than 12 from the driver table, combined with the driver IDs not 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: What are the driver IDs that are both less than or equal to 12 in the driver table and less than 7 in the school bus table?

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


Question: What are the branch and member IDs for members with IDs greater than 1 and also less than or equal to 5?

SELECT Branch_ID, Member_ID FROM membership_register_branch WHERE "Member_ID" <= 5 INTERSECT SELECT Branch_ID, Member_ID FROM membership_register_branch WHERE "Member_ID" > 1


Question: Which driver IDs are either 9 or 10 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 >= 10


Question: What are the aircraft IDs greater than 1 or less than 5, considering both the aircraft and airport_aircraft tables?

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: What are the aircraft IDs that are not equal to 3 in the aircraft table, excluding those aircraft IDs that are equal to 3 in the airport_aircraft table?

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


Question: What are the aircraft IDs and distances for aircraft with IDs up to 10, excluding "Boeing 777-300" and distances not equal to 520, combined with the aircraft IDs and distances from flights where the price isn't 278.56 and the origin is Los Angeles or the destination is Boston, and the arrival date is 04/12/2005 11:10 and the flight number is greater than 387, or the departure date is not 04/12/2005 09:15, or the aircraft ID is greater than or equal to 3?

SELECT aid, distance FROM aircraft WHERE "aid" <= 10 AND name <> "Boeing 777-300" AND "distance" != 520 UNION SELECT aid, distance FROM flight WHERE "price" != 278.56 AND origin = "Los Angeles" OR destination = "Boston" AND arrival_date = "04/12/2005 11:10" AND "flno" > 387 OR departure_date <> "04/12/2005 09:15" OR "aid" >= 3


Question: Which driver IDs are not 6, and which driver ID is 3, considering both drivers and school buses?

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: What are the aircraft IDs that are either aircraft ID 4 or aircraft IDs less than 3 in 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 driver IDs that are equal to 5, excluding those driver IDs from the school bus table that are not equal to 9?

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


Question: What are the driver IDs greater than 3 from the driver table, combined with the driver IDs greater than or equal to 4 from the school bus table?

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


Question: Which driver IDs are less than or equal to 2, excluding those that are not equal to 7?

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


Question: Which driver IDs are greater than 1 and also appear in the school bus table with IDs greater than or equal to 7?

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


Question: What are the aircraft IDs that are greater than or equal to 4, excluding those aircraft IDs that are not equal to 1 and are present in the airport_aircraft table?

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


Question: What are the school types and grades for schools located in Jakarta, Indonesia, or for schools that are not private? Also, what are the school types and grades for schools not located in Los Angeles, California, or for schools that are not St. Francis Assisi and are not 1st-3rd grade, and have a School ID greater than 6?

SELECT Type, Grade FROM school WHERE Location = "Jakarta, Indonesia" OR Type <> "Private" UNION SELECT Type, Grade FROM school WHERE Location <> "Los Angeles, California" OR School <> "St. Francis Assisi" AND Grade <> "1st-3rd grade" AND "School_ID" > 6


Question: What are the driver IDs that are greater than or equal to 1, and also the driver ID 7?

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


Question: What are the aircraft IDs that are less than or equal to 4, excluding those aircraft IDs that are less than 3, considering only the aircraft IDs present in the aircraft and airport_aircraft tables?

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


Question: What are the book IDs that are either greater than 7 in the book table, or have a price not equal to 15000000, a publication ID of 6, a publication date of April 2007, a publisher that is not Springer Nature, or a book ID of 3 in the publication table?

SELECT Book_ID FROM book WHERE "Book_ID" > 7 UNION ALL SELECT Book_ID FROM publication WHERE "Price" != 15000000.0 OR "Publication_ID" = 6 OR Publication_Date = "April 2007" OR Publisher <> "Springer Nature" OR "Book_ID" = 3


Question: Which staff IDs are present in lessons but not staff with the last name "Sawayn" or who joined on "2017-02-20 18:45:20", or staff with ID 2, an address ID other than 4, the nickname "edwin.hudson", and a birthdate different from "1998-04-27 12:55:05", and also have a staff ID that is not 8 or a lesson date of "2018-03-07 11:53:32"?

SELECT staff_id FROM Lessons WHERE "staff_id" != 8 OR lesson_date = "2018-03-07 11:53:32" INTERSECT SELECT staff_id FROM Staff WHERE last_name != "Sawayn" AND date_joined_staff != "2017-02-20 18:45:20" OR "staff_id" = 2 AND "staff_address_id" <> 4 AND nickname = "edwin.hudson" AND date_of_birth != "1998-04-27 12:55:05"


Question: What are the aircraft IDs that are not 2 and also have an ID greater than 3 in the airport aircraft table?

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


Question: What are the driver IDs that are either 8 or greater from the driver table, or 9 or greater from the school bus table?

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


Question: Which driver IDs are less than 1, and which driver IDs are greater than 7, considering driver and school bus information?

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


Question: What is the average document type description, grouped by document type code, for document types that are not "b" or have a code other than "Paper", combined with the average document type description, grouped by document type code, for document types that don't have the code "CD"?

SELECT AVG(document_type_description), document_type_code FROM Ref_Document_Types WHERE document_type_description != "b" OR document_type_code != "Paper" UNION SELECT AVG(document_type_description), document_type_code FROM Ref_Document_Types WHERE document_type_code <> "CD"


Question: What are the aircraft IDs that are either less than or equal to 2 in the aircraft table or less 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 are equal to 10 in the driver table, or are not equal to 7 in the school bus table?

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


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

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


Question: What are the aircraft IDs, excluding aircraft ID 3 from the aircraft table and excluding 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: What are the driver IDs less than 6, and also the driver IDs from 7 onwards?

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


Question: Which driver IDs are greater than 2 and also appear in the school bus table with IDs less than or equal to 3?

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 driver IDs that are less than 12 and also appear in the school bus table, excluding driver ID 3?

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


Question: What are the driver IDs that are both greater than or equal to 8 in the driver table and equal to 9 in the school bus table?

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


Question: What are the driver IDs, excluding driver ID 8, from the driver table, and also the driver IDs, up to and including 7, from the school bus table?

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


Question: What is the sum of Member IDs and the count of registration years for all branches except branch 8, excluding the sum of Member IDs and the count of registration years for branches that are not branch 5 and where the registration year is not 2016 and the Member ID is at least 5?

SELECT SUM(Member_ID), COUNT(Register_Year) FROM membership_register_branch WHERE Branch_ID <> "8" EXCEPT SELECT SUM(Member_ID), COUNT(Register_Year) FROM membership_register_branch WHERE Branch_ID <> "5" AND Register_Year != "2016" AND "Member_ID" >= 5


Question: What is the total number of drivers and the school ID, for drivers in Hartford, or named Edwin Vargas, or with a school ID less than 5 and not full-time, or under 42 years old, or not working for 6 years, grouped by school ID, where the party is not Dem, or worked for 8 years, or is full-time?

SELECT SUM(T1.Driver_ID), T2.School_ID FROM driver as T1 JOIN school_bus as T2 ON T1.Driver_ID = T2.Driver_ID WHERE Home_city = "Hartford" OR Name = "Edwin Vargas" OR "School_ID" < 5 AND If_full_time <> "T" OR "Age" < 42 OR "Years_Working" <> 6 GROUP BY School_ID HAVING Party <> "Dem" OR Years_Working = 8 OR If_full_time = "T"


Question: What are the aircraft IDs that are less than 2 in the aircraft table, combined with the aircraft IDs that are less than 5 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 < 5


Question: Which club IDs satisfy either of these conditions: the club started after 2005, or the club ID is not 2, or the region is not Russia; or the coach's name is not Robert Chen?

SELECT Club_ID FROM club WHERE "Start_year" > 2005 OR "Club_ID" <> 2 OR Region != "Russia" UNION SELECT Club_ID FROM coach WHERE Coach_name <> "Robert Chen"


Question: Which driver IDs are present in both the driver table (with IDs greater than or equal to 5) and the school bus table (with IDs not equal to 4)?

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


Question: What are the aircraft IDs that are not 1 and also appear in the airport aircraft table but are not 5?

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


Question: What are the aircraft IDs that are both aircraft ID 3 and not aircraft ID 2?

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


Question: What are the document IDs that are not draft number 2 and also have a document ID less than or equal to 10?

SELECT document_id FROM Circulation_History WHERE "draft_number" != 2 INTERSECT SELECT document_id FROM Circulation_History WHERE "document_id" <= 10


Question: What are the driver IDs that are less than or equal to 3, and also the driver IDs that are less than or equal to 10?

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


Question: What are the driver IDs, excluding driver ID 2, and also driver IDs greater than 7, considering both drivers and school buses?

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


Question: What are the aircraft IDs that are not 5, and also what is the aircraft ID that is 2?

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


Question: Which driver IDs are not equal to 1 and are not found in the school bus table with IDs less than or equal to 9?

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


Question: Which driver IDs are not equal to 9, but are not found in the school bus table with driver IDs greater than 4?

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


Question: Which driver IDs are associated with drivers, where the driver ID is 3 or greater, but not associated with school buses with a driver ID of 4 or greater?

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: What are the aircraft IDs greater than 1 from the aircraft table, combined with the aircraft IDs from the airport_aircraft table that are not equal to 5?

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


Question: Which driver IDs are less than 3 but not equal to 4, considering only the driver IDs present in the driver table and excluding those in the school bus table?

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


Question: What is the sum of contestant numbers for Tabatha Gehling, excluding the sum of contestant numbers for anyone who isn't Kelly Clauss and whose contestant number isn't 5?

SELECT contestant_name, SUM(contestant_number) FROM CONTESTANTS WHERE contestant_name = "Tabatha Gehling" EXCEPT SELECT contestant_name, SUM(contestant_number) FROM CONTESTANTS WHERE "contestant_number" <> 5 AND contestant_name != "Kelly Clauss"


Question: Which branch IDs are in London, not named Zytogorski, located on Oaks Crescent, and not opened in 2009, or have a branch ID less than or equal to 8, and also which branch IDs are in the membership register but not branch ID 1 and not registered in 2016?

SELECT Branch_ID FROM branch WHERE Name <> "Zytogorski" AND Address_road = "Oaks Crescent" AND Open_year != "2009" AND City = "London" OR "Branch_ID" <= 8 UNION SELECT Branch_ID FROM membership_register_branch WHERE Branch_ID != "1" AND Register_Year <> "2016"


Question: Which driver IDs are both less than 5 and also equal to 4, considering 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 = 4


Question: What are the aircraft IDs that are not equal to 1, excluding those with IDs less than 2, considering information from the aircraft and airport_aircraft tables?

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


Question: Show me the employee IDs, bonuses, and years awarded for bonuses greater than 3200, and also show the employee IDs, bonuses, and years awarded for bonuses not given in 2017.

SELECT Employee_ID, Bonus, Year_awarded FROM evaluation WHERE "Bonus" > 3200.0 UNION SELECT Employee_ID, Bonus, Year_awarded FROM evaluation WHERE Year_awarded <> "2017"


Question: What is the highest maker name, excluding "Saab", from the car makers table, and what is the highest maker name, excluding "datsun" and where the maker is not 4 and the model ID is greater than 35, from the model list table?

SELECT MAX(Maker) FROM car_makers WHERE FullName <> "Saab" UNION ALL SELECT MAX(Maker) FROM model_list WHERE Model <> "datsun" AND "Maker" != 4 AND "ModelId" > 35


Question: Which driver IDs are either at least 2 in the driver table or at least 7 in the school bus table?

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


Question: What are the driver IDs less than 10 from the driver table, combined with the driver IDs greater than 3 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 > 3


Question: Which driver IDs are present in both the driver and school bus tables, excluding driver ID 3, but only including driver IDs less than 5?

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


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

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


Question: Which driver IDs are 5, but not 10, considering driver information?

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


Question: Which driver IDs are greater than 1, and also include driver ID 3?

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


Question: What are the birth dates and first names of customers who either don't owe $1000, or whose last name isn't Mertz, but whose first name is Dianna and customer ID isn't 13, excluding those with the same birth date and first name as staff member 15?

SELECT date_of_birth, first_name FROM Customers WHERE "amount_outstanding" <> 1000.0 OR last_name <> "Mertz" AND first_name = "Dianna" AND "customer_id" <> 13 EXCEPT SELECT date_of_birth, first_name FROM Staff WHERE "staff_id" = 15


Question: What is the average customer ID from customer payments where the payment method is not "Direct Debit" and the payment time is not "2018-03-12 08:41:47" or the customer ID is 6, excluding the average customer ID from lessons where the lesson date is "2018-03-08 16:05:05" or the vehicle ID is less than or equal to 2 and the customer ID is greater than 2?

SELECT AVG(customer_id) FROM Customer_Payments WHERE payment_method_code != "Direct Debit" AND datetime_payment != "2018-03-12 08:41:47" OR "customer_id" = 6 EXCEPT SELECT AVG(customer_id) FROM Lessons WHERE lesson_date = "2018-03-08 16:05:05" OR "vehicle_id" <= 2 AND "customer_id" > 2


Question: What are the aircraft IDs that are either less than 4 from the aircraft table or greater than or 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: What are the aircraft IDs greater than 2, and also what are the aircraft IDs greater than 5, considering both aircraft and airport aircraft information?

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


Question: Which driver IDs are greater than or equal to 9, but not found in the school bus table with driver IDs less than or equal to 4?

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


Question: What is the sum of vehicle IDs for lessons on March 7, 2018 at 11:53:32 where the lesson ID is greater than 12, the price is not 446.0, the staff ID is not 12, the vehicle ID is less than or equal to 1, and the lesson time is not "6", combined with the sum of vehicle IDs for vehicles that are not "Truck"?

SELECT SUM(vehicle_id) FROM Lessons WHERE lesson_date = "2018-03-07 11:53:32" AND "lesson_id" > 12 AND "price" != 446.0 AND "staff_id" != 12 AND "vehicle_id" <= 1 AND lesson_time != "6" UNION ALL SELECT SUM(vehicle_id) FROM Vehicles WHERE vehicle_details != "Truck"


Question: What are the driver IDs that are both greater than or equal to 10 in the driver table and not equal to 3 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 != 3


Question: What are the driver IDs that are either less than or equal to 10 from the driver table, or 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: What are the international passenger counts and aircraft IDs for each airport?

SELECT T1.International_Passengers, T2.Aircraft_ID FROM airport as T1 JOIN airport_aircraft as T2 ON T1.Airport_ID = T2.Airport_ID


Question: Which driver IDs are greater than or equal to 6 and are also not equal to 4, considering only the driver IDs that exist in both the driver and school bus tables?

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


Question: Which driver IDs are in the driver table but not in the school bus table, considering only driver IDs up to 5 in the driver table and up to 4 in the school bus table?

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


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

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


Question: What are the draft numbers and document IDs from the circulation history where the draft number isn't 2 and the copy number is greater than 4, combined with the draft numbers and document IDs from the document drafts where the document ID is less than or equal to 13 or the draft number is greater than or equal to 16?

SELECT draft_number, document_id FROM Circulation_History WHERE "draft_number" != 2 AND "copy_number" > 4 UNION ALL SELECT draft_number, document_id FROM Document_Drafts WHERE "document_id" <= 13 OR "draft_number" >= 16


Question: What are the aircraft IDs greater than 2 that are not in the list of aircraft IDs that are not equal to 5?

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


Question: What are the names of branches where the branch ID is less than 4, or the street address is Abbott Street, or the membership amount is not 91 and the city is not Oxford? Also, what are the names of members whose member ID is not 3? Combine both sets of names.

SELECT Name FROM branch WHERE "Branch_ID" < 4 OR Address_road = "Abbott Street" OR membership_amount != "91" AND City != "Oxford" UNION SELECT Name FROM member WHERE "Member_ID" != 3


Question: What are the ranking, number of employees, and department ID for departments that either have a ranking of 7, a budget of 9.96 billion, 58622 or fewer employees, a department ID of 11 or less, or a name that is not "Health and Human Services", or that have a ranking other than 3 and a department ID of 10 or less, or more than 235000 employees?

SELECT Ranking, Num_Employees, Department_ID FROM department WHERE "Ranking" = 7 OR "Budget_in_Billions" = 9.96 OR "Num_Employees" <= 58622.0 OR "Department_ID" <= 11 OR Name != "Health and Human Services" UNION SELECT Ranking, Num_Employees, Department_ID FROM department WHERE "Ranking" != 3 AND "Department_ID" <= 10 OR "Num_Employees" > 235000.0


Question: How many staff members are there, what are their staff IDs, the sum of their departure dates, their first names, the maximum of their middle names, and the average of their joining dates, where the middle name is "Tre" and the staff ID is 14, or the staff address ID is less than or equal to 6, or the last name is not "Maggio", or the date of birth is not "1995-06-03 08:09:17" and the first name is "Jaleel", combined with the same information for staff where the middle name is "Mayra", or the last name is not "Maggio" and the departure date is not "2018-03-14 07:14:37", or the date of birth is not "2005-05-02 06:23:36" and the nickname is not "weissnat.vincenzo" and the joining date is not "2017-06-04 14:30:41" and the staff ID is greater than 4?

SELECT COUNT(last_name), staff_id, SUM(date_left_staff), first_name, MAX(middle_name), AVG(date_joined_staff) FROM Staff WHERE middle_name = "Tre" AND "staff_id" = 14 OR "staff_address_id" <= 6 OR last_name != "Maggio" OR date_of_birth != "1995-06-03 08:09:17" AND first_name = "Jaleel" UNION ALL SELECT COUNT(last_name), staff_id, SUM(date_left_staff), first_name, MAX(middle_name), AVG(date_joined_staff) FROM Staff WHERE middle_name = "Mayra" OR last_name != "Maggio" AND date_left_staff <> "2018-03-14 07:14:37" OR date_of_birth != "2005-05-02 06:23:36" AND nickname <> "weissnat.vincenzo" AND date_joined_staff <> "2017-06-04 14:30:41" AND "staff_id" > 4


Question: Which driver IDs are either 1 or not 4, considering driver and school bus information?

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


Question: Can you show me the home city, age, driver ID, party, and name of drivers from Manchester who are not driver ID 9, or are 35 or older, or whose name isn't Angel Acre? Also, include drivers whose home city isn't Hartford, or whose driver ID is less than 11 and age is less than 46.

SELECT Home_city, Age, Driver_ID, Party, Name FROM driver WHERE Home_city = "Manchester" AND "Driver_ID" != 9 OR "Age" >= 35 OR Name != "Angel Acre" UNION ALL SELECT Home_city, Age, Driver_ID, Party, Name FROM driver WHERE Home_city != "Hartford" OR "Driver_ID" < 11 AND "Age" < 46


Question: Which driver IDs, excluding driver ID 10, are greater than 5?

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: What are the aircraft IDs, excluding ID 1, that are either in the aircraft table or in 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: What are the names of airports that are not in Anchorage, or are Schiphol Airport, or have the IATA code AEY, or are not in Brussels, or are not in Iceland? Also, what are the names of companies that are not incorporated in Hong Kong, or whose principal activity is cargo airline, or whose group equity shareholding is not 60.0?

Cathay Pacific Catering Services (HK) Limited

SELECT name FROM airport WHERE ICAO != "PANC" OR name = "Schiphol Airport" OR IATA = "AEY" OR City <> "Brussels" OR Country != "Iceland" UNION SELECT name FROM operate_company WHERE Incorporated_in != "Hong Kong" OR Principal_activities = "Cargo airline" OR "Group_Equity_Shareholding" != 60.0


Question: What are the aircraft IDs that have an ID of 8 and a distance not equal to 8430, and also appear in the certificate table with an ID not equal to 9 and an employee ID greater than or equal to 159542516?

SELECT aid FROM aircraft WHERE "aid" = 8 AND "distance" != 8430 INTERSECT SELECT aid FROM certificate WHERE "aid" <> 9 AND "eid" >= 159542516


Question: Which driver IDs are not equal to 8 but are not present in the school bus table with driver IDs greater than or equal to 3?

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


Question: Which driver IDs are less than or equal to 8 but not equal to 9, considering only those driver IDs present in the 'driver' table but not 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 <> 9


Question: What are the driver IDs that are less than 12 from the driver table, combined with the driver IDs that are less than 10 from the school bus table?

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


Question: Which driver IDs are either 8 or 10, considering driver ID 8 from the driver table and driver ID 10 from the school bus table?

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


Question: What are the driver IDs that are less than or equal to 1, excluding those driver IDs that are less than 9?

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


Question: Which driver IDs are present in both the driver table (with driver IDs greater than or equal to 1) and the school bus table (with driver IDs greater than or equal to 3)?

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


Question: For each state, what is the minimum contestant number and the creation date, considering votes where the phone number is greater than 7182887233, the state is not NY, the vote ID is at most 5, and the creation date is not "2018-03-09 19:03:40" or where the contestant number is 5, combined with votes where the vote ID is not 2 or the state is NY?

SELECT state, MIN(contestant_number), created FROM VOTES WHERE "phone_number" > 7182887233 AND state <> "NY" AND "vote_id" <= 5 AND created <> "2018-03-09 19:03:40" OR "contestant_number" = 5 UNION SELECT state, MIN(contestant_number), created FROM VOTES WHERE "vote_id" <> 2 OR state = "NY"


Question: What are the driver IDs that are less than 4 from the driver table, combined with the driver IDs that are not 3 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 != 3


Question: Which driver IDs, excluding driver 6, are present in both the driver and school bus records, excluding driver 4?

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


Question: Which driver IDs are in the driver table but not in the school bus table, excluding driver ID 12 from the driver table and driver ID 10 from the school bus table?

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


Question: What is the average employee ID and the employee ID, grouped by bonus, for employees who didn't receive a bonus of 3000, and where the year the bonus was awarded isn't 2011, or the employee's name is Matt Stevens and they are older than 23?

SELECT AVG(T1.Employee_ID), T2.Employee_ID FROM employee as T1 JOIN evaluation as T2 ON T1.Employee_ID = T2.Employee_ID WHERE "Bonus" <> 3000.0 GROUP BY Bonus HAVING Year_awarded <> "2011" OR Name = "Matt Stevens" AND Age > 23


Question: What are the driver IDs greater than 8, and also the driver IDs from school buses that are not equal to 4?

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


Question: Which driver IDs are less than 6 but not greater than 4, considering only driver IDs?

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


Question: What are the driver IDs, excluding driver ID 9, and also the driver IDs less than 4?

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


Question: Which employee IDs received a bonus less than 3200 and are not employee 7 or were not awarded in 2015, and also which employee IDs started from a year other than 2009 and work in a shop with ID 2 or less?

SELECT Employee_ID FROM evaluation WHERE "Bonus" < 3200.0 AND Employee_ID != "7" OR Year_awarded != "2015" UNION SELECT Employee_ID FROM hiring WHERE Start_from != "2009" AND "Shop_ID" <= 2


Question: What are the domestic passenger numbers and aircraft IDs for each airport?

SELECT T1.Domestic_Passengers, T2.Aircraft_ID FROM airport as T1 JOIN airport_aircraft as T2 ON T1.Airport_ID = T2.Airport_ID


Question: Which driver IDs are either 6 or not 3, considering driver IDs from both the driver and school bus tables?

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: What are the driver IDs, excluding driver ID 3, from the driver table and also the driver IDs less than 3 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 < 3


Question: What are the aircraft IDs that are less than 5 in the aircraft table, combined with 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: Which driver IDs are less than 5, and also driver ID 10?

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


Question: What are the driver IDs that are less than 10 from the driver table, combined with the 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 < 10 UNION SELECT Driver_ID FROM school_bus GROUP BY Driver_ID HAVING Driver_ID != 4


Question: What are the template IDs from the Documents table that are not 21, combined with the template IDs from the Templates table where the template ID isn't 10 and the effective dates or template type code don't match specific values?

SELECT Template_ID FROM Documents WHERE "Template_ID" <> 21 UNION SELECT Template_ID FROM Templates WHERE "Template_ID" != 10 AND Date_Effective_From != "1993-10-07 02:33:04" OR Date_Effective_To <> "1973-01-12 14:13:34" AND Template_Type_Code <> "AD"


Question: What are the aircraft IDs, excluding aircraft ID 5, from the aircraft table, combined with the aircraft IDs, excluding aircraft ID 3, from the airport_aircraft table?

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


Question: Which driver IDs are greater than 5 and also appear in the school bus table, excluding driver ID 9?

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


Question: Which customer IDs are not from customers born on December 15, 1998, or not named Millie and didn't become customers on March 18, 2016, or are not customer ID 11, but are not in lessons with lesson IDs 15 or greater, or on March 21, 2018, and with staff IDs 3 or less?

SELECT customer_id FROM Customers WHERE date_of_birth != "1998-12-15 13:24:40" OR first_name <> "Millie" AND date_became_customer != "2016-03-18 06:14:18" OR "customer_id" <> 11 EXCEPT SELECT customer_id FROM Lessons WHERE "lesson_id" >= 15 OR lesson_date = "2018-03-21 06:48:45" AND "staff_id" <= 3


Question: What are the receipt numbers and document status codes for documents that meet any of the following conditions: the document ID is 7 or greater and the receipt date is not "2008-04-21 20:42:25", or the shipping agent code is not "UP" and the document type code is not "Hard Drive" and the receipt number is not "69", or the document status code is not "done", excluding those with a receipt date of "1986-12-14 14:18:59"?

SELECT receipt_number, document_status_code FROM Documents WHERE "document_id" >= 7 AND receipt_date != "2008-04-21 20:42:25" OR shipping_agent_code <> "UP" AND document_type_code != "Hard Drive" AND receipt_number <> "69" OR document_status_code <> "done" EXCEPT SELECT receipt_number, document_status_code FROM Documents WHERE receipt_date = "1986-12-14 14:18:59"


Question: What are the IDs of drivers, excluding driver 7, and the IDs of school bus drivers, excluding driver 3?

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


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

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


Question: Which driver IDs are less than 5, and also which driver IDs from the school bus table are not equal to 7?

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


Question: What are the aircraft IDs, excluding aircraft ID 3, and also the aircraft IDs less than or equal to 1, considering both aircraft and airport aircraft information?

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


Question: What is the sum of student IDs for teaching coordinators in clubs that aren't club ID 2 and don't include student ID 1001, combined with the sum of student IDs for students whose first name isn't Eric, or whose student ID is less than or equal to 1003, or whose major isn't 600?

SELECT SUM(StuID) FROM Member_of_club WHERE Position = "Teaching Coordinator" AND "ClubID" != 2 AND "StuID" != 1001 UNION SELECT SUM(StuID) FROM Student WHERE Fname <> "Eric" OR "StuID" <= 1003 OR "Major" <> 600


Question: What are the maximum earnings and the sum of best finishes for poker players, considering two different sets of conditions: either their ID is not 2 or their people ID is not 7, or their money rank is not 58.0 and they made 21 final tables, or their earnings are not 189233.0 and their best finish is not 1.0?

SELECT MAX(Earnings), SUM(Best_Finish) FROM poker_player WHERE "Poker_Player_ID" != 2 OR "People_ID" != 7 UNION ALL SELECT MAX(Earnings), SUM(Best_Finish) FROM poker_player WHERE "Money_Rank" != 58.0 AND "Final_Table_Made" = 21.0 OR "Earnings" != 189233.0 AND "Best_Finish" <> 1.0


Question: What are the regions of all clubs, excluding Halmstads BK, and also the regions of clubs that are not club ID 1?

SELECT Region FROM club WHERE Club_name <> "Halmstads BK" OR Region <> "Russia" UNION ALL SELECT Region FROM club WHERE "Club_ID" != 1


Question: What are the album IDs that don't belong to artist 200 or aren't album 62, and also the genre IDs less than 16?

SELECT id FROM albums WHERE "artist_id" <> 200 OR "id" != 62 UNION ALL SELECT id FROM genres WHERE "id" < 16


Question: What are the driver IDs that are either 8 or greater, or 4 or less, considering both drivers and school buses?

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


Question: What are the driver IDs greater than 2 that are present in both the driver and school bus tables, excluding driver ID 3?

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 names and IDs of airports with IDs of 6 or higher that are not in the United States, excluding those operated by companies where the group equity shareholding is 60%, the principal activities are not catering services, or the name is not CLS Catering Services Limited, or the company is not incorporated in Hong Kong, or the company type is a joint venture?

SELECT name, id FROM airport WHERE "id" >= 6 AND Country != "United States" EXCEPT SELECT name, id FROM operate_company WHERE "Group_Equity_Shareholding" = 60.0 AND Principal_activities <> "Catering services" OR name != "CLS Catering Services Limited" AND Incorporated_in <> "Hong Kong" OR Type = "Joint Venture"


Question: What are the aircraft IDs that appear in either the aircraft table or the airport_aircraft table, where the aircraft ID is at least 1?

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


Question: Which driver IDs, excluding driver ID 7, are greater than 4 and appear in the driver table?

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


Question: What are the driver IDs, excluding driver ID 5, and also the driver IDs that are 3 or greater, from the driver and school bus tables?

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


Question: Which employee IDs meet at least one of the following conditions: they don't live in Sale, they are not 28 years old, their name is Louis Deacon, or their employee ID is 9 or greater; and also which employee IDs have a bonus greater than 3200?

SELECT Employee_ID FROM employee WHERE City <> "Sale" OR "Age" != 28 OR Name = "Louis Deacon" OR "Employee_ID" >= 9 UNION ALL SELECT Employee_ID FROM evaluation WHERE "Bonus" > 3200.0


Question: What are the driver IDs, excluding driver ID 5, and also driver IDs greater than 4, considering both drivers and school buses?

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: What is the minimum document ID for draft number 20, or copy number 6 or less, or document ID 2 or greater? Also, what is the minimum document ID for draft number 17 or greater, excluding copy number 5, and document ID greater than 10?

SELECT MIN(document_id), draft_number FROM Draft_Copies WHERE "draft_number" = 20 OR "copy_number" <= 6 OR "document_id" >= 2 UNION ALL SELECT MIN(document_id), draft_number FROM Draft_Copies WHERE "copy_number" != 5 AND "draft_number" >= 17 AND "document_id" > 10


Question: What are the aircraft IDs that appear in both the aircraft table with an ID greater than 1 and the airport_aircraft table with an ID equal to 2?

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


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

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


Question: What are the driver IDs, excluding driver ID 7, that are present in both the driver and school bus tables, where the school bus driver IDs are less than 10?

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


Question: What are the user IDs of reviews with a rating less than 7 and not item ID 3, or with a rank not equal to 1, or with user ID 2, excluding user IDs of users whose name is not Helen or whose user ID is greater than 4?

SELECT u_id FROM review WHERE "rating" < 7 AND "i_id" <> 3 OR "rank" != 1 OR "u_id" = 2 EXCEPT SELECT u_id FROM useracct WHERE name <> "Helen" OR "u_id" > 4


Question: Which club IDs are located in AKW or have a description other than "Venture capital fund for student business." and a name other than "Tennis Club", and also have members where the student ID is not 1010 or the club ID is 4 or greater?

SELECT ClubID FROM Club WHERE ClubLocation = "AKW" OR ClubDesc != "Venture capital fund for student business." AND ClubName != "Tennis Club" INTERSECT SELECT ClubID FROM Member_of_club WHERE "StuID" <> 1010 OR "ClubID" >= 4


Question: Which aircraft IDs are greater than 2, but not equal to 5, considering only aircraft IDs present in the aircraft table?

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


Question: Give me the ICAO, name, ID, country, and city for airports that are not in the Netherlands and don't have an ID of 1 and don't have the IATA code BWI, along with the ICAO, name, ID, country, and city for airports that don't have the ICAO code EHAM and have an ID less than 9 and have the IATA code BWI, or are not in Barcelona, or are not in the United States and don't have the name "Ted Stevens Airport".

PANC
Ted Stevens Airport
3
United States
Anchorage

KBOS
Logan International Airport
8
United States
Boston

EBBR
National Airport
9
Belgium
Brussels

BIAR
Akureyri Airport
1
Iceland
Akureyri

EHAM
Schiphol Airport
2
Netherlands
Amsterdam

PANC
Ted Stevens Airport
3
United States
Anchorage

KBWI
Baltimore-Washington Airport
4
United States
Baltimore

KBOS
Logan International Airport
8
United States
Boston

EBBR
National Airport
9
Belgium
Brussels

SELECT ICAO, name, id, Country, City FROM airport WHERE Country != "Netherlands" AND "id" <> 1 AND IATA <> "BWI" UNION ALL SELECT ICAO, name, id, Country, City FROM airport WHERE ICAO <> "EHAM" AND "id" < 9 AND IATA = "BWI" OR City <> "Barcelona" OR Country <> "United States" AND name <> "Ted Stevens Airport"


Question: What is the minimum city area and the store ID for districts where the average city population is not 530438.0, or where the count of store IDs is less than or equal to 1, the city area is not 22.0, and the district name is not "Chiniot District"?

SELECT MIN(T1.City_Area), T2.Store_ID FROM district as T1 JOIN store_district as T2 ON T1.District_ID = T2.District_ID WHERE AVG(City_Population) <> 530438.0 OR COUNT(Store_ID) <= 1 AND City_Area <> 22.0 AND District_name <> "Chiniot District"


Question: What are the driver IDs that are greater than or equal to 9, and also the driver IDs that are less than or equal to 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