schema stringlengths 29 5.42k | question stringlengths 0 752 | rejected stringlengths 2 4.44k | chosen stringlengths 4 8.94k | weight float64 0 8.73 |
|---|---|---|---|---|
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity... | what is the number of patients whose diagnoses short title is cl skul base fx-coma nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Cl skul base fx-coma NOS" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Cl skul base fx-coma NOS" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" | 0.19043 |
CREATE TABLE table_42695 ("Result" CLOB, "Record" CLOB, "Opponent" CLOB, "Method" CLOB, "Date" CLOB, "Round" FLOAT, "Notes" CLOB)
| What was the result of the match held when his record was 7-0-0? | SELECT "Result" FROM table_42695 WHERE "Record" = '7-0-0' | SELECT "Result" FROM "table_42695" WHERE "Record" = '7-0-0' | 0.057617 |
CREATE TABLE table_53660 ("Entrant" CLOB, "Constructor" CLOB, "Chassis" CLOB, "Tyre" CLOB, "Driver" CLOB, "Rounds" CLOB)
| Who was the constructor of the officine alfieri maserati that was driven by Sergio Mantovani? | SELECT "Constructor" FROM table_53660 WHERE "Entrant" = 'officine alfieri maserati' AND "Driver" = 'sergio mantovani' | SELECT "Constructor" FROM "table_53660" WHERE "Driver" = 'sergio mantovani' AND "Entrant" = 'officine alfieri maserati' | 0.116211 |
CREATE TABLE table_203_125 (id NUMBER, "club" CLOB, "winners" NUMBER, "runner-ups" NUMBER, "winning years" CLOB, "runner-up years" CLOB)
| which club has played in the most supercups without winning ? | SELECT "club" FROM table_203_125 ORDER BY "runner-ups" DESC LIMIT 1 | SELECT "club" FROM "table_203_125" ORDER BY "runner-ups" DESC FETCH FIRST 1 ROWS ONLY | 0.083008 |
CREATE TABLE table_2226817_12 (title VARCHAR2, original_air_date VARCHAR2)
| what is the name of the episode whose premiere was in march 2, 1997? | SELECT title FROM table_2226817_12 WHERE original_air_date = "March 2, 1997" | SELECT "title" FROM "table_2226817_12" WHERE "March 2, 1997" = "original_air_date" | 0.080078 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_i... | give me the number of patients whose marital status is widowed and procedure short title is tonsil&adenoid biopsy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Tonsil&adenoid biopsy" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Tonsil&adenoid biopsy" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "WIDOWED" = "demographic"."marital_status" | 0.238281 |
CREATE TABLE table_name_64 (play_offs NUMBER, club VARCHAR2, total VARCHAR2)
| What is the highest play-offs that have stevenage borough as the club, and a total greater than 21? | SELECT MAX(play_offs) FROM table_name_64 WHERE club = "stevenage borough" AND total > 21 | SELECT MAX("play_offs") FROM "table_name_64" WHERE "club" = "stevenage borough" AND "total" > 21 | 0.09375 |
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE ... | Find questions with one specific tag. | SELECT Id AS "post_link", CreationDate FROM Posts WHERE PostTypeId = 1 AND Tags LIKE LOWER('%hard-science%') ORDER BY CreationDate DESC LIMIT 5000 | SELECT "Id" AS "post_link", "CreationDate" FROM "Posts" WHERE "PostTypeId" = 1 AND "Tags" LIKE LOWER('%hard-science%') ORDER BY "CreationDate" DESC FETCH FIRST 5000 ROWS ONLY | 0.169922 |
CREATE TABLE table_74259 ("Year" FLOAT, "Round" FLOAT, "Winner" CLOB, "Hawthorn score" CLOB, "St Kilda score" CLOB, "Attendance" FLOAT, "Venue" CLOB, "Silk-Miller Medallist" CLOB)
| What is the hawthorn score at the year 2000? | SELECT "Hawthorn score" FROM table_74259 WHERE "Year" = '2000' | SELECT "Hawthorn score" FROM "table_74259" WHERE "Year" = '2000' | 0.0625 |
CREATE TABLE exhibition_record (Exhibition_ID NUMBER, Date CLOB, Attendance NUMBER)
CREATE TABLE artist (Artist_ID NUMBER, Name CLOB, Country CLOB, Year_Join NUMBER, Age NUMBER)
CREATE TABLE exhibition (Exhibition_ID NUMBER, Year NUMBER, Theme CLOB, Artist_ID NUMBER, Ticket_Price FLOAT)
| Show all artist names and the number of exhibitions for each artist in a bar chart. | SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID | SELECT "Name", COUNT(*) FROM "exhibition" "T1" JOIN "artist" "T2" ON "T1"."Artist_ID" = "T2"."Artist_ID" GROUP BY "T1"."Artist_ID" | 0.126953 |
CREATE TABLE table_1342270_3 (district VARCHAR2, incumbent VARCHAR2)
| what are all the district with incumbent being sam hobbs | SELECT district FROM table_1342270_3 WHERE incumbent = "Sam Hobbs" | SELECT "district" FROM "table_1342270_3" WHERE "Sam Hobbs" = "incumbent" | 0.070313 |
CREATE TABLE table_name_15 (to_par VARCHAR2, player VARCHAR2)
| What was willie wood's to par? | SELECT to_par FROM table_name_15 WHERE player = "willie wood" | SELECT "to_par" FROM "table_name_15" WHERE "player" = "willie wood" | 0.06543 |
CREATE TABLE Products (Code NUMBER, Name VARCHAR2, Price NUMBER, Manufacturer NUMBER)
CREATE TABLE Manufacturers (Code NUMBER, Name VARCHAR2, Headquarter VARCHAR2, Founder VARCHAR2, Revenue FLOAT)
| For those records from the products and each product's manufacturer, draw a scatter chart about the correlation between code and revenue . | SELECT T1.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | SELECT "T1"."Code", "T2"."Revenue" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" | 0.115234 |
CREATE TABLE table_name_41 (week NUMBER, date VARCHAR2, attendance VARCHAR2)
| Who was the opponent on the date of November 29, 1970 and the attendance was less than 31,427? | SELECT AVG(week) FROM table_name_41 WHERE date = "november 29, 1970" AND attendance < 31 OFFSET 427 | SELECT AVG("week") FROM "table_name_41" WHERE "attendance" < 31 AND "date" = "november 29, 1970" OFFSET 427 ROWS | 0.109375 |
CREATE TABLE table_test_6 ("id" NUMBER, "scr" NUMBER, "anemia" BOOLEAN, "blood_hemoglobin" NUMBER, "bleeding" NUMBER, "hemorrhagic_diseases" BOOLEAN, "stroke" BOOLEAN, "blood_platelet_counts" NUMBER, "trauma" BOOLEAN, "renal_disease" BOOLEAN, "hematocrit_hct" FLOAT, "hepatic_disease" BOOLEAN, "polyglobulia" BOOLEAN, "e... | severe hepatic and renal dysfunction ( alt > 3 folds of upper limit of normal, egfr < 30 ml / min / 1.73 mm^2 or scr > 200 mmol / l ) ; | SELECT * FROM table_test_6 WHERE hepatic_disease = 1 AND renal_disease = 1 OR (estimated_glomerular_filtration_rate_egfr < 30 OR scr > 200) | SELECT * FROM "table_test_6" WHERE ("estimated_glomerular_filtration_rate_egfr" < 30 OR "hepatic_disease" = 1 OR "scr" > 200) AND ("estimated_glomerular_filtration_rate_egfr" < 30 OR "renal_disease" = 1 OR "scr" > 200) | 0.212891 |
CREATE TABLE table_29502 ("Number" FLOAT, "Player" CLOB, "Position" CLOB, "Seasons by team" CLOB, "Year of induction into Pro Football Hall of Fame" CLOB)
| What is the fewest amount of Pro Bowl appearances any of the players had? | SELECT MIN("Number") FROM table_29502 | SELECT MIN("Number") FROM "table_29502" | 0.038086 |
CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB)
CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Found... | Show me about the distribution of Team_Name and Team_ID in a bar chart, I want to list in descending by the bar please. | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name DESC | SELECT "Team_Name", "Team_ID" FROM "basketball_match" ORDER BY "Team_Name" DESC | 0.077148 |
CREATE TABLE host (Host_ID NUMBER, Name CLOB, Nationality CLOB, Age CLOB)
CREATE TABLE party (Party_ID NUMBER, Party_Theme CLOB, Location CLOB, First_year CLOB, Last_year CLOB, Number_of_hosts NUMBER)
CREATE TABLE party_host (Party_ID NUMBER, Host_ID NUMBER, Is_Main_in_Charge BOOLEAN)
| Create a bar chart showing how many location across location, sort X from low to high order please. | SELECT Location, COUNT(Location) FROM party GROUP BY Location ORDER BY Location | SELECT "Location", COUNT("Location") FROM "party" GROUP BY "Location" ORDER BY "Location" | 0.086914 |
CREATE TABLE table_7038 ("Year" FLOAT, "Dates" CLOB, "Champion" CLOB, "Country" CLOB, "Score" CLOB, "Margin of victory" CLOB, "Tournament Location" CLOB, "Purse ( US$ ) " FLOAT, "Winner's share" FLOAT)
| What is the highest winner's share that has jiyai shin as the championship with a year prior to 2009? | SELECT MAX("Winner's share") FROM table_7038 WHERE "Champion" = 'jiyai shin' AND "Year" < '2009' | SELECT MAX("Winner's share") FROM "table_7038" WHERE "Champion" = 'jiyai shin' AND "Year" < '2009' | 0.095703 |
CREATE TABLE table_name_13 (tie_no VARCHAR2, away_team VARCHAR2)
| What was the score of the tied game or the away team of Crewe Alexandra? | SELECT tie_no FROM table_name_13 WHERE away_team = "crewe alexandra" | SELECT "tie_no" FROM "table_name_13" WHERE "away_team" = "crewe alexandra" | 0.072266 |
CREATE TABLE table_name_86 (attendance VARCHAR2, opponent VARCHAR2)
| What is the attendance when the opponent is the San Francisco 49ers? | SELECT attendance FROM table_name_86 WHERE opponent = "san francisco 49ers" | SELECT "attendance" FROM "table_name_86" WHERE "opponent" = "san francisco 49ers" | 0.079102 |
CREATE TABLE table_59503 ("Rank" FLOAT, "Nation" CLOB, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
| Which Rank has a Nation of china (chn), and a Bronze smaller than 4? | SELECT MAX("Rank") FROM table_59503 WHERE "Nation" = 'china (chn)' AND "Bronze" < '4' | SELECT MAX("Rank") FROM "table_59503" WHERE "Bronze" < '4' AND "Nation" = 'china (chn)' | 0.084961 |
CREATE TABLE table_78786 ("Country" CLOB, "Date" CLOB, "Label" CLOB, "Format" CLOB, "Catalog Nr." CLOB)
| Which date has Total Holocaust records in the ed Remaster cassette format? | SELECT "Date" FROM table_78786 WHERE "Label" = 'total holocaust records' AND "Format" = 'ed remaster cassette' | SELECT "Date" FROM "table_78786" WHERE "Format" = 'ed remaster cassette' AND "Label" = 'total holocaust records' | 0.109375 |
CREATE TABLE table_name_85 (year NUMBER, points NUMBER)
| What is the highest year that has no more than 0 points? | SELECT MAX(year) FROM table_name_85 WHERE points < 0 | SELECT MAX("year") FROM "table_name_85" WHERE "points" < 0 | 0.056641 |
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE Po... | Four major RDBMS systems, ranked by popularity. | SELECT TagName AS Tags, cnt AS "questions_tagged", ROUND(100.0 * cnt / SUM(cnt) OVER (), 2) AS "ratio,_%" FROM Tags AS t JOIN LATERAL (SELECT COUNT(*) AS cnt FROM PostTags AS pt WHERE pt.TagId = t.Id) AS q WHERE t.TagName IN ('adminer', 'phpmyadmin', 'navicat', 'sqlyog', 'sqlbuddy', 'toad', 'dbninja', 'sqlwave', 'chive... | WITH "_u_0" AS (SELECT COUNT(*) AS "cnt", "pt"."TagId" AS "_u_1" FROM "PostTags" "pt" GROUP BY "pt"."TagId") SELECT "TagName" AS "Tags", "cnt" AS "questions_tagged", ROUND(100.0 * "cnt" / NULLIF(SUM("cnt") OVER (), 0), 2) AS "ratio,_%" FROM "Tags" "t" CROSS JOIN LATERAL COALESCE("_u_0"."cnt", 0) AS "q" LEFT JOIN "_u_0"... | 0.582031 |
CREATE TABLE table_29475 ("Team" CLOB, "Outgoing head coach" CLOB, "Manner of departure" CLOB, "Date of vacancy" CLOB, "Position in table" FLOAT, "Incoming head coach" CLOB, "Date of appointment" CLOB)
| When is the date of appointment when the position in table is 16? | SELECT "Date of appointment" FROM table_29475 WHERE "Position in table" = '16' | SELECT "Date of appointment" FROM "table_29475" WHERE "Position in table" = '16' | 0.078125 |
CREATE TABLE table_12584 ("Standard order" FLOAT, "English translation" CLOB, "Transcription ( based on Pinyin ) " CLOB, "Traditional Chinese" CLOB, "Simplified Chinese" CLOB)
| What is the simplified Chinese with a standard order over 4, and the transcription of Bei Hui Feng? | SELECT "Simplified Chinese" FROM table_12584 WHERE "Standard order" > '4' AND "Transcription (based on Pinyin)" = 'bei hui feng' | SELECT "Simplified Chinese" FROM "table_12584" WHERE "Standard order" > '4' AND "Transcription (based on Pinyin)" = 'bei hui feng' | 0.126953 |
CREATE TABLE table_train_84 ("id" NUMBER, "gender" CLOB, "mini_mental_state_examination_mmse" NUMBER, "modified_hachinski_ischemia_scale" NUMBER, "post_menopausal" BOOLEAN, "allergy_to_rifaximin" BOOLEAN, "surgically_sterilized" BOOLEAN, "body_mass_index_bmi" FLOAT, "age" FLOAT, "NOUSE" FLOAT)
| allergy to rifaximin | SELECT * FROM table_train_84 WHERE allergy_to_rifaximin = 1 | SELECT * FROM "table_train_84" WHERE "allergy_to_rifaximin" = 1 | 0.061523 |
CREATE TABLE table_name_21 (lane NUMBER, mark VARCHAR2)
| What is the lowest Lane, when Mark is 7.66? | SELECT MIN(lane) FROM table_name_21 WHERE mark = "7.66" | SELECT MIN("lane") FROM "table_name_21" WHERE "7.66" = "mark" | 0.05957 |
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitsta... | for patients who took ventilator weaning - rapid this year, what are the five most frequent procedures that were followed in the same month? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ventilator weaning - rapid' AND DATETIME... | WITH "t2" AS (SELECT "patient"."uniquepid", "treatment"."treatmentname", "treatment"."treatmenttime" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" WHERE DATETIME("treatment"."treatmenttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')), "t... | 0.980469 |
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_air... | list flights between OAKLAND and SAN FRANCISCO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FR... | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'OAKLAND' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" "AIRPORT_SERVICE_1" ON ... | 0.488281 |
CREATE TABLE table_33845 ("Number ( map ) " FLOAT, "Borough" CLOB, "Population Canada 2011 Census" FLOAT, "Area in km\\u00b2" FLOAT, "Density per km\\u00b2" FLOAT)
| Which Density per km is the lowest one that has a Number (map) smaller than 13, and an Area in km of 11.1? | SELECT MIN("Density per km\u00b2") FROM table_33845 WHERE "Number (map)" < '13' AND "Area in km\u00b2" = '11.1' | SELECT MIN("Density per km\u00b2") FROM "table_33845" WHERE "Area in km\u00b2" = '11.1' AND "Number (map)" < '13' | 0.110352 |
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE ch... | when was the first time the heart rate measured in patient 26469 on 06/28/2105? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26469)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra... | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 26469 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_item... | 0.785156 |
CREATE TABLE table_67952 ("Sydney" CLOB, "Melbourne" CLOB, "Perth" CLOB, "Adelaide" CLOB, "Gold Coast" CLOB, "Auckland" CLOB)
| Name the sydney with perth of no, adelaide of no with melbourne of yes and gold coast of yes | SELECT "Sydney" FROM table_67952 WHERE "Perth" = 'no' AND "Adelaide" = 'no' AND "Melbourne" = 'yes' AND "Gold Coast" = 'yes' | SELECT "Sydney" FROM "table_67952" WHERE "Adelaide" = 'no' AND "Gold Coast" = 'yes' AND "Melbourne" = 'yes' AND "Perth" = 'no' | 0.123047 |
CREATE TABLE Parties_in_Events (Party_ID NUMBER, Event_ID NUMBER, Role_Code CHAR)
CREATE TABLE Parties (Party_ID NUMBER, Party_Details VARCHAR2)
CREATE TABLE Finances (Finance_ID NUMBER, Other_Details VARCHAR2)
CREATE TABLE Locations (Location_ID NUMBER, Other_Details VARCHAR2)
CREATE TABLE Channels (Channel_ID NUMBER,... | Show the names of products and the number of events they are in. Visualize by bar chart. | SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name | SELECT "Product_Name", COUNT(*) FROM "Products" "T1" JOIN "Products_in_Events" "T2" ON "T1"."Product_ID" = "T2"."Product_ID" GROUP BY "T1"."Product_Name" | 0.149414 |
CREATE TABLE table_name_11 (vessels VARCHAR2, ship_name VARCHAR2)
| How many vessels are named aqua jewel? | SELECT COUNT(vessels) FROM table_name_11 WHERE ship_name = "aqua jewel" | SELECT COUNT("vessels") FROM "table_name_11" WHERE "aqua jewel" = "ship_name" | 0.075195 |
CREATE TABLE table_1277350_7 (friday_day_six VARCHAR2, thursday_day_five VARCHAR2)
| What is friday day six when thursday day five is pachhambey? | SELECT friday_day_six FROM table_1277350_7 WHERE thursday_day_five = "پچھمبے pachhambey" | SELECT "friday_day_six" FROM "table_1277350_7" WHERE "thursday_day_five" = "پچھمبے pachhambey" | 0.091797 |
CREATE TABLE table_204_604 (id NUMBER, "year" NUMBER, "date" CLOB, "driver" CLOB, "team" CLOB, "manufacturer" CLOB, "race distance\ laps" NUMBER, "race distance\ miles ( km ) " CLOB, "race time" CLOB, "average speed\ ( mph ) " NUMBER, "report" CLOB)
| how many laps did matt kenset complete on february 26 , 2006 . | SELECT "race distance\nlaps" FROM table_204_604 WHERE "date" = 'february 26' | SELECT "race distance\nlaps" FROM "table_204_604" WHERE "date" = 'february 26' | 0.076172 |
CREATE TABLE table_6065 ("Year" CLOB, "League" CLOB, "Season" CLOB, "Play-Off" CLOB, "Baltic" CLOB, "Events" CLOB, "European" CLOB)
| Which Season has a Year of 2005 06? | SELECT "Season" FROM table_6065 WHERE "Year" = '2005–06' | SELECT "Season" FROM "table_6065" WHERE "Year" = '2005–06' | 0.056641 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB... | Count the number of patients admitted before the year 2177 whose lab test abnormal status is delta. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2177" AND lab.flag = "delta" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "delta" = "lab"."flag" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2177" > "demographic"."admityear" | 0.1875 |
CREATE TABLE film_market_estimation (Estimation_ID NUMBER, Low_Estimate FLOAT, High_Estimate FLOAT, Film_ID NUMBER, Type CLOB, Market_ID NUMBER, Year NUMBER)
CREATE TABLE film (Film_ID NUMBER, Title CLOB, Studio CLOB, Director CLOB, Gross_in_dollar NUMBER)
CREATE TABLE market (Market_ID NUMBER, Country CLOB, Number_cit... | Show me the total number by studio in a histogram | SELECT Studio, COUNT(*) FROM film GROUP BY Studio | SELECT "Studio", COUNT(*) FROM "film" GROUP BY "Studio" | 0.053711 |
CREATE TABLE table_68313 ("Year" FLOAT, "Class" CLOB, "Tyres" CLOB, "Team" CLOB, "Co-Drivers" CLOB, "Laps" FLOAT, "Pos." CLOB, "Class Pos." CLOB)
| Name the average year with Laps of 6 | SELECT AVG("Year") FROM table_68313 WHERE "Laps" = '6' | SELECT AVG("Year") FROM "table_68313" WHERE "Laps" = '6' | 0.054688 |
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBE... | list the top five most frequent prescribed medications that patients have been prescribed within 2 months after being prescribed phenytoin infatab in this year. | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'phenytoin infatab' AND DATETIME(prescriptions.startdate, 'start o... | WITH "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."drug", "prescriptions"."startdate" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" WHERE DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')), "t3" AS (... | 0.972656 |
CREATE TABLE table_name_87 (home_team VARCHAR2, tie_no VARCHAR2)
| Which home team is ranked no. 7 by tie no.? | SELECT home_team FROM table_name_87 WHERE tie_no = "7" | SELECT "home_team" FROM "table_name_87" WHERE "7" = "tie_no" | 0.058594 |
CREATE TABLE student_course_attendance (student_id NUMBER, course_id NUMBER, date_of_attendance TIME)
CREATE TABLE candidate_assessments (candidate_id NUMBER, qualification CLOB, assessment_date TIME, asessment_outcome_code CLOB)
CREATE TABLE candidates (candidate_id NUMBER, candidate_details CLOB)
CREATE TABLE courses... | What are the id of students who registered courses or attended courses? | SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance | SELECT "student_id" FROM "student_course_registrations" UNION SELECT "student_id" FROM "student_course_attendance" | 0.111328 |
CREATE TABLE table_name_1 (height VARCHAR2, first_round VARCHAR2)
| What is the height of the player with a first round score of 44.1? | SELECT height FROM table_name_1 WHERE first_round = "44.1" | SELECT "height" FROM "table_name_1" WHERE "44.1" = "first_round" | 0.0625 |
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit C... | what is phenytoin infatab's intake method? | SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'phenytoin infatab' | SELECT DISTINCT "prescriptions"."route" FROM "prescriptions" WHERE "prescriptions"."drug" = 'phenytoin infatab' | 0.108398 |
CREATE TABLE table_10432351_1 (spectral_type VARCHAR2, star__pismis24__number_ VARCHAR2)
| What are all the spectral types for star mismis24-# is 1sw? | SELECT spectral_type FROM table_10432351_1 WHERE star__pismis24__number_ = "1SW" | SELECT "spectral_type" FROM "table_10432351_1" WHERE "1SW" = "star__pismis24__number_" | 0.083984 |
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUs... | Amount of users who's last activity was during that month. | SELECT Month = DATEADD(MONTH, DATEDIFF(MONTH, 0, Last_activity), 0), 'Lost members' = COUNT(activity.UserId) FROM (SELECT UserId, Last_activity = MAX(Date) FROM Badges INNER JOIN Users ON Badges.UserId = Users.Id GROUP BY UserId) AS activity GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, Last_activity), 0) ORDER BY Month | WITH "activity" AS (SELECT "UserId" FROM "Badges" JOIN "Users" ON "Badges"."UserId" = "Users"."Id" GROUP BY "UserId") SELECT "Month" = DATEADD("MONTH", DATEDIFF(CAST("MONTH" AS DATETIME), CAST(0 AS DATETIME), LAST_ACTIVITY), 0), COUNT("activity"."UserId") = 'Lost members' FROM "activity" "activity" GROUP BY DATEADD("MO... | 0.408203 |
CREATE TABLE entrepreneur (Entrepreneur_ID NUMBER, People_ID NUMBER, Company CLOB, Money_Requested FLOAT, Investor CLOB)
CREATE TABLE people (People_ID NUMBER, Name CLOB, Height FLOAT, Weight FLOAT, Date_of_Birth CLOB)
| Show the number of companies each investor has invested with a bar chart, show by the X from low to high. | SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor ORDER BY Investor | SELECT "Investor", COUNT("Investor") FROM "entrepreneur" GROUP BY "Investor" ORDER BY "Investor" | 0.09375 |
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, ... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, I want to list by the bars from low to high. | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID | SELECT "JOB_ID", SUM("DEPARTMENT_ID") FROM "employees" WHERE "FIRST_NAME" LIKE '%D%' OR "FIRST_NAME" LIKE '%S%' GROUP BY "JOB_ID" ORDER BY "JOB_ID" | 0.143555 |
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate T... | Recent PostHistory for a given user. | SELECT PostHistory.PostId AS "post_link", PostHistoryTypes.Name, PostHistory.CreationDate, Comment, Text FROM PostHistory JOIN PostHistoryTypes ON PostHistory.PostHistoryTypeId = PostHistoryTypes.Id WHERE PostHistory.UserId = '##UserId##' ORDER BY PostHistory.CreationDate DESC LIMIT 50 | SELECT "PostHistory"."PostId" AS "post_link", "PostHistoryTypes"."Name", "PostHistory"."CreationDate", "Comment", "Text" FROM "PostHistory" JOIN "PostHistoryTypes" ON "PostHistory"."PostHistoryTypeId" = "PostHistoryTypes"."Id" WHERE "PostHistory"."UserId" = '##UserId##' ORDER BY "PostHistory"."CreationDate" DESC FETCH ... | 0.330078 |
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VAR... | For the AMCULT 485 course what are the morning times ? | SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'AMCULT' AND c... | SELECT DISTINCT "course_offering"."end_time", "course_offering"."start_time", "semester"."semester", "semester"."year" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" AND "course_offering"."start_time" < '12:00:00' AND "course_offering"."start_time" >= '08:00:00' JOIN "semes... | 0.509766 |
CREATE TABLE table_6441 ("Location" CLOB, "Culture" CLOB, "# found" CLOB, "Ball diameter" CLOB, "Period" CLOB)
| What's the Period with # found of 5? | SELECT "Period" FROM table_6441 WHERE "# found" = '5' | SELECT "Period" FROM "table_6441" WHERE "# found" = '5' | 0.053711 |
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE city (city_code VARCHAR2, city_na... | i need a flight from SAN FRANCISCO to BOSTON that leaves after 2200 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time > 2200 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'SAN FRANCISCO' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "flight"."departure_time" > 2200 JOI... | 0.523438 |
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsO... | Java data from Stack overflow. | SELECT TagName, Count FROM Tags WHERE TagName = 'java' | SELECT "TagName", "Count" FROM "Tags" WHERE "TagName" = 'java' | 0.060547 |
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
CREATE TABLE ta (campus_job... | What are the all of the PreMajor classes ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%PreMajor%' JOIN "program" ON "program"."name" LIKE '%CS-LSA%' AND "program"."program_id" = "program_course"."program... | 0.316406 |
CREATE TABLE table_train_63 ("id" NUMBER, "immune_suppression" BOOLEAN, "leukocyte_count" NUMBER, "need_hemodialysis" BOOLEAN, "head_injury" BOOLEAN, "periodic_paralysis" BOOLEAN, "renal_disease" BOOLEAN, "glasgow_come_score_gcs" NUMBER, "sepsis" BOOLEAN, "pancreatitis" BOOLEAN, "enteral_feeding" BOOLEAN, "age" FLOAT, ... | acute pancreatitis without established origin | SELECT * FROM table_train_63 WHERE pancreatitis = 1 | SELECT * FROM "table_train_63" WHERE "pancreatitis" = 1 | 0.053711 |
CREATE TABLE table_203_142 (id NUMBER, "pos" CLOB, "no" NUMBER, "rider" CLOB, "bike" CLOB, "laps" NUMBER, "time" CLOB, "grid" NUMBER, "points" NUMBER)
| how many riders scored at least 9 points ? | SELECT COUNT("rider") FROM table_203_142 WHERE "points" >= 9 | SELECT COUNT("rider") FROM "table_203_142" WHERE "points" >= 9 | 0.060547 |
CREATE TABLE table_78261 ("Athlete" CLOB, "Event" CLOB, "Snatch" FLOAT, "Clean & Jerk" FLOAT, "Total" FLOAT)
| What is the total that had an event of +105 kg and clean & jerk less than 227.5? | SELECT COUNT("Total") FROM table_78261 WHERE "Event" = '+105 kg' AND "Clean & Jerk" < '227.5' | SELECT COUNT("Total") FROM "table_78261" WHERE "Clean & Jerk" < '227.5' AND "Event" = '+105 kg' | 0.092773 |
CREATE TABLE table_name_57 (lost NUMBER, pct VARCHAR2, tied VARCHAR2, years VARCHAR2)
| What is the highest number lost when the number tied is more than 42, the years are less than 132, and the PCT is less than 0.5729000000000001? | SELECT MAX(lost) FROM table_name_57 WHERE tied > 42 AND years < 132 AND pct < 0.5729000000000001 | SELECT MAX("lost") FROM "table_name_57" WHERE "pct" < 0.5729000000000001 AND "tied" > 42 AND "years" < 132 | 0.103516 |
CREATE TABLE table_60685 ("Date" CLOB, "Tournament" CLOB, "Surface" CLOB, "Opponent" CLOB, "Score" CLOB)
| What date was the match against leonardo tavares with a score of 6 4, 6 4? | SELECT "Date" FROM table_60685 WHERE "Score" = '6–4, 6–4' AND "Opponent" = 'leonardo tavares' | SELECT "Date" FROM "table_60685" WHERE "Opponent" = 'leonardo tavares' AND "Score" = '6–4, 6–4' | 0.092773 |
CREATE TABLE table_23970 ("Model Type" CLOB, "Model Designation" CLOB, "Engine" CLOB, "Wheelbase ( mm/inch ) " CLOB, "GVW ( kg/ton ) " CLOB, "Axle Ratio" CLOB)
| How many different engines are there for the model with model designation 97G00? | SELECT COUNT("Engine") FROM table_23970 WHERE "Model Designation" = '97G00' | SELECT COUNT("Engine") FROM "table_23970" WHERE "Model Designation" = '97G00' | 0.075195 |
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE city (city_code VARCHAR2, city_nam... | what are the flights from LAS VEGAS to BURBANK on saturday 5 22 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BURBANK' AND date_day.day_number = 22 AND date_day.month_number = 5 AND d... | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 22 AND "date_day"."month_number" = 5 AND "date_day"."year" = 1991 JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'LAS VEGAS' JOIN "days"... | 0.695313 |
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE procedur... | what is the minimum total cost for a hospital that includes a drug called zidovudine since 5 years ago? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'zidovudine') AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY cost.hadm_id) AS t1 | WITH "_u_0" AS (SELECT "prescriptions"."hadm_id" FROM "prescriptions" WHERE "prescriptions"."drug" = 'zidovudine' GROUP BY "hadm_id"), "t1" AS (SELECT SUM("cost"."cost") AS "c1" FROM "cost" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "cost"."hadm_id" WHERE DATETIME("cost"."chargetime") >= DATETIME(CURRENT_TIME(), '-5 year')... | 0.400391 |
CREATE TABLE table_76260 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Record" CLOB, "Attendance" CLOB)
| What is the highest week that was played against the Minnesota Vikings? | SELECT MAX("Week") FROM table_76260 WHERE "Opponent" = 'minnesota vikings' | SELECT MAX("Week") FROM "table_76260" WHERE "Opponent" = 'minnesota vikings' | 0.074219 |
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity... | what is average age of patients whose marital status is single and year of birth is greater than 2097? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2097" | SELECT AVG("demographic"."age") FROM "demographic" WHERE "2097" < "demographic"."dob_year" AND "SINGLE" = "demographic"."marital_status" | 0.132813 |
CREATE TABLE table_45785 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" CLOB, "To par" CLOB, "Money ( $ ) " CLOB)
| WHAT IS THE TO PAR FOR ERNIE ELS? | SELECT "To par" FROM table_45785 WHERE "Player" = 'ernie els' | SELECT "To par" FROM "table_45785" WHERE "Player" = 'ernie els' | 0.061523 |
CREATE TABLE table_name_30 (position VARCHAR2, height NUMBER)
| What is the position of the player who is taller than 2.12? | SELECT position FROM table_name_30 WHERE height > 2.12 | SELECT "position" FROM "table_name_30" WHERE "height" > 2.12 | 0.058594 |
CREATE TABLE table_name_12 (total VARCHAR2, player VARCHAR2)
| What is Total, when Player is 'Hale Irwin'? | SELECT total FROM table_name_12 WHERE player = "hale irwin" | SELECT "total" FROM "table_name_12" WHERE "hale irwin" = "player" | 0.063477 |
CREATE TABLE table_name_39 (points NUMBER, drawn VARCHAR2, position VARCHAR2, lost VARCHAR2)
| what is the highest points when position is higher than 6, lost is less than 12 and drawn is less than 1? | SELECT MAX(points) FROM table_name_39 WHERE position > 6 AND lost < 12 AND drawn < 1 | SELECT MAX("points") FROM "table_name_39" WHERE "drawn" < 1 AND "lost" < 12 AND "position" > 6 | 0.091797 |
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VA... | show me all YX flights from DETROIT to CHICAGO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DETRO... | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'CHICAGO' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."to_airport" AND "flight"."airline_code" = 'YX' JOIN "airport... | 0.516602 |
CREATE TABLE table_name_83 (rec NUMBER, yards VARCHAR2, avg VARCHAR2)
| How many receptions for players with over 647 yards and an under 14 yard average? | SELECT MIN(rec) FROM table_name_83 WHERE yards > 647 AND avg < 14 | SELECT MIN("rec") FROM "table_name_83" WHERE "avg" < 14 AND "yards" > 647 | 0.071289 |
CREATE TABLE conference (cid NUMBER, homepage VARCHAR2, name VARCHAR2)
CREATE TABLE domain_author (aid NUMBER, did NUMBER)
CREATE TABLE writes (aid NUMBER, pid NUMBER)
CREATE TABLE cite (cited NUMBER, citing NUMBER)
CREATE TABLE publication_keyword (kid NUMBER, pid NUMBER)
CREATE TABLE keyword (keyword VARCHAR2, kid NU... | return me the authors who have papers in VLDB conference before 1995 or after 2002 . | SELECT author.name FROM author, conference, publication, writes WHERE (publication.year < 1995 OR publication.year > 2002) AND conference.name = 'VLDB' AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid | SELECT "author"."name" FROM "author" JOIN "conference" ON "conference"."name" = 'VLDB' JOIN "publication" ON "conference"."cid" = "publication"."cid" AND ("publication"."year" < 1995 OR "publication"."year" > 2002) JOIN "writes" ON "author"."aid" = "writes"."aid" AND "publication"."pid" = "writes"."pid" | 0.296875 |
CREATE TABLE table_name_25 (year NUMBER, earnings__$_ VARCHAR2)
| What year has earnings of $557,158? | SELECT MAX(year) FROM table_name_25 WHERE earnings__$_ = "557,158" | SELECT MAX("year") FROM "table_name_25" WHERE "557,158" = "earnings__$_" | 0.070313 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE procedures (subject_id... | what is marital status and age of subject id 990? | SELECT demographic.marital_status, demographic.age FROM demographic WHERE demographic.subject_id = "990" | SELECT "demographic"."marital_status", "demographic"."age" FROM "demographic" WHERE "990" = "demographic"."subject_id" | 0.115234 |
CREATE TABLE table_63329 ("Restaurant Name" CLOB, "Original Name" CLOB, "Location" CLOB, "Chef" CLOB, "Designer" CLOB, "Still Open?" CLOB)
| What is the original name of the place by designer Glen Peloso with a Location of n/a? | SELECT "Original Name" FROM table_63329 WHERE "Designer" = 'glen peloso' AND "Location" = 'n/a' | SELECT "Original Name" FROM "table_63329" WHERE "Designer" = 'glen peloso' AND "Location" = 'n/a' | 0.094727 |
CREATE TABLE table_1137718_2 (rd NUMBER, date VARCHAR2)
| Which rd. occurred on 22 October? | SELECT MIN(rd) FROM table_1137718_2 WHERE date = "22 October" | SELECT MIN("rd") FROM "table_1137718_2" WHERE "22 October" = "date" | 0.06543 |
CREATE TABLE table_name_87 (Id VARCHAR2)
| What is the 2007 value with NMS in 2011? | SELECT 2007 FROM table_name_87 WHERE 2011 = "nms" | SELECT 2007 FROM "table_name_87" WHERE "nms" = 2011 | 0.049805 |
CREATE TABLE table_name_41 (rank NUMBER, gold NUMBER)
| What's the rank average when the gold medals are less than 0? | SELECT AVG(rank) FROM table_name_41 WHERE gold < 0 | SELECT AVG("rank") FROM "table_name_41" WHERE "gold" < 0 | 0.054688 |
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUM... | what was the last dose of sulfameth/trimethoprim ds that until 03/2105 was prescribed to patient 64292? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64292) AND prescriptions.drug = 'sulfameth/trimethoprim ds' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-03' ORDER BY prescriptions.startdate DESC LIMIT ... | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 64292 GROUP BY "hadm_id") SELECT "prescriptions"."dose_val_rx" FROM "prescriptions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE "prescriptions"."drug" = 'sulfameth/trimethoprim ds' AND NOT "_u_0"... | 0.450195 |
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, ... | Show me a bar chart for what are the department names and how many employees work in each of them?, could you list from low to high by the Y-axis? | SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY DEPARTMENT_NAME ORDER BY COUNT(*) | SELECT "DEPARTMENT_NAME", COUNT(*) FROM "employees" "T1" JOIN "departments" "T2" ON "T1"."DEPARTMENT_ID" = "T2"."DEPARTMENT_ID" GROUP BY "DEPARTMENT_NAME" ORDER BY COUNT(*) | 0.167969 |
CREATE TABLE table_34277 ("Year" CLOB, "Men's singles" CLOB, "Women's singles" CLOB, "Men's doubles" CLOB, "Women's doubles" CLOB, "Mixed doubles" CLOB)
| Who won the Women's doubles the year that there was no competition in the Men's doubles and Arthur Chatschatourow won the Men's singles? | SELECT "Women's doubles" FROM table_34277 WHERE "Men's doubles" = 'no competition' AND "Men's singles" = 'arthur chatschatourow' | SELECT "Women's doubles" FROM "table_34277" WHERE "Men's doubles" = 'no competition' AND "Men's singles" = 'arthur chatschatourow' | 0.126953 |
CREATE TABLE table_3866 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
| Name the record for 23 game | SELECT "Record" FROM table_3866 WHERE "Game" = '23' | SELECT "Record" FROM "table_3866" WHERE "Game" = '23' | 0.051758 |
CREATE TABLE table_name_26 (record VARCHAR2, visitor VARCHAR2, date VARCHAR2)
| What is the record when the visiting team was the Quebec Nordiques on April 22? | SELECT record FROM table_name_26 WHERE visitor = "quebec nordiques" AND date = "april 22" | SELECT "record" FROM "table_name_26" WHERE "april 22" = "date" AND "quebec nordiques" = "visitor" | 0.094727 |
CREATE TABLE takes (id CLOB, course_id CLOB, sec_id CLOB, semester CLOB, year NUMBER, grade CLOB)
CREATE TABLE course (course_id CLOB, title CLOB, dept_name CLOB, credits NUMBER)
CREATE TABLE time_slot (time_slot_id CLOB, day CLOB, start_hr NUMBER, start_min NUMBER, end_hr NUMBER, end_min NUMBER)
CREATE TABLE instructo... | Find the name of students who took any class in the years of 2009 and 2010. | SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE year = 2009 OR year = 2010 | SELECT DISTINCT "T1"."name" FROM "student" "T1" JOIN "takes" "T2" ON "T1"."id" = "T2"."id" WHERE "year" = 2009 OR "year" = 2010 | 0.124023 |
CREATE TABLE table_78531 ("Driver" CLOB, "Constructor" CLOB, "Laps" FLOAT, "Time/Retired" CLOB, "Grid" FLOAT)
| I want the driver that has Laps of 10 | SELECT "Driver" FROM table_78531 WHERE "Laps" = '10' | SELECT "Driver" FROM "table_78531" WHERE "Laps" = '10' | 0.052734 |
CREATE TABLE table_name_40 (constructor VARCHAR2, rounds VARCHAR2, chassis VARCHAR2)
| Which constructor has 10-12 rounds and a M7A chassis? | SELECT constructor FROM table_name_40 WHERE rounds = "10-12" AND chassis = "m7a" | SELECT "constructor" FROM "table_name_40" WHERE "10-12" = "rounds" AND "chassis" = "m7a" | 0.085938 |
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE ground_service (city_code CL... | what is the cheapest round trip fare from ATLANTA to PITTSBURGH | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... | WITH "_u_0" AS (SELECT MIN("FAREalias1"."round_trip_cost") FROM "airport_service" "AIRPORT_SERVICEalias2" JOIN "city" "CITYalias2" ON "AIRPORT_SERVICEalias2"."city_code" = "CITYalias2"."city_code" AND "CITYalias2"."city_name" = 'ATLANTA' JOIN "flight" "FLIGHTalias1" ON "AIRPORT_SERVICEalias2"."airport_code" = "FLIGHTal... | 1.428711 |
CREATE TABLE table_name_56 (period VARCHAR2, matches VARCHAR2, country VARCHAR2)
| Name the period with matches of 0 0 of portugal | SELECT period FROM table_name_56 WHERE matches = "0 0" AND country = "portugal" | SELECT "period" FROM "table_name_56" WHERE "0 0" = "matches" AND "country" = "portugal" | 0.084961 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_i... | what is admission time and diagnoses short title of subject id 9575? | SELECT demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "9575" | SELECT "demographic"."admittime", "diagnoses"."short_title" FROM "demographic" JOIN "diagnoses" ON "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "9575" = "demographic"."subject_id" | 0.183594 |
CREATE TABLE table_name_29 (against NUMBER, draws VARCHAR2, wins VARCHAR2, club VARCHAR2)
| What is the number of against when the wins were 8, and a Club of South Warrnambool, with less than 0 draws? | SELECT SUM(against) FROM table_name_29 WHERE wins = 8 AND club = "south warrnambool" AND draws < 0 | SELECT SUM("against") FROM "table_name_29" WHERE "club" = "south warrnambool" AND "draws" < 0 AND "wins" = 8 | 0.105469 |
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id ... | Are ULCS classes available next Winter ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "program_course" ON "course_offering"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%ULCS%' JOIN "semester" ON "c... | 0.428711 |
CREATE TABLE table_name_33 (champion VARCHAR2, israel_bowl VARCHAR2)
| Name the champion for israel bowl of iv | SELECT champion FROM table_name_33 WHERE israel_bowl = "iv" | SELECT "champion" FROM "table_name_33" WHERE "israel_bowl" = "iv" | 0.063477 |
CREATE TABLE table_26202847_6 (no VARCHAR2, outcome VARCHAR2, surface VARCHAR2)
| Where the outcome is Winner and surface is Hard (i), what is the No.? | SELECT no FROM table_26202847_6 WHERE outcome = "Winner" AND surface = "Hard (i)" | SELECT "no" FROM "table_26202847_6" WHERE "Hard (i)" = "surface" AND "Winner" = "outcome" | 0.086914 |
CREATE TABLE table_34849 ("Tournament" CLOB, "1981" CLOB, "1982" CLOB, "1983" CLOB, "1984" CLOB, "1985" CLOB, "1986" CLOB, "1987" CLOB, "1988" CLOB, "1989" CLOB)
| Which Tournament has a 1984 of 1r? | SELECT "Tournament" FROM table_34849 WHERE "1984" = '1r' | SELECT "Tournament" FROM "table_34849" WHERE "1984" = '1r' | 0.056641 |
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE admissions (row_id NUMBER, sub... | count the number of people who were prescribed oxcarbazepine in the same month following a diagnosis of urin tract infection nos. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'urin tract infecti... | WITH "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."startdate" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" WHERE "prescriptions"."drug" = 'oxcarbazepine') SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_... | 0.713867 |
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labnam... | in 05/2103, when was the first time patient 002-38644 was prescribed insulin lispro (humalog) injection 0-20 units and duoneb at the same time? | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'insulin lispro (humalog) injection 0-20 units' AND patient.uniquepid = '002-38644' AND STRFTIME('%y-%m', medication.drugs... | WITH "t2" AS (SELECT "patient"."uniquepid", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" AND "patient"."uniquepid" = '002-38644' WHERE "medication"."drugname" = 'duoneb' AND STRFTIME('%y-%m', "medication"."drugstarttime") = '2103-05') ... | 0.817383 |
CREATE TABLE table_name_93 (lost VARCHAR2, played VARCHAR2, against VARCHAR2, drawn VARCHAR2)
| What is the sum of lost when against is less than 37, drawn is more than 2, and played is more than 20? | SELECT COUNT(lost) FROM table_name_93 WHERE against < 37 AND drawn > 2 AND played > 20 | SELECT COUNT("lost") FROM "table_name_93" WHERE "against" < 37 AND "drawn" > 2 AND "played" > 20 | 0.09375 |
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitsta... | what was the last time that patient 009-13409 was prescribed for a drug until 48 months ago? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409')) AND DATETIME(medication.drugstarttime) <= DATETIM... | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '009-13409' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS ... | 0.643555 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.