niryuu/sni-each-converted huggingface dataset:
Step 1: find the number of rows of each value of party_phone in Parties table.
Step 2: find party_phone of Parties table with largest value in the results of step 1
Output: SELECT party_phone FROM Parties GROUP BY party_phone ORDER BY Count ( * ) Desc LIMIT 1
find each value of course_name in Courses table along with the number of the corresponding rows to each value
Output: SELECT course_name , Count ( * ) FROM Courses GROUP BY course_name
Step 1: For each row in bank table, find corresponding rows in customer table and in loan table.
Step 2: find cust_name, acc_bal of the results of step 1 whose amount greater than 5000
Output: SELECT T2.cust_name , T2.acc_bal FROM bank AS T1 JOIN customer AS T2 ON T2.branch_ID = T1.branch_ID JOIN loan AS T3 ON T1.branch_ID = T3.branch_ID WHERE T3.amount > 5000
Step 1: For each row in bank table, find corresponding rows in customer table and in loan table.
Step 2: find cust_name, city of the results of step 1 whose loan_type equals Business
Output: SELECT T2.cust_name , T1.city FROM bank AS T1 JOIN customer AS T2 ON T1.branch_ID = T2.branch_ID JOIN loan AS T3 ON T1.branch_ID = T3.branch_ID WHERE T3.loan_type = "Business"
find the StuID of Student table for which Age equals or between 20 and 18
Output: SELECT StuID FROM Student WHERE Age BETWEEN 18 AND 20
find without repetition the product_id of Order_Items table for which order_item_id equals or between 1975-01-01 and 1976-01-01
Output: SELECT DISTINCT product_id FROM Order_Items WHERE order_item_id BETWEEN "1976-01-01" AND "1975-01-01"
Step 1: For each row in Tourist_Attractions table, find the corresponding rows in Visits table.
Step 2: find Name of the results of step 1 whose Visit_Details equals Marcelle
Output: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Visit_Details = "Marcelle"
find each value of FacID in Faculty table along with the number of the corresponding rows to each value
Output: SELECT Rank , Count ( * ) FROM Faculty GROUP BY FacID
Step 1: For each row in Student table, find the corresponding rows in Voting_record table.
Step 2: find without repetition Fname of the results of step 1 whose President_Vote equals 1004
Output: SELECT DISTINCT T1.Fname FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T2.President_Vote = 1004
find the number of rows in list table whose FirstName equals LORIA and LastName equals ONDERSMA
Output: SELECT Count ( * ) FROM list WHERE FirstName = "LORIA" AND LastName = "ONDERSMA"
Step 1: For each row in Ref_Hotel_Star_Ratings table, find the corresponding rows in Hotels table.
Step 2: find hotel_id, star_rating_description, star_rating_description of the results of step 1 ordered ascending by price_range
Output: SELECT T2.hotel_id , T1.star_rating_description , T1.star_rating_description FROM Ref_Hotel_Star_Ratings AS T1 JOIN Hotels AS T2 ON T1.star_rating_code = T2.star_rating_code ORDER BY T2.price_range Asc
find the number of rows in Faculty table whose Sex equals F
Output: SELECT Count ( * ) FROM Faculty WHERE Sex = "F"
Step 1: for each value of Product_Name in Products table, calculate number of rows.
Step 2: show each value of Product_Name in Products table along with the corresponding number of rows ordered descending by the results of step 1
Output: SELECT Product_Name , Count ( * ) FROM Products GROUP BY Product_Name ORDER BY Count ( * ) Desc
Step 1: find the number of rows of each value of party_email in Parties table.
Step 2: find party_email of Parties table with largest value in the results of step 1
Output: SELECT party_email FROM Parties GROUP BY party_email ORDER BY Count ( * ) Desc LIMIT 1
find the f_id of song table with largest value of releasedate
Output: SELECT f_id FROM song ORDER BY releasedate Desc LIMIT 1
Step 1: find the artist_name, country of song table ordered descending by rating.
Step 2: only show the first 3 rows of the results
Output: SELECT artist_name , country FROM song ORDER BY rating Desc LIMIT 3
Step 1: For each row in Document_Functional_Areas table, find corresponding rows in Functional_Areas table and in Documents table.
Step 2: find the average access_count in the results of step 1 whose parent_functional_area_code equals Acknowledgement
Output: SELECT Avg ( T2.access_count ) FROM Functional_Areas AS T1 JOIN Documents AS T2 JOIN Document_Functional_Areas AS T3 ON T1.functional_area_code = T3.functional_area_code AND T3.document_code = T2.document_code WHERE T1.parent_functional_area_code = "Acknowledgement"
Step 1: find Name of driver table whose Home_city equals Hartford and Age less than 40.
Step 2: find the Name of driver table for which Age greater than 40.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Name FROM driver WHERE Home_city = "Hartford" AND Age < 40 INTERSECT SELECT Name FROM driver WHERE Age > 40
find the average rows in artist table whose gender equals Female
Output: SELECT Avg ( * ) FROM artist WHERE gender = "Female"
Step 1: For each row in Organization_Contact_Individuals table, find corresponding rows in Individuals table and in Organizations table.
Step 2: find individual_last_name of the results of step 1 with largest value of uk_vat_number
Output: SELECT T1.individual_last_name FROM Individuals AS T1 JOIN Organizations AS T2 JOIN Organization_Contact_Individuals AS T3 ON T1.individual_id = T3.individual_id AND T3.organization_id = T2.organization_id ORDER BY T2.uk_vat_number Desc LIMIT 1
find the artist_name of song table with smallest value of rating
Output: SELECT artist_name FROM song ORDER BY rating Asc LIMIT 1
Step 1: find the document_code of Documents table.
Step 2: find the document_type_code of Documents table for which access_count greater than 10000.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT document_code FROM Documents EXCEPT SELECT document_type_code FROM Documents WHERE access_count > 10000
Step 1: find the average resolution in song table.
Step 2: find the f_id of song table whose resolution greater than the results of step 1
Output: SELECT f_id FROM song WHERE resolution > ( SELECT Avg ( resolution ) FROM song )
find the Fname of Faculty table
Output: SELECT Fname FROM Faculty
find the number of rows in files table whose duration less than 4:%
Output: SELECT Count ( * ) FROM files WHERE duration < "4:%"
find name, country, elevation of airports table whose city equals New York or city equals Goroka
Output: SELECT name , country , elevation FROM airports WHERE city = "Goroka" OR city = "New York"
find without repetition the individual_last_name of Individuals table
Output: SELECT DISTINCT individual_last_name FROM Individuals
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find artist's artist_name, artist's country of the results of step 1 whose song_name equals love
Output: SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name = "love"
Step 1: For each row in list table, find the corresponding rows in teachers table.
Step 2: find the number of rows in the results of step 1 whose FirstName equals LORIA and FirstName equals ONDERSMA
Output: SELECT Count ( * ) FROM list AS T1 JOIN teachers AS T2 WHERE T1.FirstName = "LORIA" AND T2.FirstName = "ONDERSMA"
find the state, acc_type, credit_score of customer table for which cust_name equals 0
Output: SELECT state , acc_type , credit_score FROM customer WHERE cust_name = 0
Step 1: For each row in artwork table, find the corresponding rows in nomination table.
Step 2: for each value of Festival_ID in the results of step 1, find the number of rows along with artwork's Artwork_ID and Name
Output: SELECT T1.Artwork_ID , T1.Name , Count ( * ) FROM artwork AS T1 JOIN nomination AS T2 ON T1.Artwork_ID = T2.Artwork_ID GROUP BY T2.Festival_ID
find the number of different loan_type in loan table
Output: SELECT Count ( DISTINCT loan_type ) FROM loan
Step 1: find the artist_name of artist table.
Step 2: find the song's artist_name of song table for which rating greater than 8.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT T1.artist_name FROM artist AS T1 EXCEPT SELECT T2.artist_name FROM song AS T2 WHERE T2.rating > 8
find the number of rows in Staff table
Output: SELECT Count ( * ) FROM Staff
find FacID of Faculty table whose Sex equals M and Sex equals M
Output: SELECT FacID FROM Faculty WHERE Sex = "M" AND Sex = "M"
find the number of rows in artist table whose gender equals Male
Output: SELECT Count ( * ) FROM artist WHERE gender = "Male"
Step 1: find the cust_name of customer table.
Step 2: find the cust_name of customer table whose cust_ID not one of the results of step 1
Output: SELECT cust_name FROM customer WHERE cust_ID NOT IN ( SELECT cust_name FROM customer )
find the train_number, time of train table for which destination equals Chennai
Output: SELECT train_number , time FROM train WHERE destination = "Chennai"
Step 1: find without repetition the artist_name of song table.
Step 2: find the artist_name of song table for which rating greater than 8.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT DISTINCT artist_name FROM song EXCEPT SELECT artist_name FROM song WHERE rating > 8
find the number of rows in routes table whose airline equals American Airlines
Output: SELECT Count ( * ) FROM routes WHERE airline = "American Airlines"
find the invoice_date of Invoices table for which invoice_number less than 10
Output: SELECT invoice_date FROM Invoices WHERE invoice_number < 10
Step 1: For each row in Student table, find the corresponding rows in Voting_record table.
Step 2: find without repetition President_Vote of the results of step 1 whose Fname equals 08/30/2015
Output: SELECT DISTINCT T2.President_Vote FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T1.Fname = "08/30/2015"
Step 1: For each row in Course_Authors_and_Tutors table, find the corresponding rows in Courses table.
Step 2: find personal_name of the results of step 1 whose course_name equals advanced database
Output: SELECT T1.personal_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "advanced database"
find each value of product_category in Products table along with the number of the corresponding rows to each value
Output: SELECT product_category , Count ( * ) FROM Products GROUP BY product_category
find FirstName, LastName of list table whose FirstName equals MARROTTE and LastName equals KIRK
Output: SELECT FirstName , LastName FROM list WHERE FirstName = "MARROTTE" AND LastName = "KIRK"
Step 1: For each row in Locations table, find the corresponding rows in Tourist_Attractions table.
Step 2: find Name of the results of step 1 whose Address equals Marcelle
Output: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = "Marcelle"
Step 1: For each row in airports table, find the corresponding rows in routes table.
Step 2: find each value of dst_apid in the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT T2.name , Count ( * ) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid GROUP BY T1.dst_apid
Step 1: For each row in artist table, find the corresponding rows in files table.
Step 2: find artist's artist_name, gender of the results of step 1 whose formats contains Mar
Output: SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN files AS T2 ON T1.artist_name = T2.artist_name WHERE T2.formats LIKE "Mar"
Step 1: find the number of rows of each value of document_name in Documents table.
Step 2: find document_name of Documents table ordered descending by the results of step 1.
Step 3: only show the first 3 rows of the results
Output: SELECT document_name FROM Documents GROUP BY document_name ORDER BY Count ( * ) Desc LIMIT 3
Step 1: For each row in Tourist_Attractions table, find corresponding rows in Locations table and in Visits table.
Step 2: find Visit_Date, Visit_Details of the results of step 1 whose Locations's Other_Details equals Vincent
Output: SELECT T3.Visit_Date , T3.Visit_Details FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID JOIN Visits AS T3 ON T2.Tourist_Attraction_ID = T3.Tourist_Attraction_ID WHERE T1.Other_Details = "Vincent"
Step 1: find the stuid of Participates_in table for which actid equals Canoeing.
Step 2: find the stuid of Participates_in table for which actid equals Kayaking.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT stuid FROM Participates_in WHERE actid = "Canoeing" INTERSECT SELECT stuid FROM Participates_in WHERE actid = "Kayaking"
Step 1: For each row in company table, find the corresponding rows in employment table.
Step 2: find each value of employment's Company_ID in the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT T1.Name , Count ( * ) FROM company AS T1 JOIN employment AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T2.Company_ID
Step 1: find Party of driver table whose Home_city equals Hartford and Age greater than 40.
Step 2: find the Party of driver table for which Age greater than 40.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Party FROM driver WHERE Home_city = "Hartford" AND Age > 40 INTERSECT SELECT Party FROM driver WHERE Age > 40
Step 1: find the email_address, phone_number of Staff table.
Step 2: find the email_address, phone_number of Staff table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT email_address , phone_number FROM Staff EXCEPT SELECT email_address , phone_number FROM Staff
Step 1: For each row in Locations table, find the corresponding rows in Tourist_Attractions table.
Step 2: find Address of the results of step 1 whose Name equals UK Gallery
Output: SELECT T1.Address FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T2.Name = "UK Gallery"
find the average price_range in Hotels table
Output: SELECT Avg ( price_range ) FROM Hotels
Step 1: find the loan's cust_ID of loan table for which loan_type equals Mortgages.
Step 2: find the average credit_score in customer table whose cust_name not one of the results of step 1
Output: SELECT Avg ( T1.credit_score ) FROM customer AS T1 WHERE T1.cust_name NOT IN ( SELECT T2.cust_ID FROM loan AS T2 WHERE T2.loan_type = "Mortgages" )
Step 1: find the number of rows of each value of city in airports table.
Step 2: find city in airports table whose corresponding value in step 1 is greater than 2
Output: SELECT city FROM airports GROUP BY city HAVING Count ( * ) > 2
Step 1: For each row in Student table, find the corresponding rows in Voting_record table.
Step 2: find without repetition LName of the results of step 1 whose President_Vote equals 8741 and Secretary_Vote equals 1010
Output: SELECT DISTINCT T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T2.President_Vote = 8741 AND T2.Secretary_Vote = 1010
find artist_name of artist table whose gender equals UK and gender equals Male
Output: SELECT artist_name FROM artist WHERE gender = "Male" AND gender = "UK"
find each value of day_of_week in weekly_weather table along with the average low_temperature of the corresponding rows to each value
Output: SELECT day_of_week , Avg ( low_temperature ) FROM weekly_weather GROUP BY day_of_week
Step 1: For each row in Faculty table, find the corresponding rows in Faculty_Participates_in table.
Step 2: for each value of Faculty_Participates_in's FacID in the results of step 1, find the number of rows along with Fname and Lname
Output: SELECT T2.Fname , T2.Lname , Count ( * ) FROM Faculty_Participates_in AS T1 JOIN Faculty AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID
Step 1: For each row in Organization_Contact_Individuals table, find corresponding rows in Individuals table and in Organizations table.
Step 2: find individual_last_name of the results of step 1 whose organization_name equals Labour Party
Output: SELECT T1.individual_last_name FROM Individuals AS T1 JOIN Organizations AS T2 JOIN Organization_Contact_Individuals AS T3 ON T1.individual_id = T3.individual_id AND T3.organization_id = T2.organization_id WHERE T2.organization_name = "Labour Party"
Step 1: find the customer_id of Customer_Orders table.
Step 2: find the customer_name, customer_phone of Customers table whose Customers's customer_id not one of the results of step 1
Output: SELECT T1.customer_name , T1.customer_phone FROM Customers AS T1 WHERE T1.customer_id NOT IN ( SELECT T2.customer_id FROM Customer_Orders AS T2 )
find the Name of company table for which Profits_in_Billion greater than 200 ordered descending by Sales_in_Billion
Output: SELECT Name FROM company WHERE Profits_in_Billion > 200 ORDER BY Sales_in_Billion Desc
find each value of Type in school table along with the number of the corresponding rows to each value
Output: SELECT Type , Count ( * ) FROM school GROUP BY Type
find the song_name of song table
Output: SELECT song_name FROM song
Step 1: For each row in files table, find the corresponding rows in song table.
Step 2: find files's artist_name of the results of step 1 with largest value of releasedate
Output: SELECT T1.artist_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id ORDER BY T2.releasedate Desc LIMIT 1
find the cust_name of customer table with largest value of credit_score
Output: SELECT cust_name FROM customer ORDER BY credit_score Desc LIMIT 1
find the state, acc_type, credit_score of customer table
Output: SELECT state , acc_type , credit_score FROM customer
find the shipment_date of Shipments table for which shipment_tracking_number equals 3452
Output: SELECT shipment_date FROM Shipments WHERE shipment_tracking_number = 3452
Step 1: For each row in Tourist_Attractions table, find corresponding rows in Locations table and in Shops table.
Step 2: find Address of the results of step 1 whose Shop_Details equals Vincent
Output: SELECT T1.Address FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID JOIN Shops AS T3 ON T2.Tourist_Attraction_ID = T3.Shop_ID WHERE T3.Shop_Details = "Vincent"
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find artist's artist_name, song_name of the results of step 1 whose song_name contains love
Output: SELECT T1.artist_name , T2.song_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE "love"
Step 1: find the number of rows of each value of Location in festival_detail table.
Step 2: find Location of festival_detail table with largest value in the results of step 1
Output: SELECT Location FROM festival_detail GROUP BY Location ORDER BY Count ( * ) Desc LIMIT 1
Step 1: find the Name of driver table.
Step 2: find the Name of driver table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Name FROM driver EXCEPT SELECT Name FROM driver
find artist_name of song table whose song_name equals mp3 and rating less than 1000
Output: SELECT artist_name FROM song WHERE song_name = "mp3" AND rating < 1000
Step 1: For each row in bank table, find corresponding rows in customer table and in loan table.
Step 2: find without repetition cust_name, credit_score of the results of step 1 whose loan_type equals Mortgages
Output: SELECT DISTINCT T2.cust_name , T2.credit_score FROM bank AS T1 JOIN customer AS T2 ON T2.branch_ID = T1.branch_ID JOIN loan AS T3 ON T1.branch_ID = T3.branch_ID WHERE T3.loan_type = "Mortgages"
find each value of name in airports table along with the number of the corresponding rows to each value
Output: SELECT name , Count ( * ) FROM airports GROUP BY name
Step 1: find the number of rows of each value of state in customer table.
Step 2: find state of customer table with largest value in the results of step 1
Output: SELECT state FROM customer GROUP BY state ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in Tourist_Attractions table, find the corresponding rows in Visits table.
Step 2: find Name, Visit_Date of the results of step 1 whose Name equals Vincent or Name equals Vivian
Output: SELECT T1.Name , T2.Visit_Date FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = "Vivian" OR T1.Name = "Vincent"
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find gender, song's artist_name of the results of step 1 with smallest value of song_name
Output: SELECT T1.gender , T2.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.song_name Asc LIMIT 1
Step 1: find the cust_ID of loan table.
Step 2: find the average credit_score in customer table whose cust_name not one of the results of step 1
Output: SELECT Avg ( T1.credit_score ) FROM customer AS T1 WHERE T1.cust_name NOT IN ( SELECT T2.cust_ID FROM loan AS T2 )
find without repetition the Advisor of Student table for which Major equals Spring
Output: SELECT DISTINCT Advisor FROM Student WHERE Major = "Spring"
find each value of artist_name in files table along with the number of the corresponding rows to each value
Output: SELECT artist_name , Count ( * ) FROM files GROUP BY artist_name
Step 1: For each row in airports table, find the corresponding rows in routes table.
Step 2: only keep the results of step 1 whose country equals China.
Step 3: find the number of rows of each value of dst_ap in the results of step 2.
Step 4: find dst_ap of the results of step 2 with largest value in the results of step 3
Output: SELECT T1.dst_ap FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = "China" GROUP BY T1.dst_ap ORDER BY Count ( * ) Desc LIMIT 1
find the Building of Faculty table for which Rank greater than or equals Professor
Output: SELECT Building FROM Faculty WHERE Rank > = "Professor"
find the number of rows in Student table whose Sex equals M and Major equals 600
Output: SELECT Count ( * ) FROM Student WHERE Sex = "M" AND Major = 600
Step 1: find the average CHECKING's balance in CHECKING table.
Step 2: For each row in ACCOUNTS table, find the corresponding rows in SAVINGS table.
Step 3: find name in the results of step 2 whose SAVINGS's balance less than the results of step 1
Output: SELECT T1.name FROM ACCOUNTS AS T1 JOIN SAVINGS AS T2 ON T1.custid = T2.custid WHERE T2.balance < ( SELECT Avg ( T3.balance ) FROM CHECKING AS T3 )
Step 1: find the date, mean_temperature_f, max_wind_Speed_mph of weather table ordered descending by max_wind_Speed_mph.
Step 2: only show the first 3 rows of the results
Output: SELECT date , mean_temperature_f , max_wind_Speed_mph FROM weather ORDER BY max_wind_Speed_mph Desc LIMIT 3
find the cust_name, acc_bal of customer table for which no_of_loans greater than 5000
Output: SELECT cust_name , acc_bal FROM customer WHERE no_of_loans > 5000
Step 1: For each row in Person table, find the corresponding rows in PersonFriend table.
Step 2: find without repetition Person's name, age of the results of step 1 whose friend not equals Dan
Output: SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend ! = "Dan"
find the Player of match_season table for which Player contains English
Output: SELECT Player FROM match_season WHERE Player LIKE "English"
find the problem_log_id, log_entry_date of Problem_Log table for which problem_log_id equals 10
Output: SELECT problem_log_id , log_entry_date FROM Problem_Log WHERE problem_log_id = 10
Step 1: For each row in Addresses table, find corresponding rows in Drama_Workshop_Groups table and in Stores table.
Step 2: find the number of different Currency_Code in the results of step 1 whose Stores's Store_Name equals FJA Filming
Output: SELECT Count ( DISTINCT T2.Currency_Code ) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T2.Address_ID = T1.Address_ID JOIN Stores AS T3 ON T1.Address_ID = T3.Address_ID WHERE T3.Store_Name = "FJA Filming"
Step 1: For each row in files table, find the corresponding rows in song table.
Step 2: find song_name of the results of step 1 whose duration equals english or duration starts with 4:
Output: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration = "4:%" OR T1.duration LIKE "english"
find the average price_in_euros and the minimum price_in_dollars in Catalog_Contents table
Output: SELECT Avg ( price_in_euros ) , Min ( price_in_dollars ) FROM Catalog_Contents
Step 1: For each row in volume table, find the corresponding rows in music_festival table.
Step 2: find Issue_Date, Music_Festival of the results of step 1
Output: SELECT T1.Issue_Date , T2.Music_Festival FROM volume AS T1 JOIN music_festival AS T2 ON T1.Volume_ID = T2.Volume
Step 1: For each row in city table, find the corresponding rows in address table.
Step 2: find the number of rows of each value of address's city_id in the results of step 1.
Step 3: find address, city, address's city_id of step 1 results with largest value in the results of step 2
Output: SELECT T1.address , T2.city , T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY Count ( * ) Desc LIMIT 1
find the Market_Details of Street_Markets table
Output: SELECT Market_Details FROM Street_Markets
Step 1: For each row in artist table, find the corresponding rows in song table.
Step 2: find song_name of the results of step 1 whose languages equals modern or preferred_genre equals english
Output: SELECT T2.song_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "modern" OR T1.preferred_genre = "english"
Step 1: find the number of rows of each value of Location_ID in Tourist_Attractions table.
Step 2: find Name of Tourist_Attractions table with largest value in the results of step 1
Output: SELECT Name FROM Tourist_Attractions GROUP BY Location_ID ORDER BY Count ( * ) Desc LIMIT 1
find the maximum Gold and the minimum Silver in club_rank table
Output: SELECT Max ( Gold ) , Min ( Silver ) FROM club_rank
find the Issue_Date, Song of volume table
Output: SELECT Issue_Date , Song FROM volume
find the staff_id of Staff_Department_Assignments table for which date_assigned_to greater than or equals Clerical Staff
Output: SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to > = "Clerical Staff"
Step 1: For each row in Student table, find the corresponding rows in Voting_record table.
Step 2: find without repetition Fname, LName of the results of step 1 whose Advisor equals 18 and Treasurer_Vote equals 1035
Output: SELECT DISTINCT T1.Fname , T1.LName FROM Student AS T1 JOIN Voting_record AS T2 ON T1.StuID = T2.StuID WHERE T1.Advisor = 18 AND T2.Treasurer_Vote = 1035
Step 1: For each row in All_Documents table, find the corresponding rows in Document_Locations table.
Step 2: find Date_in_Locaton_To of the results of step 1 whose Document_Name equals Marry CV
Output: SELECT T2.Date_in_Locaton_To FROM All_Documents AS T1 JOIN Document_Locations AS T2 ON T1.Document_ID = T2.Document_ID WHERE T1.Document_Name = "Marry CV"
find the minimum Order_Quantity and the summation of Order_Quantity in Invoice_Items table
Output: SELECT Min ( Order_Quantity ) , Sum ( Order_Quantity ) FROM Invoice_Items
find the Date_of_ceremony, Date_of_ceremony of music_festival table
Output: SELECT Date_of_ceremony , Date_of_ceremony FROM music_festival
find the average other_customer_details in Customers table
Output: SELECT Avg ( other_customer_details ) FROM Customers
Step 1: For each row in School table, find the corresponding rows in budget table.
Step 2: find School_name, Budgeted, total_budget_percent_invested of the results of step 1 whose Year greater than or equals 2002
Output: SELECT T1.School_name , T2.Budgeted , T2.total_budget_percent_invested FROM School AS T1 JOIN budget AS T2 ON T1.School_id = T2.School_id WHERE T2.Year > = 2002
Step 1: For each row in Customers table, find the corresponding rows in Customer_Orders table.
Step 2: find customer_name of the results of step 1 whose shipping_method_code equals Paid.
Step 3: find customer_name of the results of step 1 whose order_status_code equals FedEx.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.shipping_method_code = "Paid" INTERSECT SELECT T1.customer_name FROM Customers AS T1 JOIN Customer_Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "FedEx"
Step 1: For each row in county table, find the corresponding rows in election table.
Step 2: find Committee of the results of step 1 whose Population less than 100000
Output: SELECT T2.Committee FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District WHERE T1.Population < 100000
Step 1: find the artist's artist_name of artist table for which artist's country equals UK.
Step 2: find the song's artist_name of song table for which song's country equals english.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT T1.artist_name FROM artist AS T1 WHERE T1.country = "UK" INTERSECT SELECT T2.artist_name FROM song AS T2 WHERE T2.country = "english"
Step 1: find the cmi_cross_ref_id of CMI_Cross_References table.
Step 2: find the cmi_cross_ref_id of Business_Rates table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT T1.cmi_cross_ref_id FROM CMI_Cross_References AS T1 EXCEPT SELECT T2.cmi_cross_ref_id FROM Business_Rates AS T2
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find rows of the results of step 1 whose SALARY greater than or equals 8000 and MAX_SALARY less than or equals 12000
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY > = 8000 AND T1.MAX_SALARY < = 12000
find the pName of Player table ordered ascending by pName
Output: SELECT pName FROM Player ORDER BY pName Asc
Step 1: For each row in broadcast table, find corresponding rows in program table and in channel table.
Step 2: find program's Name, channel's Owner, program's Owner of the results of step 1
Output: SELECT T1.Name , T2.Owner , T1.Owner FROM program AS T1 JOIN channel AS T2 JOIN broadcast AS T3 ON T1.Program_ID = T3.Program_ID AND T3.Channel_ID = T2.Channel_ID
find title of film table whose replacement_cost greater than 200 or rental_rate less than 100
Output: SELECT title FROM film WHERE replacement_cost > 200 OR rental_rate < 100
find the rows of jobs table for which MIN_SALARY greater than 2500
Output: SELECT * FROM jobs WHERE MIN_SALARY > 2500
find the average price_in_euros and the maximum price_in_dollars in Catalog_Contents table
Output: SELECT Avg ( price_in_euros ) , Max ( price_in_dollars ) FROM Catalog_Contents
Step 1: For each row in Institution table, find the corresponding rows in protein table.
Step 2: find protein_name, Type of the results of step 1
Output: SELECT T2.protein_name , T1.Type FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id
Step 1: find the Porphyria of enzyme table.
Step 2: find the number of rows in enzyme table whose id not one of the results of step 1
Output: SELECT Count ( * ) FROM enzyme WHERE id NOT IN ( SELECT Porphyria FROM enzyme )
find without repetition the Fname, Age of Student table for which Advisor equals 18
Output: SELECT DISTINCT Fname , Age FROM Student WHERE Advisor = 18
Step 1: For each row in Person table, find the corresponding rows in PersonFriend table.
Step 2: find the summation of age of each value of friend in the results of step 1.
Step 3: find PersonFriend's name in the results of step 1 whose corresponding value in step 2 is greater than or equals engineer
Output: SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name GROUP BY T2.friend HAVING Sum ( T1.age ) > = "engineer"
Step 1: find the date, mean_temperature_f, min_temperature_f of weather table ordered descending by mean_wind_speed_mph.
Step 2: only show the first 3 rows of the results
Output: SELECT date , mean_temperature_f , min_temperature_f FROM weather ORDER BY mean_wind_speed_mph Desc LIMIT 3
find the average Famous_Release_date in artist table whose Age greater than or equals 25
Output: SELECT Avg ( Famous_Release_date ) FROM artist WHERE Age > = 25
find the City of city table for which Regional_Population greater than 2010
Output: SELECT City FROM city WHERE Regional_Population > 2010
Step 1: For each row in artist table, find the corresponding rows in volume table.
Step 2: find the average Weeks_on_Top in the results of step 1 whose Artist equals Gorgoroth or Age equals 25
Output: SELECT Avg ( T2.Weeks_on_Top ) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = "Gorgoroth" OR T1.Age = 25
find JOB_TITLE, MIN_SALARY of jobs table whose MIN_SALARY contains 12000 and MAX_SALARY less than or equals 18000
Output: SELECT JOB_TITLE , MIN_SALARY FROM jobs WHERE MIN_SALARY LIKE 12000 AND MAX_SALARY < = 18000
Step 1: find the Boys_or_Girls of school table for which Founded greater than 1890.
Step 2: find the Denomination of school table for which Founded less than 1900.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT Boys_or_Girls FROM school WHERE Founded > 1890 INTERSECT SELECT Denomination FROM school WHERE Founded < 1900
find the EMPLOYEE_ID of employees table
Output: SELECT EMPLOYEE_ID FROM employees
Step 1: find the Unsure_rate of candidate table ordered descending by Oppose_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Unsure_rate FROM candidate ORDER BY Oppose_rate Desc LIMIT 3
find the Name, Name of Products table with largest value of Price
Output: SELECT Name , Name FROM Products ORDER BY Price Desc LIMIT 1
find the date of weather table for which wind_dir_degrees greater than 85
Output: SELECT date FROM weather WHERE wind_dir_degrees > 85
Step 1: find the minimum date_assigned_from in Staff_Department_Assignments table.
Step 2: find the staff_id of Staff_Department_Assignments table whose date_assigned_to less than the results of step 1
Output: SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < ( SELECT Min ( date_assigned_from ) FROM Staff_Department_Assignments )
find the average Sheep_and_Goats in farm table whose Cows greater than 5000
Output: SELECT Avg ( Sheep_and_Goats ) FROM farm WHERE Cows > 5000
find the pName, HS of Player table for which yCard equals yes
Output: SELECT pName , HS FROM Player WHERE yCard = "yes"
find the average Total_Horses in farm table whose Sheep_and_Goats greater than 5000
Output: SELECT Avg ( Total_Horses ) FROM farm WHERE Sheep_and_Goats > 5000
Step 1: For each row in Problems table, find the corresponding rows in Problem_Log table.
Step 2: find problem_log_id, date_problem_reported of the results of step 1 whose Problem_Log's problem_id equals 10
Output: SELECT T1.problem_log_id , T2.date_problem_reported FROM Problem_Log AS T1 JOIN Problems AS T2 ON T1.problem_id = T2.problem_id WHERE T1.problem_id = 10
Step 1: find the number of rows of each value of Nominee in musical table.
Step 2: find Award of musical table with largest value in the results of step 1
Output: SELECT Award FROM musical GROUP BY Nominee ORDER BY Count ( * ) Desc LIMIT 1
Step 1: for each value of document_type_code in Documents table, calculate number of rows.
Step 2: show each value of document_type_code in Documents table along with the corresponding average access_count with smallest value in the results of step 1
Output: SELECT access_count , Avg ( access_count ) FROM Documents GROUP BY document_type_code ORDER BY Count ( * ) Asc LIMIT 1
Step 1: find the average min_visibility_miles of each value of zip_code in weather table.
Step 2: find zip_code in weather table whose corresponding value in step 1 is greater than 10
Output: SELECT zip_code FROM weather GROUP BY zip_code HAVING Avg ( min_visibility_miles ) > 10
Step 1: find the average duration in trip table whose zip_code equals 94103.
Step 2: find the id of trip table whose duration greater than the results of step 1
Output: SELECT id FROM trip WHERE duration > ( SELECT Avg ( duration ) FROM trip WHERE zip_code = 94103 )
Step 1: For each row in Manufacturers table, find the corresponding rows in Products table.
Step 2: find the  Products's Name in the results of step 1 whose Revenue greater than or equals 180 ordered descending by Price
Output: SELECT T2.Name , T2.Price FROM Manufacturers AS T1 JOIN Products AS T2 ON T1.Code = T2.Manufacturer WHERE T1.Revenue > = 180 ORDER BY T2.Price Desc
find the number of different payment_method_code in Ref_Payment_Methods table whose payment_method_description equals credit
Output: SELECT Count ( DISTINCT payment_method_code ) FROM Ref_Payment_Methods WHERE payment_method_description = "credit"
find the Document_Type_Code, Document_Type_Description of Ref_Document_Types table
Output: SELECT Document_Type_Code , Document_Type_Description FROM Ref_Document_Types
Step 1: For each row in airport table, find the corresponding rows in flight table.
Step 2: find the number of rows of each value of airport's id in the results of step 1.
Step 3: find airport's id, name, Pilot of step 1 results with largest value in the results of step 2
Output: SELECT T1.id , T1.name , T2.Pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T1.id ORDER BY Count ( * ) Desc LIMIT 1
find the customer_name of Customers table for which customer_details equals or between 2009-01-01 and 2010-01-01
Output: SELECT customer_name FROM Customers WHERE customer_details BETWEEN "2010-01-01" AND "2009-01-01"
Step 1: find the address_line_1, email_address of Customers table for which email_address equals hsteuber@example.org.
Step 2: find the address_line_1, email_address of Customers table for which email_address equals vbogisich@example.org.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT address_line_1 , email_address FROM Customers WHERE email_address = "hsteuber@example.org" INTERSECT SELECT address_line_1 , email_address FROM Customers WHERE email_address = "vbogisich@example.org"
find the average min_sea_level_pressure_inches in weather table
Output: SELECT Avg ( min_sea_level_pressure_inches ) FROM weather
find the number of rows in storm table whose Name greater than or equals 0
Output: SELECT Count ( * ) FROM storm WHERE Name > = 0
Step 1: find the characteristic_name, other_characteristic_details, characteristic_data_type of Characteristics table for which characteristic_name equals slow.
Step 2: find the characteristic_name, other_characteristic_details, characteristic_data_type of Characteristics table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM Characteristics WHERE characteristic_name = "slow" EXCEPT SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM Characteristics
find the catalog_name of Catalogs table for which catalog_id greater than 8
Output: SELECT catalog_name FROM Catalogs WHERE catalog_id > 8
Step 1: For each row in Person table, find the corresponding rows in PersonFriend table.
Step 2: find the summation of age of each value of friend in the results of step 1.
Step 3: find PersonFriend's name in the results of step 1 whose corresponding value in step 2 is greater than engineer
Output: SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name GROUP BY T2.friend HAVING Sum ( T1.age ) > "engineer"
Step 1: For each row in genre table, find the corresponding rows in song table.
Step 2: find song_name of the results of step 1 whose g_name equals modern or genre_is equals english
Output: SELECT T2.song_name FROM genre AS T1 JOIN song AS T2 ON T1.g_name = T2.genre_is WHERE T1.g_name = "modern" OR T2.genre_is = "english"
find rows of employees table whose SALARY greater than 8000 or SALARY less than 12000
Output: SELECT * FROM employees WHERE SALARY > 12000 OR SALARY < 8000
find the catalog_entry_name, price_in_euros of Catalog_Contents table for which price_in_pounds greater than 700
Output: SELECT catalog_entry_name , price_in_euros FROM Catalog_Contents WHERE price_in_pounds > 700
find the name of bridge table ordered descending by length_meters
Output: SELECT name FROM bridge ORDER BY length_meters Desc
find cName of College table whose enr greater than 15000 or state equals LA
Output: SELECT cName FROM College WHERE enr > 15000 OR state = "LA"
Step 1: For each row in Product table, find the corresponding rows in Problems table.
Step 2: find rows in the results of step 1 whose problem_id greater than 1986-11-13.
Step 3: find each value of Product's product_id the results of step 1 along with the number of the corresponding rows to each value
Output: SELECT Count ( * ) , T1.product_id FROM Product AS T1 JOIN Problems AS T2 ON T1.product_id = T2.product_id WHERE T2.problem_id > "1986-11-13" GROUP BY T1.product_id
Step 1: find the CName of Course table for which Credits equals 1.
Step 2: find the CName of Course table for which Days equals MTW.
Step 3: show the rows that are in any of the results of step 1 or the results of step 2
Output: SELECT CName FROM Course WHERE Credits = 1 UNION SELECT CName FROM Course WHERE Days = "MTW"
Step 1: For each row in Projects table, find the corresponding rows in Documents table.
Step 2: find the number of rows of each value of Projects's Project_ID in the results of step 1.
Step 3: find Documents's Project_ID, Project_Details in the results of step 1 whose corresponding value in step 2 is greater than or equals 2
Output: SELECT T2.Project_ID , T1.Project_Details FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID GROUP BY T1.Project_ID HAVING Count ( * ) > = 2
Step 1: find the FIRST_NAME, LAST_NAME of employees table.
Step 2: find the FIRST_NAME, LAST_NAME of employees table for which COMMISSION_PCT equals null.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT FIRST_NAME , LAST_NAME FROM employees EXCEPT SELECT FIRST_NAME , LAST_NAME FROM employees WHERE COMMISSION_PCT = "null"
find the problem_id of Problems table
Output: SELECT problem_id FROM Problems
find the order_id, customer_id, order_date of Customer_Orders table for which order_status_code equals Cancelled ordered ascending by order_date
Output: SELECT order_id , customer_id , order_date FROM Customer_Orders WHERE order_status_code = "Cancelled" ORDER BY order_date Asc
Step 1: find the characteristic_name, other_characteristic_details, characteristic_data_type of Characteristics table.
Step 2: find the characteristic_name, characteristic_name, other_characteristic_details of Characteristics table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM Characteristics EXCEPT SELECT characteristic_name , characteristic_name , other_characteristic_details FROM Characteristics
Step 1: For each row in genre table, find the corresponding rows in song table.
Step 2: find each value of g_name in the results of step 1 along with the average song's rating of the corresponding rows to each value
Output: SELECT Avg ( T2.rating ) , T2.languages FROM genre AS T1 JOIN song AS T2 ON T1.g_name = T2.genre_is GROUP BY T1.g_name
Step 1: For each row in Member_of table, find corresponding rows in Faculty table and in Department table.
Step 2: find DName, Lname of the results of step 1 whose Sex equals M and Faculty's Building equals NEB.
Step 3: find DName, Lname of the results of step 1 whose Department's Building equals M and Faculty's Building equals NEB.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T2.DName , T1.Lname FROM Faculty AS T1 JOIN Department AS T2 JOIN Member_of AS T3 ON T1.FacID = T3.FacID AND T3.DNO = T2.DNO WHERE T1.Sex = "M" AND T1.Building = "NEB" INTERSECT SELECT T2.DName , T1.Lname FROM Faculty AS T1 JOIN Department AS T2 JOIN Member_of AS T3 ON T1.FacID = T3.FacID AND T3.DNO = T2.DNO WHERE T2.Building = "M" AND T1.Building = "NEB"
find the Name of Patient table
Output: SELECT Name FROM Patient
find JOB_TITLE, MIN_SALARY, MAX_SALARY of jobs table whose JOB_TITLE equals President and MAX_SALARY greater than 12000
Output: SELECT JOB_TITLE , MIN_SALARY , MAX_SALARY FROM jobs WHERE JOB_TITLE = "President" AND MAX_SALARY > 12000
Step 1: find the address_line_2, email_address of Customers table for which email_address equals hsteuber@example.org.
Step 2: find the address_line_1, email_address of Customers table for which email_address equals vbogisich@example.org.
Step 3: show the rows that are in both the results of step 1 and the results of step 2
Output: SELECT address_line_2 , email_address FROM Customers WHERE email_address = "hsteuber@example.org" INTERSECT SELECT address_line_1 , email_address FROM Customers WHERE email_address = "vbogisich@example.org"
Step 1: For each row in Member_of table, find corresponding rows in Faculty table and in Department table.
Step 2: find DName, Lname of the results of step 1 whose Sex equals M and Faculty's Building equals NEB
Output: SELECT T2.DName , T1.Lname FROM Faculty AS T1 JOIN Department AS T2 JOIN Member_of AS T3 ON T1.FacID = T3.FacID AND T3.DNO = T2.DNO WHERE T1.Sex = "M" AND T1.Building = "NEB"
find the number of rows in wine table whose Winery equals Napa
Output: SELECT Count ( * ) FROM wine WHERE Winery = "Napa"
find rows of jobs table whose MIN_SALARY greater than 2500 and MIN_SALARY less than 20000
Output: SELECT * FROM jobs WHERE MIN_SALARY > 20000 AND MIN_SALARY < 2500
find the rows of match_season table for which Draft_Class contains English
Output: SELECT * FROM match_season WHERE Draft_Class LIKE "English"
Step 1: For each row in jobs table, find the corresponding rows in employees table.
Step 2: find rows of the results of step 1 whose SALARY less than 8000 or MAX_SALARY greater than 12000
Output: SELECT * FROM jobs AS T1 JOIN employees AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T2.SALARY < 8000 OR T1.MAX_SALARY > 12000
find roomName, decor of Rooms table whose basePrice greater than 160 and basePrice greater than 2
Output: SELECT roomName , decor FROM Rooms WHERE basePrice > 2 AND basePrice > 160
Step 1: find the Oppose_rate of candidate table ordered descending by Consider_rate.
Step 2: only show the first 3 rows of the results
Output: SELECT Oppose_rate FROM candidate ORDER BY Consider_rate Desc LIMIT 3
find the Unsure_rate, Consider_rate, Oppose_rate of candidate table ordered ascending by Consider_rate
Output: SELECT Unsure_rate , Consider_rate , Oppose_rate FROM candidate ORDER BY Consider_rate Asc
Step 1: find the date, mean_temperature_f, max_gust_speed_mph of weather table ordered descending by max_gust_speed_mph.
Step 2: only show the first 3 rows of the results
Output: SELECT date , mean_temperature_f , max_gust_speed_mph FROM weather ORDER BY max_gust_speed_mph Desc LIMIT 3
Step 1: For each row in trip table, find the corresponding rows in weather table.
Step 2: find start_station_id of the results of step 1 whose duration greater than 60 and events equals A
Output: SELECT T1.start_station_id FROM trip AS T1 JOIN weather AS T2 WHERE T1.duration > 60 AND T2.events = "A"
find name, Client of Web_client_accelerator table whose Connection equals Broadband and Connection not equals Broadband, Satellite, Wireless, Fiber, DSL
Output: SELECT name , Client FROM Web_client_accelerator WHERE Connection = "Broadband, Satellite, Wireless, Fiber, DSL" AND Connection ! = "Broadband"
find each value of genre_is in song table along with the average rating of the corresponding rows to each value
Output: SELECT Avg ( rating ) , languages FROM song GROUP BY genre_is
find JOB_TITLE of jobs table whose MIN_SALARY greater than 12000 and MAX_SALARY greater than 40000
Output: SELECT JOB_TITLE FROM jobs WHERE MIN_SALARY > 12000 AND MAX_SALARY > 40000
find the rows of employees table for which SALARY less than or equals D ordered descending by SALARY
Output: SELECT * FROM employees WHERE SALARY < = "D" ORDER BY SALARY Desc