schema stringlengths 20 14.6k | query stringlengths 17 2.58k | question stringlengths 8 1.06k |
|---|---|---|
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>... | SELECT COUNT( DISTINCT `<table1>`.subject_id ) FROM `<table1>` INNER JOIN diagnoses ON `<table1>`.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Proliferative diabetic retinopathy" | how many patients have been diagnosed with proliferative diabetic retinopathy? |
<table0>[MilitaryVehicles] { <col0>[INT]:[type] <col1>[VARCHAR]:[255] <col2>[cost]:[FLOAT] } | SELECT type, AVG( `<col2>` ) FROM `<table0>` WHERE `<col2>` > 100000 GROUP BY type; | What is the average cost of military vehicles by type, for vehicles costing more than $100,000? |
<table0>[table_name_62] { <col0>[team]:[VARCHAR] <col1>[rebounds]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 48 | Which team has 48 rebounds? |
<table0>[Diversity_Metrics] { <col0>[company_name]:[VARCHAR] <col1>[gender]:[VARCHAR] <col2>[percentage]:[FLOAT] } | SELECT f.company_name, gender, AVG( `<col2>` ) as avg_percentage, SUM( funding_amount ) as total_funding FROM `<table0>` d JOIN Funding_Records f ON d.company_name = f.company_name GROUP BY f.company_name, gender; | What is the average percentage of female and male employees for each company, with total funding? |
<table0>[table_name_83] { <col0>[tie_no]:[VARCHAR] <col1>[score]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "2–2" | How many ties occurred with a score of 2–2? |
<table0>[book_club] { <col0>[book_club_id]:[int] <col1>[Year]:[int] <col2>[Author_or_Editor]:[text] <col3>[Book_Title]:[text] <col4>[Publisher]:[text] <col5>[Category]:[text] <col6>[Result]:[text] } <table1>[culture_company] { <col0>[Company_name]:[text] <col1>[Type]:[text] <col2>[Incorporated_in]:[text] <col3>[Group_... | SELECT Category, COUNT( * ) FROM `<table0>` GROUP BY `<col5>` | Give me a histogram for how many books fall into each category?
|
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[... | SELECT COUNT( DISTINCT `<table1>`.subject_id ) FROM `<table1>` WHERE `<table1>`.diagnosis = "UPPER GI BLEED" AND `<table1>`.age < "51" | provide the number of patients whose primary disease is upper gi bleed and age is less than 51?
|
<table0>[table_name_54] { <col0>[netscape]:[VARCHAR] <col1>[internet_explorer]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "63.67%" | What percentage of users were using Netscape during the period in which 63.67% were using Internet Explorer? |
<table0>[table_72181] { <col0>[Route]:[text] <col1>[Direction]:[text] <col2>[Termini]:[text] <col3>[Junctions]:[text] <col4>[Length]:[text] <col5>[Population]:[Area] <col6>[text]:[Remarks] } | SELECT COUNT( "Junctions" ) FROM `<table0>` WHERE "Remarks" = 'Replaced by BSI-35' | How many junctions have 'replaced by bsi-35' listed in their remarks section?
|
<table0>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table1>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate... | SELECT ROW_NUMBER( ) OVER ( ORDER BY Reputation DESC ) AS "#", Id AS "user_link", Reputation FROM `<table23>` WHERE LOWER( Location ) LIKE '%finland%' ORDER BY Reputation DESC LIMIT 50 | Top 50 users from Finland. |
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:... | SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` INNER JOIN lab ON `<table2>`.hadm_id = lab.hadm_id WHERE `<table2>`.discharge_location = "REHAB/DISTINCT PART HOSP" AND lab.label = "Osmolality, Measured" | What is the number of patients who had osmolality and measured lab test and were discharged to skilled nursing facility? |
<table0>[table_name_4] { <col0>[season]:[VARCHAR] <col1>[score]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "1:0" | what season had a score of 1:0
|
<table0>[aircraft_and_flight_hours] { <col0>[model]:[VARCHAR] <col1>[255]:[manufacturer] <col2>[VARCHAR]:[255] <col3>[units_manufactured]:[INT] <col4>[hours_flown]:[INT] } | SELECT SUM( `<col4>` ) FROM `<table0>` WHERE `<col3>` > 500; | What is the total number of flight hours for all aircraft with more than 500 units manufactured? |
<table0>[Performers_in_Bookings] { <col0>[Order_ID]:[INTEGER] <col1>[Performer_ID]:[INTEGER] } <table1>[Stores] { <col0>[Store_ID]:[VARCHAR] <col1>[100]:[Address_ID] <col2>[INTEGER]:[Marketing_Region_Code] <col3>[CHAR]:[Store_Name] <col4>[VARCHAR]:[255] <col5>[Store_Phone]:[VARCHAR] <col6>[255]:[Store_Email_Address] <... | SELECT Order_Date, COUNT( `<col3>` ) FROM `<table16>` AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_Price > 1000 | Find the order dates of the orders with price above 1000, and count them by a line chart |
<table0>[Appointment] { <col0>[AppointmentID]:[INTEGER] <col1>[Patient]:[INTEGER] <col2>[PrepNurse]:[INTEGER] <col3>[Physician]:[INTEGER] <col4>[Start]:[DATETIME] <col5>[End]:[DATETIME] <col6>[ExaminationRoom]:[TEXT] } <table1>[Prescribes] { <col0>[Physician]:[INTEGER] <col1>[Patient]:[INTEGER] <col2>[Medication]:[INT... | SELECT T3.Name, COUNT( T3.Name ) FROM `<table11>` AS T1 JOIN Affiliated_With AS T2 ON T1.EmployeeID = T2.`<table11>` JOIN Department AS T3 ON T2.Department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1 GROUP BY T3.Name ORDER BY COUNT( T3.Name ) DESC | Give me a bar chart showing how many physicians for each department name they primarily affiliated in, list Y-axis from high to low order. |
<table0>[City] { <col0>[integer]:[text] <col1>[CountryCode]:[text] <col2>[District]:[text] <col3>[Population]:[integer] } <table1>[Country] { <col0>[Code]:[text] <col1>[text]:[Continent] <col2>[text]:[Region] <col3>[text]:[SurfaceArea] <col4>[real]:[IndepYear] <col5>[integer]:[Population] <col6>[integer]:[LifeExpectan... | SELECT Name FROM `<table1>` ORDER BY LifeExpectancy LIMIT 1 | Which country has the shortest life expectancy? |
<table0>[tryout] { <col0>[decision]:[VARCHAR] } | SELECT COUNT( * ) FROM `<table0>` WHERE `<col0>` = 'yes' | How many students got accepted after the tryout?
|
<table0>[table_test_2] { <col0>[int]:[loss_of_consciousness] <col1>[bool]:[gender] <col2>[string]:[bleeding] <col3>[int]:[systolic_blood_pressure_sbp] <col4>[int]:[stroke] <col5>[bool]:[renal_disease] <col6>[bool]:[hemorrhagic_diathesis] <col7>[bool]:[transient_ischemic_attack] <col8>[bool]:[creatinine_clearance_cl] <c... | SELECT * FROM `<table0>` WHERE hypertension = 1 | uncontrolled arterial hypertension according to investigator decision
|
<table0>[VoteTypes] { <col0>[number]:[text] } <table1>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table2>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[Cr... | SELECT Users.DisplayName, COUNT( * ) AS questions FROM `<table8>` INNER JOIN Post`<table8>` ON Post`<table8>`.TagId = `<table8>`.Id INNER JOIN Posts ON Posts.ParentId = Post`<table8>`.PostId INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE `<table8>`.Id = 34113 AND Posts.CreationDate > '2015-01-01 00:00:00' GROUP... | Most Cassandra Questions answered for 2015.
|
<table0>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[number] <col5>[respiration]:[number] <col6>[systemicsystolic]:[number] <col7>[systemicdiastolic]:[number] <col8>[systemicmean]:[number] <col9>[observationti... | SELECT t1.`<table2>`name FROM ( SELECT `<table2>`.`<table2>`name, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM `<table2>` WHERE `<table2>`.`<table8>`unitstayid IN ( SELECT `<table8>`.`<table8>`unitstayid FROM `<table8>` WHERE `<table8>`.age BETWEEN 30 AND 39 ) AND DATETIME( `<table2>`.`<table2>`time ) >= ... | what was the four most common procedure for patients of the age 30s since 6 years ago? |
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[la... | SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` WHERE `<table3>`.admission_type = "ELECTIVE" AND `<table3>`.days_stay > "13" | get me the number of elective hospital admission patients who stayed in hospital for more than 13 days. |
<table0>[table_name_76] { <col0>[name]:[VARCHAR] <col1>[species_authority]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "sigmodon hispidus say & ord, 1825" | What is the name for the species Authority of sigmodon hispidus say & ord, 1825? |
<table0>[station] { <col0>[INTEGER]:[name] <col1>[TEXT]:[lat] <col2>[NUMERIC]:[long] <col3>[NUMERIC]:[dock_count] <col4>[INTEGER]:[city] <col5>[TEXT]:[installation_date] } <table1>[status] { <col0>[station_id]:[INTEGER] <col1>[bikes_available]:[INTEGER] <col2>[docks_available]:[INTEGER] <col3>[time]:[TEXT] } <table2>... | SELECT date, COUNT( `<col0>` ) FROM `<table2>` WHERE `<col1>` > 85 GROUP BY `<col0>` | A line chart for giveing me the number of the dates when the max temperature was higher than 85.
|
<table0>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table1>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table2>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NA... | SELECT HIRE_DATE, SUM( `<col7>` ) FROM `<table4>` WHERE `<col5>` < '2002-06-21' | For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday. |
<table0>[program_requirement] { <col0>[program_id]:[int] <col1>[category]:[varchar] <col2>[min_credit]:[int] <col3>[additional_req]:[varchar] } <table1>[semester] { <col0>[semester_id]:[int] } <table2>[instructor] { <col0>[instructor_id]:[int] <col1>[name]:[varchar] <col2>[uniqname]:[varchar] } <table3>[course_prere... | SELECT DISTINCT department, name, `<col3>` FROM `<table10>` WHERE `<table10>`_id IN ( SELECT PROGRAM_COURSE_ID FROM program_`<table10>` AS PROGRAM_COURSE WHERE PROGRAM_WORKLOAD = ( SELECT MIN( PROGRAM_COURSEalias1.workload ) FROM program_`<table10>` AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%Pre... | Which of the least difficult PreMajor courses has the largest class size ? |
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[te... | SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` INNER JOIN prescriptions ON `<table2>`.hadm_id = prescriptions.hadm_id WHERE `<table2>`.days_stay > "5" AND prescriptions.route = "TP" | how many patients stay in hospital above 5 days and with tp drug route?
|
<table0>[table_24881] { <col0>[series]:[real] <col1>[season]:[real] <col2>[Title]:[text] <col3>[Directed]:[text] <col4>[Written]:[text] <col5>[Original]:[air] <col6>[date]:[text] <col7>[Production]:[code] } | SELECT COUNT( "No. in series" ) FROM `<table0>` WHERE "Production code" = '7.07' | Which series number has the production code 7.07?
|
<table0>[table_59570] { <col0>[Club]:[text] <col1>[Wins]:[real] <col2>[Byes]:[real] <col3>[Losses]:[real] } | SELECT MIN( "Against" ) FROM `<table0>` WHERE "Losses" > '10' AND "Wins" < '4' AND "Club" = 'dunolly' | Which Against has Losses larger than 10, and Wins smaller than 4, and a Club of dunolly?
|
<table0>[States] { <col0>[StateName]:[TEXT] <col1>[NumberOfHospitals]:[INTEGER] } | SELECT `<col1>` FROM `<table0>` WHERE `<col0>` = 'California'; | How many hospitals are in California? |
<table0>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table1>[microbiologyevents] { <col0>[row_id]:[number] <col1>[subject_... | SELECT SUM( `<table3>`.amount ) FROM `<table3>` WHERE `<table3>`.icustay_id IN ( SELECT `<table16>`.icustay_id FROM `<table16>` WHERE `<table16>`.hadm_id IN ( SELECT `<table15>`.hadm_id FROM `<table15>` WHERE `<table15>`.subject_id = 4092 ) AND NOT `<table16>`.outtime IS NULL ORDER BY `<table16>`.intime DESC LIMIT 1 ) | show me patient 4092's total input on the last intensive care unit visit. |
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>... | SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` WHERE `<table0>`.admission_location = "EMERGENCY ROOM ADMIT" AND `<table0>`.age < "62" | what is the number of patients whose admission location is emergency room admit and age is less than 62? |
<table0>[table_42257] { <col0>[Year]:[real] <col1>[Division]:[text] <col2>[League]:[text] <col3>[Regular]:[Season] <col4>[text]:[Playoffs] <col5>[text]:[Open] <col6>[Cup]:[text] } | SELECT "Playoffs" FROM `<table0>` WHERE "Regular Season" = 'on hiatus.' | Who Playoffs has a Regular Season of on hiatus.?
|
<table0>[Sales] { <col0>[SaleID]:[INT] <col1>[CustomerID]:[INT] <col2>[Size]:[VARCHAR] <col3>[Region]:[VARCHAR] } | SELECT Region, 100.0 * COUNT( CASE WHEN `<col2>` IN ( 'XS', 'S', 'M', 'L', 'XL', 'XXL' ) THEN 1 END ) / COUNT( * ) as PercentageSizeInclusive FROM `<table0>` GROUP BY Region; | What is the percentage of size-inclusive clothing sold in each region? |
<table0>[consumer_preferences] { <col0>[product_id]:[INT] <col1>[product_type]:[VARCHAR] <col2>[region]:[VARCHAR] <col3>[preference_score]:[INT] } | SELECT * FROM `<table0>` WHERE `<col2>` = 'Germany' AND `<col1>` = 'Cleanser' OR `<col1>` = 'Moisturizer'; | Identify the consumer preferences for skincare products in the German region. |
<table0>[WaterUsage] { <col0>[SiteID]:[INT] <col1>[UsageDate]:[DATE] <col2>[AmountUsed]:[INT] } | SELECT DATE_FORMAT( UsageDate, '%Y-%m' ) as Month, SUM( `<col2>` ) as Total`<table0>` FROM `<table0>` GROUP BY Month; | Calculate the total water usage for all mining operations, per month |
<table0>[table_name_14] { <col0>[country]:[VARCHAR] <col1>[score]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 73 - 72 - 67 = 212 | What country has a score of 73-72-67=212?
|
<table0>[virtual_tour_stats] { <col0>[hotel_id]:[INT] <col1>[hotel_name]:[TEXT] <col2>[region]:[TEXT] <col3>[q1_2022_views]:[INT] } | SELECT hotel_name, `<col3>` FROM `<table0>` WHERE `<col2>` = 'APAC' ORDER BY `<col3>` DESC LIMIT 5; | Identify hotels with the highest virtual tour engagement in the APAC region in Q1 2022 |
<table0>[swimmer] { <col0>[int]:[name] <col1>[text]:[Nationality] <col2>[text]:[meter_100] <col3>[real]:[meter_200] <col4>[text]:[meter_300] <col5>[text]:[meter_400] <col6>[text]:[meter_500] <col7>[text]:[meter_600] <col8>[text]:[meter_700] <col9>[text]:[Time] } <table1>[event] { <col0>[int]:[text] <col1>[Stadium_ID]:... | SELECT name, ID FROM `<table0>` ORDER BY name DESC | Draw a bar chart about the distribution of name and ID , and I want to display x-axis in desc order.
|
<table0>[table_name_58] { <col0>[power]:[VARCHAR] <col1>[year]:[INTEGER] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` < 1999 | How powerful is the model before 1999? |
<table0>[MilitarySpending] { <col0>[region]:[VARCHAR] <col1>[country]:[VARCHAR] <col2>[INT]:[INSERT] } | SELECT region, SUM( amount ) FROM `<table0>` WHERE `<col0>` = 'Asia' GROUP BY region; | What is the total military spending by 'Asia' countries in the 'MilitarySpending' table? |
<table0>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table1>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[dischtime]:[time] <col5>[admission_type]:[text] <col... | SELECT `<table8>`.drug FROM `<table8>` WHERE `<table8>`.hadm_id IN ( SELECT `<table1>`.hadm_id FROM `<table1>` WHERE `<table1>`.subject_id = 76327 ) AND DATETIME( `<table8>`.startdate, 'start of day' ) = DATETIME( CURRENT_TIME( ), 'start of day', '-0 day' ) EXCEPT SELECT `<table8>`.drug FROM `<table8>` WHERE `<table8>`... | compared to yesterday, what was new in the prescription of patient 76327 today?
|
<table0>[table_28059992_1] { <col0>[cfl_team]:[VARCHAR] <col1>[player]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Mark Farraway" | What is every CFL team with the player Mark Farraway? |
<table0>[restaurants] { <col0>[restaurant_id]:[INT] <col1>[name]:[VARCHAR] <col2>[cuisine]:[VARCHAR] <col3>[diet]:[VARCHAR] <col4>[revenue]:[INT] } | SELECT diet, MAX( `<col4>` ) FROM `<table0>` WHERE `<col3>` = 'Halal'; | What is the maximum revenue earned by restaurants serving 'Halal' dishes? |
<table0>[table_name_42] { <col0>[city]:[VARCHAR] <col1>[iata]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "auh" | Which city has an IATA of AUH?
|
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>... | SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` INNER JOIN procedures ON `<table0>`.hadm_id = procedures.hadm_id WHERE `<table0>`.dob_year < "2065" AND procedures.icd9_code = "9604" | Give the number of patients who were born before the year 2065 and have a procedure icd9 code as 9604? |
<table0>[station] { <col0>[station_id]:[INT] <col1>[station_name]:[VARCHAR] } <table1>[trip] { <col0>[trip_id]:[INT] <col1>[trip_start_time]:[TIMESTAMP] <col2>[trip_end_time]:[TIMESTAMP] <col3>[trip_type]:[VARCHAR] <col4>[station_id]:[INT] } | SELECT `<table0>`_name, COUNT( CASE WHEN trip_type = 'bike' THEN 1 END ) AS bike_trips, COUNT( CASE WHEN trip_type = 'scooter' THEN 1 END ) AS scooter_trips FROM `<table0>` JOIN trip ON `<table0>`.`<table0>`_id = trip.`<table0>`_id WHERE trip_start_time BETWEEN '2022-04-01 00:00:00' AND '2022-04-30 23:59:59' GROUP BY `... | Find the number of bike trips and scooter trips for each station in a given month |
<table0>[food_service] { <col0>[meal_code]:[text] <col1>[meal_number]:[int] <col2>[compartment]:[text] <col3>[meal_description]:[varchar] } <table1>[aircraft] { <col0>[aircraft_code]:[varchar] <col1>[aircraft_description]:[varchar] <col2>[manufacturer]:[varchar] <col3>[basic_type]:[varchar] <col4>[engines]:[int] <col5... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, airport_service AS AIRPORT_SERVICE_4, airport_service AS AIRPORT_SERVICE_5, city AS CITY_0, city AS CITY_1, city AS C... | can i take a single airline from LOS ANGELES to CHARLOTTE to NEWARK back to LOS ANGELES |
<table0>[compliance_scores] { <col0>[supplier_id]:[INT] <col1>[supplier_name]:[VARCHAR] <col2>[255]:[compliance_score] <col3>[INT]:[INSERT] } | SELECT supplier_name, compliance_score, ROW_NUMBER( ) OVER ( ORDER BY compliance_score DESC ) as rank FROM `<table0>` WHERE `<col0>` IN ( SELECT `<col0>` FROM `<table0>` WHERE compliance_score IS NOT NULL ORDER BY compliance_score DESC FETCH FIRST 5 ROWS ONLY ); | What is the trend of ethical labor practices compliance scores for the top 5 suppliers? |
<table0>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table1>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table2>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NA... | SELECT JOB_ID, AVG( `<col0>` ) FROM `<table3>` WHERE `<col7>` BETWEEN 8000 AND 12000 AND `<col8>` <> "null" OR `<col10>` <> 40 GROUP BY `<col6>` ORDER BY `<col6>` | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, and sort in asc by the X please. |
<table0>[construction_labor] { <col0>[INT]:[worker_name] <col1>[VARCHAR]:[hours_worked] <col2>[INT]:[project_type] <col3>[VARCHAR]:[state] <col4>[VARCHAR]:[INSERT] } | DELETE FROM `<table0>` WHERE hours_worked > 50 AND project_type != 'Sustainable' AND state = 'New York'; | Delete records of workers who have worked more than 50 hours in the state of New York on non-sustainable projects. |
<table0>[user_details] { <col0>[user_id]:[INT] <col1>[num_posts]:[INT] } | SELECT COUNT( * ) FROM `<table0>` WHERE `<col1>` > 30; | How many users have posted more than 30 posts in the 'social_media' schema? |
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>... | SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` INNER JOIN lab ON `<table0>`.hadm_id = lab.hadm_id WHERE `<table0>`.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.itemid = "51492" | provide the number of patients whose admission location is phys referral/normal deli and item id is 51492? |
<table0>[WaterConsumption] { <col0>[product]:[VARCHAR] <col1>[255]:[material] <col2>[VARCHAR]:[255] <col3>[water]:[INT] } | SELECT AVG( `<col3>` ) FROM `<table0>` WHERE `<col0>` = 'Linen' AND material = 'France'; | What is the average water consumption for producing linen in France? |
<table0>[table_1160304_2] { <col0>[date_of_entry]:[VARCHAR] <col1>[chart]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "UK Albums Top 75" | What is the date of entry for the UK Albums Top 75 chart? |
<table0>[airports] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[location]:[VARCHAR] <col3>[255]:[type] <col4>[VARCHAR]:[255] } | SELECT COUNT( * ) FROM `<table0>` WHERE `<col2>` = 'Australia'; | How many airports are there in the country of Australia? |
<table0>[microbiologyevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[charttime]:[time] <col4>[spec_type_desc]:[text] <col5>[org_name]:[text] } <table1>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4... | SELECT MIN( `<table7>`.value ) FROM `<table7>` WHERE `<table7>`.icustay_id IN ( SELECT `<table2>`.icustay_id FROM `<table2>` WHERE `<table2>`.hadm_id IN ( SELECT `<table1>`.hadm_id FROM `<table1>` WHERE `<table1>`.subject_id = 70234 ) ) AND `<table7>`.itemid IN ( SELECT `<table14>`.itemid FROM `<table14>` WHERE `<table... | what was the yearly minimum amount of urine out foley given to patient 70234? |
<table0>[table_12834315_5] { <col0>[hand_guards]:[VARCHAR] <col1>[name]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Gas Piston Commando" | What hand guard system is used with a gas piston commando? |
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type... | SELECT `<table3>`.gender, lab.itemid FROM `<table3>` INNER JOIN lab ON `<table3>`.hadm_id = lab.hadm_id WHERE `<table3>`.subject_id = "2560" | for patient id 2560, specify gender and item id. |
<table0>[table_name_1] { <col0>[legs_lost]:[VARCHAR] <col1>[played]:[VARCHAR] } | SELECT COUNT( 3 AS _dart_average ) FROM `<table0>` WHERE `<col0>` > 41 AND `<col1>` > 7 | What is the total number of 3-dart average when legs lost is larger than 41, and played is larger than 7? |
<table0>[instructor] { <col0>[instructor_id]:[int] <col1>[name]:[varchar] <col2>[uniqname]:[varchar] } <table1>[jobs] { <col0>[job_id]:[int] <col1>[job_title]:[varchar] <col2>[description]:[varchar] <col3>[requirement]:[varchar] <col4>[city]:[varchar] <col5>[state]:[varchar] <col6>[country]:[varchar] <col7>[zip]:[int]... | SELECT DISTINCT `<table11>`.has_final_exam FROM `<table11>` INNER JOIN course ON course.course_id = `<table11>`.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = `<table11>`.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE `<table11>`.`<... | Last time she taught it , did Prof. Mijin Yoon set an exam for 181 ?
|
<table0>[ocean_health] { <col0>[location]:[VARCHAR] <col1>[temperature]:[FLOAT] <col2>[phosphorus]:[FLOAT] } | CREATE TABLE ocean_health ( location VARCHAR( 50 ), temperature FLOAT, phosphorus FLOAT ) | Create a table named 'ocean_health' with 3 columns (location VARCHAR, temperature FLOAT, phosphorus FLOAT) |
<table0>[table_204_652] { <col0>[number]:[title] <col1>[text]:[year] <col2>[number]:[director] <col3>[text]:[country] <col4>[text]:[genre] <col5>[text]:[notes] } | SELECT "genre" FROM `<table0>` GROUP BY "genre" ORDER BY COUNT( * ) DESC LIMIT 1 | which genre was used the most ? |
<table0>[aircraft] { <col0>[aircraft_code]:[varchar] <col1>[aircraft_description]:[varchar] <col2>[manufacturer]:[varchar] <col3>[basic_type]:[varchar] <col4>[engines]:[int] <col5>[propulsion]:[varchar] <col6>[wide_body]:[varchar] <col7>[wing_span]:[int] <col8>[length]:[int] <col9>[weight]:[int] <col10>[capacity]:[int]... | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, equipment_sequence, flight WHERE ( ( CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name... | i'd like to know what type of plane flies from BOSTON to DALLAS FORT WORTH after 1730 |
<table0>[table_25355501_2] { <col0>[november_3]:[VARCHAR] <col1>[august_21_22]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "August 22, 1998" | What is shown for november 3 when august 21-22 is august 22, 1998? |
<table0>[Catalogs] { <col0>[catalog_id]:[INTEGER] <col1>[catalog_name]:[VARCHAR] <col2>[catalog_publisher]:[VARCHAR] <col3>[date_of_publication]:[DATETIME] <col4>[date_of_latest_revision]:[DATETIME] } <table1>[Catalog_Structure] { <col0>[catalog_level_number]:[INTEGER] <col1>[catalog_id]:[INTEGER] <col2>[catalog_level... | SELECT catalog_entry_name, `<col10>` FROM `<table3>` WHERE `<col7>` > 700 ORDER BY `<col10>` | Which catalog contents has price above 700 dollars? Show their catalog entry names and capacities, could you order capacity in asc order please? |
<table0>[campus_job_id] { <col0>[int]:[student_id] <col1>[int]:[location] } <table1>[course_offering] { <col0>[offering_id]:[int] <col1>[course_id]:[int] <col2>[semester]:[int] <col3>[section_number]:[int] <col4>[start_time]:[time] <col5>[end_time]:[time] <col6>[monday]:[varchar] <col7>[tuesday]:[varchar] <col8>[wedne... | SELECT DISTINCT `<col5>` FROM `<table2>` WHERE `<col1>` LIKE '%Interdisciplinary Environmental Topics%' | Does Interdisciplinary Environmental Topics have any advisory prereqs ? |
<table0>[table_29626583_3] { <col0>[position]:[VARCHAR] <col1>[affiliation]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "LDU Quito" | What was the position when the affiliation is ldu quito? |
<table0>[table_name_88] { <col0>[gold]:[INTEGER] <col1>[rank]:[VARCHAR] <col2>[total]:[VARCHAR] } | SELECT MIN( `<col0>` ) FROM `<table0>` WHERE `<col1>` > 4 AND `<col2>` < 1 | What's the lowest Gold if the Rank is over 4 but the Total is less than 1? |
<table0>[garment_sales] { <col0>[sales_id]:[INT] <col1>[PRIMARY]:[KEY] <col2>[garment_id]:[INT] <col3>[store_id]:[INT] <col4>[quantity]:[INT] <col5>[price]:[DECIMAL] <col6>[date]:[DATE] } <table1>[garments] { <col0>[garment_id]:[INT] <col1>[PRIMARY]:[KEY] <col2>[garment_name]:[TEXT] <col3>[garment_category]:[TEXT] <co... | SELECT g.garment_category, SUM( gs.quantity * gs.price ) as total_sales_revenue FROM `<table0>` gs JOIN garments g ON gs.garment_id = g.garment_id GROUP BY g.garment_category; | What is the total sales revenue per garment category? |
<table0>[news_report] { <col0>[journalist_ID]:[int] <col1>[Event_ID]:[int] <col2>[Work_Type]:[text] } <table1>[event] { <col0>[Event_ID]:[int] <col1>[Date]:[text] <col2>[Venue]:[text] <col3>[text]:[Event_Attendance] } <table2>[journalist] { <col0>[journalist_ID]:[int] <col1>[text]:[Nationality] <col2>[text]:[Age] <co... | SELECT Nationality, SUM( Age ) FROM `<table2>` GROUP BY Nationality ORDER BY Nationality DESC | Bar chart of sum age from each nationality, and display by the x axis from high to low. |
<table0>[table_12588029_3] { <col0>[release_date]:[VARCHAR] <col1>[year]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 2003 | What are the release dates for songs in 2003? |
<table0>[table_name_93] { <col0>[position]:[VARCHAR] <col1>[player]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "hedo türkoğlu" | What position does Hedo T rko lu play?
|
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[t... | SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` WHERE `<table4>`.ethnicity = "WHITE - RUSSIAN" AND `<table4>`.dob_year < "2104" | provide the number of patients whose ethnicity is white - russian and year of birth is less than 2104?
|
<table0>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table1>[microbiologyevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[charttime]:[time] <col4>[spec_type_desc]:[text] <... | SELECT `<table6>`.label FROM `<table6>` WHERE `<table6>`.itemid IN ( SELECT t1.itemid FROM ( SELECT `<table9>`.itemid, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM `<table9>` WHERE STRFTIME( '%y', `<table9>`.charttime ) <= '2101' GROUP BY `<table9>`.itemid ) AS t1 WHERE t1.c1 <= 3 ) | tell me the three most common output events until 2101?
|
<table0>[Products] { <col0>[productID]:[INT] <col1>[productName]:[VARCHAR] <col2>[price]:[DECIMAL] <col3>[ethicallySourced]:[BOOLEAN] <col4>[country]:[VARCHAR] <col5>[productType]:[VARCHAR] } <table1>[Sales] { <col0>[saleID]:[INT] <col1>[productID]:[INT] <col2>[saleDate]:[DATE] } | SELECT 100.0 * SUM( CASE WHEN P.ethicallySourced = TRUE AND P.country = 'Canada' AND YEAR( S.saleDate ) = 2022 THEN P.price ELSE 0 END ) / SUM( P.price ) AS ethically_sourced_percentage FROM `<table0>` P INNER JOIN Sales S ON P.productID = S.productID WHERE P.productType = 'accessories'; | What is the percentage of ethically sourced accessories sold in Canada in 2022? |
<table0>[table_name_71] { } | SELECT 1989 FROM `<table0>` WHERE 1987 = "1r" | What is the 1989 result of the tournament that had a 1987 result of 1R? |
<table0>[table_name_19] { <col0>[tournament]:[VARCHAR] <col1>[partner]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "karel nováček" | Which Tournament has a Partner of karel nováček? |
<table0>[Extraction] { <col0>[ExtractionID]:[INT] <col1>[MineID]:[INT] <col2>[Year]:[INT] <col3>[Material]:[VARCHAR] <col4>[255]:[INT] } | INSERT INTO Extraction ( ExtractionID, MineID, Year, Material, Amount ) VALUES ( 7, 4, 2021, 'Gold', 160 ); | Insert new records of gold extraction in 2021 for mine with ID 4. |
<table0>[table_39949] { <col0>[Wins]:[real] <col1>[Byes]:[real] <col2>[Losses]:[real] <col3>[Draws]:[real] } | SELECT SUM( "Losses" ) FROM `<table0>` WHERE "Against" > '1412' AND "Wins" = '10' AND "Draws" < '0' | What is the total losses against 1412, and 10 wins, but draws less than 0?
|
<table0>[paper] { <col0>[paperid]:[int] <col1>[title]:[varchar] <col2>[venueid]:[int] <col3>[year]:[int] <col4>[numciting]:[int] <col5>[numcitedby]:[int] <col6>[journalid]:[int] } <table1>[venue] { <col0>[venueid]:[int] <col1>[venuename]:[varchar] } <table2>[journal] { <col0>[journalid]:[int] <col1>[journalname]:[var... | SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'Su-In Lee' AND paper.year < 2012 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | Give me the papers written by Su-In Lee before 2012 . |
<table0>[table_29743928_4] { <col0>[shutouts]:[INTEGER] } | SELECT MIN( `<col0>` ) FROM `<table0>` | What is the lowest overall amount of shutouts? |
<table0>[departments] { <col0>[department_id]:[number] <col1>[department_name]:[text] <col2>[manager_id]:[number] <col3>[location_id]:[number] } <table1>[locations] { <col0>[location_id]:[number] <col1>[street_address]:[text] <col2>[postal_code]:[text] <col3>[city]:[text] <col4>[state_province]:[text] <col5>[country_i... | SELECT T1.first_name, T1.last_name, T1.employee_id, T4.country_name FROM `<table2>` AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id | What the full names, ids of each employee and the name of the country they are in? |
<table0>[table_38812] { <col0>[Year]:[real] <col1>[Album]:[text] <col2>[Record]:[label] <col3>[text]:[Info] <col4>[text]:[Music] } | SELECT "Info" FROM `<table0>` WHERE "Album" = 'romeo' | Which Info has an Album of romeo?
|
<table0>[table_name_25] { <col0>[semi_finalists]:[VARCHAR] <col1>[runner_up]:[VARCHAR] <col2>[week_of]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "gigi fernández natalia zvereva" AND `<col2>` = "26 june 2 weeks" | When the runner-up is listed as Gigi Fern ndez Natalia Zvereva and the week is 26 June 2 weeks, who are the semi finalists?
|
<table0>[table_68359] { <col0>[Minister]:[text] <col1>[Party]:[text] <col2>[Governments]:[text] <col3>[Term]:[start] <col4>[text]:[Term] <col5>[end]:[text] } | SELECT "Term end" FROM `<table0>` WHERE "Governments" = '27' AND "Minister" = 'tzachi hanegbi' | When did the term end for the term that had government 27 and Minister Tzachi Hanegbi?
|
<table0>[table_name_14] { <col0>[week]:[VARCHAR] <col1>[date]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "november 19, 1989" | What week number did November 19, 1989 games fall on?
|
<table0>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_... | SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` INNER JOIN lab ON `<table2>`.hadm_id = lab.hadm_id WHERE `<table2>`.marital_status = "SINGLE" AND lab.label = "Fibrin Degradation Products" | what is the number of patients whose marital status is single and lab test name is fibrin degradation products?
|
<table0>[course_tags_count] { <col0>[course_id]:[int] <col1>[clear_grading]:[int] <col2>[pop_quiz]:[int] <col3>[group_projects]:[int] <col4>[inspirational]:[int] <col5>[long_lectures]:[int] <col6>[extra_credit]:[int] <col7>[few_tests]:[int] <col8>[good_feedback]:[int] <col9>[tough_tests]:[int] <col10>[heavy_papers]:[in... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 493 AND NOT instructor.name LIKE '%Michael Swan%' AND offering_instructor.instructor_id = instructor.instructor_id AND offer... | Other than Prof. Michael Swan , does anyone teach 493 ?
|
<table0>[table_test_8] { <col0>[int]:[anemia] <col1>[bool]:[intra_aortic_balloon_pump_iabp] <col2>[bool]:[systolic_blood_pressure_sbp] <col3>[int]:[intravenous_pressors] <col4>[bool]:[fever] <col5>[bool]:[hemoglobin_a1c_hba1c] <col6>[float]:[heart_disease] <col7>[bool]:[vasopressors] <col8>[bool]:[renal_disease] <col9>... | SELECT * FROM `<table0>` WHERE renal_disease = 1 AND creatinine_clearance_cl > 2.5 | renal insufficiency with creatinine level of more than 2.5 mg / dl |
<table0>[Customers] { <col0>[customer_id]:[INT] <col1>[customer_name]:[VARCHAR] <col2>[halal_purchase_value]:[DECIMAL] } | SELECT `<col1>` FROM `<table0>` ORDER BY `<col2>` DESC LIMIT 5; | Who are the top 5 customers based on their purchases of halal cosmetics? |
<table0>[cybersecurity_incidents] { <col0>[INT]:[year] <col1>[INT]:[type] <col2>[VARCHAR]:[255] <col3>[country]:[VARCHAR] <col4>[255]:[description] <col5>[TEXT]:[INSERT] } | UPDATE cybersecurity_incidents SET description = 'Unauthorized access to highly sensitive personal information' WHERE id = 1; | Update the description of a specific cybersecurity incident in the "cybersecurity_incidents" table |
<table0>[table_name_90] { <col0>[gender]:[VARCHAR] <col1>[years]:[VARCHAR] <col2>[decile]:[VARCHAR] <col3>[area]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col2>` = 8 AND `<col3>` = "taradale" AND `<col1>` = "1–13" | Which gender has a Decile of 8, an Area of taradale, and Years of 1 13? |
<table0>[table_name_99] { <col0>[score]:[VARCHAR] <col1>[home]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "new york islanders" | What was the score of the game when they played at new york islanders?
|
<table0>[film_text] { <col0>[film_id]:[integer] <col1>[title]:[text] <col2>[description]:[text] } <table1>[actor] { <col0>[actor_id]:[integer] <col1>[first_name]:[text] <col2>[last_name]:[text] <col3>[last_update]:[datetime] } <table2>[address] { <col0>[address_id]:[integer] } <table3>[category] { <col0>[category_id... | SELECT T3.title FROM `<table1>` AS T1 INNER JOIN film_`<table1>` AS T2 ON T1.`<table1>`_id = T2.`<table1>`_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'KARL' AND T1.last_name = 'BERRY' AND T3.rating = 'PG' | List all the films that Karl Berr starred in and rated as PG. |
<table0>[area] { <col0>[course_id]:[int] } <table1>[campus_job_id] { <col0>[int]:[student_id] <col1>[int]:[location] } <table2>[course] { <col0>[course_id]:[int] <col1>[name]:[varchar] <col2>[department]:[varchar] <col3>[number]:[varchar] <col4>[credits]:[varchar] <col5>[advisory_requirement]:[varchar] <col6>[enforce... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM ( SELECT `<col1>` FROM `<table6>` WHERE earn_credit = 'Y' AND `<col0>` = 1 ) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0, `<c... | What courses are available for me to take in Spring or Summer to meet my MDE requirement ?
|
<table0>[nyc_subway] { <col0>[trip_id]:[INT] <col1>[route_id]:[VARCHAR] <col2>[fare]:[FLOAT] <col3>[trip_date]:[DATE] } | SELECT SUM( `<col2>` ) FROM `<table0>` WHERE `<col2>` IS NOT NULL AND `<col3>` >= DATE_SUB( NOW( ), INTERVAL 1 WEEK ); | What is the total fare collected for all trips on the NYC subway system in the past week, excluding trips with missing fare data? |
<table0>[table_name_67] { <col0>[player]:[VARCHAR] <col1>[to_par]:[VARCHAR] <col2>[country]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "–7" AND `<col2>` = "spain" | which Player has a To par of –7, and a Country of spain? |
<table0>[StreamingData] { <col0>[StreamID]:[INT] <col1>[UserID]:[INT] <col2>[SongID]:[INT] <col3>[StreamDate]:[DATE] } <table1>[Users] { <col0>[UserID]:[INT] <col1>[UserName]:[VARCHAR] } | SELECT AVG( StreamCount ) FROM ( SELECT COUNT( * ) AS StreamCount FROM `<table0>` GROUP BY `<col1>` ) AS Subquery; | What is the average number of streams per user for a specific music streaming service? |
<table0>[city] { <col0>[integer]:[city_name] } <table1>[games] { <col0>[integer]:[games_year] <col1>[integer]:[games_name] <col2>[text]:[season] } <table2>[games_city] { <col0>[games_id]:[integer] <col1>[city_id]:[integer] } <table3>[medal] { <col0>[integer]:[medal_name] } <table4>[noc_region] { <col0>[integer]:[no... | SELECT T2.city_name FROM `<table2>` AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id ORDER BY T3.games_year LIMIT 1 | Where was the first Olympic game held? |
<table0>[sales_data] { <col0>[drug]:[VARCHAR] <col1>[region]:[VARCHAR] <col2>[date]:[DATE] <col3>[revenue]:[NUMERIC] } | SELECT drug, SUM( CASE WHEN `<col1>` = 'North' THEN `<col3>` ELSE 0 END ) AS north_revenue, SUM( CASE WHEN `<col1>` = 'South' THEN `<col3>` ELSE 0 END ) AS south_revenue FROM `<table0>` WHERE `<col2>` BETWEEN '2022-10-01' AND '2022-12-31' GROUP BY drug; | What was the sales revenue for each drug in Q4 2022, pivoted by sales region? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.