schema
stringlengths
28
5.65k
question
stringlengths
0
990
rejected
stringlengths
2
4.44k
chosen
stringlengths
4
9.17k
weight
float64
0
8.95
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME) CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
has any organisms been found in the last other microbiology test of patient 031-9128 since 92 months ago?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128')) AND microlab.culturesite = 'other' AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-92 month') ORDER BY microlab.culturetakentime DESC LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '031-9128' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "microlab" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "microlab"."patientunitstayid" WHERE "microlab"."culturesite" = 'other' AND DATETIME("microlab"."culturetakentime") >= DATETIME(CURRENT_TIME(), '-92 month') AND NOT "_u_1"."" IS NULL ORDER BY "microlab"."culturetakentime" DESC NULLS LAST LIMIT 1
0.664063
CREATE TABLE table_name_24 (frequency VARCHAR, coverage VARCHAR)
What is the frequency of the station with a coverage of oaxaca guerrero puebla?
SELECT frequency FROM table_name_24 WHERE coverage = "oaxaca guerrero puebla"
SELECT "frequency" FROM "table_name_24" WHERE "coverage" = "oaxaca guerrero puebla"
0.081055
CREATE TABLE schedule (cinema_id DECIMAL, film_id DECIMAL, date TEXT, show_times_per_day DECIMAL, price DECIMAL) CREATE TABLE film (film_id DECIMAL, rank_in_series DECIMAL, number_in_season DECIMAL, title TEXT, directed_by TEXT, original_air_date TEXT, production_code TEXT) CREATE TABLE cinema (cinema_id DECIMAL, name TEXT, openning_year DECIMAL, capacity DECIMAL, location TEXT)
Show all the cinema names and opening years in descending order of opening year.
SELECT name, openning_year FROM cinema ORDER BY openning_year DESC
SELECT "name", "openning_year" FROM "cinema" ORDER BY "openning_year" DESC NULLS LAST
0.083008
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
count the number of patients whose ethnicity is hispanic or latino and age is less than 44?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.age < "44"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "44" > "demographic"."age" AND "HISPANIC OR LATINO" = "demographic"."ethnicity"
0.150391
CREATE TABLE table_test_16 ("id" INT, "left_ventricular_ejection_fraction_lvef" INT, "systolic_blood_pressure_sbp" INT, "severe_hypertension" BOOLEAN, "adrenaline" BOOLEAN, "stroke" BOOLEAN, "renal_disease" BOOLEAN, "severe_uncontrolled_arterial_hypertension" BOOLEAN, "hepatic_disease" BOOLEAN, "dobutamine" BOOLEAN, "temperature" FLOAT, "creatinine_clearance_cl" FLOAT, "estimated_glomerular_filtration_rate_egfr" INT, "cardiogenic_shock" BOOLEAN, "diastolic_blood_pressure_dbp" INT, "liver_disease" BOOLEAN, "intravenous_vasoactive_agents" BOOLEAN, "kidney_disease" BOOLEAN, "hypertension" BOOLEAN, "age" FLOAT, "NOUSE" FLOAT)
severe hypertension not adequately controlled by antihypertensive therapy at the time of study entry ( bp > 180 / 110 mm hg )
SELECT * FROM table_test_16 WHERE severe_hypertension = 1 AND systolic_blood_pressure_sbp >= 180 OR diastolic_blood_pressure_dbp >= 110
SELECT * FROM "table_test_16" WHERE ("diastolic_blood_pressure_dbp" >= 110 OR "severe_hypertension" = 1) AND ("diastolic_blood_pressure_dbp" >= 110 OR "systolic_blood_pressure_sbp" >= 180)
0.183594
CREATE TABLE table_43209 ("8:00" TEXT, "8:30" TEXT, "9:00" TEXT, "9:30" TEXT, "10:00" TEXT)
When Don't Forget the Lyrics aired at 8:30 what aired at 9:00?
SELECT "9:00" FROM table_43209 WHERE "8:30" = 'don''t forget the lyrics'
SELECT "9:00" FROM "table_43209" WHERE "8:30" = 'don\'t forget the lyrics'
0.072266
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME) CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
count the number of patients who had the intake of per iv flush: antecubital l 20 gauge this year.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'per iv flush: antecubital l 20 gauge' AND intakeoutput.cellpath LIKE '%input%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
WITH "_u_0" AS (SELECT "intakeoutput"."patientunitstayid" FROM "intakeoutput" WHERE "intakeoutput"."celllabel" = 'per iv flush: antecubital l 20 gauge' AND "intakeoutput"."cellpath" LIKE '%input%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY "patientunitstayid") SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL
0.494141
CREATE TABLE table_name_94 (date VARCHAR, tournament VARCHAR)
what is the date for the tournament acapulco?
SELECT date FROM table_name_94 WHERE tournament = "acapulco"
SELECT "date" FROM "table_name_94" WHERE "acapulco" = "tournament"
0.064453
CREATE TABLE table_67182 ("Season" TEXT, "Series" TEXT, "Team" TEXT, "Races" TEXT, "wins" TEXT, "Fast laps" TEXT, "Points" TEXT, "Pos." TEXT)
What is the position with 0 points in Season of 2007 08?
SELECT "Pos." FROM table_67182 WHERE "Points" = '0' AND "Season" = '2007–08'
SELECT "Pos." FROM "table_67182" WHERE "Points" = '0' AND "Season" = '2007–08'
0.076172
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT) CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR) CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR) CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR) CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT) CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT) CREATE TABLE area (course_id INT, area VARCHAR) CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR) CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT) CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR) CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR) CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT) CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT) CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR) CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR) CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR) CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR) CREATE TABLE gsi (course_offering_id INT, student_id INT)
The 414 class , how big is it ?
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 414
SELECT DISTINCT "num_enrolled" FROM "course" WHERE "department" = 'EECS' AND "number" = 414
0.088867
CREATE TABLE table_1965650_4 (nationality VARCHAR, player VARCHAR)
What's Steve Langdon's naitionality?
SELECT nationality FROM table_1965650_4 WHERE player = "Steve Langdon"
SELECT "nationality" FROM "table_1965650_4" WHERE "Steve Langdon" = "player"
0.074219
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
provide the number of patients diagnosed with chronic liver dis nec and drug route is td.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Chronic liver dis NEC" AND prescriptions.route = "TD"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Chronic liver dis NEC" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "TD" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id"
0.295898
CREATE TABLE table_name_31 (country VARCHAR, athletes VARCHAR)
What country does Adam van Koeverden play for?
SELECT country FROM table_name_31 WHERE athletes = "adam van koeverden"
SELECT "country" FROM "table_name_31" WHERE "adam van koeverden" = "athletes"
0.075195
CREATE TABLE university (school_id DECIMAL, school TEXT, location TEXT, founded DECIMAL, affiliation TEXT, enrollment DECIMAL, nickname TEXT, primary_conference TEXT) CREATE TABLE basketball_match (team_id DECIMAL, school_id DECIMAL, team_name TEXT, acc_regular_season TEXT, acc_percent TEXT, acc_home TEXT, acc_road TEXT, all_games TEXT, all_games_percent DECIMAL, all_home TEXT, all_road TEXT, all_neutral TEXT)
What is the founded year of the non public school that was founded most recently?
SELECT founded FROM university WHERE affiliation <> 'Public' ORDER BY founded DESC LIMIT 1
SELECT "founded" FROM "university" WHERE "affiliation" <> 'Public' ORDER BY "founded" DESC NULLS LAST LIMIT 1
0.106445
CREATE TABLE table_4094 ("Country" TEXT, "Area ( km 2 ) " FLOAT, "Population ( 2012 ) " FLOAT, "Density ( /km 2 ) " FLOAT, "GDP ( nominal ) , USD ( 2012 ) " TEXT, "GDP ( nominal ) per capita , USD ( 2012 ) " TEXT, "HDI ( 2012 ) " TEXT, "Capital" TEXT)
How many HDI (2012) does the area with nominal GDP and 14,246,000,000 USD (2012) have?
SELECT COUNT("HDI (2012)") FROM table_4094 WHERE "GDP (nominal), USD (2012)" = '14,246,000,000'
SELECT COUNT("HDI (2012)") FROM "table_4094" WHERE "GDP (nominal), USD (2012)" = '14,246,000,000'
0.094727
CREATE TABLE table_name_52 (year INT, league VARCHAR)
What was the earliest year for the USISL Pro League?
SELECT MIN(year) FROM table_name_52 WHERE league = "usisl pro league"
SELECT MIN("year") FROM "table_name_52" WHERE "league" = "usisl pro league"
0.073242
CREATE TABLE table_name_43 (winning_team VARCHAR, date VARCHAR)
With a Date of 22 July, what is the Winning team?
SELECT winning_team FROM table_name_43 WHERE date = "22 july"
SELECT "winning_team" FROM "table_name_43" WHERE "22 july" = "date"
0.06543
CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT) CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT)
For those records from the products and each product's manufacturer, what is the relationship between code and manufacturer , and group by attribute founder?
SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
SELECT "T1"."Code", "T1"."Manufacturer" FROM "Products" AS "T1" JOIN "Manufacturers" AS "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "Founder"
0.144531
CREATE TABLE basketball_match (Team_ID INT, School_ID INT, Team_Name TEXT, ACC_Regular_Season TEXT, ACC_Percent TEXT, ACC_Home TEXT, ACC_Road TEXT, All_Games TEXT, All_Games_Percent INT, All_Home TEXT, All_Road TEXT, All_Neutral TEXT) CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT)
Draw a bar chart about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road, and list by the total number in desc.
SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(Team_ID) DESC
SELECT "ACC_Road", SUM("Team_ID") FROM "basketball_match" GROUP BY "ACC_Road" ORDER BY SUM("Team_ID") DESC NULLS LAST
0.114258
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT) CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT) CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
what was the first ward identification for patient 013-23267 since 2105?
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-23267') AND STRFTIME('%y', patient.unitadmittime) >= '2105' ORDER BY patient.unitadmittime LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '013-23267' GROUP BY "patienthealthsystemstayid") SELECT "patient"."wardid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y', "patient"."unitadmittime") >= '2105' ORDER BY "patient"."unitadmittime" NULLS FIRST LIMIT 1
0.405273
CREATE TABLE COURSE (CRS_CODE VARCHAR, DEPT_CODE VARCHAR, CRS_DESCRIPTION VARCHAR, CRS_CREDIT FLOAT) CREATE TABLE DEPARTMENT (DEPT_CODE VARCHAR, DEPT_NAME VARCHAR, SCHOOL_CODE VARCHAR, EMP_NUM INT, DEPT_ADDRESS VARCHAR, DEPT_EXTENSION VARCHAR) CREATE TABLE EMPLOYEE (EMP_NUM INT, EMP_LNAME VARCHAR, EMP_FNAME VARCHAR, EMP_INITIAL VARCHAR, EMP_JOBCODE VARCHAR, EMP_HIREDATE DATETIME, EMP_DOB DATETIME) CREATE TABLE STUDENT (STU_NUM INT, STU_LNAME VARCHAR, STU_FNAME VARCHAR, STU_INIT VARCHAR, STU_DOB DATETIME, STU_HRS INT, STU_CLASS VARCHAR, STU_GPA FLOAT, STU_TRANSFER DECIMAL, DEPT_CODE VARCHAR, STU_PHONE VARCHAR, PROF_NUM INT) CREATE TABLE ENROLL (CLASS_CODE VARCHAR, STU_NUM INT, ENROLL_GRADE VARCHAR) CREATE TABLE PROFESSOR (EMP_NUM INT, DEPT_CODE VARCHAR, PROF_OFFICE VARCHAR, PROF_EXTENSION VARCHAR, PROF_HIGH_DEGREE VARCHAR) CREATE TABLE CLASS (CLASS_CODE VARCHAR, CRS_CODE VARCHAR, CLASS_SECTION VARCHAR, CLASS_TIME VARCHAR, CLASS_ROOM VARCHAR, PROF_NUM INT)
What are the total number of credits offered by each department Show bar chart, display X-axis from high to low order.
SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE ORDER BY DEPT_CODE DESC
SELECT "DEPT_CODE", SUM("T1"."CRS_CREDIT") FROM "COURSE" AS "T1" JOIN "CLASS" AS "T2" ON "T1"."CRS_CODE" = "T2"."CRS_CODE" GROUP BY "T1"."DEPT_CODE" ORDER BY "DEPT_CODE" DESC NULLS LAST
0.180664
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR) CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT) CREATE TABLE days (days_code VARCHAR, day_name VARCHAR) CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT) CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT) CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR) CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT) CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT) CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT) CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT) CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT) CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT) CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR) CREATE TABLE flight_fare (flight_id INT, fare_id INT) CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR) CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR) CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT) CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR) CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT) CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT) CREATE TABLE code_description (code VARCHAR, description TEXT) CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR) CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR) CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT) CREATE TABLE month (month_number INT, month_name TEXT)
what flights takeoff and land at MKE
SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE')
SELECT DISTINCT "flight"."flight_id" FROM "airport" AS "AIRPORT_0" JOIN "airport" AS "AIRPORT_1" ON "AIRPORT_0"."airport_code" = 'MKE' OR "AIRPORT_1"."airport_code" = 'MKE' JOIN "flight" ON ("AIRPORT_0"."airport_code" = "flight"."to_airport" OR "AIRPORT_1"."airport_code" = "flight"."from_airport") AND ("AIRPORT_0"."airport_code" = "flight"."to_airport" OR "AIRPORT_1"."airport_code" = 'MKE') AND ("AIRPORT_0"."airport_code" = 'MKE' OR "AIRPORT_1"."airport_code" = "flight"."from_airport")
0.478516
CREATE TABLE table_46750 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT)
What Country is Rocco Mediate from?
SELECT "Country" FROM table_46750 WHERE "Player" = 'rocco mediate'
SELECT "Country" FROM "table_46750" WHERE "Player" = 'rocco mediate'
0.066406
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR) CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT) CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR) CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT) CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR) CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR) CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR) CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR) CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR) CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR) CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT) CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR) CREATE TABLE gsi (course_offering_id INT, student_id INT) CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT) CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT) CREATE TABLE area (course_id INT, area VARCHAR) CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR) CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
Last semester who were the GSIs for CONDUCT 801 ?
SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'CONDUCT' AND course.number = 801 AND semester.semester = 'FA' AND semester.year = 2015
SELECT DISTINCT "student"."firstname", "student"."lastname" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "gsi" ON "course_offering"."offering_id" = "gsi"."course_offering_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'FA' AND "semester"."year" = 2015 JOIN "student" ON "gsi"."student_id" = "student"."student_id" WHERE "course"."department" = 'CONDUCT' AND "course"."number" = 801
0.482422
CREATE TABLE musical (musical_id DECIMAL, name TEXT, year DECIMAL, award TEXT, category TEXT, nominee TEXT, result TEXT) CREATE TABLE actor (actor_id DECIMAL, name TEXT, musical_id DECIMAL, character TEXT, duration TEXT, age DECIMAL)
Show names of actors and names of musicals they are in.
SELECT T1.name, T2.name FROM actor AS T1 JOIN musical AS T2 ON T1.musical_id = T2.musical_id
SELECT "T1"."name", "T2"."name" FROM "actor" AS "T1" JOIN "musical" AS "T2" ON "T1"."musical_id" = "T2"."musical_id"
0.113281
CREATE TABLE table_name_5 (report VARCHAR, circuit VARCHAR)
What is the report status of Hockenheimring circuit?
SELECT report FROM table_name_5 WHERE circuit = "hockenheimring"
SELECT "report" FROM "table_name_5" WHERE "circuit" = "hockenheimring"
0.068359
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR) CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR) CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR) CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT) CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR) CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR) CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT) CREATE TABLE flight_fare (flight_id INT, fare_id INT) CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT) CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR) CREATE TABLE days (days_code VARCHAR, day_name VARCHAR) CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT) CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT) CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR) CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT) CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR) CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT) CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT) CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT) CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT) CREATE TABLE code_description (code VARCHAR, description TEXT) CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT) CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT) CREATE TABLE month (month_number INT, month_name TEXT) CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
list the flights that arrive and depart from MKE airport
SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE')
SELECT DISTINCT "flight"."flight_id" FROM "airport" AS "AIRPORT_0" JOIN "airport" AS "AIRPORT_1" ON "AIRPORT_0"."airport_code" = 'MKE' OR "AIRPORT_1"."airport_code" = 'MKE' JOIN "flight" ON ("AIRPORT_0"."airport_code" = "flight"."to_airport" OR "AIRPORT_1"."airport_code" = "flight"."from_airport") AND ("AIRPORT_0"."airport_code" = "flight"."to_airport" OR "AIRPORT_1"."airport_code" = 'MKE') AND ("AIRPORT_0"."airport_code" = 'MKE' OR "AIRPORT_1"."airport_code" = "flight"."from_airport")
0.478516
CREATE TABLE Services (Service_ID INT, Service_Type_Code CHAR, Workshop_Group_ID INT, Product_Description VARCHAR, Product_Name VARCHAR, Product_Price DECIMAL, Other_Product_Service_Details VARCHAR) CREATE TABLE Invoice_Items (Invoice_Item_ID INT, Invoice_ID INT, Order_ID INT, Order_Item_ID INT, Product_ID INT, Order_Quantity INT, Other_Item_Details VARCHAR) CREATE TABLE Order_Items (Order_Item_ID INT, Order_ID INT, Product_ID INT, Order_Quantity VARCHAR, Other_Item_Details VARCHAR) CREATE TABLE Products (Product_ID VARCHAR, Product_Name VARCHAR, Product_Price DECIMAL, Product_Description VARCHAR, Other_Product_Service_Details VARCHAR) CREATE TABLE Ref_Service_Types (Service_Type_Code CHAR, Parent_Service_Type_Code CHAR, Service_Type_Description VARCHAR) CREATE TABLE Bookings (Booking_ID INT, Customer_ID INT, Workshop_Group_ID VARCHAR, Status_Code CHAR, Store_ID INT, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR) CREATE TABLE Performers (Performer_ID INT, Address_ID INT, Customer_Name VARCHAR, Customer_Phone VARCHAR, Customer_Email_Address VARCHAR, Other_Details VARCHAR) CREATE TABLE Stores (Store_ID VARCHAR, Address_ID INT, Marketing_Region_Code CHAR, Store_Name VARCHAR, Store_Phone VARCHAR, Store_Email_Address VARCHAR, Other_Details VARCHAR) CREATE TABLE Bookings_Services (Order_ID INT, Product_ID INT) CREATE TABLE Marketing_Regions (Marketing_Region_Code CHAR, Marketing_Region_Name VARCHAR, Marketing_Region_Descriptrion VARCHAR, Other_Details VARCHAR) CREATE TABLE Customer_Orders (Order_ID INT, Customer_ID INT, Store_ID INT, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR) CREATE TABLE Addresses (Address_ID VARCHAR, Line_1 VARCHAR, Line_2 VARCHAR, City_Town VARCHAR, State_County VARCHAR, Other_Details VARCHAR) CREATE TABLE Drama_Workshop_Groups (Workshop_Group_ID INT, Address_ID INT, Currency_Code CHAR, Marketing_Region_Code CHAR, Store_Name VARCHAR, Store_Phone VARCHAR, Store_Email_Address VARCHAR, Other_Details VARCHAR) CREATE TABLE Performers_in_Bookings (Order_ID INT, Performer_ID INT) CREATE TABLE Ref_Payment_Methods (payment_method_code CHAR, payment_method_description VARCHAR) CREATE TABLE Customers (Customer_ID VARCHAR, Address_ID INT, Customer_Name VARCHAR, Customer_Phone VARCHAR, Customer_Email_Address VARCHAR, Other_Details VARCHAR) CREATE TABLE Invoices (Invoice_ID INT, Order_ID INT, payment_method_code CHAR, Product_ID INT, Order_Quantity VARCHAR, Other_Item_Details VARCHAR, Order_Item_ID INT) CREATE TABLE Clients (Client_ID INT, Address_ID INT, Customer_Email_Address VARCHAR, Customer_Name VARCHAR, Customer_Phone VARCHAR, Other_Details VARCHAR)
Plot the number of order date over order date in a line chart
SELECT Order_Date, COUNT(Order_Date) FROM Bookings
SELECT "Order_Date", COUNT("Order_Date") FROM "Bookings"
0.054688
CREATE TABLE table_name_93 (opponent VARCHAR, loss VARCHAR)
Who was the opponent at the game that had a loss of Hendrickson (0-1)?
SELECT opponent FROM table_name_93 WHERE loss = "hendrickson (0-1)"
SELECT "opponent" FROM "table_name_93" WHERE "hendrickson (0-1)" = "loss"
0.071289
CREATE TABLE students (student_id DECIMAL, date_of_registration TIME, date_of_latest_logon TIME, login_name TEXT, password TEXT, personal_name TEXT, middle_name TEXT, family_name TEXT) CREATE TABLE student_course_enrolment (registration_id DECIMAL, student_id DECIMAL, course_id DECIMAL, date_of_enrolment TIME, date_of_completion TIME) CREATE TABLE course_authors_and_tutors (author_id DECIMAL, author_tutor_atb TEXT, login_name TEXT, password TEXT, personal_name TEXT, middle_name TEXT, family_name TEXT, gender_mf TEXT, address_line_1 TEXT) CREATE TABLE subjects (subject_id DECIMAL, subject_name TEXT) CREATE TABLE student_tests_taken (registration_id DECIMAL, date_test_taken TIME, test_result TEXT) CREATE TABLE courses (course_id DECIMAL, author_id DECIMAL, subject_id DECIMAL, course_name TEXT, course_description TEXT)
Find the enrollment date for all the tests that have 'Pass' result.
SELECT T1.date_of_enrolment FROM student_course_enrolment AS T1 JOIN student_tests_taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass"
SELECT "T1"."date_of_enrolment" FROM "student_course_enrolment" AS "T1" JOIN "student_tests_taken" AS "T2" ON "Pass" = "T2"."test_result" AND "T1"."registration_id" = "T2"."registration_id"
0.18457
CREATE TABLE domain_publication (did INT, pid INT) CREATE TABLE domain_conference (cid INT, did INT) CREATE TABLE publication_keyword (kid INT, pid INT) CREATE TABLE domain_keyword (did INT, kid INT) CREATE TABLE author (aid INT, homepage VARCHAR, name VARCHAR, oid INT) CREATE TABLE publication (abstract VARCHAR, cid INT, citation_num INT, jid INT, pid INT, reference_num INT, title VARCHAR, year INT) CREATE TABLE journal (homepage VARCHAR, jid INT, name VARCHAR) CREATE TABLE organization (continent VARCHAR, homepage VARCHAR, name VARCHAR, oid INT) CREATE TABLE keyword (keyword VARCHAR, kid INT) CREATE TABLE domain (did INT, name VARCHAR) CREATE TABLE writes (aid INT, pid INT) CREATE TABLE domain_author (aid INT, did INT) CREATE TABLE domain_journal (did INT, jid INT) CREATE TABLE cite (cited INT, citing INT) CREATE TABLE conference (cid INT, homepage VARCHAR, name VARCHAR)
return me the paper after 2000 in VLDB conference with more than 200 citations .
SELECT publication.title FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.citation_num > 200 AND publication.year > 2000
SELECT "publication"."title" FROM "conference" JOIN "publication" ON "conference"."cid" = "publication"."cid" AND "publication"."citation_num" > 200 AND "publication"."year" > 2000 WHERE "conference"."name" = 'VLDB'
0.209961
CREATE TABLE table_7772 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT)
What was the score of T3 place?
SELECT "Score" FROM table_7772 WHERE "Place" = 't3'
SELECT "Score" FROM "table_7772" WHERE "Place" = 't3'
0.051758
CREATE TABLE table_61331 ("Outcome" TEXT, "Date" FLOAT, "Tournament" TEXT, "Surface" TEXT, "Partner" TEXT, "Opponents in the final" TEXT, "Score in the final" TEXT)
Name the Surface which has a Score in the final of 6 3, 6 2 and Opponents in the final of mansour bahrami diego p rez?
SELECT "Surface" FROM table_61331 WHERE "Score in the final" = '6–3, 6–2' AND "Opponents in the final" = 'mansour bahrami diego pérez'
SELECT "Surface" FROM "table_61331" WHERE "Opponents in the final" = 'mansour bahrami diego pérez' AND "Score in the final" = '6–3, 6–2'
0.132813
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
the first time when they visited the hospital last time patient 10539 received a dx ultrasound-thorax nec treatment?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dx ultrasound-thorax nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10539 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY procedures_icd.charttime LIMIT 1
SELECT "procedures_icd"."charttime" FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'dx ultrasound-thorax nec' WHERE "procedures_icd"."hadm_id" IN (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 10539 AND NOT "admissions"."dischtime" IS NULL ORDER BY "admissions"."admittime" DESC NULLS LAST LIMIT 1) ORDER BY "procedures_icd"."charttime" NULLS FIRST LIMIT 1
0.483398
CREATE TABLE Parties_in_Events (Party_ID INT, Event_ID INT, Role_Code CHAR) CREATE TABLE Parties (Party_ID INT, Party_Details VARCHAR) CREATE TABLE Finances (Finance_ID INT, Other_Details VARCHAR) CREATE TABLE Locations (Location_ID INT, Other_Details VARCHAR) CREATE TABLE Channels (Channel_ID INT, Other_Details VARCHAR) CREATE TABLE Products (Product_ID INT, Product_Type_Code CHAR, Product_Name VARCHAR, Product_Price DECIMAL) CREATE TABLE Agreements (Document_ID INT, Event_ID INT) CREATE TABLE Events (Event_ID INT, Address_ID INT, Channel_ID INT, Event_Type_Code CHAR, Finance_ID INT, Location_ID INT) CREATE TABLE Assets (Asset_ID INT, Other_Details VARCHAR) CREATE TABLE Products_in_Events (Product_in_Event_ID INT, Event_ID INT, Product_ID INT) CREATE TABLE Addresses (Address_ID INT, address_details VARCHAR) CREATE TABLE Assets_in_Events (Asset_ID INT, Event_ID INT)
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" AS "T1" JOIN "Products_in_Events" AS "T2" ON "T1"."Product_ID" = "T2"."Product_ID" GROUP BY "T1"."Product_Name"
0.155273
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
how many patients whose diagnoses long title is cerebral thrombosis with cerebral infarction and lab test fluid is cerebrospinal fluid (csf)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Cerebral thrombosis with cerebral infarction" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Cerebral thrombosis with cerebral infarction" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "Cerebrospinal Fluid (CSF)" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id"
0.310547
CREATE TABLE table_57858 ("Year" FLOAT, "Chassis" TEXT, "Engine" TEXT, "Tyres" TEXT, "Points" FLOAT)
What is the earliest year for 9 points?
SELECT MIN("Year") FROM table_57858 WHERE "Points" = '9'
SELECT MIN("Year") FROM "table_57858" WHERE "Points" = '9'
0.056641
CREATE TABLE table_62187 ("Name" TEXT, "Championship" FLOAT, "League Cup" FLOAT, "FA Cup" FLOAT, "Total" FLOAT)
What is the average total for less than 1 championship?
SELECT AVG("Total") FROM table_62187 WHERE "Championship" < '1'
SELECT AVG("Total") FROM "table_62187" WHERE "Championship" < '1'
0.063477
CREATE TABLE table_name_2 (second VARCHAR, fourth VARCHAR, fifth VARCHAR, sixth VARCHAR)
What team placed second during the season where Western Australia placed fifth, South Australia placed sixth, and Tasmania placed fourth?
SELECT second FROM table_name_2 WHERE fifth = "western australia" AND sixth = "south australia" AND fourth = "tasmania"
SELECT "second" FROM "table_name_2" WHERE "fifth" = "western australia" AND "fourth" = "tasmania" AND "sixth" = "south australia"
0.125977
CREATE TABLE table_name_85 (player VARCHAR, place VARCHAR, country VARCHAR)
What is the name of the player with t6 as his place and a country of United states?
SELECT player FROM table_name_85 WHERE place = "t6" AND country = "united states"
SELECT "player" FROM "table_name_85" WHERE "country" = "united states" AND "place" = "t6"
0.086914
CREATE TABLE table_name_42 (wins INT, goal_difference VARCHAR, draws VARCHAR)
Can you tell me the average Wins that has the Goal Difference larger than -24, and the Draws larger than 7?
SELECT AVG(wins) FROM table_name_42 WHERE goal_difference > -24 AND draws > 7
SELECT AVG("wins") FROM "table_name_42" WHERE "draws" > 7 AND "goal_difference" > -24
0.083008
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
tell me the total number of patients in the hospital last year?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "patient" WHERE DATETIME("patient"."hospitaladmittime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
0.172852
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
TeX.SX \\ corruption (based on user ID).
SELECT Id AS "post_link", 'site://posts/' + CAST(Id AS TEXT) + '/edit|' + 'Edit' AS "edit_link", CreationDate FROM Posts WHERE (REPLACE(REPLACE(Body, '\\', ''), ' ', 'X') LIKE '%\XXXX%') AND (Posts.OwnerUserId = @UserId OR 0 = @UserID) ORDER BY CreationDate
SELECT "Id" AS "post_link", CONCAT(CONCAT(CONCAT('site://posts/', CAST("Id" AS TEXT)), '/edit|'), 'Edit') AS "edit_link", "CreationDate" FROM "Posts" WHERE ("Posts"."OwnerUserId" = $UserId OR $UserID = 0) AND REPLACE(REPLACE("Body", '\\', ''), ' ', 'X') LIKE '%\XXXX%' ORDER BY "CreationDate" NULLS FIRST
0.296875
CREATE TABLE table_204_130 (id DECIMAL, "#" DECIMAL, "date" TEXT, "venue" TEXT, "opponent" TEXT, "score" TEXT, "result" TEXT, "competition" TEXT)
how many consecutive times is china represented ?
SELECT COUNT(*) FROM table_204_130 WHERE "opponent" = 'china'
SELECT COUNT(*) FROM "table_204_130" WHERE "opponent" = 'china'
0.061523
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
what is maximum age of patients whose gender is f and age is greater than or equal to 24?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.age >= "24"
SELECT MAX("demographic"."age") FROM "demographic" WHERE "24" <= "demographic"."age" AND "F" = "demographic"."gender"
0.114258
CREATE TABLE table_59562 ("Show" TEXT, "Date" TEXT, "Official ratings ( millions ) " FLOAT, "Weekly rank" TEXT, "Share" TEXT)
Which Weekly Rank for a Live Final Show has an Official Ratings (millions) greater than 5.2?
SELECT "Weekly rank" FROM table_59562 WHERE "Official ratings (millions)" > '5.2' AND "Show" = 'live final'
SELECT "Weekly rank" FROM "table_59562" WHERE "Official ratings (millions)" > '5.2' AND "Show" = 'live final'
0.106445
CREATE TABLE table_18811741_15 (pos INT, podiums VARCHAR)
What is the highest pos for a driver with 1 podium?
SELECT MAX(pos) FROM table_18811741_15 WHERE podiums = 1
SELECT MAX("pos") FROM "table_18811741_15" WHERE "podiums" = 1
0.060547
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT) CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
what are the drugs prescribed to the pancreatic tumor - pancreatic ca male patients aged 30s five most frequently in the same month after they have been diagnosed with pancreatic tumor - pancreatic ca?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pancreatic tumor - pancreatic ca') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.gender = 'male' AND patient.age BETWEEN 30 AND 39) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.drugstarttime, 'start of month') GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 5
WITH "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" AND "patient"."age" <= 39 AND "patient"."age" >= 30 AND "patient"."gender" = 'male'), "t3" AS (SELECT "t2"."drugname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" AS "t2" ON "diagnosis"."diagnosistime" < "t2"."drugstarttime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime", 'start of month') = DATETIME("t2"."drugstarttime", 'start of month') WHERE "diagnosis"."diagnosisname" = 'pancreatic tumor - pancreatic ca' GROUP BY "t2"."drugname") SELECT "t3"."drugname" FROM "t3" AS "t3" WHERE "t3"."c1" <= 5
0.844727
CREATE TABLE table_name_70 (rank INT, time VARCHAR)
what is the rank when the time is 3:12.40?
SELECT SUM(rank) FROM table_name_70 WHERE time = "3:12.40"
SELECT SUM("rank") FROM "table_name_70" WHERE "3:12.40" = "time"
0.0625
CREATE TABLE table_name_45 (gain VARCHAR, loss VARCHAR, long VARCHAR)
How many gains were there for the player who had a loss greater than 57 and a long less than 55?
SELECT COUNT(gain) FROM table_name_45 WHERE loss > 57 AND long < 55
SELECT COUNT("gain") FROM "table_name_45" WHERE "long" < 55 AND "loss" > 57
0.073242
CREATE TABLE table_name_76 (club VARCHAR, founded VARCHAR, league VARCHAR)
Which Club has a Founded smaller than 1882, and a League of fa premier league?
SELECT club FROM table_name_76 WHERE founded < 1882 AND league = "fa premier league"
SELECT "club" FROM "table_name_76" WHERE "fa premier league" = "league" AND "founded" < 1882
0.089844
CREATE TABLE table_name_74 (gold INT, silver VARCHAR, nation VARCHAR)
How many golds does Germany have with more than 1 silver?
SELECT SUM(gold) FROM table_name_74 WHERE silver > 1 AND nation = "germany"
SELECT SUM("gold") FROM "table_name_74" WHERE "germany" = "nation" AND "silver" > 1
0.081055
CREATE TABLE table_name_87 (score VARCHAR, place VARCHAR)
What score has 3 as the place?
SELECT score FROM table_name_87 WHERE place = "3"
SELECT "score" FROM "table_name_87" WHERE "3" = "place"
0.053711
CREATE TABLE table_39836 ("Rank" TEXT, "s Wicket" TEXT, "Player" TEXT, "Matches" TEXT, "Average" TEXT)
What rank has andy bichel (qld) as the player?
SELECT "Rank" FROM table_39836 WHERE "Player" = 'andy bichel (qld)'
SELECT "Rank" FROM "table_39836" WHERE "Player" = 'andy bichel (qld)'
0.067383
CREATE TABLE table_11961582_7 (location_attendance VARCHAR, date VARCHAR)
What was the attendance on March 17?
SELECT location_attendance FROM table_11961582_7 WHERE date = "March 17"
SELECT "location_attendance" FROM "table_11961582_7" WHERE "March 17" = "date"
0.076172
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME) CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
what were the top three most common lab tests for the patients with the age 20s in 2100?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND STRFTIME('%y', lab.labresulttime) = '2100' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3
WITH "_u_0" AS (SELECT "patient"."patientunitstayid" FROM "patient" WHERE "patient"."age" <= 29 AND "patient"."age" >= 20 GROUP BY "patientunitstayid"), "t1" AS (SELECT "lab"."labname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "lab" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "lab"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y', "lab"."labresulttime") = '2100' GROUP BY "lab"."labname") SELECT "t1"."labname" FROM "t1" AS "t1" WHERE "t1"."c1" <= 3
0.480469
CREATE TABLE table_name_55 (kaine__d_ VARCHAR, date VARCHAR)
What was Kaine's (D) percentage in the poll on October 30, 2005?
SELECT kaine__d_ FROM table_name_55 WHERE date = "october 30, 2005"
SELECT "kaine__d_" FROM "table_name_55" WHERE "date" = "october 30, 2005"
0.071289
CREATE TABLE table_75475 ("Game" FLOAT, "February" FLOAT, "Opponent" TEXT, "Score" TEXT, "Record" TEXT, "Points" FLOAT)
How many games have a record of 30 25 9 and more points than 69?
SELECT COUNT("Game") FROM table_75475 WHERE "Record" = '30–25–9' AND "Points" > '69'
SELECT COUNT("Game") FROM "table_75475" WHERE "Points" > '69' AND "Record" = '30–25–9'
0.083984
CREATE TABLE table_name_10 (opponent VARCHAR, week VARCHAR)
Who was the opponent on week 3?
SELECT opponent FROM table_name_10 WHERE week = 3
SELECT "opponent" FROM "table_name_10" WHERE "week" = 3
0.053711
CREATE TABLE customer_policies (policy_id DECIMAL, customer_id DECIMAL, policy_type_code TEXT, start_date TIME, end_date TIME) CREATE TABLE customers (customer_id DECIMAL, customer_details TEXT) CREATE TABLE settlements (settlement_id DECIMAL, claim_id DECIMAL, date_claim_made TIME, date_claim_settled TIME, amount_claimed DECIMAL, amount_settled DECIMAL, customer_policy_id DECIMAL) CREATE TABLE payments (payment_id DECIMAL, settlement_id DECIMAL, payment_method_code TEXT, date_payment_made TIME, amount_payment DECIMAL) CREATE TABLE claims (claim_id DECIMAL, policy_id DECIMAL, date_claim_made TIME, date_claim_settled TIME, amount_claimed DECIMAL, amount_settled DECIMAL)
Which claim incurred the most number of settlements? List the claim id, the date the claim was made, and the number.
SELECT T1.claim_id, T1.date_claim_made, COUNT(*) FROM claims AS T1 JOIN settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY COUNT(*) DESC LIMIT 1
SELECT "T1"."claim_id", "T1"."date_claim_made", COUNT(*) FROM "claims" AS "T1" JOIN "settlements" AS "T2" ON "T1"."claim_id" = "T2"."claim_id" GROUP BY "T1"."claim_id" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1
0.204102
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
Top Users with most rejected Edits.
SELECT OwnerUserId AS "user_link", COUNT(*) FROM SuggestedEdits WHERE ApprovalDate IS NULL AND NOT RejectionDate IS NULL GROUP BY OwnerUserId ORDER BY COUNT(*) DESC LIMIT 10
SELECT "OwnerUserId" AS "user_link", COUNT(*) FROM "SuggestedEdits" WHERE "ApprovalDate" IS NULL AND NOT "RejectionDate" IS NULL GROUP BY "OwnerUserId" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 10
0.189453
CREATE TABLE table_39522 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Game site" TEXT, "Record" TEXT, "Attendance" TEXT)
What was the Result on October 27, 2002?
SELECT "Result" FROM table_39522 WHERE "Date" = 'october 27, 2002'
SELECT "Result" FROM "table_39522" WHERE "Date" = 'october 27, 2002'
0.066406
CREATE TABLE table_name_58 (bronze INT, gold VARCHAR, silver VARCHAR, total VARCHAR)
What is the lowest bronze a team with 9 silvers, a total larger than 13, and more than 13 gold medals has?
SELECT MIN(bronze) FROM table_name_58 WHERE silver = 9 AND total > 13 AND gold > 13
SELECT MIN("bronze") FROM "table_name_58" WHERE "gold" > 13 AND "silver" = 9 AND "total" > 13
0.09082
CREATE TABLE table_53634 ("Team" TEXT, "Hosted" FLOAT, "Average" FLOAT, "Highest" FLOAT, "Lowest" FLOAT, "Total" FLOAT, "Last Year" FLOAT, "Up/Down" TEXT)
How many were hosted whene the average attendance was 27,638?
SELECT COUNT("Hosted") FROM table_53634 WHERE "Average" = '27,638'
SELECT COUNT("Hosted") FROM "table_53634" WHERE "Average" = '27,638'
0.066406
CREATE TABLE stadium (ID INT, name TEXT, Capacity INT, City TEXT, Country TEXT, Opening_year INT) CREATE TABLE event (ID INT, Name TEXT, Stadium_ID INT, Year TEXT) CREATE TABLE swimmer (ID INT, name TEXT, Nationality TEXT, meter_100 FLOAT, meter_200 TEXT, meter_300 TEXT, meter_400 TEXT, meter_500 TEXT, meter_600 TEXT, meter_700 TEXT, Time TEXT) CREATE TABLE record (ID INT, Result TEXT, Swimmer_ID INT, Event_ID INT)
Draw a bar chart about the distribution of meter_300 and ID , and order by the names in ascending.
SELECT meter_300, ID FROM swimmer ORDER BY meter_300
SELECT "meter_300", "ID" FROM "swimmer" ORDER BY "meter_300" NULLS FIRST
0.070313
CREATE TABLE table_71436 ("Year" FLOAT, "Team" TEXT, "Co-Drivers" TEXT, "Class" TEXT, "Laps" FLOAT, "Pos." TEXT, "Class Pos." TEXT)
What year has WSC class?
SELECT "Year" FROM table_71436 WHERE "Class" = 'wsc'
SELECT "Year" FROM "table_71436" WHERE "Class" = 'wsc'
0.052734
CREATE TABLE table_12632 ("Date" TEXT, "Opponent" TEXT, "Score" TEXT, "Decision" TEXT, "Attendance" FLOAT, "Record" TEXT)
What is the record on January 18?
SELECT "Record" FROM table_12632 WHERE "Date" = 'january 18'
SELECT "Record" FROM "table_12632" WHERE "Date" = 'january 18'
0.060547
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
i mean how many days has it been since the first time patient 006-133605 had a volume (ml) magnesium intake on the current intensive care unit visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605') AND patient.unitdischargetime IS NULL) AND intakeoutput.celllabel = 'volume (ml) magnesium' AND intakeoutput.cellpath LIKE '%intake%' ORDER BY intakeoutput.intakeoutputtime LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-133605' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE "patient"."unitdischargetime" IS NULL AND NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "intakeoutput"."intakeoutputtime")) FROM "intakeoutput" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'volume (ml) magnesium' AND "intakeoutput"."cellpath" LIKE '%intake%' AND NOT "_u_1"."" IS NULL ORDER BY "intakeoutput"."intakeoutputtime" NULLS FIRST LIMIT 1
0.768555
CREATE TABLE table_16503 ("Team" TEXT, "Outgoing manager" TEXT, "Manner of departure" TEXT, "Date of vacancy" TEXT, "Replaced by" TEXT, "Date of appointment" TEXT, "Position" TEXT)
When are team Galway's dates of appointment?
SELECT "Date of appointment" FROM table_16503 WHERE "Team" = 'Galway'
SELECT "Date of appointment" FROM "table_16503" WHERE "Team" = 'Galway'
0.069336
CREATE TABLE constructorstandings (constructorstandingsid DECIMAL, raceid DECIMAL, constructorid DECIMAL, points DECIMAL, position DECIMAL, positiontext TEXT, wins DECIMAL) CREATE TABLE laptimes (raceid DECIMAL, driverid DECIMAL, lap DECIMAL, position DECIMAL, time TEXT, milliseconds DECIMAL) CREATE TABLE status (statusid DECIMAL, status TEXT) CREATE TABLE constructors (constructorid DECIMAL, constructorref TEXT, name TEXT, nationality TEXT, url TEXT) CREATE TABLE races (raceid DECIMAL, year DECIMAL, round DECIMAL, circuitid DECIMAL, name TEXT, date TEXT, time TEXT, url TEXT) CREATE TABLE qualifying (qualifyid DECIMAL, raceid DECIMAL, driverid DECIMAL, constructorid DECIMAL, number DECIMAL, position DECIMAL, q1 TEXT, q2 TEXT, q3 TEXT) CREATE TABLE drivers (driverid DECIMAL, driverref TEXT, number DECIMAL, code TEXT, forename TEXT, surname TEXT, dob TEXT, nationality TEXT, url TEXT) CREATE TABLE circuits (circuitid DECIMAL, circuitref TEXT, name TEXT, location TEXT, country TEXT, lat DECIMAL, lng DECIMAL, alt DECIMAL, url TEXT) CREATE TABLE driverstandings (driverstandingsid DECIMAL, raceid DECIMAL, driverid DECIMAL, points DECIMAL, position DECIMAL, positiontext TEXT, wins DECIMAL) CREATE TABLE constructorresults (constructorresultsid DECIMAL, raceid DECIMAL, constructorid DECIMAL, points DECIMAL, status DECIMAL) CREATE TABLE pitstops (raceid DECIMAL, driverid DECIMAL, stop DECIMAL, lap DECIMAL, time TEXT, duration TEXT, milliseconds DECIMAL) CREATE TABLE seasons (year DECIMAL, url TEXT) CREATE TABLE results (resultid DECIMAL, raceid DECIMAL, driverid DECIMAL, constructorid DECIMAL, number DECIMAL, grid DECIMAL, position DECIMAL, positiontext TEXT, positionorder DECIMAL, points DECIMAL, laps DECIMAL, time TEXT, milliseconds DECIMAL, fastestlap DECIMAL, rank DECIMAL, fastestlaptime TEXT, fastestlapspeed TEXT, statusid DECIMAL)
What is the name and date of the most recent race?
SELECT name, date FROM races ORDER BY date DESC LIMIT 1
SELECT "name", "date" FROM "races" ORDER BY "date" DESC NULLS LAST LIMIT 1
0.072266
CREATE TABLE table_47268 ("Name" TEXT, "Years" TEXT, "League" FLOAT, "Scottish Cup" FLOAT, "League Cup" FLOAT, "Europe" FLOAT, "Total" FLOAT)
Which Total has a Name of eoin jess category:articles with hcards, and a Scottish Cup larger than 23?
SELECT MIN("Total") FROM table_47268 WHERE "Name" = 'eoin jess category:articles with hcards' AND "Scottish Cup" > '23'
SELECT MIN("Total") FROM "table_47268" WHERE "Name" = 'eoin jess category:articles with hcards' AND "Scottish Cup" > '23'
0.118164
CREATE TABLE manufacturer (Manufacturer_ID INT, Open_Year FLOAT, Name TEXT, Num_of_Factories INT, Num_of_Shops INT) CREATE TABLE furniture_manufacte (Manufacturer_ID INT, Furniture_ID INT, Price_in_Dollar FLOAT) CREATE TABLE furniture (Furniture_ID INT, Name TEXT, Num_of_Component INT, Market_Rate FLOAT)
Please give me a bar chart to show the market share of different furniture name, which no any company is producing in our records by a pie chart, list in ascending by the bar.
SELECT Name, Market_Rate FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte) ORDER BY Name
SELECT "Name", "Market_Rate" FROM "furniture" WHERE NOT "Furniture_ID" IN (SELECT "Furniture_ID" FROM "furniture_manufacte") ORDER BY "Name" NULLS FIRST
0.148438
CREATE TABLE table_41281 ("Season" TEXT, "Skip" TEXT, "Third" TEXT, "Second" TEXT, "Lead" TEXT)
What is the Lead for the 1999 00 season?
SELECT "Lead" FROM table_41281 WHERE "Season" = '1999–00'
SELECT "Lead" FROM "table_41281" WHERE "Season" = '1999–00'
0.057617
CREATE TABLE table_69240 ("Team 1" TEXT, "Agg." TEXT, "Team 2" TEXT, "1st leg" TEXT, "2nd leg" TEXT)
What team 2 had a 1st leg of 1-1, and agg of 3-1?
SELECT "Team 2" FROM table_69240 WHERE "1st leg" = '1-1' AND "Agg." = '3-1'
SELECT "Team 2" FROM "table_69240" WHERE "1st leg" = '1-1' AND "Agg." = '3-1'
0.075195
CREATE TABLE table_76353 ("Club" TEXT, "Played" TEXT, "Drawn" TEXT, "Lost" TEXT, "Points for" TEXT, "Points against" TEXT, "Tries for" TEXT, "Tries against" TEXT, "Try bonus" TEXT, "Losing bonus" TEXT, "Points" TEXT)
what is lost when the points against is 231?
SELECT "Lost" FROM table_76353 WHERE "Points against" = '231'
SELECT "Lost" FROM "table_76353" WHERE "Points against" = '231'
0.061523
CREATE TABLE table_name_61 (date VARCHAR, series VARCHAR)
On which date did the Winfield Triple Challenge series take place?
SELECT date FROM table_name_61 WHERE series = "winfield triple challenge"
SELECT "date" FROM "table_name_61" WHERE "series" = "winfield triple challenge"
0.077148
CREATE TABLE table_12310814_1 (original_artist VARCHAR, episode VARCHAR)
What's the original artist of the song performed in the top 3 episode?
SELECT original_artist FROM table_12310814_1 WHERE episode = "Top 3"
SELECT "original_artist" FROM "table_12310814_1" WHERE "Top 3" = "episode"
0.072266
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
Post edits on your owned posts not by you.
SELECT Id, Id AS "post_link", Score FROM Posts WHERE Posts.OwnerUserId != @UserID AND Posts.LastEditorUserId = @UserID
SELECT "Id", "Id" AS "post_link", "Score" FROM "Posts" WHERE "Posts"."LastEditorUserId" = $UserID AND "Posts"."OwnerUserId" <> $UserID
0.130859
CREATE TABLE management (department_id DECIMAL, head_id DECIMAL, temporary_acting TEXT) CREATE TABLE head (head_id DECIMAL, name TEXT, born_state TEXT, age DECIMAL) CREATE TABLE department (department_id DECIMAL, name TEXT, creation TEXT, ranking DECIMAL, budget_in_billions DECIMAL, num_employees DECIMAL)
In which year were most departments established?
SELECT creation FROM department GROUP BY creation ORDER BY COUNT(*) DESC LIMIT 1
SELECT "creation" FROM "department" GROUP BY "creation" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1
0.094727
CREATE TABLE table_1515346_2 (country VARCHAR, honoree_s_ VARCHAR)
How many countries does honoree Roberto de Vicenzo represent?
SELECT COUNT(country) FROM table_1515346_2 WHERE honoree_s_ = "Roberto De Vicenzo"
SELECT COUNT("country") FROM "table_1515346_2" WHERE "Roberto De Vicenzo" = "honoree_s_"
0.085938
CREATE TABLE table_name_64 (attendance INT, opponent VARCHAR)
I want the greatest attendance when the opponent is the chicago bears
SELECT MAX(attendance) FROM table_name_64 WHERE opponent = "chicago bears"
SELECT MAX("attendance") FROM "table_name_64" WHERE "chicago bears" = "opponent"
0.078125
CREATE TABLE table_name_14 (result VARCHAR, stadium VARCHAR)
What was the score of the game at RIch Stadium?
SELECT result FROM table_name_14 WHERE stadium = "rich stadium"
SELECT "result" FROM "table_name_14" WHERE "rich stadium" = "stadium"
0.067383
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
when is the last time that patient 19147 has had a heart rate measured on 04/05/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 = 19147)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') AND STRFTIME('%y-%m-%d', chartevents.charttime) = '2105-04-05' ORDER BY chartevents.charttime DESC LIMIT 1
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 19147 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'heart rate' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT "chartevents"."charttime" FROM "chartevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m-%d', "chartevents"."charttime") = '2105-04-05' ORDER BY "chartevents"."charttime" DESC NULLS LAST LIMIT 1
0.793945
CREATE TABLE table_48947 ("Heat" FLOAT, "Lane" FLOAT, "Name" TEXT, "Country" TEXT, "Mark" TEXT)
What is the total Lane with a Mark of 47.02, and a Heat higher than 5?
SELECT SUM("Lane") FROM table_48947 WHERE "Mark" = '47.02' AND "Heat" > '5'
SELECT SUM("Lane") FROM "table_48947" WHERE "Heat" > '5' AND "Mark" = '47.02'
0.075195
CREATE TABLE table_63733 ("Pick" FLOAT, "Team" TEXT, "Player" TEXT, "Position" TEXT, "College" TEXT)
What is the team when the college is virginia tech?
SELECT "Team" FROM table_63733 WHERE "College" = 'virginia tech'
SELECT "Team" FROM "table_63733" WHERE "College" = 'virginia tech'
0.064453
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
Posts tagged with only one selected tag, plus the score and number of answers. Finds posts tagged only with the one tag input below.
SELECT Id AS "post_link", Score, AnswerCount FROM Posts WHERE PostTypeId = 1 AND Tags = '<##Tag##>' AND ClosedDate IS NULL ORDER BY CreationDate DESC
SELECT "Id" AS "post_link", "Score", "AnswerCount" FROM "Posts" WHERE "ClosedDate" IS NULL AND "PostTypeId" = 1 AND "Tags" = '<##Tag##>' ORDER BY "CreationDate" DESC NULLS LAST
0.171875
CREATE TABLE table_1966992_1 (administrative_capital VARCHAR, lga_name VARCHAR)
What is the administrative capital of LGA name Akuku-Toru?
SELECT administrative_capital FROM table_1966992_1 WHERE lga_name = "Akuku-Toru"
SELECT "administrative_capital" FROM "table_1966992_1" WHERE "Akuku-Toru" = "lga_name"
0.083984
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
Rank users by number of questions and give average vote N>10.
SELECT * FROM (SELECT u.DisplayName AS UserName, COUNT(*) AS Nquestions, SUM(q.Score) AS TotalVotes, ROUND(SUM(q.Score) / (1.0 * COUNT(*)), 2) AS AverageVotes FROM Posts AS q INNER JOIN Users AS u ON q.OwnerUserId = u.Id WHERE q.PostTypeId = 1 GROUP BY u.DisplayName) AS a WHERE a.Nquestions > 10 ORDER BY a.AverageVotes DESC, a.Nquestions DESC
WITH "a" AS (SELECT "u"."DisplayName" AS "UserName", COUNT(*) AS "Nquestions", SUM("q"."Score") AS "TotalVotes", ROUND(SUM("q"."Score") / NULLIF((1.0 * COUNT(*)), 0), 2) AS "AverageVotes" FROM "Posts" AS "q" JOIN "Users" AS "u" ON "q"."OwnerUserId" = "u"."Id" WHERE "q"."PostTypeId" = 1 GROUP BY "u"."DisplayName") SELECT * FROM "a" AS "a" WHERE "a"."Nquestions" > 10 ORDER BY "a"."AverageVotes" DESC NULLS LAST, "a"."Nquestions" DESC NULLS LAST
0.43457
CREATE TABLE table_29472 ("Team" TEXT, "Head coach" TEXT, "Team captain" TEXT, "Kit maker" TEXT, "Shirt sponsor" TEXT, "Past Season" TEXT)
What is the kit maker for team foolad?
SELECT "Kit maker" FROM table_29472 WHERE "Team" = 'Foolad'
SELECT "Kit maker" FROM "table_29472" WHERE "Team" = 'Foolad'
0.05957
CREATE TABLE table_25498 ("Game" FLOAT, "Date" TEXT, "Team" TEXT, "Score" TEXT, "High points" TEXT, "High rebounds" TEXT, "High assists" TEXT, "Location Attendance" TEXT, "Record" TEXT)
What was the date for the record 23-13?
SELECT "Date" FROM table_25498 WHERE "Record" = '23-13'
SELECT "Date" FROM "table_25498" WHERE "Record" = '23-13'
0.055664
CREATE TABLE table_1272033_1 (previous_champion_s_ VARCHAR, champion_s_ VARCHAR)
Who was the champion prior to Xix Xavant?
SELECT previous_champion_s_ FROM table_1272033_1 WHERE champion_s_ = "Xix Xavant"
SELECT "previous_champion_s_" FROM "table_1272033_1" WHERE "Xix Xavant" = "champion_s_"
0.084961
CREATE TABLE table_15726 ("State" TEXT, "Name" TEXT, "Hometown" TEXT, "Age 1" FLOAT, "Height" TEXT)
Which state's delegate is from Lexington, Ky and is 5'4' tall?
SELECT "State" FROM table_15726 WHERE "Height" = '5''4' AND "Hometown" = 'lexington, ky'
SELECT "State" FROM "table_15726" WHERE "Height" = '5\'4' AND "Hometown" = 'lexington, ky'
0.087891
CREATE TABLE table_28211103_1 (winner VARCHAR, st_kilda_score VARCHAR)
How many winners have st kilda score at 14.11.95?
SELECT COUNT(winner) FROM table_28211103_1 WHERE st_kilda_score = "14.11.95"
SELECT COUNT("winner") FROM "table_28211103_1" WHERE "14.11.95" = "st_kilda_score"
0.080078
CREATE TABLE table_train_74 ("id" INT, "gender" TEXT, "pregnancy_or_lactation" BOOLEAN, "mini_mental_state_examination_mmse" INT, "clinical_dementia_rating_cdr" FLOAT, "age" FLOAT, "NOUSE" FLOAT)
mini mental state examination ( mmse ) >= 18
SELECT * FROM table_train_74 WHERE mini_mental_state_examination_mmse >= 18
SELECT * FROM "table_train_74" WHERE "mini_mental_state_examination_mmse" >= 18
0.077148
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
# Questions asked with 0 answers.
SELECT Users.Id AS "user_link", Reputation, COUNT(Posts.Id) AS QuestionsAskedWithoutAnswers FROM Posts LEFT JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Posts.PostTypeId = 1 AND AnswerCount = 0 GROUP BY Users.Id, Reputation ORDER BY COUNT(Posts.Id) DESC LIMIT 10
SELECT "Users"."Id" AS "user_link", "Reputation", COUNT("Posts"."Id") AS "QuestionsAskedWithoutAnswers" FROM "Posts" LEFT JOIN "Users" ON "Posts"."OwnerUserId" = "Users"."Id" WHERE "AnswerCount" = 0 AND "Posts"."PostTypeId" = 1 GROUP BY "Users"."Id", "Reputation" ORDER BY COUNT("Posts"."Id") DESC NULLS LAST LIMIT 10
0.30957
CREATE TABLE table_34940 ("Date" TEXT, "Opponent#" TEXT, "Site" TEXT, "Result" TEXT, "Attendance" TEXT)
What is the Date at memorial stadium minneapolis, mn with an Attendance of 20,000, and a Result of w52-0?
SELECT "Date" FROM table_34940 WHERE "Site" = 'memorial stadium • minneapolis, mn' AND "Attendance" = '20,000' AND "Result" = 'w52-0'
SELECT "Date" FROM "table_34940" WHERE "Attendance" = '20,000' AND "Result" = 'w52-0' AND "Site" = 'memorial stadium • minneapolis, mn'
0.131836
CREATE TABLE table_train_93 ("id" INT, "mini_mental_state_examination_mmse" INT, "creatinine_clearance_cl" FLOAT, "cornell_scale_for_depression_in_dementia_csdd" INT, "clinical_dementia_rating_cdr" FLOAT, "NOUSE" FLOAT)
creatinine clearance < 30 ml / min
SELECT * FROM table_train_93 WHERE creatinine_clearance_cl < 30
SELECT * FROM "table_train_93" WHERE "creatinine_clearance_cl" < 30
0.06543
CREATE TABLE table_25755 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Original air date" TEXT, "Production code" TEXT, "U.S. viewers ( millions ) " TEXT)
What is the original air date of the episode written by David Zuckerman?
SELECT "Original air date" FROM table_25755 WHERE "Written by" = 'David Zuckerman'
SELECT "Original air date" FROM "table_25755" WHERE "Written by" = 'David Zuckerman'
0.082031
CREATE TABLE table_name_15 (high_rebounds VARCHAR, date VARCHAR)
Who had the highest rebounds of the game on April 7?
SELECT high_rebounds FROM table_name_15 WHERE date = "april 7"
SELECT "high_rebounds" FROM "table_name_15" WHERE "april 7" = "date"
0.066406
CREATE TABLE table_test_6 ("id" INT, "scr" INT, "anemia" BOOLEAN, "blood_hemoglobin" INT, "bleeding" INT, "hemorrhagic_diseases" BOOLEAN, "stroke" BOOLEAN, "blood_platelet_counts" INT, "trauma" BOOLEAN, "renal_disease" BOOLEAN, "hematocrit_hct" FLOAT, "hepatic_disease" BOOLEAN, "polyglobulia" BOOLEAN, "estimated_glomerular_filtration_rate_egfr" INT, "non_ischemic_stroke" BOOLEAN, "surgery" BOOLEAN, "NOUSE" FLOAT)
history of stroke in 6 months;
SELECT * FROM table_test_6 WHERE stroke = 1
SELECT * FROM "table_test_6" WHERE "stroke" = 1
0.045898