schema
stringlengths 28
6.63k
| question
stringlengths 0
990
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
9.72k
| weight
float64 0
9.49
|
---|---|---|---|---|
CREATE TABLE genre (gid INTEGER, genre VARCHAR(MAX))
CREATE TABLE cast (id INTEGER, msid INTEGER, aid INTEGER, role VARCHAR(MAX))
CREATE TABLE copyright (id INTEGER, msid INTEGER, cid INTEGER)
CREATE TABLE company (id INTEGER, name VARCHAR(MAX), country_code VARCHAR)
CREATE TABLE made_by (id INTEGER, msid INTEGER, pid INTEGER)
CREATE TABLE written_by (id INTEGER, msid INTEGER, wid INTEGER)
CREATE TABLE producer (pid INTEGER, gender VARCHAR(MAX), name VARCHAR(MAX), nationality VARCHAR(MAX), birth_city VARCHAR(MAX), birth_year INTEGER)
CREATE TABLE writer (wid INTEGER, gender VARCHAR(MAX), name VARCHAR(MAX), nationality VARCHAR(MAX), birth_city VARCHAR(MAX), birth_year INTEGER)
CREATE TABLE keyword (id INTEGER, keyword VARCHAR(MAX))
CREATE TABLE director (did INTEGER, gender VARCHAR(MAX), name VARCHAR(MAX), nationality VARCHAR(MAX), birth_city VARCHAR(MAX), birth_year INTEGER)
CREATE TABLE actor (aid INTEGER, gender VARCHAR(MAX), name VARCHAR(MAX), nationality VARCHAR(MAX), birth_city VARCHAR(MAX), birth_year INTEGER)
CREATE TABLE tv_series (sid INTEGER, title VARCHAR(MAX), release_year INTEGER, num_of_seasons INTEGER, num_of_episodes INTEGER, title_aka VARCHAR(MAX), budget VARCHAR(MAX))
CREATE TABLE tags (id INTEGER, msid INTEGER, kid INTEGER)
CREATE TABLE directed_by (id INTEGER, msid INTEGER, did INTEGER)
CREATE TABLE classification (id INTEGER, msid INTEGER, gid INTEGER)
CREATE TABLE movie (mid INTEGER, title VARCHAR(MAX), release_year INTEGER, title_aka VARCHAR(MAX), budget VARCHAR(MAX))
| who acted the role of ' Mr. Bean | SELECT actor.name FROM actor, cast WHERE cast.aid = actor.aid AND cast.role = 'Mr. Bean' | SELECT [actor].[name] FROM [actor] JOIN [cast] ON [actor].[aid] = [cast].[aid] AND [cast].[role] = 'Mr. Bean' | 0.106445 |
CREATE TABLE Participants_in_Events (event_id VARCHAR, Participant_ID VARCHAR)
CREATE TABLE Participants (Participant_ID VARCHAR)
CREATE TABLE EVENTS (event_id VARCHAR, Participant_Details VARCHAR)
| Which events id does not have any participant with detail 'Kenyatta Kuhn'? | SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn' | SELECT [event_id] FROM [EVENTS] EXCEPT SELECT [T1].[event_id] FROM [Participants_in_Events] AS [T1] JOIN [Participants] AS [T2] ON [T1].[participant_id] = [T2].[participant_id] WHERE [Participant_Details] = 'Kenyatta Kuhn' | 0.216797 |
CREATE TABLE table_60541 ([Country] VARCHAR(MAX), [Date] VARCHAR(MAX), [Label] VARCHAR(MAX), [Format] VARCHAR(MAX), [Catalogue number ( s ) ] VARCHAR(MAX))
| Which Format has a Label of eagle eye media, a Catalogue number(s) of , and a Country of united states? | SELECT "Format" FROM table_60541 WHERE "Label" = 'eagle eye media' AND "Catalogue number(s)" = '—' AND "Country" = 'united states' | SELECT [Format] FROM [table_60541] WHERE [Catalogue number(s)] = '—' AND [Country] = 'united states' AND [Label] = 'eagle eye media' | 0.128906 |
CREATE TABLE table_name_66 (date VARCHAR, home_team VARCHAR)
| When did South Melbourne play as the home team? | SELECT date FROM table_name_66 WHERE home_team = "south melbourne" | SELECT [date] FROM [table_name_66] WHERE [home_team] = [south melbourne] | 0.070313 |
CREATE TABLE musical (Musical_ID INTEGER, Name VARCHAR(MAX), Year INTEGER, Award VARCHAR(MAX), Category VARCHAR(MAX), Nominee VARCHAR(MAX), Result VARCHAR(MAX))
CREATE TABLE actor (Actor_ID INTEGER, Name VARCHAR(MAX), Musical_ID INTEGER, Character VARCHAR(MAX), Duration VARCHAR(MAX), age INTEGER)
| How many actors have appeared in each musical. Show a pie chart. | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID | SELECT [T2].[name], COUNT(*) FROM [actor] AS [T1] JOIN [musical] AS [T2] ON [T1].[musical_id] = [T2].[musical_id] GROUP BY [T1].[musical_id] | 0.136719 |
CREATE TABLE table_name_28 (polyunsaturated_fat VARCHAR, monounsaturated_fat VARCHAR, smoke_point VARCHAR, total_fat VARCHAR)
| What is the polyunsaturated fat with a smoke point of c (), a total fat of 100g and 63g of monounsaturated fat? | SELECT polyunsaturated_fat FROM table_name_28 WHERE smoke_point = "°c ()" AND total_fat = "100g" AND monounsaturated_fat = "63g" | SELECT [polyunsaturated_fat] FROM [table_name_28] WHERE [100g] = [total_fat] AND [63g] = [monounsaturated_fat] AND [smoke_point] = [°c ()] | 0.134766 |
CREATE TABLE table_41403 ([Date] VARCHAR(MAX), [Tournament] VARCHAR(MAX), [Winning score] VARCHAR(MAX), [Margin of victory] VARCHAR(MAX), [Runner ( s ) -up] VARCHAR(MAX))
| Who was the runner-up on Jan 19, 1964? | SELECT "Runner(s)-up" FROM table_41403 WHERE "Date" = 'jan 19, 1964' | SELECT [Runner(s)-up] FROM [table_41403] WHERE [Date] = 'jan 19, 1964' | 0.068359 |
CREATE TABLE table_name_66 (interview INTEGER, country VARCHAR, swimsuit VARCHAR)
| What is the lowest interview score for Missouri, where the swimsuit score was highter than 9.433? | SELECT MIN(interview) FROM table_name_66 WHERE country = "missouri" AND swimsuit > 9.433 | SELECT MIN([interview]) FROM [table_name_66] WHERE [country] = [missouri] AND [swimsuit] > 9.433 | 0.09375 |
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric NUMERIC, intakeoutputtime TIME)
CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname VARCHAR(MAX), labresult NUMERIC, labresulttime TIME)
CREATE TABLE cost (costid NUMERIC, uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, eventtype VARCHAR(MAX), eventid NUMERIC, chargetime TIME, cost NUMERIC)
CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname VARCHAR(MAX), treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
| how much of a difference is there in patient 013-28507's weight second measured on the current hospital visit compared to the first value measured on the current hospital visit? | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1) - (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1) | WITH [_u_0] AS (SELECT [patient].[patienthealthsystemstayid] AS [patienthealthsystemstayid] FROM [patient] WHERE [patient].[hospitaldischargetime] IS NULL AND [patient].[uniquepid] = '013-28507' GROUP BY [patienthealthsystemstayid]) SELECT (SELECT TOP 1 [patient].[admissionweight] FROM [patient] LEFT JOIN [_u_0] AS [_u_0] ON [_u_0].[] = [patient].[patienthealthsystemstayid] WHERE NOT [_u_0].[] IS NULL AND NOT [patient].[admissionweight] IS NULL ORDER BY [patient].[unitadmittime]) - (SELECT TOP 1 [patient].[admissionweight] FROM [patient] LEFT JOIN [_u_0] AS [_u_2] ON [_u_2].[] = [patient].[patienthealthsystemstayid] WHERE NOT [_u_2].[] IS NULL AND NOT [patient].[admissionweight] IS NULL ORDER BY [patient].[unitadmittime]) | 0.713867 |
CREATE TABLE student_record (student_id INTEGER, course_id INTEGER, semester INTEGER, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE program (program_id INTEGER, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE program_requirement (program_id INTEGER, category VARCHAR, min_credit INTEGER, additional_req VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INTEGER, offering_id INTEGER, instructor_id INTEGER)
CREATE TABLE course_tags_count (course_id INTEGER, clear_grading INTEGER, pop_quiz INTEGER, group_projects INTEGER, inspirational INTEGER, long_lectures INTEGER, extra_credit INTEGER, few_tests INTEGER, good_feedback INTEGER, tough_tests INTEGER, heavy_papers INTEGER, cares_for_students INTEGER, heavy_assignments INTEGER, respected INTEGER, participation INTEGER, heavy_reading INTEGER, tough_grader INTEGER, hilarious INTEGER, would_take_again INTEGER, good_lecture INTEGER, no_skip INTEGER)
CREATE TABLE semester (semester_id INTEGER, semester VARCHAR, year INTEGER)
CREATE TABLE jobs (job_id INTEGER, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INTEGER)
CREATE TABLE program_course (program_id INTEGER, course_id INTEGER, workload INTEGER, category VARCHAR)
CREATE TABLE area (course_id INTEGER, area VARCHAR)
CREATE TABLE course_offering (offering_id INTEGER, course_id INTEGER, semester INTEGER, section_number INTEGER, 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 ta (campus_job_id INTEGER, student_id INTEGER, location VARCHAR)
CREATE TABLE course (course_id INTEGER, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INTEGER, num_enrolled INTEGER, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INTEGER, clarity_score INTEGER, easiness_score INTEGER, helpfulness_score INTEGER)
CREATE TABLE requirement (requirement_id INTEGER, requirement VARCHAR, college VARCHAR)
CREATE TABLE student (student_id INTEGER, lastname VARCHAR, firstname VARCHAR, program_id INTEGER, declare_major VARCHAR, total_credit INTEGER, total_gpa FLOAT, entered_as VARCHAR, admit_term INTEGER, predicted_graduation_semester INTEGER, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE comment_instructor (instructor_id INTEGER, student_id INTEGER, score INTEGER, comment_text VARCHAR)
CREATE TABLE gsi (course_offering_id INTEGER, student_id INTEGER)
CREATE TABLE instructor (instructor_id INTEGER, name VARCHAR, uniqname VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INTEGER, course_id INTEGER)
| On Mondays and Wednesday is 545 available to take ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 545 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | SELECT COUNT(*) > 0 FROM [course] JOIN [course_offering] ON [course].[course_id] = [course_offering].[course_id] AND [course_offering].[friday] = 'N' AND [course_offering].[monday] = 'Y' AND [course_offering].[thursday] = 'N' AND [course_offering].[tuesday] = 'N' AND [course_offering].[wednesday] = 'Y' JOIN [semester] ON [course_offering].[semester] = [semester].[semester_id] AND [semester].[semester] = 'WN' AND [semester].[year] = 2016 WHERE [course].[department] = 'EECS' AND [course].[number] = 545 | 0.493164 |
CREATE TABLE table_204_887 (id NUMERIC, [district] NUMERIC, [representative] VARCHAR(MAX), [party] VARCHAR(MAX), [residence] VARCHAR(MAX), [counties represented] VARCHAR(MAX))
| how many times is the word republican on the list ? | SELECT COUNT(*) FROM table_204_887 WHERE "party" = 'republican' | SELECT COUNT(*) FROM [table_204_887] WHERE [party] = 'republican' | 0.063477 |
CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric NUMERIC, intakeoutputtime TIME)
CREATE TABLE cost (costid NUMERIC, uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, eventtype VARCHAR(MAX), eventid NUMERIC, chargetime TIME, cost NUMERIC)
CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME)
CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname VARCHAR(MAX), treatmenttime TIME)
CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname VARCHAR(MAX), labresult NUMERIC, labresulttime TIME)
| has any procedure been performed on patient 006-205326 in a year before? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-205326')) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | WITH [_u_0] AS (SELECT [patient].[patienthealthsystemstayid] AS [patienthealthsystemstayid] FROM [patient] WHERE [patient].[uniquepid] = '006-205326' GROUP BY [patienthealthsystemstayid]), [_u_1] AS (SELECT [patient].[patientunitstayid] AS [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 [treatment] LEFT JOIN [_u_1] AS [_u_1] ON [_u_1].[] = [treatment].[patientunitstayid] WHERE DATETIME([treatment].[treatmenttime], 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT [_u_1].[] IS NULL | 0.649414 |
CREATE TABLE table_name_34 (position VARCHAR, round VARCHAR, college VARCHAR)
| Which position has a Round of 7, and a College of kansas state? | SELECT position FROM table_name_34 WHERE round = 7 AND college = "kansas state" | SELECT [position] FROM [table_name_34] WHERE [college] = [kansas state] AND [round] = 7 | 0.084961 |
CREATE TABLE airline (airline_code VARCHAR, airline_name VARCHAR(MAX), note VARCHAR(MAX))
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE flight_fare (flight_id INTEGER, fare_id INTEGER)
CREATE TABLE food_service (meal_code VARCHAR(MAX), meal_number INTEGER, compartment VARCHAR(MAX), meal_description VARCHAR)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INTEGER, high_flight_number INTEGER, dual_airline VARCHAR, service_name VARCHAR(MAX))
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INTEGER, propulsion VARCHAR, wide_body VARCHAR, wing_span INTEGER, length INTEGER, weight INTEGER, capacity INTEGER, pay_load INTEGER, cruising_speed INTEGER, range_miles INTEGER, pressurized VARCHAR)
CREATE TABLE state (state_code VARCHAR(MAX), state_name VARCHAR(MAX), country_name VARCHAR(MAX))
CREATE TABLE ground_service (city_code VARCHAR(MAX), airport_code VARCHAR(MAX), transport_type VARCHAR(MAX), ground_fare INTEGER)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INTEGER, direction VARCHAR, minutes_distant INTEGER)
CREATE TABLE time_zone (time_zone_code VARCHAR(MAX), time_zone_name VARCHAR(MAX), hours_from_gmt INTEGER)
CREATE TABLE code_description (code VARCHAR, description VARCHAR(MAX))
CREATE TABLE flight_leg (flight_id INTEGER, leg_number INTEGER, leg_flight INTEGER)
CREATE TABLE date_day (month_number INTEGER, day_number INTEGER, year INTEGER, day_name VARCHAR)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE flight_stop (flight_id INTEGER, stop_number INTEGER, stop_days VARCHAR(MAX), stop_airport VARCHAR(MAX), arrival_time INTEGER, arrival_airline VARCHAR(MAX), arrival_flight_number INTEGER, departure_time INTEGER, departure_airline VARCHAR(MAX), departure_flight_number INTEGER, stop_time INTEGER)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INTEGER, class_description VARCHAR(MAX))
CREATE TABLE flight (aircraft_code_sequence VARCHAR(MAX), airline_code VARCHAR, airline_flight VARCHAR(MAX), arrival_time INTEGER, connections INTEGER, departure_time INTEGER, dual_carrier VARCHAR(MAX), flight_days VARCHAR(MAX), flight_id INTEGER, flight_number INTEGER, from_airport VARCHAR, meal_code VARCHAR(MAX), stops INTEGER, time_elapsed INTEGER, to_airport VARCHAR)
CREATE TABLE airport (airport_code VARCHAR, airport_name VARCHAR(MAX), airport_location VARCHAR(MAX), state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INTEGER)
CREATE TABLE month (month_number INTEGER, month_name VARCHAR(MAX))
CREATE TABLE time_interval (period VARCHAR(MAX), begin_time INTEGER, end_time INTEGER)
CREATE TABLE fare (fare_id INTEGER, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code VARCHAR(MAX), fare_airline VARCHAR(MAX), restriction_code VARCHAR(MAX), one_direction_cost INTEGER, round_trip_cost INTEGER, round_trip_required VARCHAR)
CREATE TABLE fare_basis (fare_basis_code VARCHAR(MAX), booking_class VARCHAR(MAX), class_type VARCHAR(MAX), premium VARCHAR(MAX), economy VARCHAR(MAX), discounted VARCHAR(MAX), night VARCHAR(MAX), season VARCHAR(MAX), basis_days VARCHAR(MAX))
CREATE TABLE restriction (restriction_code VARCHAR(MAX), advance_purchase INTEGER, stopovers VARCHAR(MAX), saturday_stay_required VARCHAR(MAX), minimum_stay INTEGER, maximum_stay INTEGER, application VARCHAR(MAX), no_discounts VARCHAR(MAX))
| on flight US 2153 from SAN FRANCISCO to BALTIMORE what time and what city does the plane stop in between | SELECT DISTINCT CITY_0.city_code, FLIGHT_STOP_0.arrival_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_1 WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'BALTIMORE' AND flight.flight_number = 2153 AND flight.to_airport = AIRPORT_SERVICE_2.airport_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_code = AIRPORT_SERVICE_3.city_code AND FLIGHT_STOP_0.stop_airport = AIRPORT_SERVICE_0.airport_code AND FLIGHT_STOP_1.stop_airport = AIRPORT_SERVICE_3.airport_code AND flight.airline_code = 'US' AND flight.flight_id = FLIGHT_STOP_0.flight_id | SELECT DISTINCT [CITY_0].[city_code], [FLIGHT_STOP_0].[arrival_time] FROM [airport_service] AS [AIRPORT_SERVICE_0] CROSS JOIN [airport_service] AS [AIRPORT_SERVICE_2] JOIN [city] AS [CITY_0] ON [AIRPORT_SERVICE_0].[city_code] = [CITY_0].[city_code] JOIN [city] AS [CITY_2] ON [AIRPORT_SERVICE_2].[city_code] = [CITY_2].[city_code] AND [CITY_2].[city_name] = 'BALTIMORE' JOIN [flight] ON [AIRPORT_SERVICE_2].[airport_code] = [flight].[to_airport] AND [flight].[airline_code] = 'US' AND [flight].[flight_number] = 2153 JOIN [airport_service] AS [AIRPORT_SERVICE_1] ON [AIRPORT_SERVICE_1].[airport_code] = [flight].[from_airport] JOIN [airport_service] AS [AIRPORT_SERVICE_3] ON [AIRPORT_SERVICE_3].[city_code] = [CITY_0].[city_code] JOIN [flight_stop] AS [FLIGHT_STOP_0] ON [AIRPORT_SERVICE_0].[airport_code] = [FLIGHT_STOP_0].[stop_airport] AND [FLIGHT_STOP_0].[flight_id] = [flight].[flight_id] JOIN [city] AS [CITY_1] ON [AIRPORT_SERVICE_1].[city_code] = [CITY_1].[city_code] AND [CITY_1].[city_name] = 'SAN FRANCISCO' JOIN [flight_stop] AS [FLIGHT_STOP_1] ON [AIRPORT_SERVICE_3].[airport_code] = [FLIGHT_STOP_1].[stop_airport] | 1.101563 |
CREATE TABLE table_203_587 (id NUMERIC, [country] VARCHAR(MAX), [weapon designation] VARCHAR(MAX), [weapon description] VARCHAR(MAX), [year ( s ) delivered] VARCHAR(MAX), [quantity delivered] NUMERIC)
| according to this list , how many countries sold weapons to iraq ? | SELECT COUNT(DISTINCT "country") FROM table_203_587 | SELECT COUNT(DISTINCT [country]) FROM [table_203_587] | 0.051758 |
CREATE TABLE table_26336739_1 (result VARCHAR, elected VARCHAR)
| What was the result for the district with an election in 1986 | SELECT result FROM table_26336739_1 WHERE elected = 1986 | SELECT [result] FROM [table_26336739_1] WHERE [elected] = 1986 | 0.060547 |
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
CREATE TABLE cost (costid NUMERIC, uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, eventtype VARCHAR(MAX), eventid NUMERIC, chargetime TIME, cost NUMERIC)
CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname VARCHAR(MAX), labresult NUMERIC, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric NUMERIC, intakeoutputtime TIME)
CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname VARCHAR(MAX), treatmenttime TIME)
| how many days have passed since the patient 006-2586 was admitted to the hospital? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '006-2586' AND patient.hospitaldischargetime IS NULL | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', [patient].[hospitaladmittime])) FROM [patient] WHERE [patient].[hospitaldischargetime] IS NULL AND [patient].[uniquepid] = '006-2586' | 0.188477 |
CREATE TABLE PostTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE ReviewRejectionReasons (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX), PostTypeId NUMERIC)
CREATE TABLE VoteTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE SuggestedEdits (Id NUMERIC, PostId NUMERIC, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMERIC, Comment VARCHAR(MAX), Text VARCHAR(MAX), Title VARCHAR(MAX), Tags VARCHAR(MAX), RevisionGUID other)
CREATE TABLE TagSynonyms (Id NUMERIC, SourceTagName VARCHAR(MAX), TargetTagName VARCHAR(MAX), CreationDate TIME, OwnerUserId NUMERIC, AutoRenameCount NUMERIC, LastAutoRename TIME, Score NUMERIC, ApprovedByUserId NUMERIC, ApprovalDate TIME)
CREATE TABLE ReviewTaskResultTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE Tags (Id NUMERIC, TagName VARCHAR(MAX), Count NUMERIC, ExcerptPostId NUMERIC, WikiPostId NUMERIC)
CREATE TABLE ReviewTaskStates (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostsWithDeleted (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body VARCHAR(MAX), OwnerUserId NUMERIC, OwnerDisplayName VARCHAR(MAX), LastEditorUserId NUMERIC, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE PostHistory (Id NUMERIC, PostHistoryTypeId NUMERIC, PostId NUMERIC, RevisionGUID other, CreationDate TIME, UserId NUMERIC, UserDisplayName VARCHAR(MAX), Comment VARCHAR(MAX), Text VARCHAR(MAX), ContentLicense VARCHAR(MAX))
CREATE TABLE Users (Id NUMERIC, Reputation NUMERIC, CreationDate TIME, DisplayName VARCHAR(MAX), LastAccessDate TIME, WebsiteUrl VARCHAR(MAX), Location VARCHAR(MAX), AboutMe VARCHAR(MAX), Views NUMERIC, UpVotes NUMERIC, DownVotes NUMERIC, ProfileImageUrl VARCHAR(MAX), EmailHash VARCHAR(MAX), AccountId NUMERIC)
CREATE TABLE Votes (Id NUMERIC, PostId NUMERIC, VoteTypeId NUMERIC, UserId NUMERIC, CreationDate TIME, BountyAmount NUMERIC)
CREATE TABLE PostNotices (Id NUMERIC, PostId NUMERIC, PostNoticeTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body VARCHAR(MAX), OwnerUserId NUMERIC, DeletionUserId NUMERIC)
CREATE TABLE CloseReasonTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE Comments (Id NUMERIC, PostId NUMERIC, Score NUMERIC, Text VARCHAR(MAX), CreationDate TIME, UserDisplayName VARCHAR(MAX), UserId NUMERIC, ContentLicense VARCHAR(MAX))
CREATE TABLE PostFeedback (Id NUMERIC, PostId NUMERIC, IsAnonymous BIT, VoteTypeId NUMERIC, CreationDate TIME)
CREATE TABLE PostHistoryTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE ReviewTaskResults (Id NUMERIC, ReviewTaskId NUMERIC, ReviewTaskResultTypeId NUMERIC, CreationDate TIME, RejectionReasonId NUMERIC, Comment VARCHAR(MAX))
CREATE TABLE FlagTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE Badges (Id NUMERIC, UserId NUMERIC, Name VARCHAR(MAX), Date TIME, Class NUMERIC, TagBased BIT)
CREATE TABLE SuggestedEditVotes (Id NUMERIC, SuggestedEditId NUMERIC, UserId NUMERIC, VoteTypeId NUMERIC, CreationDate TIME, TargetUserId NUMERIC, TargetRepChange NUMERIC)
CREATE TABLE Posts (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body VARCHAR(MAX), OwnerUserId NUMERIC, OwnerDisplayName VARCHAR(MAX), LastEditorUserId NUMERIC, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE ReviewTaskTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostTags (PostId NUMERIC, TagId NUMERIC)
CREATE TABLE ReviewTasks (Id NUMERIC, ReviewTaskTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMERIC, PostId NUMERIC, SuggestedEditId NUMERIC, CompletedByReviewTaskId NUMERIC)
CREATE TABLE PostLinks (Id NUMERIC, CreationDate TIME, PostId NUMERIC, RelatedPostId NUMERIC, LinkTypeId NUMERIC)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMERIC, IsUniversal BIT, InputTitle VARCHAR(MAX), MarkdownInputGuidance VARCHAR(MAX), MarkdownPostOwnerGuidance VARCHAR(MAX), MarkdownPrivilegedUserGuidance VARCHAR(MAX), MarkdownConcensusDescription VARCHAR(MAX), CreationDate TIME, CreationModeratorId NUMERIC, ApprovalDate TIME, ApprovalModeratorId NUMERIC, DeactivationDate TIME, DeactivationModeratorId NUMERIC)
CREATE TABLE PendingFlags (Id NUMERIC, FlagTypeId NUMERIC, PostId NUMERIC, CreationDate TIME, CloseReasonTypeId NUMERIC, CloseAsOffTopicReasonTypeId NUMERIC, DuplicateOfQuestionId NUMERIC, BelongsOnBaseHostAddress VARCHAR(MAX))
CREATE TABLE PostNoticeTypes (Id NUMERIC, ClassId NUMERIC, Name VARCHAR(MAX), Body VARCHAR(MAX), IsHidden BIT, Predefined BIT, PostNoticeDurationId NUMERIC)
| Find questions containing the given two tags. | SELECT q.Id AS "post_link", q.Tags, q.CreationDate, q.ViewCount, q.Score, q.AnswerCount, q.OwnerUserId AS "user_link", q.OwnerDisplayName FROM Posts AS q WHERE (q.Tags LIKE '%<##tag1?abstract-algebra##>%') AND q.CreationDate >= '2020-02-01' AND q.CreationDate < '2020-04-30' ORDER BY q.CreationDate DESC | SELECT [q].[id] AS [post_link], [q].[tags], [q].[creationdate], [q].[viewcount], [q].[score], [q].[answercount], [q].[owneruserid] AS [user_link], [q].[ownerdisplayname] FROM [Posts] AS [q] WHERE [q].[creationdate] < '2020-04-30' AND [q].[creationdate] >= '2020-02-01' AND [q].[tags] LIKE '%<##tag1?abstract-algebra##>%' ORDER BY [q].[creationdate] DESC | 0.344727 |
CREATE TABLE patients (row_id NUMERIC, subject_id NUMERIC, gender VARCHAR(MAX), dob TIME, dod TIME)
CREATE TABLE d_labitems (row_id NUMERIC, itemid NUMERIC, label VARCHAR(MAX))
CREATE TABLE prescriptions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, startdate TIME, enddate TIME, drug VARCHAR(MAX), dose_val_rx VARCHAR(MAX), dose_unit_rx VARCHAR(MAX), route VARCHAR(MAX))
CREATE TABLE labevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom VARCHAR(MAX))
CREATE TABLE diagnoses_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code VARCHAR(MAX), charttime TIME)
CREATE TABLE icustays (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, first_careunit VARCHAR(MAX), last_careunit VARCHAR(MAX), first_wardid NUMERIC, last_wardid NUMERIC, intime TIME, outtime TIME)
CREATE TABLE admissions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, admittime TIME, dischtime TIME, admission_type VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), insurance VARCHAR(MAX), language VARCHAR(MAX), marital_status VARCHAR(MAX), ethnicity VARCHAR(MAX), age NUMERIC)
CREATE TABLE d_icd_diagnoses (row_id NUMERIC, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE procedures_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code VARCHAR(MAX), charttime TIME)
CREATE TABLE inputevents_cv (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, amount NUMERIC)
CREATE TABLE microbiologyevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, charttime TIME, spec_type_desc VARCHAR(MAX), org_name VARCHAR(MAX))
CREATE TABLE d_items (row_id NUMERIC, itemid NUMERIC, label VARCHAR(MAX), linksto VARCHAR(MAX))
CREATE TABLE chartevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom VARCHAR(MAX))
CREATE TABLE d_icd_procedures (row_id NUMERIC, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE transfers (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, eventtype VARCHAR(MAX), careunit VARCHAR(MAX), wardid NUMERIC, intime TIME, outtime TIME)
CREATE TABLE outputevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, value NUMERIC)
CREATE TABLE cost (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, event_type VARCHAR(MAX), event_id NUMERIC, chargetime TIME, cost NUMERIC)
| calculate the number of people who died after being diagnosed with dysphagia nec within 2 months a year before. | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dysphagia nec')) AS t1 GROUP BY t1.subject_id HAVING MIN(t1.charttime) = t1.charttime AND DATETIME(t1.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 JOIN (SELECT patients.subject_id, admissions.hadm_id, patients.dod FROM admissions JOIN patients ON patients.subject_id = admissions.subject_id WHERE NOT patients.dod IS NULL AND DATETIME(patients.dod, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t3 ON t2.subject_id = t3.subject_id WHERE (DATETIME(t3.dod) BETWEEN DATETIME(t2.charttime) AND DATETIME(t2.charttime, '+2 month')) OR (DATETIME(t2.charttime) BETWEEN DATETIME(t3.dod) AND DATETIME(t3.dod, '+2 month')) | WITH [t2] AS (SELECT [admissions].[subject_id] AS [subject_id], [diagnoses_icd].[charttime] AS [charttime] FROM [diagnoses_icd] JOIN [d_icd_diagnoses] ON [d_icd_diagnoses].[icd9_code] = [diagnoses_icd].[icd9_code] AND [d_icd_diagnoses].[short_title] = 'dysphagia nec' JOIN [admissions] ON [admissions].[hadm_id] = [diagnoses_icd].[hadm_id] GROUP BY [admissions].[subject_id] HAVING [diagnoses_icd].[charttime] = MIN([diagnoses_icd].[charttime]) AND DATETIME([diagnoses_icd].[charttime], 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')), [t3] AS (SELECT [patients].[subject_id] AS [subject_id], [patients].[dod] AS [dod] FROM [admissions] JOIN [patients] ON [admissions].[subject_id] = [patients].[subject_id] AND DATETIME([patients].[dod], 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT [patients].[dod] IS NULL) SELECT COUNT(DISTINCT [t2].[subject_id]) FROM [t2] AS [t2] JOIN [t3] AS [t3] ON [t2].[subject_id] = [t3].[subject_id] AND ((DATETIME([t2].[charttime]) <= DATETIME([t3].[dod]) AND DATETIME([t2].[charttime], '+2 month') >= DATETIME([t3].[dod])) OR (DATETIME([t2].[charttime]) <= DATETIME([t3].[dod], '+2 month') AND DATETIME([t2].[charttime]) >= DATETIME([t3].[dod]))) WHERE (DATETIME([t2].[charttime]) <= DATETIME([t3].[dod]) AND DATETIME([t2].[charttime], '+2 month') >= DATETIME([t3].[dod])) OR (DATETIME([t2].[charttime]) <= DATETIME([t3].[dod], '+2 month') AND DATETIME([t2].[charttime]) >= DATETIME([t3].[dod])) | 1.450195 |
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID NUMERIC)
CREATE TABLE locations (LOCATION_ID NUMERIC, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE job_history (EMPLOYEE_ID NUMERIC, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID NUMERIC)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY NUMERIC, MAX_SALARY NUMERIC)
CREATE TABLE employees (EMPLOYEE_ID NUMERIC, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY NUMERIC, COMMISSION_PCT NUMERIC, MANAGER_ID NUMERIC, DEPARTMENT_ID NUMERIC)
CREATE TABLE departments (DEPARTMENT_ID NUMERIC, DEPARTMENT_NAME VARCHAR, MANAGER_ID NUMERIC, LOCATION_ID NUMERIC)
CREATE TABLE regions (REGION_ID NUMERIC, REGION_NAME VARCHAR)
| For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the average of department_id over the hire_date bin hire_date by time, display in desc by the y-axis please. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID) DESC | SELECT [HIRE_DATE], AVG([DEPARTMENT_ID]) FROM [employees] WHERE NOT [DEPARTMENT_ID] IN (SELECT [DEPARTMENT_ID] FROM [departments] WHERE [MANAGER_ID] <= 200 AND [MANAGER_ID] >= 100) ORDER BY AVG([DEPARTMENT_ID]) DESC | 0.209961 |
CREATE TABLE table_name_88 (listed VARCHAR, built VARCHAR)
| What is the list date of the historic place that was built 1896, 1914? | SELECT listed FROM table_name_88 WHERE built = "1896, 1914" | SELECT [listed] FROM [table_name_88] WHERE [1896, 1914] = [built] | 0.063477 |
CREATE TABLE table_name_47 (broadcasting_hours VARCHAR, network VARCHAR)
| What's the broadcasting hours of NBT? | SELECT broadcasting_hours FROM table_name_47 WHERE network = "nbt" | SELECT [broadcasting_hours] FROM [table_name_47] WHERE [nbt] = [network] | 0.070313 |
CREATE TABLE table_79464 ([Rank] FLOAT, [Player] VARCHAR(MAX), [County] VARCHAR(MAX), [Tally] VARCHAR(MAX), [Total] FLOAT, [Opposition] VARCHAR(MAX))
| What is galway county's total? | SELECT SUM("Total") FROM table_79464 WHERE "County" = 'galway' | SELECT SUM([Total]) FROM [table_79464] WHERE [County] = 'galway' | 0.0625 |
CREATE TABLE table_name_96 (release_date VARCHAR, sspec_number VARCHAR)
| What is the Release Date when sSpec Number is sl5xl, sl657, sl6by, sl6jp? | SELECT release_date FROM table_name_96 WHERE sspec_number = "sl5xl, sl657, sl6by, sl6jp" | SELECT [release_date] FROM [table_name_96] WHERE [sl5xl, sl657, sl6by, sl6jp] = [sspec_number] | 0.091797 |
CREATE TABLE course_prerequisite (pre_course_id INTEGER, course_id INTEGER)
CREATE TABLE jobs (job_id INTEGER, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INTEGER)
CREATE TABLE comment_instructor (instructor_id INTEGER, student_id INTEGER, score INTEGER, comment_text VARCHAR)
CREATE TABLE ta (campus_job_id INTEGER, student_id INTEGER, location VARCHAR)
CREATE TABLE instructor (instructor_id INTEGER, name VARCHAR, uniqname VARCHAR)
CREATE TABLE requirement (requirement_id INTEGER, requirement VARCHAR, college VARCHAR)
CREATE TABLE area (course_id INTEGER, area VARCHAR)
CREATE TABLE program (program_id INTEGER, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE course_tags_count (course_id INTEGER, clear_grading INTEGER, pop_quiz INTEGER, group_projects INTEGER, inspirational INTEGER, long_lectures INTEGER, extra_credit INTEGER, few_tests INTEGER, good_feedback INTEGER, tough_tests INTEGER, heavy_papers INTEGER, cares_for_students INTEGER, heavy_assignments INTEGER, respected INTEGER, participation INTEGER, heavy_reading INTEGER, tough_grader INTEGER, hilarious INTEGER, would_take_again INTEGER, good_lecture INTEGER, no_skip INTEGER)
CREATE TABLE course_offering (offering_id INTEGER, course_id INTEGER, semester INTEGER, section_number INTEGER, 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 gsi (course_offering_id INTEGER, student_id INTEGER)
CREATE TABLE student (student_id INTEGER, lastname VARCHAR, firstname VARCHAR, program_id INTEGER, declare_major VARCHAR, total_credit INTEGER, total_gpa FLOAT, entered_as VARCHAR, admit_term INTEGER, predicted_graduation_semester INTEGER, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE program_requirement (program_id INTEGER, category VARCHAR, min_credit INTEGER, additional_req VARCHAR)
CREATE TABLE course (course_id INTEGER, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INTEGER, num_enrolled INTEGER, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INTEGER, clarity_score INTEGER, easiness_score INTEGER, helpfulness_score INTEGER)
CREATE TABLE semester (semester_id INTEGER, semester VARCHAR, year INTEGER)
CREATE TABLE program_course (program_id INTEGER, course_id INTEGER, workload INTEGER, category VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INTEGER, offering_id INTEGER, instructor_id INTEGER)
CREATE TABLE student_record (student_id INTEGER, course_id INTEGER, semester INTEGER, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
| What 's the easiest way to fulfill the MDE requirement ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%') | WITH [_u_0] AS (SELECT MIN([PROGRAM_COURSEalias1].[workload]) AS _col_0 FROM [program_course] AS [PROGRAM_COURSEalias1] WHERE [PROGRAM_COURSEalias1].[category] LIKE '%MDE%') SELECT DISTINCT [course].[department], [course].[name], [course].[number], [program_course].[workload], [program_course].[workload] FROM [course] JOIN [program_course] ON [course].[course_id] = [program_course].[course_id] AND [program_course].[category] LIKE '%MDE%' JOIN [_u_0] AS [_u_0] ON [_u_0].[] = [program_course].[workload] | 0.494141 |
CREATE TABLE table_1828 ([Year] FLOAT, [Tournaments played] FLOAT, [Cuts made*] FLOAT, [Wins] FLOAT, [2nd] FLOAT, [3rd] FLOAT, [Top 10s] FLOAT, [Best finish] VARCHAR(MAX), [Earnings ( $ ) ] VARCHAR(MAX), [Money list rank] VARCHAR(MAX), [Scoring average] VARCHAR(MAX), [Scoring rank] VARCHAR(MAX))
| Name the scoring average for best finsih being t35 | SELECT "Scoring average" FROM table_1828 WHERE "Best finish" = 'T35' | SELECT [Scoring average] FROM [table_1828] WHERE [Best finish] = 'T35' | 0.068359 |
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
| which patients have myco500i drug code? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "MYCO500I" | SELECT COUNT(DISTINCT [demographic].[subject_id]) FROM [demographic] JOIN [prescriptions] ON [MYCO500I] = [prescriptions].[formulary_drug_cd] AND [demographic].[hadm_id] = [prescriptions].[hadm_id] | 0.192383 |
CREATE TABLE requirement (requirement_id INTEGER, requirement VARCHAR, college VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INTEGER, offering_id INTEGER, instructor_id INTEGER)
CREATE TABLE instructor (instructor_id INTEGER, name VARCHAR, uniqname VARCHAR)
CREATE TABLE course_offering (offering_id INTEGER, course_id INTEGER, semester INTEGER, section_number INTEGER, 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 INTEGER, student_id INTEGER, score INTEGER, comment_text VARCHAR)
CREATE TABLE student_record (student_id INTEGER, course_id INTEGER, semester INTEGER, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE area (course_id INTEGER, area VARCHAR)
CREATE TABLE program_requirement (program_id INTEGER, category VARCHAR, min_credit INTEGER, additional_req VARCHAR)
CREATE TABLE gsi (course_offering_id INTEGER, student_id INTEGER)
CREATE TABLE semester (semester_id INTEGER, semester VARCHAR, year INTEGER)
CREATE TABLE course (course_id INTEGER, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INTEGER, num_enrolled INTEGER, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INTEGER, clarity_score INTEGER, easiness_score INTEGER, helpfulness_score INTEGER)
CREATE TABLE ta (campus_job_id INTEGER, student_id INTEGER, location VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INTEGER, course_id INTEGER)
CREATE TABLE student (student_id INTEGER, lastname VARCHAR, firstname VARCHAR, program_id INTEGER, declare_major VARCHAR, total_credit INTEGER, total_gpa FLOAT, entered_as VARCHAR, admit_term INTEGER, predicted_graduation_semester INTEGER, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE program_course (program_id INTEGER, course_id INTEGER, workload INTEGER, category VARCHAR)
CREATE TABLE course_tags_count (course_id INTEGER, clear_grading INTEGER, pop_quiz INTEGER, group_projects INTEGER, inspirational INTEGER, long_lectures INTEGER, extra_credit INTEGER, few_tests INTEGER, good_feedback INTEGER, tough_tests INTEGER, heavy_papers INTEGER, cares_for_students INTEGER, heavy_assignments INTEGER, respected INTEGER, participation INTEGER, heavy_reading INTEGER, tough_grader INTEGER, hilarious INTEGER, would_take_again INTEGER, good_lecture INTEGER, no_skip INTEGER)
CREATE TABLE jobs (job_id INTEGER, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INTEGER)
CREATE TABLE program (program_id INTEGER, name VARCHAR, college VARCHAR, introduction VARCHAR)
| Which courses in Modern Middle East History reach the Core requirement ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Modern Middle East History%' OR course.description LIKE '%Modern Middle East History%' OR course.name LIKE '%Modern Middle East History%') AND program_course.category LIKE '%Core%' | SELECT DISTINCT [course].[department], [course].[name], [course].[number] FROM [course] JOIN [area] ON ([area].[area] LIKE '%Modern Middle East History%' OR [course].[description] LIKE '%Modern Middle East History%' OR [course].[name] LIKE '%Modern Middle East History%') AND [area].[course_id] = [course].[course_id] JOIN [program_course] ON [course].[course_id] = [program_course].[course_id] AND [program_course].[category] LIKE '%Core%' | 0.429688 |
CREATE TABLE employees (EMPLOYEE_ID NUMERIC, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY NUMERIC, COMMISSION_PCT NUMERIC, MANAGER_ID NUMERIC, DEPARTMENT_ID NUMERIC)
CREATE TABLE departments (DEPARTMENT_ID NUMERIC, DEPARTMENT_NAME VARCHAR, MANAGER_ID NUMERIC, LOCATION_ID NUMERIC)
CREATE TABLE job_history (EMPLOYEE_ID NUMERIC, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID NUMERIC)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY NUMERIC, MAX_SALARY NUMERIC)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID NUMERIC)
CREATE TABLE locations (LOCATION_ID NUMERIC, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE regions (REGION_ID NUMERIC, REGION_NAME VARCHAR)
| For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a line chart about the change of commission_pct over hire_date . | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | SELECT [HIRE_DATE], [COMMISSION_PCT] FROM [employees] WHERE NOT [DEPARTMENT_ID] IN (SELECT [DEPARTMENT_ID] FROM [departments] WHERE [MANAGER_ID] <= 200 AND [MANAGER_ID] >= 100) | 0.171875 |
CREATE TABLE table_204_617 (id NUMERIC, [date] VARCHAR(MAX), [opponent#] VARCHAR(MAX), [rank#] VARCHAR(MAX), [site] VARCHAR(MAX), [tv] VARCHAR(MAX), [result] VARCHAR(MAX), [attendance] NUMERIC)
| what is the total of games where the opponent scored no points ? | SELECT COUNT(*) FROM table_204_617 WHERE "result" = 0 | SELECT COUNT(*) FROM [table_204_617] WHERE [result] = 0 | 0.053711 |
CREATE TABLE table_name_13 (silver INTEGER, total VARCHAR, bronze VARCHAR)
| What is the most silver medals a team with 3 total medals and less than 1 bronze has? | SELECT MAX(silver) FROM table_name_13 WHERE total = 3 AND bronze < 1 | SELECT MAX([silver]) FROM [table_name_13] WHERE [bronze] < 1 AND [total] = 3 | 0.074219 |
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
| give me the number of patients whose diagnoses short title is retention urine nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Retention urine NOS" | SELECT COUNT(DISTINCT [demographic].[subject_id]) FROM [demographic] JOIN [diagnoses] ON [Retention urine NOS] = [diagnoses].[short_title] AND [demographic].[hadm_id] = [diagnoses].[hadm_id] | 0.185547 |
CREATE TABLE PostTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE ReviewRejectionReasons (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX), PostTypeId NUMERIC)
CREATE TABLE ReviewTaskResults (Id NUMERIC, ReviewTaskId NUMERIC, ReviewTaskResultTypeId NUMERIC, CreationDate TIME, RejectionReasonId NUMERIC, Comment VARCHAR(MAX))
CREATE TABLE ReviewTaskResultTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMERIC, IsUniversal BIT, InputTitle VARCHAR(MAX), MarkdownInputGuidance VARCHAR(MAX), MarkdownPostOwnerGuidance VARCHAR(MAX), MarkdownPrivilegedUserGuidance VARCHAR(MAX), MarkdownConcensusDescription VARCHAR(MAX), CreationDate TIME, CreationModeratorId NUMERIC, ApprovalDate TIME, ApprovalModeratorId NUMERIC, DeactivationDate TIME, DeactivationModeratorId NUMERIC)
CREATE TABLE Comments (Id NUMERIC, PostId NUMERIC, Score NUMERIC, Text VARCHAR(MAX), CreationDate TIME, UserDisplayName VARCHAR(MAX), UserId NUMERIC, ContentLicense VARCHAR(MAX))
CREATE TABLE VoteTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE PostNoticeTypes (Id NUMERIC, ClassId NUMERIC, Name VARCHAR(MAX), Body VARCHAR(MAX), IsHidden BIT, Predefined BIT, PostNoticeDurationId NUMERIC)
CREATE TABLE CloseReasonTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostLinks (Id NUMERIC, CreationDate TIME, PostId NUMERIC, RelatedPostId NUMERIC, LinkTypeId NUMERIC)
CREATE TABLE PostHistory (Id NUMERIC, PostHistoryTypeId NUMERIC, PostId NUMERIC, RevisionGUID other, CreationDate TIME, UserId NUMERIC, UserDisplayName VARCHAR(MAX), Comment VARCHAR(MAX), Text VARCHAR(MAX), ContentLicense VARCHAR(MAX))
CREATE TABLE SuggestedEditVotes (Id NUMERIC, SuggestedEditId NUMERIC, UserId NUMERIC, VoteTypeId NUMERIC, CreationDate TIME, TargetUserId NUMERIC, TargetRepChange NUMERIC)
CREATE TABLE Votes (Id NUMERIC, PostId NUMERIC, VoteTypeId NUMERIC, UserId NUMERIC, CreationDate TIME, BountyAmount NUMERIC)
CREATE TABLE PostsWithDeleted (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body VARCHAR(MAX), OwnerUserId NUMERIC, OwnerDisplayName VARCHAR(MAX), LastEditorUserId NUMERIC, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE ReviewTaskStates (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE Users (Id NUMERIC, Reputation NUMERIC, CreationDate TIME, DisplayName VARCHAR(MAX), LastAccessDate TIME, WebsiteUrl VARCHAR(MAX), Location VARCHAR(MAX), AboutMe VARCHAR(MAX), Views NUMERIC, UpVotes NUMERIC, DownVotes NUMERIC, ProfileImageUrl VARCHAR(MAX), EmailHash VARCHAR(MAX), AccountId NUMERIC)
CREATE TABLE FlagTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PendingFlags (Id NUMERIC, FlagTypeId NUMERIC, PostId NUMERIC, CreationDate TIME, CloseReasonTypeId NUMERIC, CloseAsOffTopicReasonTypeId NUMERIC, DuplicateOfQuestionId NUMERIC, BelongsOnBaseHostAddress VARCHAR(MAX))
CREATE TABLE PostTags (PostId NUMERIC, TagId NUMERIC)
CREATE TABLE PostNotices (Id NUMERIC, PostId NUMERIC, PostNoticeTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body VARCHAR(MAX), OwnerUserId NUMERIC, DeletionUserId NUMERIC)
CREATE TABLE PostFeedback (Id NUMERIC, PostId NUMERIC, IsAnonymous BIT, VoteTypeId NUMERIC, CreationDate TIME)
CREATE TABLE Badges (Id NUMERIC, UserId NUMERIC, Name VARCHAR(MAX), Date TIME, Class NUMERIC, TagBased BIT)
CREATE TABLE TagSynonyms (Id NUMERIC, SourceTagName VARCHAR(MAX), TargetTagName VARCHAR(MAX), CreationDate TIME, OwnerUserId NUMERIC, AutoRenameCount NUMERIC, LastAutoRename TIME, Score NUMERIC, ApprovedByUserId NUMERIC, ApprovalDate TIME)
CREATE TABLE Posts (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body VARCHAR(MAX), OwnerUserId NUMERIC, OwnerDisplayName VARCHAR(MAX), LastEditorUserId NUMERIC, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE PostHistoryTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE SuggestedEdits (Id NUMERIC, PostId NUMERIC, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMERIC, Comment VARCHAR(MAX), Text VARCHAR(MAX), Title VARCHAR(MAX), Tags VARCHAR(MAX), RevisionGUID other)
CREATE TABLE Tags (Id NUMERIC, TagName VARCHAR(MAX), Count NUMERIC, ExcerptPostId NUMERIC, WikiPostId NUMERIC)
CREATE TABLE ReviewTaskTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewTasks (Id NUMERIC, ReviewTaskTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMERIC, PostId NUMERIC, SuggestedEditId NUMERIC, CompletedByReviewTaskId NUMERIC)
| Questions that were answered after they were closed. | SELECT questions.Id AS "post_link", answers.OwnerUserId AS "user_link", questions.ClosedDate, answers.CreationDate, CAST((JULIANDAY(CreationDate) - JULIANDAY(questions.ClosedDate)) * 1440.0 AS INT) AS "difference" FROM Posts AS questions INNER JOIN Posts AS answers ON answers.ParentId = questions.Id WHERE answers.CreationDate > questions.ClosedDate ORDER BY answers.CreationDate DESC | SELECT [questions].[id] AS [post_link], [answers].[owneruserid] AS [user_link], [questions].[closeddate], [answers].[creationdate], CAST((JULIANDAY([CreationDate]) - JULIANDAY([questions].[closeddate])) * 1440.0 AS INTEGER) AS [difference] FROM [Posts] AS [questions] JOIN [Posts] AS [answers] ON [answers].[creationdate] > [questions].[closeddate] AND [answers].[parentid] = [questions].[id] ORDER BY [answers].[creationdate] DESC | 0.420898 |
CREATE TABLE table_1841901_1 (english VARCHAR, french VARCHAR)
| Name the english for j'avais entendu | SELECT english FROM table_1841901_1 WHERE french = "j'avais entendu" | SELECT [english] FROM [table_1841901_1] WHERE [french] = [j'avais entendu] | 0.072266 |
CREATE TABLE outputevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, value NUMERIC)
CREATE TABLE patients (row_id NUMERIC, subject_id NUMERIC, gender VARCHAR(MAX), dob TIME, dod TIME)
CREATE TABLE procedures_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code VARCHAR(MAX), charttime TIME)
CREATE TABLE d_icd_diagnoses (row_id NUMERIC, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE cost (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, event_type VARCHAR(MAX), event_id NUMERIC, chargetime TIME, cost NUMERIC)
CREATE TABLE icustays (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, first_careunit VARCHAR(MAX), last_careunit VARCHAR(MAX), first_wardid NUMERIC, last_wardid NUMERIC, intime TIME, outtime TIME)
CREATE TABLE inputevents_cv (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, amount NUMERIC)
CREATE TABLE chartevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom VARCHAR(MAX))
CREATE TABLE admissions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, admittime TIME, dischtime TIME, admission_type VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), insurance VARCHAR(MAX), language VARCHAR(MAX), marital_status VARCHAR(MAX), ethnicity VARCHAR(MAX), age NUMERIC)
CREATE TABLE d_icd_procedures (row_id NUMERIC, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE transfers (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, eventtype VARCHAR(MAX), careunit VARCHAR(MAX), wardid NUMERIC, intime TIME, outtime TIME)
CREATE TABLE microbiologyevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, charttime TIME, spec_type_desc VARCHAR(MAX), org_name VARCHAR(MAX))
CREATE TABLE diagnoses_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code VARCHAR(MAX), charttime TIME)
CREATE TABLE labevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom VARCHAR(MAX))
CREATE TABLE d_labitems (row_id NUMERIC, itemid NUMERIC, label VARCHAR(MAX))
CREATE TABLE prescriptions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, startdate TIME, enddate TIME, drug VARCHAR(MAX), dose_val_rx VARCHAR(MAX), dose_unit_rx VARCHAR(MAX), route VARCHAR(MAX))
CREATE TABLE d_items (row_id NUMERIC, itemid NUMERIC, label VARCHAR(MAX), linksto VARCHAR(MAX))
| when was patient 45601 born? | SELECT patients.dob FROM patients WHERE patients.subject_id = 45601 | SELECT [patients].[dob] FROM [patients] WHERE [patients].[subject_id] = 45601 | 0.075195 |
CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME)
CREATE TABLE cost (costid NUMERIC, uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, eventtype VARCHAR(MAX), eventid NUMERIC, chargetime TIME, cost NUMERIC)
CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric NUMERIC, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname VARCHAR(MAX), treatmenttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname VARCHAR(MAX), labresult NUMERIC, labresulttime TIME)
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
| what was the three most common lab test that were given since 3 years ago? | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3 | WITH [t1] AS (SELECT [lab].[labname] AS [labname], DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS [c1] FROM [lab] WHERE DATETIME([lab].[labresulttime]) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY [lab].[labname]) SELECT [t1].[labname] FROM [t1] AS [t1] WHERE [t1].[c1] <= 3 | 0.269531 |
CREATE TABLE table_name_59 (leading_scorer VARCHAR, visitor VARCHAR)
| Tell me the leading scorer for grizzlies | SELECT leading_scorer FROM table_name_59 WHERE visitor = "grizzlies" | SELECT [leading_scorer] FROM [table_name_59] WHERE [grizzlies] = [visitor] | 0.072266 |
CREATE TABLE artist (name VARCHAR, age VARCHAR, country VARCHAR, Year_Join VARCHAR)
| Show all artist name, age, and country ordered by the yeared they joined. | SELECT name, age, country FROM artist ORDER BY Year_Join | SELECT [name], [age], [country] FROM [artist] ORDER BY [Year_Join] | 0.064453 |
CREATE TABLE SuggestedEditVotes (Id NUMERIC, SuggestedEditId NUMERIC, UserId NUMERIC, VoteTypeId NUMERIC, CreationDate TIME, TargetUserId NUMERIC, TargetRepChange NUMERIC)
CREATE TABLE ReviewTaskStates (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostFeedback (Id NUMERIC, PostId NUMERIC, IsAnonymous BIT, VoteTypeId NUMERIC, CreationDate TIME)
CREATE TABLE Comments (Id NUMERIC, PostId NUMERIC, Score NUMERIC, Text VARCHAR(MAX), CreationDate TIME, UserDisplayName VARCHAR(MAX), UserId NUMERIC, ContentLicense VARCHAR(MAX))
CREATE TABLE PostTags (PostId NUMERIC, TagId NUMERIC)
CREATE TABLE VoteTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMERIC, IsUniversal BIT, InputTitle VARCHAR(MAX), MarkdownInputGuidance VARCHAR(MAX), MarkdownPostOwnerGuidance VARCHAR(MAX), MarkdownPrivilegedUserGuidance VARCHAR(MAX), MarkdownConcensusDescription VARCHAR(MAX), CreationDate TIME, CreationModeratorId NUMERIC, ApprovalDate TIME, ApprovalModeratorId NUMERIC, DeactivationDate TIME, DeactivationModeratorId NUMERIC)
CREATE TABLE Badges (Id NUMERIC, UserId NUMERIC, Name VARCHAR(MAX), Date TIME, Class NUMERIC, TagBased BIT)
CREATE TABLE SuggestedEdits (Id NUMERIC, PostId NUMERIC, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMERIC, Comment VARCHAR(MAX), Text VARCHAR(MAX), Title VARCHAR(MAX), Tags VARCHAR(MAX), RevisionGUID other)
CREATE TABLE FlagTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostHistory (Id NUMERIC, PostHistoryTypeId NUMERIC, PostId NUMERIC, RevisionGUID other, CreationDate TIME, UserId NUMERIC, UserDisplayName VARCHAR(MAX), Comment VARCHAR(MAX), Text VARCHAR(MAX), ContentLicense VARCHAR(MAX))
CREATE TABLE PostNotices (Id NUMERIC, PostId NUMERIC, PostNoticeTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body VARCHAR(MAX), OwnerUserId NUMERIC, DeletionUserId NUMERIC)
CREATE TABLE Votes (Id NUMERIC, PostId NUMERIC, VoteTypeId NUMERIC, UserId NUMERIC, CreationDate TIME, BountyAmount NUMERIC)
CREATE TABLE Posts (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body VARCHAR(MAX), OwnerUserId NUMERIC, OwnerDisplayName VARCHAR(MAX), LastEditorUserId NUMERIC, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE PostHistoryTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE PostTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE TagSynonyms (Id NUMERIC, SourceTagName VARCHAR(MAX), TargetTagName VARCHAR(MAX), CreationDate TIME, OwnerUserId NUMERIC, AutoRenameCount NUMERIC, LastAutoRename TIME, Score NUMERIC, ApprovedByUserId NUMERIC, ApprovalDate TIME)
CREATE TABLE CloseReasonTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewRejectionReasons (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX), PostTypeId NUMERIC)
CREATE TABLE Tags (Id NUMERIC, TagName VARCHAR(MAX), Count NUMERIC, ExcerptPostId NUMERIC, WikiPostId NUMERIC)
CREATE TABLE ReviewTaskTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewTaskResults (Id NUMERIC, ReviewTaskId NUMERIC, ReviewTaskResultTypeId NUMERIC, CreationDate TIME, RejectionReasonId NUMERIC, Comment VARCHAR(MAX))
CREATE TABLE PostsWithDeleted (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body VARCHAR(MAX), OwnerUserId NUMERIC, OwnerDisplayName VARCHAR(MAX), LastEditorUserId NUMERIC, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE Users (Id NUMERIC, Reputation NUMERIC, CreationDate TIME, DisplayName VARCHAR(MAX), LastAccessDate TIME, WebsiteUrl VARCHAR(MAX), Location VARCHAR(MAX), AboutMe VARCHAR(MAX), Views NUMERIC, UpVotes NUMERIC, DownVotes NUMERIC, ProfileImageUrl VARCHAR(MAX), EmailHash VARCHAR(MAX), AccountId NUMERIC)
CREATE TABLE PendingFlags (Id NUMERIC, FlagTypeId NUMERIC, PostId NUMERIC, CreationDate TIME, CloseReasonTypeId NUMERIC, CloseAsOffTopicReasonTypeId NUMERIC, DuplicateOfQuestionId NUMERIC, BelongsOnBaseHostAddress VARCHAR(MAX))
CREATE TABLE PostLinks (Id NUMERIC, CreationDate TIME, PostId NUMERIC, RelatedPostId NUMERIC, LinkTypeId NUMERIC)
CREATE TABLE PostNoticeTypes (Id NUMERIC, ClassId NUMERIC, Name VARCHAR(MAX), Body VARCHAR(MAX), IsHidden BIT, Predefined BIT, PostNoticeDurationId NUMERIC)
CREATE TABLE ReviewTasks (Id NUMERIC, ReviewTaskTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMERIC, PostId NUMERIC, SuggestedEditId NUMERIC, CompletedByReviewTaskId NUMERIC)
CREATE TABLE ReviewTaskResultTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
| Answers of mine that are voted higher than the accepted answer. Inverse query of http://data.stackexchange.com/stackoverflow/query/158759/accepted-answers-of-mine-that-are-not-the-highest-voted-answer | SELECT q.Id AS "post_link", p.Score AS "your_score", a.Score AS "accepted_answer_score" FROM Posts AS p JOIN Posts AS q ON p.ParentId = q.Id JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 AND p.Score > a.Score ORDER BY p.Score DESC | SELECT [q].[id] AS [post_link], [p].[score] AS [your_score], [a].[score] AS [accepted_answer_score] FROM [Posts] AS [p] JOIN [Posts] AS [q] ON [p].[parentid] = [q].[id] JOIN [Posts] AS [a] ON [a].[id] = [q].[acceptedanswerid] AND [a].[score] < [p].[score] WHERE [p].[owneruserid] = '##UserId##' AND [p].[posttypeid] = 2 ORDER BY [p].[score] DESC | 0.336914 |
CREATE TABLE Faculty (FacID INTEGER, Lname VARCHAR, Fname VARCHAR, Rank VARCHAR, Sex VARCHAR, Phone INTEGER, Room VARCHAR, Building VARCHAR)
CREATE TABLE Course (CID VARCHAR, CName VARCHAR, Credits INTEGER, Instructor INTEGER, Days VARCHAR, Hours VARCHAR, DNO INTEGER)
CREATE TABLE Minor_in (StuID INTEGER, DNO INTEGER)
CREATE TABLE Member_of (FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR)
CREATE TABLE Student (StuID INTEGER, LName VARCHAR, Fname VARCHAR, Age INTEGER, Sex VARCHAR, Major INTEGER, Advisor INTEGER, city_code VARCHAR)
CREATE TABLE Gradeconversion (lettergrade VARCHAR, gradepoint FLOAT)
CREATE TABLE Enrolled_in (StuID INTEGER, CID VARCHAR, Grade VARCHAR)
CREATE TABLE Department (DNO INTEGER, Division VARCHAR, DName VARCHAR, Room VARCHAR, Building VARCHAR, DPhone INTEGER)
| Draw a scatter chart about the correlation between CID and Credits . | SELECT CID, Credits FROM Course ORDER BY Credits | SELECT [CID], [Credits] FROM [Course] ORDER BY [Credits] | 0.054688 |
CREATE TABLE Dorm (dormid INTEGER, dorm_name VARCHAR, student_capacity INTEGER, gender VARCHAR)
CREATE TABLE Dorm_amenity (amenid INTEGER, amenity_name VARCHAR)
CREATE TABLE Student (StuID INTEGER, LName VARCHAR, Fname VARCHAR, Age INTEGER, Sex VARCHAR, Major INTEGER, Advisor INTEGER, city_code VARCHAR)
CREATE TABLE Has_amenity (dormid INTEGER, amenid INTEGER)
CREATE TABLE Lives_in (stuid INTEGER, dormid INTEGER, room_number INTEGER)
| What are the first names of all students in Smith Hall, and count them by a bar chart, could you list in asc by the x-axis? | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY Fname | SELECT [Fname], COUNT([Fname]) FROM [Student] AS [T1] JOIN [Lives_in] AS [T2] ON [T1].[stuid] = [T2].[stuid] JOIN [Dorm] AS [T3] ON [T2].[dormid] = [T3].[dormid] AND [T3].[dorm_name] = 'Smith Hall' GROUP BY [Fname] ORDER BY [Fname] | 0.225586 |
CREATE TABLE table_25511 ([No. in series] FLOAT, [No. in season] FLOAT, [Title] VARCHAR(MAX), [Directed by] VARCHAR(MAX), [Written by] VARCHAR(MAX), [Original air date] VARCHAR(MAX))
| What episode number in the series originally aired on April 27, 1999? | SELECT MAX("No. in series") FROM table_25511 WHERE "Original air date" = 'April 27, 1999' | SELECT MAX([No. in series]) FROM [table_25511] WHERE [Original air date] = 'April 27, 1999' | 0.088867 |
CREATE TABLE course_tags_count (course_id INTEGER, clear_grading INTEGER, pop_quiz INTEGER, group_projects INTEGER, inspirational INTEGER, long_lectures INTEGER, extra_credit INTEGER, few_tests INTEGER, good_feedback INTEGER, tough_tests INTEGER, heavy_papers INTEGER, cares_for_students INTEGER, heavy_assignments INTEGER, respected INTEGER, participation INTEGER, heavy_reading INTEGER, tough_grader INTEGER, hilarious INTEGER, would_take_again INTEGER, good_lecture INTEGER, no_skip INTEGER)
CREATE TABLE instructor (instructor_id INTEGER, name VARCHAR, uniqname VARCHAR)
CREATE TABLE comment_instructor (instructor_id INTEGER, student_id INTEGER, score INTEGER, comment_text VARCHAR)
CREATE TABLE student (student_id INTEGER, lastname VARCHAR, firstname VARCHAR, program_id INTEGER, declare_major VARCHAR, total_credit INTEGER, total_gpa FLOAT, entered_as VARCHAR, admit_term INTEGER, predicted_graduation_semester INTEGER, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE program (program_id INTEGER, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE semester (semester_id INTEGER, semester VARCHAR, year INTEGER)
CREATE TABLE course_prerequisite (pre_course_id INTEGER, course_id INTEGER)
CREATE TABLE requirement (requirement_id INTEGER, requirement VARCHAR, college VARCHAR)
CREATE TABLE program_requirement (program_id INTEGER, category VARCHAR, min_credit INTEGER, additional_req VARCHAR)
CREATE TABLE course_offering (offering_id INTEGER, course_id INTEGER, semester INTEGER, section_number INTEGER, 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 jobs (job_id INTEGER, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INTEGER)
CREATE TABLE offering_instructor (offering_instructor_id INTEGER, offering_id INTEGER, instructor_id INTEGER)
CREATE TABLE area (course_id INTEGER, area VARCHAR)
CREATE TABLE program_course (program_id INTEGER, course_id INTEGER, workload INTEGER, category VARCHAR)
CREATE TABLE gsi (course_offering_id INTEGER, student_id INTEGER)
CREATE TABLE student_record (student_id INTEGER, course_id INTEGER, semester INTEGER, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE course (course_id INTEGER, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INTEGER, num_enrolled INTEGER, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INTEGER, clarity_score INTEGER, easiness_score INTEGER, helpfulness_score INTEGER)
CREATE TABLE ta (campus_job_id INTEGER, student_id INTEGER, location VARCHAR)
| Can undergrads take the course 452 ? | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 452 | SELECT DISTINCT [advisory_requirement], [enforced_requirement], [name] FROM [course] WHERE [department] = 'EECS' AND [number] = 452 | 0.12793 |
CREATE TABLE table_name_1 (result VARCHAR, category VARCHAR, year VARCHAR)
| WHAT IS THE RESULT FOR best urban/alternative performance, IN 2003 OR GREATER? | SELECT result FROM table_name_1 WHERE category = "best urban/alternative performance" AND year > 2003 | SELECT [result] FROM [table_name_1] WHERE [best urban/alternative performance] = [category] AND [year] > 2003 | 0.106445 |
CREATE TABLE job_history (EMPLOYEE_ID NUMERIC, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID NUMERIC)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY NUMERIC, MAX_SALARY NUMERIC)
CREATE TABLE departments (DEPARTMENT_ID NUMERIC, DEPARTMENT_NAME VARCHAR, MANAGER_ID NUMERIC, LOCATION_ID NUMERIC)
CREATE TABLE locations (LOCATION_ID NUMERIC, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE employees (EMPLOYEE_ID NUMERIC, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY NUMERIC, COMMISSION_PCT NUMERIC, MANAGER_ID NUMERIC, DEPARTMENT_ID NUMERIC)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID NUMERIC)
CREATE TABLE regions (REGION_ID NUMERIC, REGION_NAME VARCHAR)
| For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id, and I want to list from high to low by the y axis. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) DESC | SELECT [JOB_ID], AVG([DEPARTMENT_ID]) FROM [employees] WHERE NOT [EMPLOYEE_ID] IN (SELECT [EMPLOYEE_ID] FROM [job_history]) GROUP BY [JOB_ID] ORDER BY AVG([DEPARTMENT_ID]) DESC | 0.171875 |
CREATE TABLE table_name_38 (apparatus VARCHAR, score_final INTEGER)
| Which apparatus had a final score that was more than 17.75? | SELECT apparatus FROM table_name_38 WHERE score_final > 17.75 | SELECT [apparatus] FROM [table_name_38] WHERE [score_final] > 17.75 | 0.06543 |
CREATE TABLE program (program_id INTEGER, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE course_offering (offering_id INTEGER, course_id INTEGER, semester INTEGER, section_number INTEGER, 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 offering_instructor (offering_instructor_id INTEGER, offering_id INTEGER, instructor_id INTEGER)
CREATE TABLE program_requirement (program_id INTEGER, category VARCHAR, min_credit INTEGER, additional_req VARCHAR)
CREATE TABLE course (course_id INTEGER, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INTEGER, num_enrolled INTEGER, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INTEGER, clarity_score INTEGER, easiness_score INTEGER, helpfulness_score INTEGER)
CREATE TABLE requirement (requirement_id INTEGER, requirement VARCHAR, college VARCHAR)
CREATE TABLE instructor (instructor_id INTEGER, name VARCHAR, uniqname VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INTEGER, course_id INTEGER)
CREATE TABLE comment_instructor (instructor_id INTEGER, student_id INTEGER, score INTEGER, comment_text VARCHAR)
CREATE TABLE semester (semester_id INTEGER, semester VARCHAR, year INTEGER)
CREATE TABLE area (course_id INTEGER, area VARCHAR)
CREATE TABLE program_course (program_id INTEGER, course_id INTEGER, workload INTEGER, category VARCHAR)
CREATE TABLE jobs (job_id INTEGER, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INTEGER)
CREATE TABLE ta (campus_job_id INTEGER, student_id INTEGER, location VARCHAR)
CREATE TABLE student_record (student_id INTEGER, course_id INTEGER, semester INTEGER, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE gsi (course_offering_id INTEGER, student_id INTEGER)
CREATE TABLE student (student_id INTEGER, lastname VARCHAR, firstname VARCHAR, program_id INTEGER, declare_major VARCHAR, total_credit INTEGER, total_gpa FLOAT, entered_as VARCHAR, admit_term INTEGER, predicted_graduation_semester INTEGER, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE course_tags_count (course_id INTEGER, clear_grading INTEGER, pop_quiz INTEGER, group_projects INTEGER, inspirational INTEGER, long_lectures INTEGER, extra_credit INTEGER, few_tests INTEGER, good_feedback INTEGER, tough_tests INTEGER, heavy_papers INTEGER, cares_for_students INTEGER, heavy_assignments INTEGER, respected INTEGER, participation INTEGER, heavy_reading INTEGER, tough_grader INTEGER, hilarious INTEGER, would_take_again INTEGER, good_lecture INTEGER, no_skip INTEGER)
| What teacher has the easiest course for PreMajor ? | SELECT DISTINCT instructor.name, program_course.workload FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_course.category LIKE '%PreMajor%' AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%PreMajor%') | WITH [_u_0] AS (SELECT MIN([PROGRAM_COURSEalias1].[workload]) AS _col_0 FROM [program_course] AS [PROGRAM_COURSEalias1] WHERE [PROGRAM_COURSEalias1].[category] LIKE '%PreMajor%') SELECT DISTINCT [instructor].[name], [program_course].[workload] FROM [instructor] JOIN [offering_instructor] ON [instructor].[instructor_id] = [offering_instructor].[instructor_id] JOIN [course_offering] ON [course_offering].[offering_id] = [offering_instructor].[offering_id] JOIN [program_course] ON [course_offering].[course_id] = [program_course].[course_id] AND [program_course].[category] LIKE '%PreMajor%' JOIN [_u_0] AS [_u_0] ON [_u_0].[] = [program_course].[workload] | 0.641602 |
CREATE TABLE manager (Manager_ID INTEGER, Name VARCHAR(MAX), Country VARCHAR(MAX), Working_year_starts VARCHAR(MAX), Age INTEGER, Level INTEGER)
CREATE TABLE train (Train_ID INTEGER, Train_Num VARCHAR(MAX), Name VARCHAR(MAX), From VARCHAR(MAX), Arrival VARCHAR(MAX), Railway_ID INTEGER)
CREATE TABLE railway (Railway_ID INTEGER, Railway VARCHAR(MAX), Builder VARCHAR(MAX), Built VARCHAR(MAX), Wheels VARCHAR(MAX), Location VARCHAR(MAX), ObjectNumber VARCHAR(MAX))
CREATE TABLE railway_manage (Railway_ID INTEGER, Manager_ID INTEGER, From_Year VARCHAR(MAX))
| A bar chart for showing the number of the working years of managers in descending order of their level. | SELECT Working_year_starts, COUNT(Working_year_starts) FROM manager ORDER BY Level DESC | SELECT [Working_year_starts], COUNT([Working_year_starts]) FROM [manager] ORDER BY [Level] DESC | 0.092773 |
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
| what is the number of patients whose days of hospital stay is greater than 16 and diagnoses icd9 code is 5781? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "16" AND diagnoses.icd9_code = "5781" | SELECT COUNT(DISTINCT [demographic].[subject_id]) FROM [demographic] JOIN [diagnoses] ON [5781] = [diagnoses].[icd9_code] AND [demographic].[hadm_id] = [diagnoses].[hadm_id] WHERE [16] < [demographic].[days_stay] | 0.207031 |
CREATE TABLE table_name_21 (title VARCHAR, appointed_by VARCHAR)
| Which Title has an Appointed by of Millard Fillmore? | SELECT title FROM table_name_21 WHERE appointed_by = "millard fillmore" | SELECT [title] FROM [table_name_21] WHERE [appointed_by] = [millard fillmore] | 0.075195 |
CREATE TABLE table_78422 ([Home team] VARCHAR(MAX), [Home team score] VARCHAR(MAX), [Away team] VARCHAR(MAX), [Away team score] VARCHAR(MAX), [Venue] VARCHAR(MAX), [Crowd] FLOAT, [Date] VARCHAR(MAX))
| Name the away team for essendon | SELECT "Away team" FROM table_78422 WHERE "Home team" = 'essendon' | SELECT [Away team] FROM [table_78422] WHERE [Home team] = 'essendon' | 0.066406 |
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
| what is the number of patients whose days of hospital stay is greater than 2 and lab test fluid is joint fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.fluid = "Joint Fluid" | SELECT COUNT(DISTINCT [demographic].[subject_id]) FROM [demographic] JOIN [lab] ON [Joint Fluid] = [lab].[fluid] AND [demographic].[hadm_id] = [lab].[hadm_id] WHERE [2] < [demographic].[days_stay] | 0.191406 |
CREATE TABLE table_1717824_3 (indians_admitted VARCHAR, year VARCHAR)
| How many Indians were admitted in 2001? | SELECT indians_admitted FROM table_1717824_3 WHERE year = 2001 | SELECT [indians_admitted] FROM [table_1717824_3] WHERE [year] = 2001 | 0.066406 |
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
| find out the icu stay id of the patient colton andrade. | SELECT prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Colton Andrade" | SELECT [prescriptions].[icustay_id] FROM [demographic] JOIN [prescriptions] ON [demographic].[hadm_id] = [prescriptions].[hadm_id] WHERE [Colton Andrade] = [demographic].[name] | 0.171875 |
CREATE TABLE table_name_20 (position VARCHAR, club_team VARCHAR)
| What position does the player from the Miami University (CCHA) club team play? | SELECT position FROM table_name_20 WHERE club_team = "miami university (ccha)" | SELECT [position] FROM [table_name_20] WHERE [club_team] = [miami university (ccha)] | 0.082031 |
CREATE TABLE table_204_398 (id NUMERIC, [title] VARCHAR(MAX), [year] NUMERIC, [publisher] VARCHAR(MAX), [developer] VARCHAR(MAX), [platforms] VARCHAR(MAX))
| what lord of the rings game was previously released before lego the lord of the rings ? | SELECT "title" FROM table_204_398 WHERE id = (SELECT id FROM table_204_398 WHERE "title" = 'lego the lord of the rings') - 1 | SELECT [title] FROM [table_204_398] WHERE [id] = (SELECT [id] FROM [table_204_398] WHERE [title] = 'lego the lord of the rings') - 1 | 0.128906 |
CREATE TABLE fare (fare_id INTEGER, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code VARCHAR(MAX), fare_airline VARCHAR(MAX), restriction_code VARCHAR(MAX), one_direction_cost INTEGER, round_trip_cost INTEGER, round_trip_required VARCHAR)
CREATE TABLE time_zone (time_zone_code VARCHAR(MAX), time_zone_name VARCHAR(MAX), hours_from_gmt INTEGER)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INTEGER, high_flight_number INTEGER, dual_airline VARCHAR, service_name VARCHAR(MAX))
CREATE TABLE airport (airport_code VARCHAR, airport_name VARCHAR(MAX), airport_location VARCHAR(MAX), state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INTEGER)
CREATE TABLE month (month_number INTEGER, month_name VARCHAR(MAX))
CREATE TABLE flight (aircraft_code_sequence VARCHAR(MAX), airline_code VARCHAR, airline_flight VARCHAR(MAX), arrival_time INTEGER, connections INTEGER, departure_time INTEGER, dual_carrier VARCHAR(MAX), flight_days VARCHAR(MAX), flight_id INTEGER, flight_number INTEGER, from_airport VARCHAR, meal_code VARCHAR(MAX), stops INTEGER, time_elapsed INTEGER, to_airport VARCHAR)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE state (state_code VARCHAR(MAX), state_name VARCHAR(MAX), country_name VARCHAR(MAX))
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INTEGER, direction VARCHAR, minutes_distant INTEGER)
CREATE TABLE code_description (code VARCHAR, description VARCHAR(MAX))
CREATE TABLE class_of_service (booking_class VARCHAR, rank INTEGER, class_description VARCHAR(MAX))
CREATE TABLE fare_basis (fare_basis_code VARCHAR(MAX), booking_class VARCHAR(MAX), class_type VARCHAR(MAX), premium VARCHAR(MAX), economy VARCHAR(MAX), discounted VARCHAR(MAX), night VARCHAR(MAX), season VARCHAR(MAX), basis_days VARCHAR(MAX))
CREATE TABLE flight_stop (flight_id INTEGER, stop_number INTEGER, stop_days VARCHAR(MAX), stop_airport VARCHAR(MAX), arrival_time INTEGER, arrival_airline VARCHAR(MAX), arrival_flight_number INTEGER, departure_time INTEGER, departure_airline VARCHAR(MAX), departure_flight_number INTEGER, stop_time INTEGER)
CREATE TABLE ground_service (city_code VARCHAR(MAX), airport_code VARCHAR(MAX), transport_type VARCHAR(MAX), ground_fare INTEGER)
CREATE TABLE time_interval (period VARCHAR(MAX), begin_time INTEGER, end_time INTEGER)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE flight_fare (flight_id INTEGER, fare_id INTEGER)
CREATE TABLE restriction (restriction_code VARCHAR(MAX), advance_purchase INTEGER, stopovers VARCHAR(MAX), saturday_stay_required VARCHAR(MAX), minimum_stay INTEGER, maximum_stay INTEGER, application VARCHAR(MAX), no_discounts VARCHAR(MAX))
CREATE TABLE flight_leg (flight_id INTEGER, leg_number INTEGER, leg_flight INTEGER)
CREATE TABLE date_day (month_number INTEGER, day_number INTEGER, year INTEGER, day_name VARCHAR)
CREATE TABLE food_service (meal_code VARCHAR(MAX), meal_number INTEGER, compartment VARCHAR(MAX), meal_description VARCHAR)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INTEGER, propulsion VARCHAR, wide_body VARCHAR, wing_span INTEGER, length INTEGER, weight INTEGER, capacity INTEGER, pay_load INTEGER, cruising_speed INTEGER, range_miles INTEGER, pressurized VARCHAR)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE airline (airline_code VARCHAR, airline_name VARCHAR(MAX), note VARCHAR(MAX))
| what are the flights from ST. LOUIS to BURBANK sunday evening | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BURBANK' AND date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ST. LOUIS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 1800 AND 2200 | SELECT DISTINCT [flight].[flight_id] FROM [airport_service] AS [AIRPORT_SERVICE_0] JOIN [date_day] ON [date_day].[day_number] = 27 AND [date_day].[month_number] = 8 AND [date_day].[year] = 1991 JOIN [city] AS [CITY_0] ON [AIRPORT_SERVICE_0].[city_code] = [CITY_0].[city_code] AND [CITY_0].[city_name] = 'ST. LOUIS' JOIN [days] ON [date_day].[day_name] = [days].[day_name] JOIN [flight] ON [AIRPORT_SERVICE_0].[airport_code] = [flight].[from_airport] AND [days].[days_code] = [flight].[flight_days] AND [flight].[departure_time] <= 2200 AND [flight].[departure_time] >= 1800 JOIN [airport_service] AS [AIRPORT_SERVICE_1] ON [AIRPORT_SERVICE_1].[airport_code] = [flight].[to_airport] JOIN [city] AS [CITY_1] ON [AIRPORT_SERVICE_1].[city_code] = [CITY_1].[city_code] AND [CITY_1].[city_name] = 'BURBANK' | 0.78125 |
CREATE TABLE course_prerequisite (pre_course_id INTEGER, course_id INTEGER)
CREATE TABLE jobs (job_id INTEGER, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INTEGER)
CREATE TABLE comment_instructor (instructor_id INTEGER, student_id INTEGER, score INTEGER, comment_text VARCHAR)
CREATE TABLE ta (campus_job_id INTEGER, student_id INTEGER, location VARCHAR)
CREATE TABLE instructor (instructor_id INTEGER, name VARCHAR, uniqname VARCHAR)
CREATE TABLE requirement (requirement_id INTEGER, requirement VARCHAR, college VARCHAR)
CREATE TABLE area (course_id INTEGER, area VARCHAR)
CREATE TABLE program (program_id INTEGER, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE course_tags_count (course_id INTEGER, clear_grading INTEGER, pop_quiz INTEGER, group_projects INTEGER, inspirational INTEGER, long_lectures INTEGER, extra_credit INTEGER, few_tests INTEGER, good_feedback INTEGER, tough_tests INTEGER, heavy_papers INTEGER, cares_for_students INTEGER, heavy_assignments INTEGER, respected INTEGER, participation INTEGER, heavy_reading INTEGER, tough_grader INTEGER, hilarious INTEGER, would_take_again INTEGER, good_lecture INTEGER, no_skip INTEGER)
CREATE TABLE course_offering (offering_id INTEGER, course_id INTEGER, semester INTEGER, section_number INTEGER, 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 gsi (course_offering_id INTEGER, student_id INTEGER)
CREATE TABLE student (student_id INTEGER, lastname VARCHAR, firstname VARCHAR, program_id INTEGER, declare_major VARCHAR, total_credit INTEGER, total_gpa FLOAT, entered_as VARCHAR, admit_term INTEGER, predicted_graduation_semester INTEGER, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE program_requirement (program_id INTEGER, category VARCHAR, min_credit INTEGER, additional_req VARCHAR)
CREATE TABLE course (course_id INTEGER, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INTEGER, num_enrolled INTEGER, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INTEGER, clarity_score INTEGER, easiness_score INTEGER, helpfulness_score INTEGER)
CREATE TABLE semester (semester_id INTEGER, semester VARCHAR, year INTEGER)
CREATE TABLE program_course (program_id INTEGER, course_id INTEGER, workload INTEGER, category VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INTEGER, offering_id INTEGER, instructor_id INTEGER)
CREATE TABLE student_record (student_id INTEGER, course_id INTEGER, semester INTEGER, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
| Should we expect there to be an Molecular and Genomic Evolution lab in 2016 ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE (course.description LIKE '%lab%' OR course.name LIKE '%lab%') AND (course.description LIKE '%Molecular and Genomic Evolution%' OR course.name LIKE '%Molecular and Genomic Evolution%') AND course.course_id = course_offering.course_id AND semester.semester_id = course_offering.semester AND semester.year = 2016 | SELECT COUNT(*) > 0 FROM [course] JOIN [course_offering] ON [course].[course_id] = [course_offering].[course_id] JOIN [semester] ON [course_offering].[semester] = [semester].[semester_id] AND [semester].[year] = 2016 WHERE ([course].[description] LIKE '%Molecular and Genomic Evolution%' OR [course].[name] LIKE '%Molecular and Genomic Evolution%') AND ([course].[description] LIKE '%lab%' OR [course].[name] LIKE '%lab%') | 0.412109 |
CREATE TABLE table_name_94 (place INTEGER, total VARCHAR, draw VARCHAR)
| Which Place is the lowest one that has a Total smaller than 24, and a Draw larger than 7? | SELECT MIN(place) FROM table_name_94 WHERE total < 24 AND draw > 7 | SELECT MIN([place]) FROM [table_name_94] WHERE [draw] > 7 AND [total] < 24 | 0.072266 |
CREATE TABLE program (program_id INTEGER, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE ta (campus_job_id INTEGER, student_id INTEGER, location VARCHAR)
CREATE TABLE program_course (program_id INTEGER, course_id INTEGER, workload INTEGER, category VARCHAR)
CREATE TABLE instructor (instructor_id INTEGER, name VARCHAR, uniqname VARCHAR)
CREATE TABLE student (student_id INTEGER, lastname VARCHAR, firstname VARCHAR, program_id INTEGER, declare_major VARCHAR, total_credit INTEGER, total_gpa FLOAT, entered_as VARCHAR, admit_term INTEGER, predicted_graduation_semester INTEGER, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE requirement (requirement_id INTEGER, requirement VARCHAR, college VARCHAR)
CREATE TABLE student_record (student_id INTEGER, course_id INTEGER, semester INTEGER, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE program_requirement (program_id INTEGER, category VARCHAR, min_credit INTEGER, additional_req VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INTEGER, offering_id INTEGER, instructor_id INTEGER)
CREATE TABLE area (course_id INTEGER, area VARCHAR)
CREATE TABLE semester (semester_id INTEGER, semester VARCHAR, year INTEGER)
CREATE TABLE jobs (job_id INTEGER, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INTEGER)
CREATE TABLE course_tags_count (course_id INTEGER, clear_grading INTEGER, pop_quiz INTEGER, group_projects INTEGER, inspirational INTEGER, long_lectures INTEGER, extra_credit INTEGER, few_tests INTEGER, good_feedback INTEGER, tough_tests INTEGER, heavy_papers INTEGER, cares_for_students INTEGER, heavy_assignments INTEGER, respected INTEGER, participation INTEGER, heavy_reading INTEGER, tough_grader INTEGER, hilarious INTEGER, would_take_again INTEGER, good_lecture INTEGER, no_skip INTEGER)
CREATE TABLE gsi (course_offering_id INTEGER, student_id INTEGER)
CREATE TABLE course (course_id INTEGER, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INTEGER, num_enrolled INTEGER, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INTEGER, clarity_score INTEGER, easiness_score INTEGER, helpfulness_score INTEGER)
CREATE TABLE course_offering (offering_id INTEGER, course_id INTEGER, semester INTEGER, section_number INTEGER, 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 INTEGER, student_id INTEGER, score INTEGER, comment_text VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INTEGER, course_id INTEGER)
| Will I be able to take SI 638 over the Winter ? | SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN (DERIVED_TABLEalias0.course_id) AND NOT COURSEalias0.course_id IN (SELECT DISTINCT COURSE_PREREQUISITEalias0.course_id FROM course_prerequisite AS COURSE_PREREQUISITEalias0 WHERE NOT COURSE_PREREQUISITEalias0.pre_course_id IN (DERIVED_TABLEalias0.course_id)) AND COURSEalias0.department = 'SI' AND COURSEalias0.number = 638 AND SEMESTERalias0.semester = 'Winter' AND SEMESTERalias0.semester_id = COURSE_OFFERINGalias0.semester AND SEMESTERalias0.year = 2016 | SELECT COUNT(*) > 0 FROM [student_record] JOIN [course] AS [COURSEalias0] ON [COURSEalias0].[department] = 'SI' AND [COURSEalias0].[number] = 638 AND NOT [COURSEalias0].[course_id] IN ([course_id]) AND NOT [COURSEalias0].[course_id] IN (SELECT DISTINCT [COURSE_PREREQUISITEalias0].[course_id] FROM [course_prerequisite] AS [COURSE_PREREQUISITEalias0] WHERE NOT [COURSE_PREREQUISITEalias0].[pre_course_id] IN ([course_id])) JOIN [course_offering] AS [COURSE_OFFERINGalias0] ON [COURSE_OFFERINGalias0].[course_id] = [COURSEalias0].[course_id] JOIN [semester] AS [SEMESTERalias0] ON [COURSE_OFFERINGalias0].[semester] = [SEMESTERalias0].[semester_id] AND [SEMESTERalias0].[semester] = 'Winter' AND [SEMESTERalias0].[year] = 2016 WHERE [earn_credit] = 'Y' AND [student_id] = 1 | 0.753906 |
CREATE TABLE offering_instructor (offering_instructor_id INTEGER, offering_id INTEGER, instructor_id INTEGER)
CREATE TABLE student_record (student_id INTEGER, course_id INTEGER, semester INTEGER, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE gsi (course_offering_id INTEGER, student_id INTEGER)
CREATE TABLE requirement (requirement_id INTEGER, requirement VARCHAR, college VARCHAR)
CREATE TABLE jobs (job_id INTEGER, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INTEGER)
CREATE TABLE program_requirement (program_id INTEGER, category VARCHAR, min_credit INTEGER, additional_req VARCHAR)
CREATE TABLE area (course_id INTEGER, area VARCHAR)
CREATE TABLE semester (semester_id INTEGER, semester VARCHAR, year INTEGER)
CREATE TABLE course (course_id INTEGER, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INTEGER, num_enrolled INTEGER, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INTEGER, clarity_score INTEGER, easiness_score INTEGER, helpfulness_score INTEGER)
CREATE TABLE comment_instructor (instructor_id INTEGER, student_id INTEGER, score INTEGER, comment_text VARCHAR)
CREATE TABLE course_offering (offering_id INTEGER, course_id INTEGER, semester INTEGER, section_number INTEGER, 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 course_tags_count (course_id INTEGER, clear_grading INTEGER, pop_quiz INTEGER, group_projects INTEGER, inspirational INTEGER, long_lectures INTEGER, extra_credit INTEGER, few_tests INTEGER, good_feedback INTEGER, tough_tests INTEGER, heavy_papers INTEGER, cares_for_students INTEGER, heavy_assignments INTEGER, respected INTEGER, participation INTEGER, heavy_reading INTEGER, tough_grader INTEGER, hilarious INTEGER, would_take_again INTEGER, good_lecture INTEGER, no_skip INTEGER)
CREATE TABLE instructor (instructor_id INTEGER, name VARCHAR, uniqname VARCHAR)
CREATE TABLE ta (campus_job_id INTEGER, student_id INTEGER, location VARCHAR)
CREATE TABLE student (student_id INTEGER, lastname VARCHAR, firstname VARCHAR, program_id INTEGER, declare_major VARCHAR, total_credit INTEGER, total_gpa FLOAT, entered_as VARCHAR, admit_term INTEGER, predicted_graduation_semester INTEGER, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE program (program_id INTEGER, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE program_course (program_id INTEGER, course_id INTEGER, workload INTEGER, category VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INTEGER, course_id INTEGER)
| Is a project part of 388 ? | SELECT DISTINCT has_projects FROM course WHERE department = 'EECS' AND number = 388 | SELECT DISTINCT [has_projects] FROM [course] WHERE [department] = 'EECS' AND [number] = 388 | 0.088867 |
CREATE TABLE table_58704 ([Year] FLOAT, [Binibining Pilipinas-Universe] VARCHAR(MAX), [Binibining Pilipinas-International] VARCHAR(MAX), [Miss Maja Pilipinas] VARCHAR(MAX), [Binibining Pilipinas-Tourism] VARCHAR(MAX), [First runner-up] VARCHAR(MAX), [Second runner-up] VARCHAR(MAX))
| What Miss Maja Pilipinas has a Binibining Pilipinas-Tourism of not awarded, and a Binibining Pilipinas-Universe of anjanette abayari? | SELECT "Miss Maja Pilipinas" FROM table_58704 WHERE "Binibining Pilipinas-Tourism" = 'not awarded' AND "Binibining Pilipinas-Universe" = 'anjanette abayari' | SELECT [Miss Maja Pilipinas] FROM [table_58704] WHERE [Binibining Pilipinas-Tourism] = 'not awarded' AND [Binibining Pilipinas-Universe] = 'anjanette abayari' | 0.154297 |
CREATE TABLE table_14188 ([Constituency number] VARCHAR(MAX), [Name] VARCHAR(MAX), [Reserved for ( SC / ST /None ) ] VARCHAR(MAX), [District] VARCHAR(MAX), [Number of electorates ( 2009 ) ] FLOAT)
| What is the Constituency number for Pandhana? | SELECT "Constituency number" FROM table_14188 WHERE "Name" = 'pandhana' | SELECT [Constituency number] FROM [table_14188] WHERE [Name] = 'pandhana' | 0.071289 |
CREATE TABLE table_dev_41 ([id] INTEGER, [gender] VARCHAR(MAX), [serum_potassium] FLOAT, [systolic_blood_pressure_sbp] INTEGER, [serum_bicarbonate] INTEGER, [renal_disease] BIT, [temperature] FLOAT, [diastolic_blood_pressure_dbp] INTEGER, [liver_disease] BIT, [hdl] INTEGER, [serum_sodium_concentration] INTEGER, [heart_rate] INTEGER, [serum_creatinine] FLOAT, [kidney_disease] BIT, [hypertension] BIT, [uncontrolled_blood_pressure] BIT, [unstable_vitals_signs] BIT, [NOUSE] FLOAT)
| low hdl level ( < 40 mg / dl male , < 50 mg / dl female ) | SELECT * FROM table_dev_41 WHERE (hdl < 40 AND gender = 'male') OR (hdl < 50 AND gender = 'female') | SELECT * FROM [table_dev_41] WHERE ([gender] = 'female' OR [gender] = 'male') AND ([gender] = 'female' OR [hdl] < 40) AND [hdl] < 50 | 0.128906 |
CREATE TABLE table_name_97 (gold INTEGER, silver VARCHAR, bronze VARCHAR, rank VARCHAR)
| What is the lowest number of Gold, when the number of Bronze is less than 36, when the Rank is 2, and when Silver is less than 37? | SELECT MIN(gold) FROM table_name_97 WHERE bronze < 36 AND rank = "2" AND silver < 37 | SELECT MIN([gold]) FROM [table_name_97] WHERE [2] = [rank] AND [bronze] < 36 AND [silver] < 37 | 0.091797 |
CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric NUMERIC, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname VARCHAR(MAX), treatmenttime TIME)
CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname VARCHAR(MAX), labresult NUMERIC, labresulttime TIME)
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE cost (costid NUMERIC, uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, eventtype VARCHAR(MAX), eventid NUMERIC, chargetime TIME, cost NUMERIC)
CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME)
CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
| calculate the number of patients who have stayed in the 377 ward until 2103. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 377 AND STRFTIME('%y', patient.unitadmittime) <= '2103' | SELECT COUNT(DISTINCT [patient].[uniquepid]) FROM [patient] WHERE [patient].[wardid] = 377 AND STRFTIME('%y', [patient].[unitadmittime]) <= '2103' | 0.142578 |
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
| provide the number of patients whose insurance is government and procedure short title is open reduc-int fix femur? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Open reduc-int fix femur" | SELECT COUNT(DISTINCT [demographic].[subject_id]) FROM [demographic] JOIN [procedures] ON [Open reduc-int fix femur] = [procedures].[short_title] AND [demographic].[hadm_id] = [procedures].[hadm_id] WHERE [Government] = [demographic].[insurance] | 0.239258 |
CREATE TABLE table_name_58 (college_junior_club_team VARCHAR, position VARCHAR, nationality VARCHAR)
| Can you tell me the College/Junior/Club Team that has the Position of defence, and the Nationality of czechoslovakia? | SELECT college_junior_club_team FROM table_name_58 WHERE position = "defence" AND nationality = "czechoslovakia" | SELECT [college_junior_club_team] FROM [table_name_58] WHERE [czechoslovakia] = [nationality] AND [defence] = [position] | 0.117188 |
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE cost (costid NUMERIC, uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, eventtype VARCHAR(MAX), eventid NUMERIC, chargetime TIME, cost NUMERIC)
CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname VARCHAR(MAX), labresult NUMERIC, labresulttime TIME)
CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric NUMERIC, intakeoutputtime TIME)
CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname VARCHAR(MAX), treatmenttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME)
| what was the last time patient 002-3784 was prescribed medications via sc route in 09/last year? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-3784')) AND medication.routeadmin = 'sc' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', medication.drugstarttime) = '09' ORDER BY medication.drugstarttime DESC LIMIT 1 | WITH [_u_0] AS (SELECT [patient].[patienthealthsystemstayid] AS [patienthealthsystemstayid] FROM [patient] WHERE [patient].[uniquepid] = '002-3784' GROUP BY [patienthealthsystemstayid]), [_u_1] AS (SELECT [patient].[patientunitstayid] AS [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 TOP 1 [medication].[drugstarttime] FROM [medication] LEFT JOIN [_u_1] AS [_u_1] ON [_u_1].[] = [medication].[patientunitstayid] WHERE [medication].[routeadmin] = 'sc' AND DATETIME([medication].[drugstarttime], 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT [_u_1].[] IS NULL AND STRFTIME('%m', [medication].[drugstarttime]) = '09' ORDER BY [medication].[drugstarttime] DESC | 0.804688 |
CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname VARCHAR(MAX), labresult NUMERIC, labresulttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME)
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname VARCHAR(MAX), treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric NUMERIC, intakeoutputtime TIME)
CREATE TABLE cost (costid NUMERIC, uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, eventtype VARCHAR(MAX), eventid NUMERIC, chargetime TIME, cost NUMERIC)
| how many times did patient 016-35481 produce urine on 01/19/this year? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-35481')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'urine' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', intakeoutput.intakeoutputtime) = '01-19' | WITH [_u_0] AS (SELECT [patient].[patienthealthsystemstayid] AS [patienthealthsystemstayid] FROM [patient] WHERE [patient].[uniquepid] = '016-35481' GROUP BY [patienthealthsystemstayid]), [_u_1] AS (SELECT [patient].[patientunitstayid] AS [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(*) FROM [intakeoutput] LEFT JOIN [_u_1] AS [_u_1] ON [_u_1].[] = [intakeoutput].[patientunitstayid] WHERE [intakeoutput].[celllabel] = 'urine' AND [intakeoutput].[cellpath] LIKE '%output%' AND DATETIME([intakeoutput].[intakeoutputtime], 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT [_u_1].[] IS NULL AND STRFTIME('%m-%d', [intakeoutput].[intakeoutputtime]) = '01-19' | 0.806641 |
CREATE TABLE table_name_44 (game INTEGER, record VARCHAR)
| Record of 20 4 involved what highest game? | SELECT MAX(game) FROM table_name_44 WHERE record = "20–4" | SELECT MAX([game]) FROM [table_name_44] WHERE [20–4] = [record] | 0.061523 |
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
| how many patients with tietze's disease are insured by the government? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.long_title = "Tietze's disease" | SELECT COUNT(DISTINCT [demographic].[subject_id]) FROM [demographic] JOIN [diagnoses] ON [Tietze's disease] = [diagnoses].[long_title] AND [demographic].[hadm_id] = [diagnoses].[hadm_id] WHERE [Government] = [demographic].[insurance] | 0.227539 |
CREATE TABLE table_name_81 (joined INTEGER, city VARCHAR, conference_championships VARCHAR)
| What is the lowest year joined in the city of College Park at the Conference championships smaller than 0? | SELECT MIN(joined) FROM table_name_81 WHERE city = "college park" AND conference_championships < 0 | SELECT MIN([joined]) FROM [table_name_81] WHERE [city] = [college park] AND [conference_championships] < 0 | 0.103516 |
CREATE TABLE table_42232 ([Rank] VARCHAR(MAX), [Nation] VARCHAR(MAX), [Gold] FLOAT, [Silver] FLOAT, [Bronze] FLOAT, [Total] FLOAT)
| How much gold received by nation of uzbekistan (uzb)? | SELECT MAX("Gold") FROM table_42232 WHERE "Nation" = 'uzbekistan (uzb)' | SELECT MAX([Gold]) FROM [table_42232] WHERE [Nation] = 'uzbekistan (uzb)' | 0.071289 |
CREATE TABLE table_203_653 (id NUMERIC, [rank] NUMERIC, [nation] VARCHAR(MAX), [gold] NUMERIC, [silver] NUMERIC, [bronze] NUMERIC, [total] NUMERIC)
| the average silver medal count of the first five ranked nations ? | SELECT AVG("silver") FROM table_203_653 WHERE "rank" <= 5 | SELECT AVG([silver]) FROM [table_203_653] WHERE [rank] <= 5 | 0.057617 |
CREATE TABLE table_name_42 (position VARCHAR, player VARCHAR)
| What position does Mike Dennis play? | SELECT position FROM table_name_42 WHERE player = "mike dennis" | SELECT [position] FROM [table_name_42] WHERE [mike dennis] = [player] | 0.067383 |
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
| how many upper gi bleed primary disease patients died on or before 2154? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "UPPER GI BLEED" AND demographic.dod_year <= "2154.0" | SELECT COUNT(DISTINCT [demographic].[subject_id]) FROM [demographic] WHERE [2154.0] >= [demographic].[dod_year] AND [UPPER GI BLEED] = [demographic].[diagnosis] | 0.15625 |
CREATE TABLE table_16944 ([Date] VARCHAR(MAX), [Tournament] VARCHAR(MAX), [Location] VARCHAR(MAX), [Purse ( $ ) ] FLOAT, [Winner] VARCHAR(MAX), [Score] VARCHAR(MAX), [1st Prize ( $ ) ] FLOAT)
| what's the date where location is illinois | SELECT "Date" FROM table_16944 WHERE "Location" = 'Illinois' | SELECT [Date] FROM [table_16944] WHERE [Location] = 'Illinois' | 0.060547 |
CREATE TABLE table_43465 ([Index] VARCHAR(MAX), [Name] VARCHAR(MAX), [Song] VARCHAR(MAX), [Group Song] VARCHAR(MAX), [Score] VARCHAR(MAX))
| What Song has a Group Song of Ring Ring Ring and a Score of 6.0 + 6.5 + 5.0 + 6.5 = 24.0? | SELECT "Song" FROM table_43465 WHERE "Group Song" = 'ring ring ring' AND "Score" = '6.0 + 6.5 + 5.0 + 6.5 = 24.0' | SELECT [Song] FROM [table_43465] WHERE [Group Song] = 'ring ring ring' AND [Score] = '6.0 + 6.5 + 5.0 + 6.5 = 24.0' | 0.112305 |
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
| provide the number of patients whose admission type is elective and lab test name is potassium, urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Potassium, Urine" | SELECT COUNT(DISTINCT [demographic].[subject_id]) FROM [demographic] JOIN [lab] ON [Potassium, Urine] = [lab].[label] AND [demographic].[hadm_id] = [lab].[hadm_id] WHERE [ELECTIVE] = [demographic].[admission_type] | 0.208008 |
CREATE TABLE wine (No INTEGER, Grape VARCHAR(MAX), Winery VARCHAR(MAX), Appelation VARCHAR(MAX), State VARCHAR(MAX), Name VARCHAR(MAX), Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink VARCHAR(MAX))
CREATE TABLE appellations (No INTEGER, Appelation VARCHAR(MAX), County VARCHAR(MAX), State VARCHAR(MAX), Area VARCHAR(MAX), isAVA VARCHAR(MAX))
CREATE TABLE grapes (ID INTEGER, Grape VARCHAR(MAX), Color VARCHAR(MAX))
| Give me a bar chart for the number of year of each year, and rank total number in desc order. | SELECT Year, COUNT(Year) FROM wine ORDER BY COUNT(Year) DESC | SELECT [Year], COUNT([Year]) FROM [wine] ORDER BY COUNT([Year]) DESC | 0.066406 |
CREATE TABLE table_3327 ([Settlement] VARCHAR(MAX), [Cyrillic Name Other Names] VARCHAR(MAX), [Type] VARCHAR(MAX), [Population ( 2011 ) ] FLOAT, [Largest ethnic group ( 2002 ) ] VARCHAR(MAX), [Dominant religion ( 2002 ) ] VARCHAR(MAX))
| Name the number of cyrillic name for stani i | SELECT COUNT("Cyrillic Name Other Names") FROM table_3327 WHERE "Settlement" = 'Stanišić' | SELECT COUNT([Cyrillic Name Other Names]) FROM [table_3327] WHERE [Settlement] = 'Stanišić' | 0.088867 |
CREATE TABLE demographic (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), name VARCHAR(MAX), marital_status VARCHAR(MAX), age VARCHAR(MAX), dob VARCHAR(MAX), gender VARCHAR(MAX), language VARCHAR(MAX), religion VARCHAR(MAX), admission_type VARCHAR(MAX), days_stay VARCHAR(MAX), insurance VARCHAR(MAX), ethnicity VARCHAR(MAX), expire_flag VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), diagnosis VARCHAR(MAX), dod VARCHAR(MAX), dob_year VARCHAR(MAX), dod_year VARCHAR(MAX), admittime VARCHAR(MAX), dischtime VARCHAR(MAX), admityear VARCHAR(MAX))
CREATE TABLE lab (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), itemid VARCHAR(MAX), charttime VARCHAR(MAX), flag VARCHAR(MAX), value_unit VARCHAR(MAX), label VARCHAR(MAX), fluid VARCHAR(MAX))
CREATE TABLE procedures (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE prescriptions (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icustay_id VARCHAR(MAX), drug_type VARCHAR(MAX), drug VARCHAR(MAX), formulary_drug_cd VARCHAR(MAX), route VARCHAR(MAX), drug_dose VARCHAR(MAX))
CREATE TABLE diagnoses (subject_id VARCHAR(MAX), hadm_id VARCHAR(MAX), icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
| give me the number of patients whose age is less than 80 and drug code is aztr1000fb? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "80" AND prescriptions.formulary_drug_cd = "AZTR1000FB" | SELECT COUNT(DISTINCT [demographic].[subject_id]) FROM [demographic] JOIN [prescriptions] ON [AZTR1000FB] = [prescriptions].[formulary_drug_cd] AND [demographic].[hadm_id] = [prescriptions].[hadm_id] WHERE [80] > [demographic].[age] | 0.226563 |
CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname VARCHAR(MAX), labresult NUMERIC, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME)
CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname VARCHAR(MAX), treatmenttime TIME)
CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE cost (costid NUMERIC, uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, eventtype VARCHAR(MAX), eventid NUMERIC, chargetime TIME, cost NUMERIC)
CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric NUMERIC, intakeoutputtime TIME)
| how many hours have it been since the first time patient 022-6959 was prescribed zolpidem 5 mg tab on the current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-6959') AND patient.hospitaldischargetime IS NULL) AND medication.drugname = 'zolpidem 5 mg tab' ORDER BY medication.drugstarttime LIMIT 1 | WITH [_u_0] AS (SELECT [patient].[patienthealthsystemstayid] AS [patienthealthsystemstayid] FROM [patient] WHERE [patient].[uniquepid] = '022-6959' GROUP BY [patienthealthsystemstayid]), [_u_1] AS (SELECT [patient].[patientunitstayid] AS [patientunitstayid] FROM [patient] LEFT JOIN [_u_0] AS [_u_0] ON [_u_0].[] = [patient].[patienthealthsystemstayid] WHERE [patient].[hospitaldischargetime] IS NULL AND NOT [_u_0].[] IS NULL GROUP BY [patientunitstayid]) SELECT TOP 1 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', [medication].[drugstarttime])) FROM [medication] LEFT JOIN [_u_1] AS [_u_1] ON [_u_1].[] = [medication].[patientunitstayid] WHERE [medication].[drugname] = 'zolpidem 5 mg tab' AND NOT [_u_1].[] IS NULL ORDER BY [medication].[drugstarttime] | 0.745117 |
CREATE TABLE job_history (EMPLOYEE_ID NUMERIC, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID NUMERIC)
CREATE TABLE locations (LOCATION_ID NUMERIC, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE regions (REGION_ID NUMERIC, REGION_NAME VARCHAR)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY NUMERIC, MAX_SALARY NUMERIC)
CREATE TABLE departments (DEPARTMENT_ID NUMERIC, DEPARTMENT_NAME VARCHAR, MANAGER_ID NUMERIC, LOCATION_ID NUMERIC)
CREATE TABLE employees (EMPLOYEE_ID NUMERIC, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY NUMERIC, COMMISSION_PCT NUMERIC, MANAGER_ID NUMERIC, DEPARTMENT_ID NUMERIC)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID NUMERIC)
| For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the sum of employee_id , and group by attribute job_id, show JOB_ID from low to high order. | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID | SELECT [JOB_ID], SUM([EMPLOYEE_ID]) FROM [employees] WHERE NOT [EMPLOYEE_ID] IN (SELECT [EMPLOYEE_ID] FROM [job_history]) GROUP BY [JOB_ID] ORDER BY [JOB_ID] | 0.15332 |
CREATE TABLE Movie (mID INTEGER, title VARCHAR(MAX), year INTEGER, director VARCHAR(MAX))
CREATE TABLE Reviewer (rID INTEGER, name VARCHAR(MAX))
CREATE TABLE Rating (rID INTEGER, mID INTEGER, stars INTEGER, ratingDate DATE)
| What are the titles of all movies that have rating star is between 3 and 5, and count them by a bar chart | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title | SELECT [title], COUNT([title]) FROM [Rating] AS [T1] JOIN [Movie] AS [T2] ON [T1].[mid] = [T2].[mid] WHERE [T1].[stars] <= 5 AND [T1].[stars] >= 3 GROUP BY [title] | 0.15918 |
CREATE TABLE diagnoses_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code VARCHAR(MAX), charttime TIME)
CREATE TABLE d_icd_procedures (row_id NUMERIC, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE icustays (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, first_careunit VARCHAR(MAX), last_careunit VARCHAR(MAX), first_wardid NUMERIC, last_wardid NUMERIC, intime TIME, outtime TIME)
CREATE TABLE procedures_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code VARCHAR(MAX), charttime TIME)
CREATE TABLE d_labitems (row_id NUMERIC, itemid NUMERIC, label VARCHAR(MAX))
CREATE TABLE chartevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom VARCHAR(MAX))
CREATE TABLE outputevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, value NUMERIC)
CREATE TABLE prescriptions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, startdate TIME, enddate TIME, drug VARCHAR(MAX), dose_val_rx VARCHAR(MAX), dose_unit_rx VARCHAR(MAX), route VARCHAR(MAX))
CREATE TABLE d_items (row_id NUMERIC, itemid NUMERIC, label VARCHAR(MAX), linksto VARCHAR(MAX))
CREATE TABLE d_icd_diagnoses (row_id NUMERIC, icd9_code VARCHAR(MAX), short_title VARCHAR(MAX), long_title VARCHAR(MAX))
CREATE TABLE microbiologyevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, charttime TIME, spec_type_desc VARCHAR(MAX), org_name VARCHAR(MAX))
CREATE TABLE inputevents_cv (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, amount NUMERIC)
CREATE TABLE admissions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, admittime TIME, dischtime TIME, admission_type VARCHAR(MAX), admission_location VARCHAR(MAX), discharge_location VARCHAR(MAX), insurance VARCHAR(MAX), language VARCHAR(MAX), marital_status VARCHAR(MAX), ethnicity VARCHAR(MAX), age NUMERIC)
CREATE TABLE cost (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, event_type VARCHAR(MAX), event_id NUMERIC, chargetime TIME, cost NUMERIC)
CREATE TABLE patients (row_id NUMERIC, subject_id NUMERIC, gender VARCHAR(MAX), dob TIME, dod TIME)
CREATE TABLE labevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom VARCHAR(MAX))
CREATE TABLE transfers (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, eventtype VARCHAR(MAX), careunit VARCHAR(MAX), wardid NUMERIC, intime TIME, outtime TIME)
| show me the five year survival rate of patients who were prescribed lactulose after they were diagnosed with digestive neoplasm nos? | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'digestive neoplasm nos') GROUP BY admissions.subject_id HAVING MIN(diagnoses_icd.charttime) = diagnoses_icd.charttime) AS t1 WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', t1.charttime) > 5 * 365) AS t2 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'lactulose') AS t3 ON t2.subject_id = t3.subject_id WHERE t2.charttime < t3.startdate) AS t4 JOIN patients ON t4.subject_id = patients.subject_id | WITH [t1] AS (SELECT [admissions].[subject_id] AS [subject_id], [diagnoses_icd].[charttime] AS [charttime] FROM [diagnoses_icd] JOIN [d_icd_diagnoses] ON [d_icd_diagnoses].[icd9_code] = [diagnoses_icd].[icd9_code] AND [d_icd_diagnoses].[short_title] = 'digestive neoplasm nos' JOIN [admissions] ON [admissions].[hadm_id] = [diagnoses_icd].[hadm_id] GROUP BY [admissions].[subject_id] HAVING [diagnoses_icd].[charttime] = MIN([diagnoses_icd].[charttime])), [t3] AS (SELECT [admissions].[subject_id] AS [subject_id], [prescriptions].[startdate] AS [startdate] FROM [prescriptions] JOIN [admissions] ON [admissions].[hadm_id] = [prescriptions].[hadm_id] WHERE [prescriptions].[drug] = 'lactulose') SELECT SUM(CASE WHEN [patients].[dod] IS NULL THEN 1 WHEN STRFTIME('%j', [patients].[dod]) - STRFTIME('%j', [t1].[charttime]) > 1825 THEN 1 ELSE 0 END) * 100 / NULLIF(COUNT(*), 0) FROM [t1] AS [t1] JOIN [t3] AS [t3] ON [t1].[charttime] < [t3].[startdate] AND [t1].[subject_id] = [t3].[subject_id] JOIN [patients] ON [patients].[subject_id] = [t1].[subject_id] WHERE STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', [t1].[charttime]) > 1825 | 1.106445 |
CREATE TABLE PostsWithDeleted (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body VARCHAR(MAX), OwnerUserId NUMERIC, OwnerDisplayName VARCHAR(MAX), LastEditorUserId NUMERIC, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE PostTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE VoteTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE PostTags (PostId NUMERIC, TagId NUMERIC)
CREATE TABLE Posts (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body VARCHAR(MAX), OwnerUserId NUMERIC, OwnerDisplayName VARCHAR(MAX), LastEditorUserId NUMERIC, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE Comments (Id NUMERIC, PostId NUMERIC, Score NUMERIC, Text VARCHAR(MAX), CreationDate TIME, UserDisplayName VARCHAR(MAX), UserId NUMERIC, ContentLicense VARCHAR(MAX))
CREATE TABLE Tags (Id NUMERIC, TagName VARCHAR(MAX), Count NUMERIC, ExcerptPostId NUMERIC, WikiPostId NUMERIC)
CREATE TABLE PostHistory (Id NUMERIC, PostHistoryTypeId NUMERIC, PostId NUMERIC, RevisionGUID other, CreationDate TIME, UserId NUMERIC, UserDisplayName VARCHAR(MAX), Comment VARCHAR(MAX), Text VARCHAR(MAX), ContentLicense VARCHAR(MAX))
CREATE TABLE ReviewTaskStates (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostLinks (Id NUMERIC, CreationDate TIME, PostId NUMERIC, RelatedPostId NUMERIC, LinkTypeId NUMERIC)
CREATE TABLE Badges (Id NUMERIC, UserId NUMERIC, Name VARCHAR(MAX), Date TIME, Class NUMERIC, TagBased BIT)
CREATE TABLE SuggestedEdits (Id NUMERIC, PostId NUMERIC, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMERIC, Comment VARCHAR(MAX), Text VARCHAR(MAX), Title VARCHAR(MAX), Tags VARCHAR(MAX), RevisionGUID other)
CREATE TABLE Users (Id NUMERIC, Reputation NUMERIC, CreationDate TIME, DisplayName VARCHAR(MAX), LastAccessDate TIME, WebsiteUrl VARCHAR(MAX), Location VARCHAR(MAX), AboutMe VARCHAR(MAX), Views NUMERIC, UpVotes NUMERIC, DownVotes NUMERIC, ProfileImageUrl VARCHAR(MAX), EmailHash VARCHAR(MAX), AccountId NUMERIC)
CREATE TABLE PostHistoryTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE PendingFlags (Id NUMERIC, FlagTypeId NUMERIC, PostId NUMERIC, CreationDate TIME, CloseReasonTypeId NUMERIC, CloseAsOffTopicReasonTypeId NUMERIC, DuplicateOfQuestionId NUMERIC, BelongsOnBaseHostAddress VARCHAR(MAX))
CREATE TABLE TagSynonyms (Id NUMERIC, SourceTagName VARCHAR(MAX), TargetTagName VARCHAR(MAX), CreationDate TIME, OwnerUserId NUMERIC, AutoRenameCount NUMERIC, LastAutoRename TIME, Score NUMERIC, ApprovedByUserId NUMERIC, ApprovalDate TIME)
CREATE TABLE PostFeedback (Id NUMERIC, PostId NUMERIC, IsAnonymous BIT, VoteTypeId NUMERIC, CreationDate TIME)
CREATE TABLE FlagTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE SuggestedEditVotes (Id NUMERIC, SuggestedEditId NUMERIC, UserId NUMERIC, VoteTypeId NUMERIC, CreationDate TIME, TargetUserId NUMERIC, TargetRepChange NUMERIC)
CREATE TABLE CloseReasonTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewRejectionReasons (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX), PostTypeId NUMERIC)
CREATE TABLE PostNoticeTypes (Id NUMERIC, ClassId NUMERIC, Name VARCHAR(MAX), Body VARCHAR(MAX), IsHidden BIT, Predefined BIT, PostNoticeDurationId NUMERIC)
CREATE TABLE Votes (Id NUMERIC, PostId NUMERIC, VoteTypeId NUMERIC, UserId NUMERIC, CreationDate TIME, BountyAmount NUMERIC)
CREATE TABLE ReviewTaskResults (Id NUMERIC, ReviewTaskId NUMERIC, ReviewTaskResultTypeId NUMERIC, CreationDate TIME, RejectionReasonId NUMERIC, Comment VARCHAR(MAX))
CREATE TABLE ReviewTaskTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostNotices (Id NUMERIC, PostId NUMERIC, PostNoticeTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body VARCHAR(MAX), OwnerUserId NUMERIC, DeletionUserId NUMERIC)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMERIC, IsUniversal BIT, InputTitle VARCHAR(MAX), MarkdownInputGuidance VARCHAR(MAX), MarkdownPostOwnerGuidance VARCHAR(MAX), MarkdownPrivilegedUserGuidance VARCHAR(MAX), MarkdownConcensusDescription VARCHAR(MAX), CreationDate TIME, CreationModeratorId NUMERIC, ApprovalDate TIME, ApprovalModeratorId NUMERIC, DeactivationDate TIME, DeactivationModeratorId NUMERIC)
CREATE TABLE ReviewTasks (Id NUMERIC, ReviewTaskTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMERIC, PostId NUMERIC, SuggestedEditId NUMERIC, CompletedByReviewTaskId NUMERIC)
CREATE TABLE ReviewTaskResultTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
| Most repeated comments on Super User. | SELECT COUNT(*) AS Number, Text, AVG(CAST(Score AS FLOAT(6, 2))) AS AvgScore FROM Comments GROUP BY Text HAVING COUNT(*) >= 5 ORDER BY Number DESC, AvgScore DESC LIMIT 1000 | SELECT TOP 1000 COUNT(*) AS [Number], [Text], AVG(CAST([Score] AS FLOAT(6, 2))) AS [AvgScore] FROM [Comments] GROUP BY [Text] HAVING COUNT(*) >= 5 ORDER BY [Number] DESC, [AvgScore] DESC | 0.181641 |
CREATE TABLE fielding_postseason (player_id VARCHAR(MAX), year NUMERIC, team_id VARCHAR(MAX), league_id VARCHAR(MAX), round VARCHAR(MAX), pos VARCHAR(MAX), g NUMERIC, gs NUMERIC, inn_outs NUMERIC, po NUMERIC, a NUMERIC, e NUMERIC, dp NUMERIC, tp NUMERIC, pb NUMERIC, sb NUMERIC, cs NUMERIC)
CREATE TABLE team_half (year NUMERIC, league_id VARCHAR(MAX), team_id VARCHAR(MAX), half NUMERIC, div_id VARCHAR(MAX), div_win VARCHAR(MAX), rank NUMERIC, g NUMERIC, w NUMERIC, l NUMERIC)
CREATE TABLE player_college (player_id VARCHAR(MAX), college_id VARCHAR(MAX), year NUMERIC)
CREATE TABLE player_award_vote (award_id VARCHAR(MAX), year NUMERIC, league_id VARCHAR(MAX), player_id VARCHAR(MAX), points_won NUMERIC, points_max NUMERIC, votes_first NUMERIC)
CREATE TABLE postseason (year NUMERIC, round VARCHAR(MAX), team_id_winner VARCHAR(MAX), league_id_winner VARCHAR(MAX), team_id_loser VARCHAR(MAX), league_id_loser VARCHAR(MAX), wins NUMERIC, losses NUMERIC, ties NUMERIC)
CREATE TABLE salary (year NUMERIC, team_id VARCHAR(MAX), league_id VARCHAR(MAX), player_id VARCHAR(MAX), salary NUMERIC)
CREATE TABLE fielding (player_id VARCHAR(MAX), year NUMERIC, stint NUMERIC, team_id VARCHAR(MAX), league_id VARCHAR(MAX), pos VARCHAR(MAX), g NUMERIC, gs NUMERIC, inn_outs NUMERIC, po NUMERIC, a NUMERIC, e NUMERIC, dp NUMERIC, pb NUMERIC, wp NUMERIC, sb NUMERIC, cs NUMERIC, zr NUMERIC)
CREATE TABLE player_award (player_id VARCHAR(MAX), award_id VARCHAR(MAX), year NUMERIC, league_id VARCHAR(MAX), tie VARCHAR(MAX), notes VARCHAR(MAX))
CREATE TABLE player (player_id VARCHAR(MAX), birth_year NUMERIC, birth_month NUMERIC, birth_day NUMERIC, birth_country VARCHAR(MAX), birth_state VARCHAR(MAX), birth_city VARCHAR(MAX), death_year NUMERIC, death_month NUMERIC, death_day NUMERIC, death_country VARCHAR(MAX), death_state VARCHAR(MAX), death_city VARCHAR(MAX), name_first VARCHAR(MAX), name_last VARCHAR(MAX), name_given VARCHAR(MAX), weight NUMERIC, height NUMERIC, bats VARCHAR(MAX), throws VARCHAR(MAX), debut VARCHAR(MAX), final_game VARCHAR(MAX), retro_id VARCHAR(MAX), bbref_id VARCHAR(MAX))
CREATE TABLE manager_half (player_id VARCHAR(MAX), year NUMERIC, team_id VARCHAR(MAX), league_id VARCHAR(MAX), inseason NUMERIC, half NUMERIC, g NUMERIC, w NUMERIC, l NUMERIC, rank NUMERIC)
CREATE TABLE team (year NUMERIC, league_id VARCHAR(MAX), team_id VARCHAR(MAX), franchise_id VARCHAR(MAX), div_id VARCHAR(MAX), rank NUMERIC, g NUMERIC, ghome NUMERIC, w NUMERIC, l NUMERIC, div_win VARCHAR(MAX), wc_win VARCHAR(MAX), lg_win VARCHAR(MAX), ws_win VARCHAR(MAX), r NUMERIC, ab NUMERIC, h NUMERIC, double NUMERIC, triple NUMERIC, hr NUMERIC, bb NUMERIC, so NUMERIC, sb NUMERIC, cs NUMERIC, hbp NUMERIC, sf NUMERIC, ra NUMERIC, er NUMERIC, era NUMERIC, cg NUMERIC, sho NUMERIC, sv NUMERIC, ipouts NUMERIC, ha NUMERIC, hra NUMERIC, bba NUMERIC, soa NUMERIC, e NUMERIC, dp NUMERIC, fp NUMERIC, name VARCHAR(MAX), park VARCHAR(MAX), attendance NUMERIC, bpf NUMERIC, ppf NUMERIC, team_id_br VARCHAR(MAX), team_id_lahman45 VARCHAR(MAX), team_id_retro VARCHAR(MAX))
CREATE TABLE manager_award (player_id VARCHAR(MAX), award_id VARCHAR(MAX), year NUMERIC, league_id VARCHAR(MAX), tie VARCHAR(MAX), notes NUMERIC)
CREATE TABLE pitching (player_id VARCHAR(MAX), year NUMERIC, stint NUMERIC, team_id VARCHAR(MAX), league_id VARCHAR(MAX), w NUMERIC, l NUMERIC, g NUMERIC, gs NUMERIC, cg NUMERIC, sho NUMERIC, sv NUMERIC, ipouts NUMERIC, h NUMERIC, er NUMERIC, hr NUMERIC, bb NUMERIC, so NUMERIC, baopp NUMERIC, era NUMERIC, ibb NUMERIC, wp NUMERIC, hbp NUMERIC, bk NUMERIC, bfp NUMERIC, gf NUMERIC, r NUMERIC, sh NUMERIC, sf NUMERIC, g_idp NUMERIC)
CREATE TABLE pitching_postseason (player_id VARCHAR(MAX), year NUMERIC, round VARCHAR(MAX), team_id VARCHAR(MAX), league_id VARCHAR(MAX), w NUMERIC, l NUMERIC, g NUMERIC, gs NUMERIC, cg NUMERIC, sho NUMERIC, sv NUMERIC, ipouts NUMERIC, h NUMERIC, er NUMERIC, hr NUMERIC, bb NUMERIC, so NUMERIC, baopp VARCHAR(MAX), era NUMERIC, ibb NUMERIC, wp NUMERIC, hbp NUMERIC, bk NUMERIC, bfp NUMERIC, gf NUMERIC, r NUMERIC, sh NUMERIC, sf NUMERIC, g_idp NUMERIC)
CREATE TABLE college (college_id VARCHAR(MAX), name_full VARCHAR(MAX), city VARCHAR(MAX), state VARCHAR(MAX), country VARCHAR(MAX))
CREATE TABLE hall_of_fame (player_id VARCHAR(MAX), yearid NUMERIC, votedby VARCHAR(MAX), ballots NUMERIC, needed NUMERIC, votes NUMERIC, inducted VARCHAR(MAX), category VARCHAR(MAX), needed_note VARCHAR(MAX))
CREATE TABLE home_game (year NUMERIC, league_id VARCHAR(MAX), team_id VARCHAR(MAX), park_id VARCHAR(MAX), span_first VARCHAR(MAX), span_last VARCHAR(MAX), games NUMERIC, openings NUMERIC, attendance NUMERIC)
CREATE TABLE team_franchise (franchise_id VARCHAR(MAX), franchise_name VARCHAR(MAX), active VARCHAR(MAX), na_assoc VARCHAR(MAX))
CREATE TABLE batting_postseason (year NUMERIC, round VARCHAR(MAX), player_id VARCHAR(MAX), team_id VARCHAR(MAX), league_id VARCHAR(MAX), g NUMERIC, ab NUMERIC, r NUMERIC, h NUMERIC, double NUMERIC, triple NUMERIC, hr NUMERIC, rbi NUMERIC, sb NUMERIC, cs NUMERIC, bb NUMERIC, so NUMERIC, ibb NUMERIC, hbp NUMERIC, sh NUMERIC, sf NUMERIC, g_idp NUMERIC)
CREATE TABLE manager_award_vote (award_id VARCHAR(MAX), year NUMERIC, league_id VARCHAR(MAX), player_id VARCHAR(MAX), points_won NUMERIC, points_max NUMERIC, votes_first NUMERIC)
CREATE TABLE park (park_id VARCHAR(MAX), park_name VARCHAR(MAX), park_alias VARCHAR(MAX), city VARCHAR(MAX), state VARCHAR(MAX), country VARCHAR(MAX))
CREATE TABLE manager (player_id VARCHAR(MAX), year NUMERIC, team_id VARCHAR(MAX), league_id VARCHAR(MAX), inseason NUMERIC, g NUMERIC, w NUMERIC, l NUMERIC, rank NUMERIC, plyr_mgr VARCHAR(MAX))
CREATE TABLE batting (player_id VARCHAR(MAX), year NUMERIC, stint NUMERIC, team_id VARCHAR(MAX), league_id VARCHAR(MAX), g NUMERIC, ab NUMERIC, r NUMERIC, h NUMERIC, double NUMERIC, triple NUMERIC, hr NUMERIC, rbi NUMERIC, sb NUMERIC, cs NUMERIC, bb NUMERIC, so NUMERIC, ibb NUMERIC, hbp NUMERIC, sh NUMERIC, sf NUMERIC, g_idp NUMERIC)
CREATE TABLE all_star (player_id VARCHAR(MAX), year NUMERIC, game_num NUMERIC, game_id VARCHAR(MAX), team_id VARCHAR(MAX), league_id VARCHAR(MAX), gp NUMERIC, starting_pos NUMERIC)
CREATE TABLE fielding_outfield (player_id VARCHAR(MAX), year NUMERIC, stint NUMERIC, glf NUMERIC, gcf NUMERIC, grf NUMERIC)
CREATE TABLE appearances (year NUMERIC, team_id VARCHAR(MAX), league_id VARCHAR(MAX), player_id VARCHAR(MAX), g_all NUMERIC, gs NUMERIC, g_batting NUMERIC, g_defense NUMERIC, g_p NUMERIC, g_c NUMERIC, g_1b NUMERIC, g_2b NUMERIC, g_3b NUMERIC, g_ss NUMERIC, g_lf NUMERIC, g_cf NUMERIC, g_rf NUMERIC, g_of NUMERIC, g_dh NUMERIC, g_ph NUMERIC, g_pr NUMERIC)
| List the first and last name for players who participated in all star game in 1998. | SELECT name_first, name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE year = 1998 | SELECT [name_first], [name_last] FROM [player] AS [T1] JOIN [all_star] AS [T2] ON [T1].[player_id] = [T2].[player_id] WHERE [year] = 1998 | 0.133789 |
CREATE TABLE Payments (payment_id INTEGER, booking_id INTEGER, customer_id INTEGER, payment_type_code VARCHAR, amount_paid_in_full_yn VARCHAR, payment_date DATETIME2, amount_due NUMERIC, amount_paid NUMERIC)
CREATE TABLE Customers (customer_id INTEGER, coupon_id INTEGER, good_or_bad_customer VARCHAR, first_name VARCHAR, last_name VARCHAR, gender_mf VARCHAR, date_became_customer DATETIME2, date_last_hire DATETIME2)
CREATE TABLE Discount_Coupons (coupon_id INTEGER, date_issued DATETIME2, coupon_amount NUMERIC)
CREATE TABLE Bookings (booking_id INTEGER, customer_id INTEGER, booking_status_code VARCHAR, returned_damaged_yn VARCHAR, booking_start_date DATETIME2, booking_end_date DATETIME2, count_hired VARCHAR, amount_payable NUMERIC, amount_of_discount NUMERIC, amount_outstanding NUMERIC, amount_of_refund NUMERIC)
CREATE TABLE View_Product_Availability (product_id INTEGER, booking_id INTEGER, status_date DATETIME2, available_yn VARCHAR)
CREATE TABLE Products_Booked (booking_id INTEGER, product_id INTEGER, returned_yn VARCHAR, returned_late_yn VARCHAR, booked_count INTEGER, booked_amount FLOAT)
CREATE TABLE Products_for_Hire (product_id INTEGER, product_type_code VARCHAR, daily_hire_cost NUMERIC, product_name VARCHAR, product_description VARCHAR)
| What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check, and count them by a line chart, and show X from high to low order. | SELECT payment_date, COUNT(payment_date) FROM Payments WHERE amount_paid > 300 OR payment_type_code = 'Check' GROUP BY payment_date ORDER BY payment_date DESC | SELECT [payment_date], COUNT([payment_date]) FROM [Payments] WHERE [amount_paid] > 300 OR [payment_type_code] = 'Check' GROUP BY [payment_date] ORDER BY [payment_date] DESC | 0.167969 |
CREATE TABLE table_1841901_1 (macedonian VARCHAR, french VARCHAR)
| Name the macedonian for il/elle avait entendu | SELECT macedonian FROM table_1841901_1 WHERE french = "il/elle avait entendu" | SELECT [macedonian] FROM [table_1841901_1] WHERE [french] = [il/elle avait entendu] | 0.081055 |
CREATE TABLE table_77859 ([Code] FLOAT, [Type] VARCHAR(MAX), [Name] VARCHAR(MAX), [Area ( km 2 ) ] FLOAT, [Population] FLOAT, [Regional County Municipality] VARCHAR(MAX), [Metropolitan area] VARCHAR(MAX), [Region] FLOAT)
| What is the largest region with a Code smaller than 66112, and a Name of l' le-dorval? | SELECT MAX("Region") FROM table_77859 WHERE "Code" < '66112' AND "Name" = 'l''île-dorval' | SELECT MAX([Region]) FROM [table_77859] WHERE [Code] < '66112' AND [Name] = 'l''île-dorval' | 0.088867 |
CREATE TABLE Document_Locations (Document_ID INTEGER, Location_Code CHAR, Date_in_Location_From DATETIME2, Date_in_Locaton_To DATETIME2)
CREATE TABLE Documents_to_be_Destroyed (Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME2, Actual_Destruction_Date DATETIME2, Other_Details VARCHAR)
CREATE TABLE Employees (Employee_ID INTEGER, Role_Code CHAR, Employee_Name VARCHAR, Gender_MFU CHAR, Date_of_Birth DATETIME2, Other_Details VARCHAR)
CREATE TABLE Ref_Calendar (Calendar_Date DATETIME2, Day_Number INTEGER)
CREATE TABLE Roles (Role_Code CHAR, Role_Name VARCHAR, Role_Description VARCHAR)
CREATE TABLE All_Documents (Document_ID INTEGER, Date_Stored DATETIME2, Document_Type_Code CHAR, Document_Name CHAR, Document_Description CHAR, Other_Details VARCHAR)
CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR, Document_Type_Name VARCHAR, Document_Type_Description VARCHAR)
CREATE TABLE Ref_Locations (Location_Code CHAR, Location_Name VARCHAR, Location_Description VARCHAR)
| I want to see trend of day_number by calendar date | SELECT Calendar_Date, Day_Number FROM Ref_Calendar | SELECT [Calendar_Date], [Day_Number] FROM [Ref_Calendar] | 0.054688 |
CREATE TABLE table_14966667_19 (name VARCHAR, number VARCHAR)
| who is number 98? | SELECT name FROM table_14966667_19 WHERE number = "98" | SELECT [name] FROM [table_14966667_19] WHERE [98] = [number] | 0.058594 |
CREATE TABLE table_37100 ([Title] VARCHAR(MAX), [Date] VARCHAR(MAX), [Theatre] VARCHAR(MAX), [Role] VARCHAR(MAX), [Dance Partner] VARCHAR(MAX), [Director] VARCHAR(MAX), [Lyrics] VARCHAR(MAX), [Music] VARCHAR(MAX))
| Which Role has a Theatre of globe, and a Music of jerome kern? | SELECT "Role" FROM table_37100 WHERE "Theatre" = 'globe' AND "Music" = 'jerome kern' | SELECT [Role] FROM [table_37100] WHERE [Music] = 'jerome kern' AND [Theatre] = 'globe' | 0.083984 |
CREATE TABLE Faculty (FacID INTEGER, Lname VARCHAR, Fname VARCHAR, Rank VARCHAR, Sex VARCHAR, Phone INTEGER, Room VARCHAR, Building VARCHAR)
CREATE TABLE Activity (actid INTEGER, activity_name VARCHAR)
CREATE TABLE Student (StuID INTEGER, LName VARCHAR, Fname VARCHAR, Age INTEGER, Sex VARCHAR, Major INTEGER, Advisor INTEGER, city_code VARCHAR)
CREATE TABLE Faculty_Participates_in (FacID INTEGER, actid INTEGER)
CREATE TABLE Participates_in (stuid INTEGER, actid INTEGER)
| Return a bar chart on how many faculty members does each building have? List the result with the name of the building, order from high to low by the x axis. | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building DESC | SELECT [Building], COUNT(*) FROM [Faculty] GROUP BY [Building] ORDER BY [Building] DESC | 0.084961 |
CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname VARCHAR(MAX), treatmenttime TIME)
CREATE TABLE cost (costid NUMERIC, uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, eventtype VARCHAR(MAX), eventid NUMERIC, chargetime TIME, cost NUMERIC)
CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname VARCHAR(MAX), labresult NUMERIC, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME)
CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), allergyname VARCHAR(MAX), allergytime TIME)
CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname VARCHAR(MAX), diagnosistime TIME, icd9code VARCHAR(MAX))
CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath VARCHAR(MAX), celllabel VARCHAR(MAX), cellvaluenumeric NUMERIC, intakeoutputtime TIME)
CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname VARCHAR(MAX), dosage VARCHAR(MAX), routeadmin VARCHAR(MAX), drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid VARCHAR(MAX), patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender VARCHAR(MAX), age VARCHAR(MAX), ethnicity VARCHAR(MAX), hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource VARCHAR(MAX), unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus VARCHAR(MAX))
CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite VARCHAR(MAX), organism VARCHAR(MAX), culturetakentime TIME)
| in the last hospital encounter, when was patient 031-22988's first microbiology test time? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) ORDER BY microlab.culturetakentime LIMIT 1 | SELECT TOP 1 [microlab].[culturetakentime] FROM [microlab] WHERE [microlab].[patientunitstayid] IN (SELECT [patient].[patientunitstayid] FROM [patient] WHERE [patient].[patienthealthsystemstayid] IN (SELECT TOP 1 [patient].[patienthealthsystemstayid] FROM [patient] WHERE [patient].[uniquepid] = '031-22988' AND NOT [patient].[hospitaldischargetime] IS NULL ORDER BY [patient].[hospitaladmittime] DESC)) ORDER BY [microlab].[culturetakentime] | 0.431641 |
CREATE TABLE table_name_27 (team VARCHAR, make VARCHAR)
| What team drove a Dodge vehicle? | SELECT team FROM table_name_27 WHERE make = "dodge" | SELECT [team] FROM [table_name_27] WHERE [dodge] = [make] | 0.055664 |
CREATE TABLE table_name_30 (date VARCHAR, opponent VARCHAR, score VARCHAR)
| On what Date was the Score 106-104 against the Portland Trail Blazers? | SELECT date FROM table_name_30 WHERE opponent = "portland trail blazers" AND score = "106-104" | SELECT [date] FROM [table_name_30] WHERE [106-104] = [score] AND [opponent] = [portland trail blazers] | 0.099609 |
CREATE TABLE PostsWithDeleted (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body VARCHAR(MAX), OwnerUserId NUMERIC, OwnerDisplayName VARCHAR(MAX), LastEditorUserId NUMERIC, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMERIC, IsUniversal BIT, InputTitle VARCHAR(MAX), MarkdownInputGuidance VARCHAR(MAX), MarkdownPostOwnerGuidance VARCHAR(MAX), MarkdownPrivilegedUserGuidance VARCHAR(MAX), MarkdownConcensusDescription VARCHAR(MAX), CreationDate TIME, CreationModeratorId NUMERIC, ApprovalDate TIME, ApprovalModeratorId NUMERIC, DeactivationDate TIME, DeactivationModeratorId NUMERIC)
CREATE TABLE VoteTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE Comments (Id NUMERIC, PostId NUMERIC, Score NUMERIC, Text VARCHAR(MAX), CreationDate TIME, UserDisplayName VARCHAR(MAX), UserId NUMERIC, ContentLicense VARCHAR(MAX))
CREATE TABLE ReviewTaskResultTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewTaskStates (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE ReviewTaskTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE PostHistory (Id NUMERIC, PostHistoryTypeId NUMERIC, PostId NUMERIC, RevisionGUID other, CreationDate TIME, UserId NUMERIC, UserDisplayName VARCHAR(MAX), Comment VARCHAR(MAX), Text VARCHAR(MAX), ContentLicense VARCHAR(MAX))
CREATE TABLE PendingFlags (Id NUMERIC, FlagTypeId NUMERIC, PostId NUMERIC, CreationDate TIME, CloseReasonTypeId NUMERIC, CloseAsOffTopicReasonTypeId NUMERIC, DuplicateOfQuestionId NUMERIC, BelongsOnBaseHostAddress VARCHAR(MAX))
CREATE TABLE SuggestedEditVotes (Id NUMERIC, SuggestedEditId NUMERIC, UserId NUMERIC, VoteTypeId NUMERIC, CreationDate TIME, TargetUserId NUMERIC, TargetRepChange NUMERIC)
CREATE TABLE Badges (Id NUMERIC, UserId NUMERIC, Name VARCHAR(MAX), Date TIME, Class NUMERIC, TagBased BIT)
CREATE TABLE Users (Id NUMERIC, Reputation NUMERIC, CreationDate TIME, DisplayName VARCHAR(MAX), LastAccessDate TIME, WebsiteUrl VARCHAR(MAX), Location VARCHAR(MAX), AboutMe VARCHAR(MAX), Views NUMERIC, UpVotes NUMERIC, DownVotes NUMERIC, ProfileImageUrl VARCHAR(MAX), EmailHash VARCHAR(MAX), AccountId NUMERIC)
CREATE TABLE PostNotices (Id NUMERIC, PostId NUMERIC, PostNoticeTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body VARCHAR(MAX), OwnerUserId NUMERIC, DeletionUserId NUMERIC)
CREATE TABLE CloseReasonTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE FlagTypes (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX))
CREATE TABLE Posts (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body VARCHAR(MAX), OwnerUserId NUMERIC, OwnerDisplayName VARCHAR(MAX), LastEditorUserId NUMERIC, LastEditorDisplayName VARCHAR(MAX), LastEditDate TIME, LastActivityDate TIME, Title VARCHAR(MAX), Tags VARCHAR(MAX), AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense VARCHAR(MAX))
CREATE TABLE Tags (Id NUMERIC, TagName VARCHAR(MAX), Count NUMERIC, ExcerptPostId NUMERIC, WikiPostId NUMERIC)
CREATE TABLE TagSynonyms (Id NUMERIC, SourceTagName VARCHAR(MAX), TargetTagName VARCHAR(MAX), CreationDate TIME, OwnerUserId NUMERIC, AutoRenameCount NUMERIC, LastAutoRename TIME, Score NUMERIC, ApprovedByUserId NUMERIC, ApprovalDate TIME)
CREATE TABLE PostTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE Votes (Id NUMERIC, PostId NUMERIC, VoteTypeId NUMERIC, UserId NUMERIC, CreationDate TIME, BountyAmount NUMERIC)
CREATE TABLE PostTags (PostId NUMERIC, TagId NUMERIC)
CREATE TABLE ReviewTaskResults (Id NUMERIC, ReviewTaskId NUMERIC, ReviewTaskResultTypeId NUMERIC, CreationDate TIME, RejectionReasonId NUMERIC, Comment VARCHAR(MAX))
CREATE TABLE PostHistoryTypes (Id NUMERIC, Name VARCHAR(MAX))
CREATE TABLE PostFeedback (Id NUMERIC, PostId NUMERIC, IsAnonymous BIT, VoteTypeId NUMERIC, CreationDate TIME)
CREATE TABLE PostLinks (Id NUMERIC, CreationDate TIME, PostId NUMERIC, RelatedPostId NUMERIC, LinkTypeId NUMERIC)
CREATE TABLE PostNoticeTypes (Id NUMERIC, ClassId NUMERIC, Name VARCHAR(MAX), Body VARCHAR(MAX), IsHidden BIT, Predefined BIT, PostNoticeDurationId NUMERIC)
CREATE TABLE ReviewTasks (Id NUMERIC, ReviewTaskTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMERIC, PostId NUMERIC, SuggestedEditId NUMERIC, CompletedByReviewTaskId NUMERIC)
CREATE TABLE SuggestedEdits (Id NUMERIC, PostId NUMERIC, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMERIC, Comment VARCHAR(MAX), Text VARCHAR(MAX), Title VARCHAR(MAX), Tags VARCHAR(MAX), RevisionGUID other)
CREATE TABLE ReviewRejectionReasons (Id NUMERIC, Name VARCHAR(MAX), Description VARCHAR(MAX), PostTypeId NUMERIC)
| Recent questions from given users. | SELECT p.Id AS "post_link", u.Id AS "user_link", p.Score, p.CreationDate, p.ViewCount, p.Tags FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE u.Id IN ('##list##') AND p.PostTypeId = 1 ORDER BY p.Id DESC LIMIT 100 | SELECT TOP 100 [p].[id] AS [post_link], [u].[id] AS [user_link], [p].[score], [p].[creationdate], [p].[viewcount], [p].[tags] FROM [Users] AS [u] JOIN [Posts] AS [p] ON [p].[owneruserid] = [u].[id] AND [p].[posttypeid] = 1 WHERE [u].[id] IN ('##list##') ORDER BY [p].[id] DESC | 0.269531 |