schema
stringlengths
27
5.9k
question
stringlengths
3
990
rejected
stringlengths
2
4.44k
chosen
stringlengths
4
9.17k
weight
float64
0
8.95
CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING)
what is maximum age of patients whose primary disease is pneumonia;human immunodefiency virus;rule out tuberculosis and days of hospital stay is 5?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.days_stay = "5"
SELECT MAX(`demographic`.`age`) FROM `demographic` WHERE `5` = `demographic`.`days_stay` AND `PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS` = `demographic`.`diagnosis`
0.176758
CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING) CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING)
what number of divorced patients have been daignosed with parapelgia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Paraplegia"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `diagnoses` ON `Paraplegia` = `diagnoses`.`long_title` AND `demographic`.`hadm_id` = `diagnoses`.`hadm_id` WHERE `DIVORCED` = `demographic`.`marital_status`
0.224609
CREATE TABLE table_32526 (`Year` FLOAT64, `Name` STRING, `Date` STRING, `Stages` STRING, `Distance` STRING, `Winner` STRING, `Time` STRING)
What year has the time of 55:29:20?
SELECT COUNT("Year") FROM table_32526 WHERE "Time" = '55:29:20'
SELECT COUNT(`Year`) FROM `table_32526` WHERE `Time` = '55:29:20'
0.063477
CREATE TABLE table_5346 (`Year` STRING, `Men's singles` STRING, `Women's singles` STRING, `Men's doubles` STRING, `Women's doubles` STRING, `Mixed doubles` STRING)
Who played women's singles in 1933?
SELECT "Women's singles" FROM table_5346 WHERE "Year" = '1933'
SELECT `Women's singles` FROM `table_5346` WHERE `Year` = '1933'
0.0625
CREATE TABLE ReviewTasks (Id NUMERIC, ReviewTaskTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMERIC, PostId NUMERIC, SuggestedEditId NUMERIC, CompletedByReviewTaskId NUMERIC) CREATE TABLE Tags (Id NUMERIC, TagName STRING, Count NUMERIC, ExcerptPostId NUMERIC, WikiPostId NUMERIC) CREATE TABLE Posts (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body STRING, OwnerUserId NUMERIC, OwnerDisplayName STRING, LastEditorUserId NUMERIC, LastEditorDisplayName STRING, LastEditDate TIME, LastActivityDate TIME, Title STRING, Tags STRING, AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense STRING) CREATE TABLE ReviewTaskTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE ReviewTaskStates (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE Badges (Id NUMERIC, UserId NUMERIC, Name STRING, Date TIME, Class NUMERIC, TagBased BOOL) CREATE TABLE PostNoticeTypes (Id NUMERIC, ClassId NUMERIC, Name STRING, Body STRING, IsHidden BOOL, Predefined BOOL, PostNoticeDurationId NUMERIC) CREATE TABLE FlagTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE PostFeedback (Id NUMERIC, PostId NUMERIC, IsAnonymous BOOL, VoteTypeId NUMERIC, CreationDate TIME) CREATE TABLE PendingFlags (Id NUMERIC, FlagTypeId NUMERIC, PostId NUMERIC, CreationDate TIME, CloseReasonTypeId NUMERIC, CloseAsOffTopicReasonTypeId NUMERIC, DuplicateOfQuestionId NUMERIC, BelongsOnBaseHostAddress STRING) CREATE TABLE PostsWithDeleted (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body STRING, OwnerUserId NUMERIC, OwnerDisplayName STRING, LastEditorUserId NUMERIC, LastEditorDisplayName STRING, LastEditDate TIME, LastActivityDate TIME, Title STRING, Tags STRING, AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense STRING) CREATE TABLE Users (Id NUMERIC, Reputation NUMERIC, CreationDate TIME, DisplayName STRING, LastAccessDate TIME, WebsiteUrl STRING, Location STRING, AboutMe STRING, Views NUMERIC, UpVotes NUMERIC, DownVotes NUMERIC, ProfileImageUrl STRING, EmailHash STRING, AccountId NUMERIC) CREATE TABLE SuggestedEditVotes (Id NUMERIC, SuggestedEditId NUMERIC, UserId NUMERIC, VoteTypeId NUMERIC, CreationDate TIME, TargetUserId NUMERIC, TargetRepChange NUMERIC) CREATE TABLE PostTypes (Id NUMERIC, Name STRING) CREATE TABLE PostNotices (Id NUMERIC, PostId NUMERIC, PostNoticeTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body STRING, OwnerUserId NUMERIC, DeletionUserId NUMERIC) CREATE TABLE PostHistoryTypes (Id NUMERIC, Name STRING) CREATE TABLE PostLinks (Id NUMERIC, CreationDate TIME, PostId NUMERIC, RelatedPostId NUMERIC, LinkTypeId NUMERIC) CREATE TABLE SuggestedEdits (Id NUMERIC, PostId NUMERIC, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMERIC, Comment STRING, Text STRING, Title STRING, Tags STRING, RevisionGUID other) CREATE TABLE VoteTypes (Id NUMERIC, Name STRING) CREATE TABLE PostHistory (Id NUMERIC, PostHistoryTypeId NUMERIC, PostId NUMERIC, RevisionGUID other, CreationDate TIME, UserId NUMERIC, UserDisplayName STRING, Comment STRING, Text STRING, ContentLicense STRING) CREATE TABLE PostTags (PostId NUMERIC, TagId NUMERIC) CREATE TABLE Votes (Id NUMERIC, PostId NUMERIC, VoteTypeId NUMERIC, UserId NUMERIC, CreationDate TIME, BountyAmount NUMERIC) CREATE TABLE ReviewTaskResultTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE TagSynonyms (Id NUMERIC, SourceTagName STRING, TargetTagName STRING, CreationDate TIME, OwnerUserId NUMERIC, AutoRenameCount NUMERIC, LastAutoRename TIME, Score NUMERIC, ApprovedByUserId NUMERIC, ApprovalDate TIME) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMERIC, IsUniversal BOOL, InputTitle STRING, MarkdownInputGuidance STRING, MarkdownPostOwnerGuidance STRING, MarkdownPrivilegedUserGuidance STRING, MarkdownConcensusDescription STRING, CreationDate TIME, CreationModeratorId NUMERIC, ApprovalDate TIME, ApprovalModeratorId NUMERIC, DeactivationDate TIME, DeactivationModeratorId NUMERIC) CREATE TABLE ReviewTaskResults (Id NUMERIC, ReviewTaskId NUMERIC, ReviewTaskResultTypeId NUMERIC, CreationDate TIME, RejectionReasonId NUMERIC, Comment STRING) CREATE TABLE CloseReasonTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE Comments (Id NUMERIC, PostId NUMERIC, Score NUMERIC, Text STRING, CreationDate TIME, UserDisplayName STRING, UserId NUMERIC, ContentLicense STRING) CREATE TABLE ReviewRejectionReasons (Id NUMERIC, Name STRING, Description STRING, PostTypeId NUMERIC)
Questions Per Tag (Top Five) (By Month).
SELECT t.TagName FROM Tags AS t /* *, COUNT(*) AS Count FROM ( SELECT CAST( CAST(DATEPART(YYYY, CreationDate) AS varchar) + '-' + CAST(DATEPART(MM, CreationDate) AS varchar) + '-01' AS DATETIME) 'month', t.TagName FROM Posts p JOIN PostTags pt ON pt.PostId = p.Id JOIN Tags t ON t.Id = pt.TagId WHERE TagId IN ( SELECT TOP 5 Id FROM Tags ORDER BY Count DESC ) ) AS X WHERE 'month' >= CAST('2012-04-01' as datetime) AND 'month' < CAST('2012-07-01' as datetime) GROUP BY TagName, 'month' ORDER BY 'month' ASC, TagName ASC */ WHERE t.Id IN (SELECT Id FROM Tags ORDER BY Count DESC LIMIT 5)
SELECT `t`.`tagname` FROM `Tags` AS `t` /* *, COUNT(*) AS Count FROM ( SELECT CAST( CAST(DATEPART(YYYY, CreationDate) AS varchar) + '-' + CAST(DATEPART(MM, CreationDate) AS varchar) + '-01' AS DATETIME) 'month', t.TagName FROM Posts p JOIN PostTags pt ON pt.PostId = p.Id JOIN Tags t ON t.Id = pt.TagId WHERE TagId IN ( SELECT TOP 5 Id FROM Tags ORDER BY Count DESC ) ) AS X WHERE 'month' >= CAST('2012-04-01' as datetime) AND 'month' < CAST('2012-07-01' as datetime) GROUP BY TagName, 'month' ORDER BY 'month' ASC, TagName ASC */ WHERE `t`.`id` IN (SELECT `Id` FROM `Tags` ORDER BY `Count` DESC LIMIT 5)
0.589844
CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath STRING, celllabel STRING, cellvaluenumeric NUMERIC, intakeoutputtime TIME) CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite STRING, organism STRING, culturetakentime TIME) CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname STRING, dosage STRING, routeadmin STRING, drugstarttime TIME, drugstoptime TIME) CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname STRING, treatmenttime TIME) CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname STRING, labresult NUMERIC, labresulttime TIME) CREATE TABLE cost (costid NUMERIC, uniquepid STRING, patienthealthsystemstayid NUMERIC, eventtype STRING, eventid NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE patient (uniquepid STRING, patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender STRING, age STRING, ethnicity STRING, hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource STRING, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus STRING) CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname STRING, diagnosistime TIME, icd9code STRING) CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname STRING, allergyname STRING, 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)
how many patients since 5 years ago underwent anticoagulant administration - factor xa inhibitor after the previous pulmonary medicine consultation within 2 months?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'pulmonary medicine consultation' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'anticoagulant administration - factor xa inhibitor' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t2 WHERE t1.treatmenttime < t2.treatmenttime AND DATETIME(t2.treatmenttime) BETWEEN DATETIME(t1.treatmenttime) AND DATETIME(t1.treatmenttime, '+2 month')
SELECT COUNT(DISTINCT `patient`.`uniquepid`) FROM `treatment` JOIN `patient` ON `patient`.`patientunitstayid` = `treatment`.`patientunitstayid` JOIN `treatment` AS `treatment_2` ON `treatment`.`treatmenttime` < `treatment_2`.`treatmenttime` AND `treatment_2`.`treatmentname` = 'anticoagulant administration - factor xa inhibitor' AND DATETIME(`treatment`.`treatmenttime`) <= DATETIME(`treatment_2`.`treatmenttime`) AND DATETIME(`treatment`.`treatmenttime`, '+2 month') >= DATETIME(`treatment_2`.`treatmenttime`) AND DATETIME(`treatment_2`.`treatmenttime`) >= DATETIME(CURRENT_TIME(), '-5 year') JOIN `patient` AS `patient_2` ON `patient_2`.`patientunitstayid` = `treatment_2`.`patientunitstayid` WHERE `treatment`.`treatmentname` = 'pulmonary medicine consultation' AND DATETIME(`treatment`.`treatmenttime`) >= DATETIME(CURRENT_TIME(), '-5 year')
0.826172
CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING)
find the minimum age of patients with government insurance admitted in or after 2178.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.admityear >= "2178"
SELECT MIN(`demographic`.`age`) FROM `demographic` WHERE `2178` <= `demographic`.`admityear` AND `Government` = `demographic`.`insurance`
0.133789
CREATE TABLE table_51411 (`Year` FLOAT64, `Film` STRING, `Role` STRING, `Leading Man` STRING, `Director` STRING)
What film was the director william a. wellman, later than 1931 with a leading man of george brent, and a Role of joan gordon, aka francine la rue?
SELECT "Film" FROM table_51411 WHERE "Director" = 'william a. wellman' AND "Year" > '1931' AND "Leading Man" = 'george brent' AND "Role" = 'joan gordon, aka francine la rue'
SELECT `Film` FROM `table_51411` WHERE `Director` = 'william a. wellman' AND `Leading Man` = 'george brent' AND `Role` = 'joan gordon, aka francine la rue' AND `Year` > '1931'
0.170898
CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING)
count the number of patients whose death status is 0 and diagnoses icd9 code is 5712?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "5712"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `diagnoses` ON `5712` = `diagnoses`.`icd9_code` AND `demographic`.`hadm_id` = `diagnoses`.`hadm_id` WHERE `0` = `demographic`.`expire_flag`
0.208008
CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING) CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING)
Give the number of patients whose ethnicity is Hispanic or Latino and were born before the year 1850.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.dob_year < "1850"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` WHERE `1850` > `demographic`.`dob_year` AND `HISPANIC OR LATINO` = `demographic`.`ethnicity`
0.157227
CREATE TABLE table_2780146_6 (pm__g_kwh_ STRING, co__g_kwh_ STRING)
What's the PM for the standard with 12.3 g/kWh CO?
SELECT pm__g_kwh_ FROM table_2780146_6 WHERE co__g_kwh_ = "12.3"
SELECT `pm__g_kwh_` FROM `table_2780146_6` WHERE `12.3` = `co__g_kwh_`
0.068359
CREATE TABLE table_57930 (`Episode` STRING, `Air Date` STRING, `Rating` FLOAT64, `Share` FLOAT64, `Rating/Share 18\\u201349` STRING, `Viewers ( m ) ` FLOAT64, `Timeslot Rank` FLOAT64, `Night Rank` STRING, `Overall Rank` FLOAT64)
What is the rank of the episode with a share of 6 and timeslot rank smaller than 4?
SELECT AVG("Overall Rank") FROM table_57930 WHERE "Share" = '6' AND "Timeslot Rank" < '4'
SELECT AVG(`Overall Rank`) FROM `table_57930` WHERE `Share` = '6' AND `Timeslot Rank` < '4'
0.088867
CREATE TABLE table_55218 (`Home team` STRING, `Home team score` STRING, `Away team` STRING, `Away team score` STRING, `Venue` STRING, `Crowd` FLOAT64, `Date` STRING)
What is the score of the away team who played home team Hawthorn?
SELECT "Away team score" FROM table_55218 WHERE "Home team" = 'hawthorn'
SELECT `Away team score` FROM `table_55218` WHERE `Home team` = 'hawthorn'
0.072266
CREATE TABLE comment_instructor (instructor_id INT64, student_id INT64, score INT64, comment_text STRING) CREATE TABLE course_prerequisite (pre_course_id INT64, course_id INT64) CREATE TABLE jobs (job_id INT64, job_title STRING, description STRING, requirement STRING, city STRING, state STRING, country STRING, zip INT64) CREATE TABLE student_record (student_id INT64, course_id INT64, semester INT64, grade STRING, how STRING, transfer_source STRING, earn_credit STRING, repeat_term STRING, test_id STRING) CREATE TABLE course_tags_count (course_id INT64, clear_grading INT64, pop_quiz INT64, group_projects INT64, inspirational INT64, long_lectures INT64, extra_credit INT64, few_tests INT64, good_feedback INT64, tough_tests INT64, heavy_papers INT64, cares_for_students INT64, heavy_assignments INT64, respected INT64, participation INT64, heavy_reading INT64, tough_grader INT64, hilarious INT64, would_take_again INT64, good_lecture INT64, no_skip INT64) CREATE TABLE course_offering (offering_id INT64, course_id INT64, semester INT64, section_number INT64, start_time TIME, end_time TIME, monday STRING, tuesday STRING, wednesday STRING, thursday STRING, friday STRING, saturday STRING, sunday STRING, has_final_project STRING, has_final_exam STRING, textbook STRING, class_address STRING, allow_audit STRING) CREATE TABLE offering_instructor (offering_instructor_id INT64, offering_id INT64, instructor_id INT64) CREATE TABLE gsi (course_offering_id INT64, student_id INT64) CREATE TABLE program_course (program_id INT64, course_id INT64, workload INT64, category STRING) CREATE TABLE instructor (instructor_id INT64, name STRING, uniqname STRING) CREATE TABLE program (program_id INT64, name STRING, college STRING, introduction STRING) CREATE TABLE requirement (requirement_id INT64, requirement STRING, college STRING) CREATE TABLE program_requirement (program_id INT64, category STRING, min_credit INT64, additional_req STRING) CREATE TABLE course (course_id INT64, name STRING, department STRING, number STRING, credits STRING, advisory_requirement STRING, enforced_requirement STRING, description STRING, num_semesters INT64, num_enrolled INT64, has_discussion STRING, has_lab STRING, has_projects STRING, has_exams STRING, num_reviews INT64, clarity_score INT64, easiness_score INT64, helpfulness_score INT64) CREATE TABLE semester (semester_id INT64, semester STRING, year INT64) CREATE TABLE student (student_id INT64, lastname STRING, firstname STRING, program_id INT64, declare_major STRING, total_credit INT64, total_gpa FLOAT64, entered_as STRING, admit_term INT64, predicted_graduation_semester INT64, degree STRING, minor STRING, internship STRING) CREATE TABLE ta (campus_job_id INT64, student_id INT64, location STRING) CREATE TABLE area (course_id INT64, area STRING)
Do any professors besides Pinella teach The Writing of Poetry ?
SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%The Writing of Poetry%' AND NOT instructor.name LIKE '%Pinella%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id
SELECT DISTINCT `course`.`department`, `course`.`name`, `course`.`number`, `instructor`.`name` FROM `course` JOIN `course_offering` ON `course`.`course_id` = `course_offering`.`course_id` JOIN `offering_instructor` ON `course_offering`.`offering_id` = `offering_instructor`.`offering_id` JOIN `instructor` ON `instructor`.`instructor_id` = `offering_instructor`.`instructor_id` AND NOT `instructor`.`name` LIKE '%Pinella%' WHERE `course`.`name` LIKE '%The Writing of Poetry%'
0.463867
CREATE TABLE table_name_87 (Id STRING)
What is the 1990 value with a 24 in 1995?
SELECT 1990 FROM table_name_87 WHERE 1995 = "24"
SELECT 1990 FROM `table_name_87` WHERE `24` = 1995
0.048828
CREATE TABLE table_name_12 (laps INT64, grid STRING)
What is the low lap total for a grid of 14?
SELECT MIN(laps) FROM table_name_12 WHERE grid = 14
SELECT MIN(`laps`) FROM `table_name_12` WHERE `grid` = 14
0.055664
CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING)
what is the number of patients whose admission location is emergency room admit and procedure short title is arthrocentesis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Arthrocentesis"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `procedures` ON `Arthrocentesis` = `procedures`.`short_title` AND `demographic`.`hadm_id` = `procedures`.`hadm_id` WHERE `EMERGENCY ROOM ADMIT` = `demographic`.`admission_location`
0.248047
CREATE TABLE department (departmentid NUMERIC, name STRING, head NUMERIC) CREATE TABLE prescribes (physician NUMERIC, patient NUMERIC, medication NUMERIC, date TIME, appointment NUMERIC, dose STRING) CREATE TABLE affiliated_with (physician NUMERIC, department NUMERIC, primaryaffiliation BOOL) CREATE TABLE trained_in (physician NUMERIC, treatment NUMERIC, certificationdate TIME, certificationexpires TIME) CREATE TABLE block (blockfloor NUMERIC, blockcode NUMERIC) CREATE TABLE procedures (code NUMERIC, name STRING, cost NUMERIC) CREATE TABLE on_call (nurse NUMERIC, blockfloor NUMERIC, blockcode NUMERIC, oncallstart TIME, oncallend TIME) CREATE TABLE room (roomnumber NUMERIC, roomtype STRING, blockfloor NUMERIC, blockcode NUMERIC, unavailable BOOL) CREATE TABLE stay (stayid NUMERIC, patient NUMERIC, room NUMERIC, staystart TIME, stayend TIME) CREATE TABLE nurse (employeeid NUMERIC, name STRING, position STRING, registered BOOL, ssn NUMERIC) CREATE TABLE undergoes (patient NUMERIC, procedures NUMERIC, stay NUMERIC, dateundergoes TIME, physician NUMERIC, assistingnurse NUMERIC) CREATE TABLE appointment (appointmentid NUMERIC, patient NUMERIC, prepnurse NUMERIC, physician NUMERIC, start TIME, `end` TIME, examinationroom STRING) CREATE TABLE physician (employeeid NUMERIC, name STRING, position STRING, ssn NUMERIC) CREATE TABLE patient (ssn NUMERIC, name STRING, address STRING, phone STRING, insuranceid NUMERIC, pcp NUMERIC) CREATE TABLE medication (code NUMERIC, name STRING, brand STRING, description STRING)
What are the names of the physicians who have 'senior' in their titles.
SELECT name FROM physician WHERE position LIKE '%senior%'
SELECT `name` FROM `physician` WHERE `position` LIKE '%senior%'
0.061523
CREATE TABLE table_21312 (`Game` FLOAT64, `Date` STRING, `Opponent` STRING, `Score` STRING, `High points` STRING, `High rebounds` STRING, `High assists` STRING, `Location/Attendance` STRING, `Record` STRING)
Namethe score for july 16
SELECT "Score" FROM table_21312 WHERE "Date" = 'July 16'
SELECT `Score` FROM `table_21312` WHERE `Date` = 'July 16'
0.056641
CREATE TABLE table_21100348_15 (rank STRING, player STRING)
What is the rank of Tim Paine?
SELECT rank FROM table_21100348_15 WHERE player = "Tim Paine"
SELECT `rank` FROM `table_21100348_15` WHERE `Tim Paine` = `player`
0.06543
CREATE TABLE table_name_72 (character_name STRING, release_date STRING)
What was the character name for the film with a release date of July 29, 1938?
SELECT character_name FROM table_name_72 WHERE release_date = "july 29, 1938"
SELECT `character_name` FROM `table_name_72` WHERE `july 29, 1938` = `release_date`
0.081055
CREATE TABLE table_name_16 (gold INT64, rank STRING, total STRING)
Tell me the lowest gold for rank of 6 and total less than 2
SELECT MIN(gold) FROM table_name_16 WHERE rank = "6" AND total < 2
SELECT MIN(`gold`) FROM `table_name_16` WHERE `6` = `rank` AND `total` < 2
0.072266
CREATE TABLE table_78417 (`Home team` STRING, `Home team score` STRING, `Away team` STRING, `Away team score` STRING, `Venue` STRING, `Crowd` FLOAT64, `Date` STRING)
Who was the home team in the game where North Melbourne was the away team?
SELECT "Home team score" FROM table_78417 WHERE "Away team" = 'north melbourne'
SELECT `Home team score` FROM `table_78417` WHERE `Away team` = 'north melbourne'
0.079102
CREATE TABLE table_203_447 (id NUMERIC, `constituency` NUMERIC, `region` STRING, `name` STRING, `party` STRING, `last elected` NUMERIC)
what is the difference in years between constiuency 1 and 2 ?
SELECT (SELECT "last elected" FROM table_203_447 WHERE "constituency" = 1) - (SELECT "last elected" FROM table_203_447 WHERE "constituency" = 2)
SELECT (SELECT `last elected` FROM `table_203_447` WHERE `constituency` = 1) - (SELECT `last elected` FROM `table_203_447` WHERE `constituency` = 2)
0.144531
CREATE TABLE table_19210674_1 (finale STRING, rank STRING)
What is the finale number ranked at number 7?
SELECT finale FROM table_19210674_1 WHERE rank = 7
SELECT `finale` FROM `table_19210674_1` WHERE `rank` = 7
0.054688
CREATE TABLE plays_games (stuid NUMERIC, gameid NUMERIC, hours_played NUMERIC) CREATE TABLE sportsinfo (stuid NUMERIC, sportname STRING, hoursperweek NUMERIC, gamesplayed NUMERIC, onscholarship STRING) CREATE TABLE video_games (gameid NUMERIC, gname STRING, gtype STRING) CREATE TABLE student (stuid NUMERIC, lname STRING, fname STRING, age NUMERIC, sex STRING, major NUMERIC, advisor NUMERIC, city_code STRING)
Show ids of students who play video game and play sports.
SELECT stuid FROM sportsinfo INTERSECT SELECT stuid FROM plays_games
SELECT `stuid` FROM `sportsinfo` INTERSECT DISTINCT SELECT `stuid` FROM `plays_games`
0.083008
CREATE TABLE table_name_91 (bronze INT64, total STRING, gold STRING, rank STRING)
What's the lowest bronze with a 6 rank, smaller than 5 gold, and a total of more than 1?
SELECT MIN(bronze) FROM table_name_91 WHERE gold < 5 AND rank = "6" AND total > 1
SELECT MIN(`bronze`) FROM `table_name_91` WHERE `6` = `rank` AND `gold` < 5 AND `total` > 1
0.088867
CREATE TABLE table_name_14 (venue STRING, home_team STRING)
Where did Carlton play as the home team?
SELECT venue FROM table_name_14 WHERE home_team = "carlton"
SELECT `venue` FROM `table_name_14` WHERE `carlton` = `home_team`
0.063477
CREATE TABLE table_32652 (`Home team` STRING, `Home team score` STRING, `Away team` STRING, `Away team score` STRING, `Venue` STRING, `Crowd` FLOAT64, `Date` STRING)
What is the largest crowd when the home team scores 14.12 (96)?
SELECT MAX("Crowd") FROM table_32652 WHERE "Home team score" = '14.12 (96)'
SELECT MAX(`Crowd`) FROM `table_32652` WHERE `Home team score` = '14.12 (96)'
0.075195
CREATE TABLE table_name_84 (position STRING, player STRING)
What Position does the Player Vince Carter hold?
SELECT position FROM table_name_84 WHERE player = "vince carter"
SELECT `position` FROM `table_name_84` WHERE `player` = `vince carter`
0.068359
CREATE TABLE table_28946 (`District` STRING, `Incumbent` STRING, `Party` STRING, `First elected` FLOAT64, `Result` STRING, `Candidates` STRING)
How many times were the candidates leven powell (f) 63.8% roger west (dr) 36.4%?
SELECT COUNT("First elected") FROM table_28946 WHERE "Candidates" = 'Leven Powell (F) 63.8% Roger West (DR) 36.4%'
SELECT COUNT(`First elected`) FROM `table_28946` WHERE `Candidates` = 'Leven Powell (F) 63.8% Roger West (DR) 36.4%'
0.113281
CREATE TABLE table_name_77 (attendance STRING, loss STRING)
What was the attendance when Nakamura (0-1) lost?
SELECT attendance FROM table_name_77 WHERE loss = "nakamura (0-1)"
SELECT `attendance` FROM `table_name_77` WHERE `loss` = `nakamura (0-1)`
0.070313
CREATE TABLE table_39688 (`Rank` STRING, `Nation` STRING, `Gold` FLOAT64, `Silver` FLOAT64, `Bronze` FLOAT64, `Total` FLOAT64)
What is the number of Bronze medals of the Nation with 64 total and silver greater than 16?
SELECT COUNT("Bronze") FROM table_39688 WHERE "Total" = '64' AND "Silver" > '16'
SELECT COUNT(`Bronze`) FROM `table_39688` WHERE `Silver` > '16' AND `Total` = '64'
0.080078
CREATE TABLE table_24086 (`County` STRING, `Won by` STRING, `Walker %` FLOAT64, `Walker votes` FLOAT64, `Barrett %` FLOAT64, `Barrett votes` FLOAT64)
What percentage did Walker win in Calumet county?
SELECT "Walker %" FROM table_24086 WHERE "County" = 'Calumet'
SELECT `Walker %` FROM `table_24086` WHERE `County` = 'Calumet'
0.061523
CREATE TABLE table_61360 (`Outcome` STRING, `Date` FLOAT64, `Championship` STRING, `Surface` STRING, `Opponent in the final` STRING, `Score in the final` STRING)
What Championship has an Opponent in the final of aaron krickstein, and a Score in the final of 7 5, 6 2?
SELECT "Championship" FROM table_61360 WHERE "Opponent in the final" = 'aaron krickstein' AND "Score in the final" = '7–5, 6–2'
SELECT `Championship` FROM `table_61360` WHERE `Opponent in the final` = 'aaron krickstein' AND `Score in the final` = '7–5, 6–2'
0.125977
CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname STRING, diagnosistime TIME, icd9code STRING) CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname STRING, allergyname STRING, allergytime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath STRING, celllabel STRING, cellvaluenumeric NUMERIC, intakeoutputtime TIME) CREATE TABLE cost (costid NUMERIC, uniquepid STRING, patienthealthsystemstayid NUMERIC, eventtype STRING, eventid NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite STRING, organism STRING, culturetakentime TIME) CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname STRING, 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 treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname STRING, treatmenttime TIME) CREATE TABLE patient (uniquepid STRING, patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender STRING, age STRING, ethnicity STRING, hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource STRING, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus STRING) CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname STRING, dosage STRING, routeadmin STRING, drugstarttime TIME, drugstoptime TIME)
when was the first time patient 006-229746 had a respiration measured on the last intensive care unit visit.
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-229746') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) AND NOT vitalperiodic.respiration IS NULL ORDER BY vitalperiodic.observationtime LIMIT 1
WITH `_u_0` AS (SELECT `patient`.`patienthealthsystemstayid` FROM `patient` WHERE `patient`.`uniquepid` = '006-229746' GROUP BY `patienthealthsystemstayid`) SELECT `vitalperiodic`.`observationtime` FROM `vitalperiodic` WHERE `vitalperiodic`.`patientunitstayid` IN (SELECT `patient`.`patientunitstayid` FROM `patient` LEFT JOIN `_u_0` AS `_u_0` ON `_u_0`.`` = `patient`.`patienthealthsystemstayid` WHERE NOT `_u_0`.`` IS NULL AND NOT `patient`.`unitdischargetime` IS NULL ORDER BY `patient`.`unitadmittime` DESC LIMIT 1) AND NOT `vitalperiodic`.`respiration` IS NULL ORDER BY `vitalperiodic`.`observationtime` LIMIT 1
0.601563
CREATE TABLE table_name_1 (race_winner STRING, round STRING)
Who won the round in Europe?
SELECT race_winner FROM table_name_1 WHERE round = "europe"
SELECT `race_winner` FROM `table_name_1` WHERE `europe` = `round`
0.063477
CREATE TABLE body_builder (Body_Builder_ID INT64, People_ID INT64, Snatch FLOAT64, Clean_Jerk FLOAT64, Total FLOAT64) CREATE TABLE people (People_ID INT64, Name STRING, Height FLOAT64, Weight FLOAT64, Birth_Date STRING, Birth_Place STRING)
Visualize the relationship between Snatch and Clean_Jerk .
SELECT Snatch, Clean_Jerk FROM body_builder
SELECT `Snatch`, `Clean_Jerk` FROM `body_builder`
0.047852
CREATE TABLE table_30161 (`Proceed to Quarter-final` STRING, `Match points` STRING, `Aggregate score` STRING, `Points margin` FLOAT64, `Eliminated from competition` STRING)
Who proceeded to the quarter finals with a points margin of 21?
SELECT "Proceed to Quarter-final" FROM table_30161 WHERE "Points margin" = '21'
SELECT `Proceed to Quarter-final` FROM `table_30161` WHERE `Points margin` = '21'
0.079102
CREATE TABLE table_7180 (`Television service` STRING, `Country` STRING, `Language` STRING, `Content` STRING, `HDTV` STRING, `Package/Option` STRING)
What is Country, when HDTV is yes, and when Content is cinema?
SELECT "Country" FROM table_7180 WHERE "HDTV" = 'yes' AND "Content" = 'cinema'
SELECT `Country` FROM `table_7180` WHERE `Content` = 'cinema' AND `HDTV` = 'yes'
0.078125
CREATE TABLE table_name_87 (elimination STRING, eliminated_by STRING)
What Elimination number is listed againt Eliminated by Sonjay Dutt?
SELECT elimination FROM table_name_87 WHERE eliminated_by = "sonjay dutt"
SELECT `elimination` FROM `table_name_87` WHERE `eliminated_by` = `sonjay dutt`
0.077148
CREATE TABLE table_45783 (`Place` STRING, `Player` STRING, `Country` STRING, `Score` STRING, `To par` STRING, `Money ( $ ) ` STRING)
WHAT IS THE PLACE WITH A SCORE OF 76-69-64-70=279?
SELECT "Place" FROM table_45783 WHERE "Score" = '76-69-64-70=279'
SELECT `Place` FROM `table_45783` WHERE `Score` = '76-69-64-70=279'
0.06543
CREATE TABLE table_23917 (`Year` STRING, `Head Coach` STRING, `Regular Season Record ( W-L ) ` STRING, `NEC Record` STRING, `Standing` STRING, `NEC Tournament Record` STRING)
Name the year for standing 9th
SELECT "Year" FROM table_23917 WHERE "Standing" = '9th'
SELECT `Year` FROM `table_23917` WHERE `Standing` = '9th'
0.055664
CREATE TABLE table_name_49 (attendance STRING, game STRING, date STRING)
Which Attendance has a Game smaller than 3, and a Date of october 31?
SELECT COUNT(attendance) FROM table_name_49 WHERE game < 3 AND date = "october 31"
SELECT COUNT(`attendance`) FROM `table_name_49` WHERE `date` = `october 31` AND `game` < 3
0.087891
CREATE TABLE table_56946 (`Street` STRING, `West` STRING, `East` STRING, `# of lanes` STRING, `Traffic direction` STRING)
What is the traffic direction of 64th street with 2nd avenue to the west and 1 lane?
SELECT "Traffic direction" FROM table_56946 WHERE "West" = '2nd avenue' AND "# of lanes" = '1' AND "Street" = '64th street'
SELECT `Traffic direction` FROM `table_56946` WHERE `# of lanes` = '1' AND `Street` = '64th street' AND `West` = '2nd avenue'
0.12207
CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING) CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING)
how many of the patients on urgent admission had item id 50803?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50803"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `lab` ON `50803` = `lab`.`itemid` AND `demographic`.`hadm_id` = `lab`.`hadm_id` WHERE `URGENT` = `demographic`.`admission_type`
0.196289
CREATE TABLE procedures_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code STRING, 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 labevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom STRING) CREATE TABLE d_icd_diagnoses (row_id NUMERIC, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE cost (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, event_type STRING, event_id NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE admissions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, admittime TIME, dischtime TIME, admission_type STRING, admission_location STRING, discharge_location STRING, insurance STRING, language STRING, marital_status STRING, ethnicity STRING, age NUMERIC) CREATE TABLE d_labitems (row_id NUMERIC, itemid NUMERIC, label STRING) CREATE TABLE d_icd_procedures (row_id NUMERIC, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE prescriptions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, startdate TIME, enddate TIME, drug STRING, dose_val_rx STRING, dose_unit_rx STRING, route STRING) CREATE TABLE patients (row_id NUMERIC, subject_id NUMERIC, gender STRING, dob TIME, dod TIME) CREATE TABLE transfers (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, eventtype STRING, careunit STRING, wardid NUMERIC, intime TIME, outtime TIME) CREATE TABLE diagnoses_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code STRING, charttime TIME) CREATE TABLE icustays (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, first_careunit STRING, last_careunit STRING, first_wardid NUMERIC, last_wardid NUMERIC, intime TIME, outtime TIME) CREATE TABLE chartevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom STRING) CREATE TABLE outputevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, value NUMERIC) CREATE TABLE d_items (row_id NUMERIC, itemid NUMERIC, label STRING, linksto STRING) CREATE TABLE microbiologyevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, charttime TIME, spec_type_desc STRING, org_name STRING)
what is the unabbreviated version of the act lym leuk w rmsion?
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'act lym leuk w rmsion' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'act lym leuk w rmsion'
SELECT `d_icd_diagnoses`.`long_title` FROM `d_icd_diagnoses` WHERE `d_icd_diagnoses`.`short_title` = 'act lym leuk w rmsion' UNION DISTINCT SELECT `d_icd_procedures`.`long_title` FROM `d_icd_procedures` WHERE `d_icd_procedures`.`short_title` = 'act lym leuk w rmsion'
0.260742
CREATE TABLE table_2668254_8 (candidates STRING, district STRING)
Who were the candidates in the Kentucky 9 district?
SELECT candidates FROM table_2668254_8 WHERE district = "Kentucky 9"
SELECT `candidates` FROM `table_2668254_8` WHERE `Kentucky 9` = `district`
0.072266
CREATE TABLE table_name_33 (report STRING, winning_driver STRING, circuit STRING)
Which report has a Winning driver of peter collins, and a Circuit of syracuse?
SELECT report FROM table_name_33 WHERE winning_driver = "peter collins" AND circuit = "syracuse"
SELECT `report` FROM `table_name_33` WHERE `circuit` = `syracuse` AND `peter collins` = `winning_driver`
0.101563
CREATE TABLE table_33877 (`Player` STRING, `Ranking` STRING, `Event` STRING, `Surface` STRING, `Round` STRING, `Score` STRING)
Which Player has a Score of 6 4, 7 6 (7 5)?
SELECT "Player" FROM table_33877 WHERE "Score" = '6–4, 7–6 (7–5)'
SELECT `Player` FROM `table_33877` WHERE `Score` = '6–4, 7–6 (7–5)'
0.06543
CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING)
How many patients are born before 2197 and with procedure icd9 code 309?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2197" AND procedures.icd9_code = "309"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `procedures` ON `309` = `procedures`.`icd9_code` AND `demographic`.`hadm_id` = `procedures`.`hadm_id` WHERE `2197` > `demographic`.`dob_year`
0.209961
CREATE TABLE table_71922 (`Year` STRING, `Start` STRING, `Qual` STRING, `Rank` STRING, `Finish` STRING, `Laps` FLOAT64)
What is the start of lap 55?
SELECT "Start" FROM table_71922 WHERE "Laps" = '55'
SELECT `Start` FROM `table_71922` WHERE `Laps` = '55'
0.051758
CREATE TABLE table_name_72 (position STRING, nationality STRING, goals STRING)
What is the position of the player from England with 62 goals?
SELECT position FROM table_name_72 WHERE nationality = "england" AND goals = "62"
SELECT `position` FROM `table_name_72` WHERE `62` = `goals` AND `england` = `nationality`
0.086914
CREATE TABLE table_20325360_2 (total INT64, country_territory STRING)
How many competitors in total, for the Mr. International competition, does Brazil have?
SELECT MAX(total) FROM table_20325360_2 WHERE country_territory = "Brazil"
SELECT MAX(`total`) FROM `table_20325360_2` WHERE `Brazil` = `country_territory`
0.078125
CREATE TABLE table_55296 (`Grid` FLOAT64, `Driver` STRING, `Constructor` STRING, `Qual` FLOAT64, `Rank` FLOAT64, `Laps` FLOAT64, `Time/Retired` STRING)
I want the total number of rank for Grid less than 20 and dick rathmann and Qual more than 130.92
SELECT COUNT("Rank") FROM table_55296 WHERE "Grid" < '20' AND "Driver" = 'dick rathmann' AND "Qual" > '130.92'
SELECT COUNT(`Rank`) FROM `table_55296` WHERE `Driver` = 'dick rathmann' AND `Grid` < '20' AND `Qual` > '130.92'
0.109375
CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING) CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING)
what is the number of patients whose admission year is less than 2194 and diagnoses long title is hypopotassemia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2194" AND diagnoses.long_title = "Hypopotassemia"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `diagnoses` ON `Hypopotassemia` = `diagnoses`.`long_title` AND `demographic`.`hadm_id` = `diagnoses`.`hadm_id` WHERE `2194` > `demographic`.`admityear`
0.219727
CREATE TABLE table_61229 (`Week` FLOAT64, `Date` STRING, `Opponent` STRING, `Result` STRING, `Attendance` STRING)
Who was the opponent after week 16?
SELECT "Opponent" FROM table_61229 WHERE "Week" > '16'
SELECT `Opponent` FROM `table_61229` WHERE `Week` > '16'
0.054688
CREATE TABLE table_11602313_4 (fsb STRING, part_number_s_ STRING)
What is the FSB of the model with part number lf80537gf0411m?
SELECT fsb FROM table_11602313_4 WHERE part_number_s_ = "LF80537GF0411M"
SELECT `fsb` FROM `table_11602313_4` WHERE `LF80537GF0411M` = `part_number_s_`
0.076172
CREATE TABLE table_204_178 (id NUMERIC, `number` STRING, `south/west end` STRING, `north/east end` STRING, `formed` STRING, `eliminated` STRING)
is oregon route 69 newer than oregon route 90 ?
SELECT (SELECT "formed" FROM table_204_178 WHERE "number" = 'oregon route 69') > (SELECT "formed" FROM table_204_178 WHERE "number" = 'oregon route 90')
SELECT (SELECT `formed` FROM `table_204_178` WHERE `number` = 'oregon route 69') > (SELECT `formed` FROM `table_204_178` WHERE `number` = 'oregon route 90')
0.152344
CREATE TABLE reviewer (rid NUMERIC, name STRING) CREATE TABLE movie (mid NUMERIC, title STRING, year NUMERIC, director STRING) CREATE TABLE rating (rid NUMERIC, mid NUMERIC, stars NUMERIC, ratingdate TIME)
What are the names of all movies that were created after the most recent Steven Spielberg film?
SELECT title FROM movie WHERE year > (SELECT MAX(year) FROM movie WHERE director = "Steven Spielberg")
SELECT `title` FROM `movie` WHERE `year` > (SELECT MAX(`year`) FROM `movie` WHERE `Steven Spielberg` = `director`)
0.111328
CREATE TABLE airline (airline_code STRING, airline_name STRING, note STRING) CREATE TABLE city (city_code STRING, city_name STRING, state_code STRING, country_name STRING, time_zone_code STRING) CREATE TABLE food_service (meal_code STRING, meal_number INT64, compartment STRING, meal_description STRING) CREATE TABLE time_interval (period STRING, begin_time INT64, end_time INT64) CREATE TABLE flight (aircraft_code_sequence STRING, airline_code STRING, airline_flight STRING, arrival_time INT64, connections INT64, departure_time INT64, dual_carrier STRING, flight_days STRING, flight_id INT64, flight_number INT64, from_airport STRING, meal_code STRING, stops INT64, time_elapsed INT64, to_airport STRING) CREATE TABLE flight_leg (flight_id INT64, leg_number INT64, leg_flight INT64) CREATE TABLE compartment_class (compartment STRING, class_type STRING) CREATE TABLE airport_service (city_code STRING, airport_code STRING, miles_distant INT64, direction STRING, minutes_distant INT64) CREATE TABLE month (month_number INT64, month_name STRING) CREATE TABLE code_description (code STRING, description STRING) CREATE TABLE time_zone (time_zone_code STRING, time_zone_name STRING, hours_from_gmt INT64) CREATE TABLE state (state_code STRING, state_name STRING, country_name STRING) CREATE TABLE aircraft (aircraft_code STRING, aircraft_description STRING, manufacturer STRING, basic_type STRING, engines INT64, propulsion STRING, wide_body STRING, wing_span INT64, length INT64, weight INT64, capacity INT64, pay_load INT64, cruising_speed INT64, range_miles INT64, pressurized STRING) CREATE TABLE fare (fare_id INT64, from_airport STRING, to_airport STRING, fare_basis_code STRING, fare_airline STRING, restriction_code STRING, one_direction_cost INT64, round_trip_cost INT64, round_trip_required STRING) CREATE TABLE equipment_sequence (aircraft_code_sequence STRING, aircraft_code STRING) CREATE TABLE class_of_service (booking_class STRING, rank INT64, class_description STRING) CREATE TABLE restriction (restriction_code STRING, advance_purchase INT64, stopovers STRING, saturday_stay_required STRING, minimum_stay INT64, maximum_stay INT64, application STRING, no_discounts STRING) CREATE TABLE fare_basis (fare_basis_code STRING, booking_class STRING, class_type STRING, premium STRING, economy STRING, discounted STRING, night STRING, season STRING, basis_days STRING) CREATE TABLE airport (airport_code STRING, airport_name STRING, airport_location STRING, state_code STRING, country_name STRING, time_zone_code STRING, minimum_connect_time INT64) CREATE TABLE flight_fare (flight_id INT64, fare_id INT64) CREATE TABLE days (days_code STRING, day_name STRING) CREATE TABLE date_day (month_number INT64, day_number INT64, year INT64, day_name STRING) CREATE TABLE ground_service (city_code STRING, airport_code STRING, transport_type STRING, ground_fare INT64) CREATE TABLE flight_stop (flight_id INT64, stop_number INT64, stop_days STRING, stop_airport STRING, arrival_time INT64, arrival_airline STRING, arrival_flight_number INT64, departure_time INT64, departure_airline STRING, departure_flight_number INT64, stop_time INT64) CREATE TABLE dual_carrier (main_airline STRING, low_flight_number INT64, high_flight_number INT64, dual_airline STRING, service_name STRING)
show me all flights from OAKLAND to PHILADELPHIA on saturday which serve a meal and arrive in PHILADELPHIA before 1200
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, food_service WHERE (((flight.arrival_time < 1200 AND food_service.meal_code = flight.meal_code) AND date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
SELECT DISTINCT `flight`.`flight_id` FROM `airport_service` AS `AIRPORT_SERVICE_0` JOIN `date_day` ON `date_day`.`day_number` = 26 AND `date_day`.`month_number` = 7 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` = 'OAKLAND' 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`.`arrival_time` < 1200 JOIN `airport_service` AS `AIRPORT_SERVICE_1` ON `AIRPORT_SERVICE_1`.`airport_code` = `flight`.`to_airport` JOIN `food_service` ON `flight`.`meal_code` = `food_service`.`meal_code` JOIN `city` AS `CITY_1` ON `AIRPORT_SERVICE_1`.`city_code` = `CITY_1`.`city_code` AND `CITY_1`.`city_name` = 'PHILADELPHIA'
0.81543
CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING) CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING)
count the number of patients whose admission type is newborn and lab test name is phosphate.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.label = "Phosphate"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `lab` ON `Phosphate` = `lab`.`label` AND `demographic`.`hadm_id` = `lab`.`hadm_id` WHERE `NEWBORN` = `demographic`.`admission_type`
0.200195
CREATE TABLE student (stuid NUMERIC, lname STRING, fname STRING, age NUMERIC, sex STRING, major NUMERIC, advisor NUMERIC, city_code STRING) CREATE TABLE has_allergy (stuid NUMERIC, allergy STRING) CREATE TABLE allergy_type (allergy STRING, allergytype STRING)
Which students are unaffected by allergies?
SELECT stuid FROM student EXCEPT SELECT stuid FROM has_allergy
SELECT `stuid` FROM `student` EXCEPT DISTINCT SELECT `stuid` FROM `has_allergy`
0.077148
CREATE TABLE table_name_40 (Id STRING)
What is the 2004 Lukoil oil prodroduction when in 2011 oil production 90.917 million tonnes?
SELECT 2004 FROM table_name_40 WHERE 2011 = "90.917"
SELECT 2004 FROM `table_name_40` WHERE `90.917` = 2011
0.052734
CREATE TABLE table_28030 (`Player` STRING, `Position` STRING, `Starter` STRING, `Touchdowns` FLOAT64, `Extra points` FLOAT64, `Field goals` FLOAT64, `Points` FLOAT64)
How many touchdowns did the player took which gained 25 points?
SELECT "Touchdowns" FROM table_28030 WHERE "Points" = '25'
SELECT `Touchdowns` FROM `table_28030` WHERE `Points` = '25'
0.058594
CREATE TABLE Manufacturers (Code INT64, Name STRING, Headquarter STRING, Founder STRING, Revenue FLOAT64) CREATE TABLE Products (Code INT64, Name STRING, Price NUMERIC, Manufacturer INT64)
For those records from the products and each product's manufacturer, give me the comparison about the average of revenue over the founder , and group by attribute founder by a bar chart, show by the x-axis in asc.
SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
SELECT `Founder`, AVG(`Revenue`) FROM `Products` AS `T1` JOIN `Manufacturers` AS `T2` ON `T1`.`manufacturer` = `T2`.`code` GROUP BY `Founder` ORDER BY `Founder`
0.15625
CREATE TABLE table_name_4 (date STRING, score_in_the_final STRING)
What Date has a Score in the final of 3 6, 2 6, 4 6?
SELECT date FROM table_name_4 WHERE score_in_the_final = "3–6, 2–6, 4–6"
SELECT `date` FROM `table_name_4` WHERE `3–6, 2–6, 4–6` = `score_in_the_final`
0.076172
CREATE TABLE table_4502 (`Home team` STRING, `Home team score` STRING, `Away team` STRING, `Away team score` STRING, `Venue` STRING, `Crowd` FLOAT64, `Date` STRING)
Where was the game held where the home team scored 17.18 (120)?
SELECT "Venue" FROM table_4502 WHERE "Home team score" = '17.18 (120)'
SELECT `Venue` FROM `table_4502` WHERE `Home team score` = '17.18 (120)'
0.070313
CREATE TABLE table_47479 (`Track` FLOAT64, `Title` STRING, `Songwriter ( s ) ` STRING, `Producer ( s ) ` STRING, `Length` STRING)
What is track 6's title?
SELECT "Title" FROM table_47479 WHERE "Track" = '6'
SELECT `Title` FROM `table_47479` WHERE `Track` = '6'
0.051758
CREATE TABLE ReviewTaskTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE CloseReasonTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE PostNotices (Id NUMERIC, PostId NUMERIC, PostNoticeTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body STRING, OwnerUserId NUMERIC, DeletionUserId NUMERIC) CREATE TABLE TagSynonyms (Id NUMERIC, SourceTagName STRING, TargetTagName STRING, CreationDate TIME, OwnerUserId NUMERIC, AutoRenameCount NUMERIC, LastAutoRename TIME, Score NUMERIC, ApprovedByUserId NUMERIC, ApprovalDate TIME) CREATE TABLE ReviewTaskStates (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE ReviewTaskResultTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE Badges (Id NUMERIC, UserId NUMERIC, Name STRING, Date TIME, Class NUMERIC, TagBased BOOL) CREATE TABLE PostsWithDeleted (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body STRING, OwnerUserId NUMERIC, OwnerDisplayName STRING, LastEditorUserId NUMERIC, LastEditorDisplayName STRING, LastEditDate TIME, LastActivityDate TIME, Title STRING, Tags STRING, AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense STRING) CREATE TABLE Users (Id NUMERIC, Reputation NUMERIC, CreationDate TIME, DisplayName STRING, LastAccessDate TIME, WebsiteUrl STRING, Location STRING, AboutMe STRING, Views NUMERIC, UpVotes NUMERIC, DownVotes NUMERIC, ProfileImageUrl STRING, EmailHash STRING, AccountId NUMERIC) CREATE TABLE Comments (Id NUMERIC, PostId NUMERIC, Score NUMERIC, Text STRING, CreationDate TIME, UserDisplayName STRING, UserId NUMERIC, ContentLicense STRING) CREATE TABLE PendingFlags (Id NUMERIC, FlagTypeId NUMERIC, PostId NUMERIC, CreationDate TIME, CloseReasonTypeId NUMERIC, CloseAsOffTopicReasonTypeId NUMERIC, DuplicateOfQuestionId NUMERIC, BelongsOnBaseHostAddress STRING) CREATE TABLE PostTags (PostId NUMERIC, TagId NUMERIC) CREATE TABLE Tags (Id NUMERIC, TagName STRING, Count NUMERIC, ExcerptPostId NUMERIC, WikiPostId NUMERIC) CREATE TABLE PostHistoryTypes (Id NUMERIC, Name STRING) CREATE TABLE PostFeedback (Id NUMERIC, PostId NUMERIC, IsAnonymous BOOL, VoteTypeId NUMERIC, CreationDate TIME) CREATE TABLE Votes (Id NUMERIC, PostId NUMERIC, VoteTypeId NUMERIC, UserId NUMERIC, CreationDate TIME, BountyAmount NUMERIC) CREATE TABLE ReviewTasks (Id NUMERIC, ReviewTaskTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMERIC, PostId NUMERIC, SuggestedEditId NUMERIC, CompletedByReviewTaskId NUMERIC) CREATE TABLE PostNoticeTypes (Id NUMERIC, ClassId NUMERIC, Name STRING, Body STRING, IsHidden BOOL, Predefined BOOL, PostNoticeDurationId NUMERIC) CREATE TABLE SuggestedEditVotes (Id NUMERIC, SuggestedEditId NUMERIC, UserId NUMERIC, VoteTypeId NUMERIC, CreationDate TIME, TargetUserId NUMERIC, TargetRepChange NUMERIC) CREATE TABLE FlagTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE PostLinks (Id NUMERIC, CreationDate TIME, PostId NUMERIC, RelatedPostId NUMERIC, LinkTypeId NUMERIC) CREATE TABLE Posts (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body STRING, OwnerUserId NUMERIC, OwnerDisplayName STRING, LastEditorUserId NUMERIC, LastEditorDisplayName STRING, LastEditDate TIME, LastActivityDate TIME, Title STRING, Tags STRING, AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense STRING) CREATE TABLE PostHistory (Id NUMERIC, PostHistoryTypeId NUMERIC, PostId NUMERIC, RevisionGUID other, CreationDate TIME, UserId NUMERIC, UserDisplayName STRING, Comment STRING, Text STRING, ContentLicense STRING) CREATE TABLE VoteTypes (Id NUMERIC, Name STRING) CREATE TABLE SuggestedEdits (Id NUMERIC, PostId NUMERIC, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMERIC, Comment STRING, Text STRING, Title STRING, Tags STRING, RevisionGUID other) CREATE TABLE ReviewTaskResults (Id NUMERIC, ReviewTaskId NUMERIC, ReviewTaskResultTypeId NUMERIC, CreationDate TIME, RejectionReasonId NUMERIC, Comment STRING) CREATE TABLE PostTypes (Id NUMERIC, Name STRING) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMERIC, IsUniversal BOOL, InputTitle STRING, MarkdownInputGuidance STRING, MarkdownPostOwnerGuidance STRING, MarkdownPrivilegedUserGuidance STRING, MarkdownConcensusDescription STRING, CreationDate TIME, CreationModeratorId NUMERIC, ApprovalDate TIME, ApprovalModeratorId NUMERIC, DeactivationDate TIME, DeactivationModeratorId NUMERIC) CREATE TABLE ReviewRejectionReasons (Id NUMERIC, Name STRING, Description STRING, PostTypeId NUMERIC)
Total comment score for a user.
SELECT SUM(c.Score) FROM Comments AS c WHERE c.UserId = '##UserId##'
SELECT SUM(`c`.`score`) FROM `Comments` AS `c` WHERE `c`.`userid` = '##UserId##'
0.078125
CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING)
give the number of patients diagnosed with streptococcal septicemia and had lab test for blood gas .
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Streptococcal septicemia" AND lab."CATEGORY" = "Blood Gas"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `diagnoses` ON `Streptococcal septicemia` = `diagnoses`.`long_title` AND `demographic`.`hadm_id` = `diagnoses`.`hadm_id` JOIN `lab` ON `Blood Gas` = `lab`.`category` AND `demographic`.`hadm_id` = `lab`.`hadm_id`
0.27832
CREATE TABLE table_name_33 (total_matches INT64, total_w_l_h STRING)
Which Total matches is the lowest one that has a Total W-L-H of 1-2-0?
SELECT MIN(total_matches) FROM table_name_33 WHERE total_w_l_h = "1-2-0"
SELECT MIN(`total_matches`) FROM `table_name_33` WHERE `1-2-0` = `total_w_l_h`
0.076172
CREATE TABLE table_62122 (`Date` STRING, `Ship Name` STRING, `Tonnage` FLOAT64, `Ship Type` STRING, `Location` STRING, `Disposition of Ship` STRING)
What is the highest tonnage of the Brig Ship Type and the disposition of Ship of Prize?
SELECT MAX("Tonnage") FROM table_62122 WHERE "Ship Type" = 'brig' AND "Disposition of Ship" = 'prize'
SELECT MAX(`Tonnage`) FROM `table_62122` WHERE `Disposition of Ship` = 'prize' AND `Ship Type` = 'brig'
0.100586
CREATE TABLE table_name_67 (title STRING, share STRING)
Which title has a share of 19,9%
SELECT title FROM table_name_67 WHERE share = "19,9%"
SELECT `title` FROM `table_name_67` WHERE `19,9%` = `share`
0.057617
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 STRING, patienthealthsystemstayid NUMERIC, eventtype STRING, eventid NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath STRING, celllabel STRING, cellvaluenumeric NUMERIC, intakeoutputtime TIME) CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname STRING, dosage STRING, routeadmin STRING, drugstarttime TIME, drugstoptime TIME) CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname STRING, allergyname STRING, allergytime TIME) CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite STRING, organism STRING, culturetakentime TIME) CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname STRING, labresult NUMERIC, labresulttime TIME) CREATE TABLE patient (uniquepid STRING, patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender STRING, age STRING, ethnicity STRING, hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource STRING, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus STRING) CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname STRING, treatmenttime TIME) CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname STRING, diagnosistime TIME, icd9code STRING)
what is the total output (ml)-urethral catheter chasity yates, rnfa latex;temperature probe 16 fr. output of patient 030-31704 until 802 days ago?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-31704')) AND intakeoutput.celllabel = 'output (ml)-urethral catheter chasity yates, rnfa latex;temperature probe 16 fr.' AND intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime) <= DATETIME(CURRENT_TIME(), '-802 day')
WITH `_u_0` AS (SELECT `patient`.`patienthealthsystemstayid` FROM `patient` WHERE `patient`.`uniquepid` = '030-31704' GROUP BY `patienthealthsystemstayid`), `_u_1` AS (SELECT `patient`.`patientunitstayid` FROM `patient` LEFT JOIN `_u_0` AS `_u_0` ON `_u_0`.`` = `patient`.`patienthealthsystemstayid` WHERE NOT `_u_0`.`` IS NULL GROUP BY `patientunitstayid`) SELECT SUM(`intakeoutput`.`cellvaluenumeric`) FROM `intakeoutput` LEFT JOIN `_u_1` AS `_u_1` ON `_u_1`.`` = `intakeoutput`.`patientunitstayid` WHERE `intakeoutput`.`celllabel` = 'output (ml)-urethral catheter chasity yates, rnfa latex;temperature probe 16 fr.' AND `intakeoutput`.`cellpath` LIKE '%output%' AND DATETIME(`intakeoutput`.`intakeoutputtime`) <= DATETIME(CURRENT_TIME(), '-802 day') AND NOT `_u_1`.`` IS NULL
0.759766
CREATE TABLE table_203_303 (id NUMERIC, `tribunal` STRING, `number of autos da fe` NUMERIC, `executions in persona` NUMERIC, `executions in effigie` NUMERIC, `penanced` NUMERIC, `total` NUMERIC)
which spanish tribunal was the only one to not have any autos da fe during this time period ?
SELECT "tribunal" FROM table_203_303 WHERE "number of autos da fe" = 0
SELECT `tribunal` FROM `table_203_303` WHERE `number of autos da fe` = 0
0.070313
CREATE TABLE table_11677691_10 (player STRING, school STRING)
What player represented Vista Murrieta High School?
SELECT player FROM table_11677691_10 WHERE school = "Vista Murrieta High school"
SELECT `player` FROM `table_11677691_10` WHERE `Vista Murrieta High school` = `school`
0.083984
CREATE TABLE Manufacturers (Code INT64, Name STRING, Headquarter STRING, Founder STRING, Revenue FLOAT64) CREATE TABLE Products (Code INT64, Name STRING, Price NUMERIC, Manufacturer INT64)
For those records from the products and each product's manufacturer, give me the comparison about the sum of code over the headquarter , and group by attribute headquarter, and sort total number in ascending order.
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
SELECT `T2`.`headquarter`, `T1`.`code` FROM `Products` AS `T1` JOIN `Manufacturers` AS `T2` ON `T1`.`manufacturer` = `T2`.`code` GROUP BY `T2`.`headquarter` ORDER BY `T1`.`code`
0.172852
CREATE TABLE table_80364 (`Date` STRING, `Opponent` STRING, `Score` STRING, `Loss` STRING, `Attendance` FLOAT64, `Record` STRING)
When the team had their record of 16 14, what was the total attendance?
SELECT COUNT("Attendance") FROM table_80364 WHERE "Record" = '16–14'
SELECT COUNT(`Attendance`) FROM `table_80364` WHERE `Record` = '16–14'
0.068359
CREATE TABLE table_name_66 (player STRING, to_par STRING)
Which player had a to par score of +2?
SELECT player FROM table_name_66 WHERE to_par = "+2"
SELECT `player` FROM `table_name_66` WHERE `+2` = `to_par`
0.056641
CREATE TABLE table_name_21 (lead STRING, season STRING, third STRING, second STRING)
Which Lead has a Third of randy ferbey (skip), a Second of scott pfeifer, and a Season of 2009 10?
SELECT lead FROM table_name_21 WHERE third = "randy ferbey (skip)" AND second = "scott pfeifer" AND season = "2009–10"
SELECT `lead` FROM `table_name_21` WHERE `2009–10` = `season` AND `randy ferbey (skip)` = `third` AND `scott pfeifer` = `second`
0.125
CREATE TABLE table_31148 (`No. in series` FLOAT64, `No. in season` FLOAT64, `Title` STRING, `Directed by` STRING, `Written by` STRING, `Original air date` STRING, `Production code` FLOAT64)
What is the production code when the title is 'you don't know dick'?
SELECT MIN("Production code") FROM table_31148 WHERE "Title" = 'You Don''t Know Dick'
SELECT MIN(`Production code`) FROM `table_31148` WHERE `Title` = 'You Don\'t Know Dick'
0.084961
CREATE TABLE table_31182 (`#` FLOAT64, `Title` STRING, `Author` STRING, `Doctor` STRING, `Featuring` STRING, `Read by` STRING, `Published` STRING, `ISBN` STRING)
The Empty House audiobook has what #?
SELECT "#" FROM table_31182 WHERE "Title" = 'The Empty House'
SELECT `#` FROM `table_31182` WHERE `Title` = 'The Empty House'
0.061523
CREATE TABLE table_name_73 (total_points INT64, details STRING)
For the match that had detail of 2001 nrl grand final, what was the lowest total points?
SELECT MIN(total_points) FROM table_name_73 WHERE details = "2001 nrl grand final"
SELECT MIN(`total_points`) FROM `table_name_73` WHERE `2001 nrl grand final` = `details`
0.085938
CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING)
what is the number of patients on main type drug prescription who had diagnoses of angioneurotic edema, not elsewhere classified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Angioneurotic edema, not elsewhere classified" AND prescriptions.drug_type = "MAIN"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `diagnoses` ON `Angioneurotic edema, not elsewhere classified` = `diagnoses`.`long_title` AND `demographic`.`hadm_id` = `diagnoses`.`hadm_id` JOIN `prescriptions` ON `MAIN` = `prescriptions`.`drug_type` AND `demographic`.`hadm_id` = `prescriptions`.`hadm_id`
0.324219
CREATE TABLE table_name_96 (signal_quality STRING, station_call_letters STRING)
What signal quality does the KCAL-DT channel have?
SELECT signal_quality FROM table_name_96 WHERE station_call_letters = "kcal-dt"
SELECT `signal_quality` FROM `table_name_96` WHERE `kcal-dt` = `station_call_letters`
0.083008
CREATE TABLE races (raceId INT64, year INT64, round INT64, circuitId INT64, name STRING, date STRING, time STRING, url STRING) CREATE TABLE constructors (constructorId INT64, constructorRef STRING, name STRING, nationality STRING, url STRING) CREATE TABLE lapTimes (raceId INT64, driverId INT64, lap INT64, position INT64, time STRING, milliseconds INT64) CREATE TABLE pitStops (raceId INT64, driverId INT64, stop INT64, lap INT64, time STRING, duration STRING, milliseconds INT64) CREATE TABLE constructorStandings (constructorStandingsId INT64, raceId INT64, constructorId INT64, points FLOAT64, position INT64, positionText STRING, wins INT64) CREATE TABLE circuits (circuitId INT64, circuitRef STRING, name STRING, location STRING, country STRING, lat FLOAT64, lng FLOAT64, alt STRING, url STRING) CREATE TABLE seasons (year INT64, url STRING) CREATE TABLE status (statusId INT64, status STRING) CREATE TABLE qualifying (qualifyId INT64, raceId INT64, driverId INT64, constructorId INT64, number INT64, position INT64, q1 STRING, q2 STRING, q3 STRING) CREATE TABLE constructorResults (constructorResultsId INT64, raceId INT64, constructorId INT64, points FLOAT64, status STRING) CREATE TABLE drivers (driverId INT64, driverRef STRING, number STRING, code STRING, forename STRING, surname STRING, dob STRING, nationality STRING, url STRING) CREATE TABLE results (resultId INT64, raceId INT64, driverId INT64, constructorId INT64, number INT64, grid INT64, position STRING, positionText STRING, positionOrder INT64, points FLOAT64, laps STRING, time STRING, milliseconds STRING, fastestLap STRING, rank STRING, fastestLapTime STRING, fastestLapSpeed STRING, statusId INT64) CREATE TABLE driverStandings (driverStandingsId INT64, raceId INT64, driverId INT64, points FLOAT64, position INT64, positionText STRING, wins INT64)
Find the id and location of circuits that belong to France or Belgium Plot them as bar chart, could you sort in descending by the Y?
SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" ORDER BY circuitId DESC
SELECT `location`, `circuitId` FROM `circuits` WHERE `Belgium` = `country` OR `France` = `country` ORDER BY `circuitId` DESC
0.121094
CREATE TABLE table_36352 (`Outcome` STRING, `Date` STRING, `Surface` STRING, `Partner` STRING, `Opponents` STRING, `Score` STRING)
Which Partner has a Date of 12 july 2009?
SELECT "Partner" FROM table_36352 WHERE "Date" = '12 july 2009'
SELECT `Partner` FROM `table_36352` WHERE `Date` = '12 july 2009'
0.063477
CREATE TABLE chartevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom STRING) CREATE TABLE outputevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, value NUMERIC) CREATE TABLE labevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom STRING) CREATE TABLE inputevents_cv (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, amount NUMERIC) CREATE TABLE transfers (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, eventtype STRING, careunit STRING, wardid NUMERIC, intime TIME, outtime TIME) CREATE TABLE patients (row_id NUMERIC, subject_id NUMERIC, gender STRING, dob TIME, dod TIME) CREATE TABLE cost (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, event_type STRING, event_id NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE icustays (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, first_careunit STRING, last_careunit STRING, first_wardid NUMERIC, last_wardid NUMERIC, intime TIME, outtime TIME) CREATE TABLE d_icd_procedures (row_id NUMERIC, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE d_items (row_id NUMERIC, itemid NUMERIC, label STRING, linksto STRING) CREATE TABLE diagnoses_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code STRING, charttime TIME) CREATE TABLE procedures_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code STRING, charttime TIME) CREATE TABLE d_icd_diagnoses (row_id NUMERIC, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE d_labitems (row_id NUMERIC, itemid NUMERIC, label STRING) CREATE TABLE microbiologyevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, charttime TIME, spec_type_desc STRING, org_name STRING) CREATE TABLE prescriptions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, startdate TIME, enddate TIME, drug STRING, dose_val_rx STRING, dose_unit_rx STRING, route STRING) CREATE TABLE admissions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, admittime TIME, dischtime TIME, admission_type STRING, admission_location STRING, discharge_location STRING, insurance STRING, language STRING, marital_status STRING, ethnicity STRING, age NUMERIC)
since 1 year ago was patient 23070 undergone a nucleated rbc test?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'nucleated rbc') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-1 year')
WITH `_u_0` AS (SELECT `d_labitems`.`itemid` FROM `d_labitems` WHERE `d_labitems`.`label` = 'nucleated rbc' GROUP BY `itemid`), `_u_1` AS (SELECT `admissions`.`hadm_id` FROM `admissions` WHERE `admissions`.`subject_id` = 23070 GROUP BY `hadm_id`) SELECT COUNT(*) > 0 FROM `labevents` LEFT JOIN `_u_0` AS `_u_0` ON `_u_0`.`` = `labevents`.`itemid` LEFT JOIN `_u_1` AS `_u_1` ON `_u_1`.`` = `labevents`.`hadm_id` WHERE DATETIME(`labevents`.`charttime`) >= DATETIME(CURRENT_TIME(), '-1 year') AND NOT `_u_0`.`` IS NULL AND NOT `_u_1`.`` IS NULL
0.52832
CREATE TABLE table_name_67 (segment_c STRING, episode INT64)
Episode smaller than 210 had what segment c?
SELECT segment_c FROM table_name_67 WHERE episode < 210
SELECT `segment_c` FROM `table_name_67` WHERE `episode` < 210
0.05957
CREATE TABLE table_name_44 (tonnage__grt_ INT64, nationality STRING, name STRING)
Which Tonnage (GRT) has a Nationality of united kingdom, and a Name of king gruffydd?
SELECT MIN(tonnage__grt_) FROM table_name_44 WHERE nationality = "united kingdom" AND name = "king gruffydd"
SELECT MIN(`tonnage__grt_`) FROM `table_name_44` WHERE `king gruffydd` = `name` AND `nationality` = `united kingdom`
0.113281
CREATE TABLE table_14102379_4 (attendance INT64, stadium STRING)
what is the minimum attendance with stadium being cotton bowl
SELECT MIN(attendance) FROM table_14102379_4 WHERE stadium = "Cotton Bowl"
SELECT MIN(`attendance`) FROM `table_14102379_4` WHERE `Cotton Bowl` = `stadium`
0.078125
CREATE TABLE table_59906 (`Season` STRING, `Date Released` STRING, `# Of Episodes` FLOAT64, `# Of Discs` FLOAT64, `Special Features` STRING)
What Date Released, when # Of Discs is greater than 4?
SELECT "Date Released" FROM table_59906 WHERE "# Of Discs" > '4'
SELECT `Date Released` FROM `table_59906` WHERE `# Of Discs` > '4'
0.064453
CREATE TABLE table_47654 (`Pick #` FLOAT64, `NFL Team` STRING, `Player` STRING, `Position` STRING, `College` STRING)
Which NFL team has a player that came from a college in Washington?
SELECT "NFL Team" FROM table_47654 WHERE "College" = 'washington'
SELECT `NFL Team` FROM `table_47654` WHERE `College` = 'washington'
0.06543
CREATE TABLE table_33396 (`Incident No.` STRING, `Date` STRING, `Place` STRING, `Killed` FLOAT64, `Injured` FLOAT64)
What is the highest number killed in incident #14?
SELECT MAX("Killed") FROM table_33396 WHERE "Incident No." = '14'
SELECT MAX(`Killed`) FROM `table_33396` WHERE `Incident No.` = '14'
0.06543
CREATE TABLE table_18157 (`District` STRING, `Incumbent` STRING, `Party` STRING, `First elected` STRING, `Results` STRING, `Candidates` STRING)
When was Chaka Fattah first elected in the Pennsylvania 2 district?
SELECT "First elected" FROM table_18157 WHERE "District" = 'Pennsylvania 2'
SELECT `First elected` FROM `table_18157` WHERE `District` = 'Pennsylvania 2'
0.075195
CREATE TABLE table_32144 (`Lift Name` STRING, `Type` STRING, `Length` FLOAT64, `Vertical` FLOAT64, `Cap./Hour` FLOAT64)
Tell me the sum of cap/hor for double chair and vertical less than 479
SELECT SUM("Cap./Hour") FROM table_32144 WHERE "Type" = 'double chair' AND "Vertical" < '479'
SELECT SUM(`Cap./Hour`) FROM `table_32144` WHERE `Type` = 'double chair' AND `Vertical` < '479'
0.092773
CREATE TABLE table_61739 (`7:00 am` STRING, `7:30 am` STRING, `8:00 am` STRING, `9:00 am` STRING, `11:00 am` STRING, `noon` STRING, `12:30 pm` STRING, `1:00 pm` STRING, `1:30 pm` STRING, `2:00 pm` STRING, `3:00 pm` STRING, `4:30 pm` STRING, `5:00 pm` STRING, `6:30 pm` STRING)
What 12:30 pm has an 8:00 am of the today show with katie couric & matt lauer?
SELECT "12:30 pm" FROM table_61739 WHERE "8:00 am" = 'the today show with katie couric & matt lauer'
SELECT `12:30 pm` FROM `table_61739` WHERE `8:00 am` = 'the today show with katie couric & matt lauer'
0.099609
CREATE TABLE Customers (customer_id INT64, payment_method STRING, customer_name STRING, customer_phone STRING, customer_email STRING, date_became_customer DATETIME) CREATE TABLE Delivery_Routes (route_id INT64, route_name STRING, other_route_details STRING) CREATE TABLE Addresses (address_id INT64, address_details STRING, city STRING, zip_postcode STRING, state_province_county STRING, country STRING) CREATE TABLE Customer_Addresses (customer_id INT64, address_id INT64, date_from DATETIME, address_type STRING, date_to DATETIME) CREATE TABLE Regular_Order_Products (regular_order_id INT64, product_id INT64) CREATE TABLE Actual_Order_Products (actual_order_id INT64, product_id INT64) CREATE TABLE Delivery_Route_Locations (location_code STRING, route_id INT64, location_address_id INT64, location_name STRING) CREATE TABLE Products (product_id INT64, product_name STRING, product_price NUMERIC, product_description STRING) CREATE TABLE Order_Deliveries (location_code STRING, actual_order_id INT64, delivery_status_code STRING, driver_employee_id INT64, truck_id INT64, delivery_date DATETIME) CREATE TABLE Trucks (truck_id INT64, truck_licence_number STRING, truck_details STRING) CREATE TABLE Actual_Orders (actual_order_id INT64, order_status_code STRING, regular_order_id INT64, actual_order_date DATETIME) CREATE TABLE Regular_Orders (regular_order_id INT64, distributer_id INT64) CREATE TABLE Employees (employee_id INT64, employee_address_id INT64, employee_name STRING, employee_phone STRING)
List the state names and the number of customers living in each state with a bar chart, display bar from high to low order please.
SELECT state_province_county, COUNT(*) FROM Customer_Addresses AS t1 JOIN Addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county ORDER BY state_province_county DESC
SELECT `state_province_county`, COUNT(*) FROM `Customer_Addresses` AS `t1` JOIN `Addresses` AS `t2` ON `t1`.`address_id` = `t2`.`address_id` GROUP BY `t2`.`state_province_county` ORDER BY `state_province_county` DESC
0.210938
CREATE TABLE table_name_66 (roll STRING, decile STRING, name STRING)
What's the roll for summerland primary when decile is over 6?
SELECT roll FROM table_name_66 WHERE decile > 6 AND name = "summerland primary"
SELECT `roll` FROM `table_name_66` WHERE `decile` > 6 AND `name` = `summerland primary`
0.084961