schema
stringlengths
29
5.42k
question
stringlengths
0
752
rejected
stringlengths
2
4.44k
chosen
stringlengths
4
8.94k
weight
float64
0
8.73
CREATE TABLE table_79405 ("play" CLOB, "author" CLOB, "company" CLOB, "base" CLOB, "country" CLOB)
what is the company when the country is greece and the author is aeschylus?
SELECT "company" FROM table_79405 WHERE "country" = 'greece' AND "author" = 'aeschylus'
SELECT "company" FROM "table_79405" WHERE "author" = 'aeschylus' AND "country" = 'greece'
0.086914
CREATE TABLE table_14302582_1 (result VARCHAR2, record VARCHAR2)
What was the result when the team was 4-1?
SELECT result FROM table_14302582_1 WHERE record = "4-1"
SELECT "result" FROM "table_14302582_1" WHERE "4-1" = "record"
0.060547
CREATE TABLE table_22851 ("Year" FLOAT, "Worldwide" FLOAT, "Africa" FLOAT, "America" FLOAT, "Asia" FLOAT, "Australia" FLOAT, "Europe" FLOAT)
How many members did Africa have the year that Australia had 94615?
SELECT "Africa" FROM table_22851 WHERE "Australia" = '94615'
SELECT "Africa" FROM "table_22851" WHERE "Australia" = '94615'
0.060547
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
how many patients whose age is less than 44 and drug name is 0.9% sodium chloride?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "44" AND prescriptions.drug = "0.9% Sodium Chloride"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "0.9% Sodium Chloride" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "44" > "demographic"."age"
0.223633
CREATE TABLE table_name_23 (round VARCHAR2, player VARCHAR2)
Which Round has a Player of anna chakvetadze?
SELECT round FROM table_name_23 WHERE player = "anna chakvetadze"
SELECT "round" FROM "table_name_23" WHERE "anna chakvetadze" = "player"
0.069336
CREATE TABLE table_21321804_1 (pick__number VARCHAR2, player VARCHAR2)
What is the pick # for player wes lysack?
SELECT pick__number FROM table_21321804_1 WHERE player = "Wes Lysack"
SELECT "pick__number" FROM "table_21321804_1" WHERE "Wes Lysack" = "player"
0.073242
CREATE TABLE table_9538 ("Tournament" CLOB, "2006" CLOB, "2007" CLOB, "2008" CLOB, "2009" CLOB, "2010" CLOB, "2011" CLOB, "2012" CLOB)
What 2001 has a ATP World Tour Masters 1000 2007?
SELECT "2011" FROM table_9538 WHERE "2007" = 'atp world tour masters 1000'
SELECT "2011" FROM "table_9538" WHERE "2007" = 'atp world tour masters 1000'
0.074219
CREATE TABLE table_48585 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Attendance" FLOAT)
What was the Result of the game on December 14, 1986 after Week 11?
SELECT "Result" FROM table_48585 WHERE "Week" > '11' AND "Date" = 'december 14, 1986'
SELECT "Result" FROM "table_48585" WHERE "Date" = 'december 14, 1986' AND "Week" > '11'
0.084961
CREATE TABLE table_12789 ("Tournament" CLOB, "2009" CLOB, "2010" CLOB, "2011" CLOB, "2012" CLOB, "Win %" CLOB)
What is the winning % for the 2010 QF?
SELECT "Win %" FROM table_12789 WHERE "2010" = 'qf'
SELECT "Win %" FROM "table_12789" WHERE "2010" = 'qf'
0.051758
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
unsolved Q's asker's Info [Consider Bounty](Q is not closed yet).
SELECT pUser.OwnerUserId AS askerId, u.DisplayName AS askerName, COUNT(pUser.OwnerUserId) AS caseCnt, u.Reputation AS askerReputation, u.UpVotes AS askerUpVotes, u.DownVotes AS akserDownVotes, SUM(v.bountyOnce) AS bountyCaseCnt FROM (SELECT OwnerUserId, Id FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND ClosedDate IS NULL) AS pUser LEFT OUTER JOIN (SELECT PostId, VoteTypeId, 1 AS bountyOnce FROM Votes WHERE VoteTypeId = 8 GROUP BY PostId, VoteTypeId) AS v ON pUser.Id = v.PostId JOIN Users AS u ON pUser.OwnerUserId = u.Id GROUP BY pUser.OwnerUserId, u.DisplayName, u.Reputation, u.UpVotes, u.DownVotes ORDER BY caseCnt DESC
WITH "v" AS (SELECT "PostId", 1 AS "bountyOnce" FROM "Votes" WHERE "VoteTypeId" = 8 GROUP BY "PostId", "VoteTypeId") SELECT "OwnerUserId" AS "askerId", "u"."DisplayName" AS "askerName", COUNT("OwnerUserId") AS "caseCnt", "u"."Reputation" AS "askerReputation", "u"."UpVotes" AS "askerUpVotes", "u"."DownVotes" AS "akserDownVotes", SUM("v"."bountyOnce") AS "bountyCaseCnt" FROM "Posts" JOIN "Users" "u" ON "OwnerUserId" = "u"."Id" LEFT JOIN "v" "v" ON "Id" = "v"."PostId" WHERE "AcceptedAnswerId" IS NULL AND "ClosedDate" IS NULL AND "PostTypeId" = 1 GROUP BY "OwnerUserId", "u"."DisplayName", "u"."Reputation", "u"."UpVotes", "u"."DownVotes" ORDER BY "caseCnt" DESC
0.648438
CREATE TABLE table_75906 ("RR Romaja" CLOB, "M\\u2013R Romaja" CLOB, "Hangul/Chosongul" CLOB, "Hanja" CLOB, "Area" CLOB, "Capital" CLOB, "Region" CLOB, "Country" CLOB)
What is the RR Romaja for the province that has Hangul of and capital of Wonsan?
SELECT "RR Romaja" FROM table_75906 WHERE "Hangul/Chosongul" = '강원도' AND "Capital" = 'wonsan'
SELECT "RR Romaja" FROM "table_75906" WHERE "Capital" = 'wonsan' AND "Hangul/Chosongul" = '강원도'
0.092773
CREATE TABLE table_name_46 (date VARCHAR2, winning_score VARCHAR2)
On what date was the winning score 20 (68-67-65-64=264)?
SELECT date FROM table_name_46 WHERE winning_score = –20(68 - 67 - 65 - 64 = 264)
SELECT "date" FROM "table_name_46" WHERE "winning_score" = –20(FALSE)
0.067383
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
How many patients born before the year 1882 had the lab test cyclosporin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1882" AND lab.label = "Cyclosporin"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Cyclosporin" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "1882" > "demographic"."dob_year"
0.193359
CREATE TABLE table_name_12 (currency VARCHAR2, central_rate VARCHAR2)
Which currency has a central rate of 0.702804?
SELECT currency FROM table_name_12 WHERE central_rate = "0.702804"
SELECT "currency" FROM "table_name_12" WHERE "0.702804" = "central_rate"
0.070313
CREATE TABLE table_name_4 (country VARCHAR2, total VARCHAR2, day_1 VARCHAR2)
what is the country when the total is 111 and the day 1 is 69?
SELECT country FROM table_name_4 WHERE total = 111 AND day_1 = 69
SELECT "country" FROM "table_name_4" WHERE "day_1" = 69 AND "total" = 111
0.071289
CREATE TABLE table_1753 ("DVD Title" CLOB, "No. of Discs" FLOAT, "Year" CLOB, "No. of Episodes" FLOAT, "Region 1" CLOB, "Region 2" CLOB, "Region 4" CLOB)
What is the largest number of episodes for a 1989 season dvd release?
SELECT MAX("No. of Episodes") FROM table_1753 WHERE "Year" = '1989'
SELECT MAX("No. of Episodes") FROM "table_1753" WHERE "Year" = '1989'
0.067383
CREATE TABLE loan (cust_id VARCHAR2, amount NUMBER) CREATE TABLE customer (cust_name VARCHAR2, cust_id VARCHAR2)
Find the name of customer who has the highest amount of loans.
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1
SELECT "T1"."cust_name" FROM "customer" "T1" JOIN "loan" "T2" ON "T1"."cust_id" = "T2"."cust_id" GROUP BY "T1"."cust_name" ORDER BY SUM("T2"."amount") DESC FETCH FIRST 1 ROWS ONLY
0.174805
CREATE TABLE table_10785 ("Call sign" CLOB, "Frequency MHz" CLOB, "City of license" CLOB, "ERP W" CLOB, "FCC info" CLOB)
Name the city of license for call sign of kcmp
SELECT "City of license" FROM table_10785 WHERE "Call sign" = 'kcmp'
SELECT "City of license" FROM "table_10785" WHERE "Call sign" = 'kcmp'
0.068359
CREATE TABLE table_name_89 (tv_time VARCHAR2, opponent VARCHAR2)
What is TV Time, when Opponent is At Cincinnati Bengals?
SELECT tv_time FROM table_name_89 WHERE opponent = "at cincinnati bengals"
SELECT "tv_time" FROM "table_name_89" WHERE "at cincinnati bengals" = "opponent"
0.078125
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
How many patients with neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues/bone marrow transplant as their primary disease died in or before the year 2112?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND demographic.dod_year <= "2112.0"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2112.0" >= "demographic"."dod_year" AND "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" = "demographic"."diagnosis"
0.238281
CREATE TABLE allergy_type (allergy CLOB, allergytype CLOB) CREATE TABLE has_allergy (stuid NUMBER, allergy CLOB) CREATE TABLE student (stuid NUMBER, lname CLOB, fname CLOB, age NUMBER, sex CLOB, major NUMBER, advisor NUMBER, city_code CLOB)
Show the minimum, average, and maximum age of all students.
SELECT MIN(age), AVG(age), MAX(age) FROM student
SELECT MIN("age"), AVG("age"), MAX("age") FROM "student"
0.054688
CREATE TABLE table_2268216_1 (team VARCHAR2, race_time VARCHAR2)
What team had a race time of 2:53:57?
SELECT team FROM table_2268216_1 WHERE race_time = "2:53:57"
SELECT "team" FROM "table_2268216_1" WHERE "2:53:57" = "race_time"
0.064453
CREATE TABLE table_2869837_1 (runners_up VARCHAR2, school VARCHAR2)
What are the number of runners up for Royal School Dungannon?
SELECT runners_up FROM table_2869837_1 WHERE school = "Royal school Dungannon"
SELECT "runners_up" FROM "table_2869837_1" WHERE "Royal school Dungannon" = "school"
0.082031
CREATE TABLE table_30704 ("Track no." FLOAT, "Track" CLOB, "Original Artist" CLOB, "Soloist ( s ) " CLOB, "Vocal Percussionist" CLOB, "Arranger ( s ) " CLOB)
How many track numbers were called song 2?
SELECT COUNT("Track no.") FROM table_30704 WHERE "Track" = 'Song 2'
SELECT COUNT("Track no.") FROM "table_30704" WHERE "Track" = 'Song 2'
0.067383
CREATE TABLE table_204_511 (id NUMBER, "number" NUMBER, "driver" CLOB, "entrant" CLOB, "chassis" CLOB, "engine" CLOB, "tyre" CLOB)
who was the last driver on the list ?
SELECT "driver" FROM table_204_511 ORDER BY id DESC LIMIT 1
SELECT "driver" FROM "table_204_511" ORDER BY "id" DESC FETCH FIRST 1 ROWS ONLY
0.077148
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
does patient 035-24054 had any output (ml)-nephrostomy left output during yesterday?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'output (ml)-nephrostomy left' AND DATETIME(intakeoutput.intakeoutputtime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day')
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '035-24054' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'output (ml)-nephrostomy left' AND "intakeoutput"."cellpath" LIKE '%output%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day') AND NOT "_u_1"."" IS NULL
0.706055
CREATE TABLE airports (apid NUMBER, name CLOB, city CLOB, country CLOB, x NUMBER, y NUMBER, elevation NUMBER, iata CLOB, icao CLOB) CREATE TABLE airlines (alid NUMBER, name CLOB, iata CLOB, icao CLOB, callsign CLOB, country CLOB, active CLOB) CREATE TABLE routes (rid NUMBER, dst_apid NUMBER, dst_ap CLOB, src_apid NUMBER, src_ap CLOB, alid NUMBER, airline CLOB, codeshare CLOB)
Return the cities with more than 3 airports in the United States.
SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING COUNT(*) > 3
SELECT "city" FROM "airports" WHERE "country" = 'United States' GROUP BY "city" HAVING COUNT(*) > 3
0.09668
CREATE TABLE table_12104319_1 (mens_singles VARCHAR2, year VARCHAR2)
What is the mens singles of 2008?
SELECT mens_singles FROM table_12104319_1 WHERE year = 2008
SELECT "mens_singles" FROM "table_12104319_1" WHERE "year" = 2008
0.063477
CREATE TABLE table_46194 ("Date" CLOB, "Venue" CLOB, "Score" CLOB, "Competition" CLOB, "Report" CLOB)
What is the score of the FIFA report on October 13, 2007?
SELECT "Score" FROM table_46194 WHERE "Report" = 'fifa' AND "Date" = 'october 13, 2007'
SELECT "Score" FROM "table_46194" WHERE "Date" = 'october 13, 2007' AND "Report" = 'fifa'
0.086914
CREATE TABLE table_name_54 (political_rights NUMBER, year VARCHAR2)
What is the least political rights rank in 1976?
SELECT MIN(political_rights) FROM table_name_54 WHERE year = 1976
SELECT MIN("political_rights") FROM "table_name_54" WHERE "year" = 1976
0.069336
CREATE TABLE table_7525 ("Event" CLOB, "2006\\u201307" CLOB, "2007\\u201308" CLOB, "2008\\u201309" CLOB, "2010\\u201311" CLOB)
what kind of 2006 07 has a 2010 11 of n/a, and an Event of masters?
SELECT "2006\u201307" FROM table_7525 WHERE "2010\u201311" = 'n/a' AND "Event" = 'masters'
SELECT "2006\u201307" FROM "table_7525" WHERE "2010\u201311" = 'n/a' AND "Event" = 'masters'
0.089844
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
what is the maximum age of patients whose admission type is elective and insurance is medicaid?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.insurance = "Medicaid"
SELECT MAX("demographic"."age") FROM "demographic" WHERE "ELECTIVE" = "demographic"."admission_type" AND "Medicaid" = "demographic"."insurance"
0.139648
CREATE TABLE table_13570_1 (nucleus VARCHAR2, cytoplasm VARCHAR2)
The pink cytoplasm will have a nucleus of what color?
SELECT nucleus FROM table_13570_1 WHERE cytoplasm = "Pink"
SELECT "nucleus" FROM "table_13570_1" WHERE "Pink" = "cytoplasm"
0.0625
CREATE TABLE table_name_46 (record VARCHAR2, opponent VARCHAR2, game VARCHAR2, location VARCHAR2)
What is the record of the game with a game number greater than 7 at boston garden with the providence steam rollers as the opponent?
SELECT record FROM table_name_46 WHERE game > 7 AND location = "boston garden" AND opponent = "providence steam rollers"
SELECT "record" FROM "table_name_46" WHERE "boston garden" = "location" AND "game" > 7 AND "opponent" = "providence steam rollers"
0.126953
CREATE TABLE table_name_25 (margin_of_victory VARCHAR2, tournament VARCHAR2)
What is the margin of victory for PGA Championship?
SELECT margin_of_victory FROM table_name_25 WHERE tournament = "pga championship"
SELECT "margin_of_victory" FROM "table_name_25" WHERE "pga championship" = "tournament"
0.084961
CREATE TABLE captain (Captain_ID NUMBER, Name CLOB, Ship_ID NUMBER, age CLOB, Class CLOB, Rank CLOB) CREATE TABLE Ship (Ship_ID NUMBER, Name CLOB, Type CLOB, Built_Year FLOAT, Class CLOB, Flag CLOB)
How many captains with younger than 50 are in each rank, and sort in desc by the bar.
SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank ORDER BY Rank DESC
SELECT "Rank", COUNT(*) FROM "captain" WHERE "age" < 50 GROUP BY "Rank" ORDER BY "Rank" DESC
0.089844
CREATE TABLE table_1688640_4 (website VARCHAR2, car__number VARCHAR2)
Name the website for car number of 92
SELECT website FROM table_1688640_4 WHERE car__number = "92"
SELECT "website" FROM "table_1688640_4" WHERE "92" = "car__number"
0.064453
CREATE TABLE table_52804 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Attendance" CLOB)
What Date is Week 1?
SELECT "Date" FROM table_52804 WHERE "Week" = '1'
SELECT "Date" FROM "table_52804" WHERE "Week" = '1'
0.049805
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
give me the number of patients whose ethnicity is black/haitian and lab test category is chemistry?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND lab."CATEGORY" = "Chemistry"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Chemistry" = "lab"."CATEGORY" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "BLACK/HAITIAN" = "demographic"."ethnicity"
0.204102
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
what are the four most commonly taken specimens for patients who were diagnosed with copd - severe previously within 2 months, since 3 years ago?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'copd - severe' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid WHERE DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-3 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.culturetakentime AND DATETIME(t2.culturetakentime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 4
WITH "t2" AS (SELECT "patient"."uniquepid", "microlab"."culturesite", "microlab"."culturetakentime" FROM "microlab" JOIN "patient" ON "microlab"."patientunitstayid" = "patient"."patientunitstayid" WHERE DATETIME("microlab"."culturetakentime") >= DATETIME(CURRENT_TIME(), '-3 year')), "t3" AS (SELECT "t2"."culturesite", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."culturetakentime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime") <= DATETIME("t2"."culturetakentime") AND DATETIME("diagnosis"."diagnosistime", '+2 month') >= DATETIME("t2"."culturetakentime") WHERE "diagnosis"."diagnosisname" = 'copd - severe' AND DATETIME("diagnosis"."diagnosistime") >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY "t2"."culturesite") SELECT "t3"."culturesite" FROM "t3" "t3" WHERE "t3"."c1" <= 4
0.957031
CREATE TABLE driver (Driver_ID NUMBER, Name CLOB, Party CLOB, Home_city CLOB, Age NUMBER) CREATE TABLE school_bus (School_ID NUMBER, Driver_ID NUMBER, Years_Working NUMBER, If_full_time BOOLEAN) CREATE TABLE school (School_ID NUMBER, Grade CLOB, School CLOB, Location CLOB, Type CLOB)
Show the type of school and the number of buses for each type, and I want to list by the y axis in descending.
SELECT Type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T2.Type ORDER BY COUNT(*) DESC
SELECT "Type", COUNT(*) FROM "school_bus" "T1" JOIN "school" "T2" ON "T1"."School_ID" = "T2"."School_ID" GROUP BY "T2"."Type" ORDER BY COUNT(*) DESC
0.144531
CREATE TABLE table_11362 ("Date" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Leading scorer" CLOB, "Record" CLOB)
What is the record of the game on March 5?
SELECT "Record" FROM table_11362 WHERE "Date" = 'march 5'
SELECT "Record" FROM "table_11362" WHERE "Date" = 'march 5'
0.057617
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
are patient 017-41154 a man or a woman.
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '017-41154'
SELECT DISTINCT "patient"."gender" FROM "patient" WHERE "patient"."uniquepid" = '017-41154'
0.088867
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
most popular public key crypto algorithms.
SELECT t.TagName, COUNT(1) AS total FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName IN ('rsa', 'ecdsa', 'ed25519', 'dsa') AND p.CreationDate >= '1/1/2019' GROUP BY t.TagName ORDER BY total DESC
SELECT "t"."TagName", COUNT(1) AS "total" FROM "Posts" "p" JOIN "PostTags" "pt" ON "p"."Id" = "pt"."PostId" JOIN "Tags" "t" ON "pt"."TagId" = "t"."Id" AND "t"."TagName" IN ('rsa', 'ecdsa', 'ed25519', 'dsa') WHERE "p"."CreationDate" >= '1/1/2019' GROUP BY "t"."TagName" ORDER BY "total" DESC
0.283203
CREATE TABLE table_70799 ("Date" CLOB, "Opponents" CLOB, "Result F\\u2013A" CLOB, "Attendance" FLOAT, "Group position" CLOB)
Attendance larger than 63,439, and an Opponent of bayer leverkusen had what result?
SELECT "Result F\u2013A" FROM table_70799 WHERE "Attendance" > '63,439' AND "Opponents" = 'bayer leverkusen'
SELECT "Result F\u2013A" FROM "table_70799" WHERE "Attendance" > '63,439' AND "Opponents" = 'bayer leverkusen'
0.107422
CREATE TABLE station (id NUMBER, name CLOB, lat NUMBER, long NUMBER, dock_count NUMBER, city CLOB, installation_date CLOB) CREATE TABLE trip (id NUMBER, duration NUMBER, start_date CLOB, start_station_name CLOB, start_station_id NUMBER, end_date CLOB, end_station_name CLOB, end_station_id NUMBER, bike_id NUMBER, subscription_type CLOB, zip_code NUMBER) CREATE TABLE weather (date CLOB, max_temperature_f NUMBER, mean_temperature_f NUMBER, min_temperature_f NUMBER, max_dew_point_f NUMBER, mean_dew_point_f NUMBER, min_dew_point_f NUMBER, max_humidity NUMBER, mean_humidity NUMBER, min_humidity NUMBER, max_sea_level_pressure_inches NUMBER, mean_sea_level_pressure_inches NUMBER, min_sea_level_pressure_inches NUMBER, max_visibility_miles NUMBER, mean_visibility_miles NUMBER, min_visibility_miles NUMBER, max_wind_Speed_mph NUMBER, mean_wind_speed_mph NUMBER, max_gust_speed_mph NUMBER, precipitation_inches NUMBER, cloud_cover NUMBER, events CLOB, wind_dir_degrees NUMBER, zip_code NUMBER) CREATE TABLE status (station_id NUMBER, bikes_available NUMBER, docks_available NUMBER, time CLOB)
What is the date, average temperature for the days with the 3 largest maximum gust speeds? Just give me a histogram, please.
SELECT date, mean_temperature_f FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
SELECT "date", "mean_temperature_f" FROM "weather" ORDER BY "max_gust_speed_mph" DESC FETCH FIRST 3 ROWS ONLY
0.106445
CREATE TABLE course (course_id VARCHAR2, title VARCHAR2, dept_name VARCHAR2, credits NUMBER) CREATE TABLE instructor (ID VARCHAR2, name VARCHAR2, dept_name VARCHAR2, salary NUMBER) CREATE TABLE time_slot (time_slot_id VARCHAR2, day VARCHAR2, start_hr NUMBER, start_min NUMBER, end_hr NUMBER, end_min NUMBER) CREATE TABLE department (dept_name VARCHAR2, building VARCHAR2, budget NUMBER) CREATE TABLE prereq (course_id VARCHAR2, prereq_id VARCHAR2) CREATE TABLE student (ID VARCHAR2, name VARCHAR2, dept_name VARCHAR2, tot_cred NUMBER) CREATE TABLE teaches (ID VARCHAR2, course_id VARCHAR2, sec_id VARCHAR2, semester VARCHAR2, year NUMBER) CREATE TABLE takes (ID VARCHAR2, course_id VARCHAR2, sec_id VARCHAR2, semester VARCHAR2, year NUMBER, grade VARCHAR2) CREATE TABLE classroom (building VARCHAR2, room_number VARCHAR2, capacity NUMBER) CREATE TABLE advisor (s_ID VARCHAR2, i_ID VARCHAR2) CREATE TABLE section (course_id VARCHAR2, sec_id VARCHAR2, semester VARCHAR2, year NUMBER, building VARCHAR2, room_number VARCHAR2, time_slot_id VARCHAR2)
List the number of instructors for each course in year 2008 with a bar chart, order by the y-axis in desc.
SELECT title, COUNT(title) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY title ORDER BY COUNT(title) DESC
SELECT "title", COUNT("title") FROM "course" "T1" JOIN "teaches" "T2" ON "T1"."course_id" = "T2"."course_id" JOIN "instructor" "T3" ON "T2"."ID" = "T3"."ID" WHERE "year" = 2008 GROUP BY "title" ORDER BY COUNT("title") DESC
0.216797
CREATE TABLE table_name_29 (player VARCHAR2, to_par VARCHAR2)
What player has +2 to par?
SELECT player FROM table_name_29 WHERE to_par = "+2"
SELECT "player" FROM "table_name_29" WHERE "+2" = "to_par"
0.056641
CREATE TABLE host (host_id NUMBER, name CLOB, nationality CLOB, age CLOB) CREATE TABLE party (party_id NUMBER, party_theme CLOB, location CLOB, first_year CLOB, last_year CLOB, number_of_hosts NUMBER) CREATE TABLE party_host (party_id NUMBER, host_id NUMBER, is_main_in_charge others)
Show the themes of parties and the names of the party hosts.
SELECT T3.party_theme, T2.name FROM party_host AS T1 JOIN host AS T2 ON T1.host_id = T2.host_id JOIN party AS T3 ON T1.party_id = T3.party_id
SELECT "T3"."party_theme", "T2"."name" FROM "party_host" "T1" JOIN "host" "T2" ON "T1"."host_id" = "T2"."host_id" JOIN "party" "T3" ON "T1"."party_id" = "T3"."party_id"
0.164063
CREATE TABLE table_4112 ("Player" CLOB, "County" CLOB, "Balls" FLOAT, "Wickets" FLOAT, "Average" CLOB, "Economy" CLOB, "BBI" CLOB, "4wi" FLOAT, "5wi" FLOAT)
in the leage what was the minimum 4wi
SELECT MIN("4wi") FROM table_4112
SELECT MIN("4wi") FROM "table_4112"
0.03418
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
count the number of patients whose death status is 0 and procedure short title is ventricl shunt tube punc?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Ventricl shunt tube punc"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Ventricl shunt tube punc" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "0" = "demographic"."expire_flag"
0.232422
CREATE TABLE table_name_64 (pos VARCHAR2, name VARCHAR2)
What is Eftychia Karagianni Pos.?
SELECT pos FROM table_name_64 WHERE name = "eftychia karagianni"
SELECT "pos" FROM "table_name_64" WHERE "eftychia karagianni" = "name"
0.068359
CREATE TABLE table_80321 ("Source" CLOB, "Dates Administered" CLOB, "Terry McAuliffe" CLOB, "Brian Moran" CLOB, "Creigh Deeds" CLOB)
Which Source has Terry McAuliffe of 36%
SELECT "Source" FROM table_80321 WHERE "Terry McAuliffe" = '36%'
SELECT "Source" FROM "table_80321" WHERE "Terry McAuliffe" = '36%'
0.064453
CREATE TABLE table_name_26 (date VARCHAR2, result VARCHAR2)
When was the game with a result of w 27-24 (ot)?
SELECT date FROM table_name_26 WHERE result = "w 27-24 (ot)"
SELECT "date" FROM "table_name_26" WHERE "result" = "w 27-24 (ot)"
0.064453
CREATE TABLE table_78242 ("Model" CLOB, "Build year" CLOB, "Total produced" FLOAT, "Wheel arrangement" CLOB, "Prime mover" CLOB, "Power output" CLOB)
Which is the smallest Total produced with a model of FM H-15-44?
SELECT MIN("Total produced") FROM table_78242 WHERE "Model" = 'fm h-15-44'
SELECT MIN("Total produced") FROM "table_78242" WHERE "Model" = 'fm h-15-44'
0.074219
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
among patients who were prescribed with calcium acetate, what are the three most frequently prescribed drugs at the same time, until 2 years ago?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'calcium acetate' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-2 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3
WITH "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."drug", "prescriptions"."startdate" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" WHERE DATETIME("prescriptions"."startdate") <= DATETIME(CURRENT_TIME(), '-2 year')), "t3" AS (SELECT "t2"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" JOIN "t2" "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND DATETIME("prescriptions"."startdate") = DATETIME("t2"."startdate") WHERE "prescriptions"."drug" = 'calcium acetate' AND DATETIME("prescriptions"."startdate") <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY "t2"."drug") SELECT "t3"."drug" FROM "t3" "t3" WHERE "t3"."c1" <= 3
0.773438
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
how many times a adrenal exploration nos has been taken until 2102?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'adrenal exploration nos') AND STRFTIME('%y', procedures_icd.charttime) <= '2102'
SELECT COUNT(*) FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'adrenal exploration nos' WHERE STRFTIME('%y', "procedures_icd"."charttime") <= '2102'
0.246094
CREATE TABLE candidate (Candidate_ID NUMBER, People_ID NUMBER, Poll_Source CLOB, Date CLOB, Support_rate FLOAT, Consider_rate FLOAT, Oppose_rate FLOAT, Unsure_rate FLOAT) CREATE TABLE people (People_ID NUMBER, Sex CLOB, Name CLOB, Date_of_Birth CLOB, Height FLOAT, Weight FLOAT)
Draw a bar chart about the distribution of Name and Weight , display Y in ascending order.
SELECT Name, Weight FROM people ORDER BY Weight
SELECT "Name", "Weight" FROM "people" ORDER BY "Weight"
0.053711
CREATE TABLE table_53848 ("Species" CLOB, "Strain" CLOB, "Type" CLOB, "Base Pairs" FLOAT, "Genes" FLOAT)
What type has an unspecified species and less than 367 genes?
SELECT "Type" FROM table_53848 WHERE "Species" = 'unspecified' AND "Genes" < '367'
SELECT "Type" FROM "table_53848" WHERE "Genes" < '367' AND "Species" = 'unspecified'
0.082031
CREATE TABLE table_14807 ("Date" CLOB, "Tournament" CLOB, "Winning score" CLOB, "Margin of victory" CLOB, "Runner ( s ) -up" CLOB)
Name the margin of victory for jonas blixt
SELECT "Margin of victory" FROM table_14807 WHERE "Runner(s)-up" = 'jonas blixt'
SELECT "Margin of victory" FROM "table_14807" WHERE "Runner(s)-up" = 'jonas blixt'
0.080078
CREATE TABLE table_45929 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" CLOB, "To par" FLOAT, "Money ( $ ) " FLOAT)
What is the score of player dick metz?
SELECT "Score" FROM table_45929 WHERE "Player" = 'dick metz'
SELECT "Score" FROM "table_45929" WHERE "Player" = 'dick metz'
0.060547
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
provide the number of patients whose discharge location is home and days of hospital stay is greater than 13?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "13"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "13" < "demographic"."days_stay" AND "HOME" = "demographic"."discharge_location"
0.151367
CREATE TABLE table_name_8 (date VARCHAR2, opponent VARCHAR2)
When did indiana play?
SELECT date FROM table_name_8 WHERE opponent = "indiana"
SELECT "date" FROM "table_name_8" WHERE "indiana" = "opponent"
0.060547
CREATE TABLE table_20860739_1 (round VARCHAR2, college VARCHAR2)
How many rounds did Virginia have?
SELECT round FROM table_20860739_1 WHERE college = "Virginia"
SELECT "round" FROM "table_20860739_1" WHERE "Virginia" = "college"
0.06543
CREATE TABLE table_26866205_1 (original_airdate VARCHAR2, series__number VARCHAR2)
What is every original air date for series# of 26?
SELECT original_airdate FROM table_26866205_1 WHERE series__number = 26
SELECT "original_airdate" FROM "table_26866205_1" WHERE "series__number" = 26
0.075195
CREATE TABLE table_27986 ("Rnd" CLOB, "Circuit" CLOB, "Location" CLOB, "Date" CLOB, "Pole position" CLOB, "Fastest lap" CLOB, "Most laps led" CLOB, "Winning driver" CLOB, "Winning team" CLOB, "Supporting" CLOB)
How many races went for 10 rounds?
SELECT COUNT("Fastest lap") FROM table_27986 WHERE "Rnd" = '10'
SELECT COUNT("Fastest lap") FROM "table_27986" WHERE "Rnd" = '10'
0.063477
CREATE TABLE table_name_62 (result VARCHAR2, opponent VARCHAR2)
What is the Result of the game against Philadelphia Eagles?
SELECT result FROM table_name_62 WHERE opponent = "philadelphia eagles"
SELECT "result" FROM "table_name_62" WHERE "opponent" = "philadelphia eagles"
0.075195
CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB) CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB)
A bar chart shows the distribution of All_Home and the amount of All_Home , and group by attribute All_Home, and I want to rank in ascending by the Y-axis.
SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY COUNT(All_Home)
SELECT "All_Home", COUNT("All_Home") FROM "basketball_match" GROUP BY "All_Home" ORDER BY COUNT("All_Home")
0.104492
CREATE TABLE table_20824 ("Gun" CLOB, "m/v ft/s" FLOAT, "Shell ( lb ) " CLOB, "Time to ft ( m ) at 25\\u00b0 ( seconds ) " CLOB, "Time to ft ( m ) at 40\\u00b0 ( seconds ) " CLOB, "Time to ft ( m ) at 55\\u00b0 ( seconds ) " CLOB, "Max. height ( ft ) " FLOAT)
What is the maximum foot per second speed where time to feet ratio is 22.1 at 55 degrees?
SELECT MAX("m/v ft/s") FROM table_20824 WHERE "Time to ft (m) at 55\u00b0 (seconds)" = '22.1'
SELECT MAX("m/v ft/s") FROM "table_20824" WHERE "Time to ft (m) at 55\u00b0 (seconds)" = '22.1'
0.092773
CREATE TABLE table_36147 ("Rank" FLOAT, "Name" CLOB, "Team" CLOB, "Games" FLOAT, "Rebounds" FLOAT)
Who played 10 games?
SELECT "Name" FROM table_36147 WHERE "Games" = '10'
SELECT "Name" FROM "table_36147" WHERE "Games" = '10'
0.051758
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
how many patients until 2100 had received a spinal struct repair nec procedure?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'spinal struct repair nec') AND STRFTIME('%y', procedures_icd.charttime) <= '2100')
WITH "_u_1" AS (SELECT "procedures_icd"."hadm_id" FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'spinal struct repair nec' WHERE STRFTIME('%y', "procedures_icd"."charttime") <= '2100' GROUP BY "hadm_id") SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "admissions" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "admissions"."hadm_id" WHERE NOT "_u_1"."" IS NULL
0.453125
CREATE TABLE table_2818164_4 (no_in_series NUMBER, directed_by VARCHAR2, original_air_date VARCHAR2)
What is the series number for the episode directed by jay sandrich that aired October 23, 1986?
SELECT MIN(no_in_series) FROM table_2818164_4 WHERE directed_by = "Jay Sandrich" AND original_air_date = "October 23, 1986"
SELECT MIN("no_in_series") FROM "table_2818164_4" WHERE "Jay Sandrich" = "directed_by" AND "October 23, 1986" = "original_air_date"
0.12793
CREATE TABLE table_73096 ("Election" FLOAT, "Leader" CLOB, "# of candidates" FLOAT, "# of seats to be won" FLOAT, "# of seats won" FLOAT, "# of total votes" FLOAT, "% of popular vote" CLOB)
Name the number of leaders for % of popular vote being 11.05%
SELECT COUNT("Leader") FROM table_73096 WHERE "% of popular vote" = '11.05%'
SELECT COUNT("Leader") FROM "table_73096" WHERE "% of popular vote" = '11.05%'
0.076172
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
what was the dosage of warfarin that was last prescribed to patient 69895 in the last hospital visit?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 69895 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'warfarin' ORDER BY prescriptions.startdate DESC LIMIT 1
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 69895 AND NOT "admissions"."dischtime" IS NULL GROUP BY "hadm_id" ORDER BY "admissions"."admittime" DESC FETCH FIRST 1 ROWS ONLY) SELECT "prescriptions"."dose_val_rx" FROM "prescriptions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE "prescriptions"."drug" = 'warfarin' AND NOT "_u_0"."" IS NULL ORDER BY "prescriptions"."startdate" DESC FETCH FIRST 1 ROWS ONLY
0.472656
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
Score as function of Datalength of Post body.
WITH cte AS (SELECT NTILE(10) OVER (ORDER BY Body_length) AS "Bucket", Body_length, Id FROM (SELECT Id, DATALENGTH(Body) AS Body_length FROM Posts WHERE PostTypeId = 2) AS p) SELECT bucket, AVG(Body_length), SUM(Score) FROM Posts AS p INNER JOIN cte ON p.Id = cte.Id GROUP BY bucket ORDER BY bucket
WITH "_u_0" AS (SELECT ARRAY_AGG(1) AS "_", 2 AS "_u_1" FROM "Posts" GROUP BY 2), "cte" AS (SELECT "Id" FROM "_u_0"."_" LEFT JOIN "_u_0" "_u_0" ON "PostTypeId" = "_u_0"."_u_1") SELECT "bucket", AVG("Body_length"), SUM("Score") FROM "Posts" "p" JOIN "cte" ON "cte"."Id" = "p"."Id" GROUP BY "bucket" ORDER BY "bucket"
0.307617
CREATE TABLE artist (Artist_ID NUMBER, Artist CLOB, Age NUMBER, Famous_Title CLOB, Famous_Release_date CLOB) CREATE TABLE volume (Volume_ID NUMBER, Volume_Issue CLOB, Issue_Date CLOB, Weeks_on_Top FLOAT, Song CLOB, Artist_ID NUMBER) CREATE TABLE music_festival (ID NUMBER, Music_Festival CLOB, Date_of_ceremony CLOB, Category CLOB, Volume NUMBER, Result CLOB)
What are the number of the category of music festivals with result 'Awarded'?, could you order in ascending by the X-axis?
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY Category
SELECT "Category", COUNT("Category") FROM "music_festival" WHERE "Awarded" = "Result" GROUP BY "Category" ORDER BY "Category"
0.12207
CREATE TABLE table_42262 ("Position" CLOB, "Jersey number" FLOAT, "Name v t e" CLOB, "Height ( cm ) " FLOAT, "Weight ( kg ) " FLOAT, "Birthplace" CLOB, "2009-10 team" CLOB, "NHL rights , if any" CLOB)
What is the position of the player who played for the London Knights during 2009-2010?
SELECT "Position" FROM table_42262 WHERE "2009-10 team" = 'london knights'
SELECT "Position" FROM "table_42262" WHERE "2009-10 team" = 'london knights'
0.074219
CREATE TABLE table_11677691_8 (position VARCHAR2, hometown VARCHAR2)
What position did the kid from loganville, georgia play
SELECT position FROM table_11677691_8 WHERE hometown = "Loganville, Georgia"
SELECT "position" FROM "table_11677691_8" WHERE "Loganville, Georgia" = "hometown"
0.080078
CREATE TABLE table_name_65 (games NUMBER, season VARCHAR2, red_cards VARCHAR2)
Which Games has a Season of 2003/2004, and a Red Cards smaller than 5?
SELECT AVG(games) FROM table_name_65 WHERE season = "2003/2004" AND red_cards < 5
SELECT AVG("games") FROM "table_name_65" WHERE "2003/2004" = "season" AND "red_cards" < 5
0.086914
CREATE TABLE table_23286112_6 (date VARCHAR2, game VARCHAR2)
When was the game number 3 played?
SELECT date FROM table_23286112_6 WHERE game = 3
SELECT "date" FROM "table_23286112_6" WHERE "game" = 3
0.052734
CREATE TABLE department (dno NUMBER, division CLOB, dname CLOB, room CLOB, building CLOB, dphone NUMBER) CREATE TABLE enrolled_in (stuid NUMBER, cid CLOB, grade CLOB) CREATE TABLE gradeconversion (lettergrade CLOB, gradepoint NUMBER) CREATE TABLE faculty (facid NUMBER, lname CLOB, fname CLOB, rank CLOB, sex CLOB, phone NUMBER, room CLOB, building CLOB) CREATE TABLE minor_in (stuid NUMBER, dno NUMBER) CREATE TABLE course (cid CLOB, cname CLOB, credits NUMBER, instructor NUMBER, days CLOB, hours CLOB, dno NUMBER) CREATE TABLE student (stuid NUMBER, lname CLOB, fname CLOB, age NUMBER, sex CLOB, major NUMBER, advisor NUMBER, city_code CLOB) CREATE TABLE member_of (facid NUMBER, dno NUMBER, appt_type CLOB)
Find the first names of students whose first names contain letter 'a'.
SELECT DISTINCT fname FROM student WHERE fname LIKE '%a%'
SELECT DISTINCT "fname" FROM "student" WHERE "fname" LIKE '%a%'
0.061523
CREATE TABLE table_name_70 (home_captain VARCHAR2, result VARCHAR2)
Who is the home captain of the match that resulted [[|]] by 151 runs?
SELECT home_captain FROM table_name_70 WHERE result = "[[|]] by 151 runs"
SELECT "home_captain" FROM "table_name_70" WHERE "[[|]] by 151 runs" = "result"
0.077148
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER) CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2) CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER) CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2) CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2) CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2) CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2) CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER) CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2) CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2) CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2) CREATE TABLE area (course_id NUMBER, area VARCHAR2) CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2) CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
During the Spring and Summer , what upper-level electives are being offered ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND semester.semester IN ('SP', 'SS', 'SU') AND semester.year = 2016
SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%ULCS%' JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" IN ('SP', 'SS', 'SU') AND "semester"."year" = 2016 WHERE "course"."department" = 'EECS'
0.466797
CREATE TABLE table_1520559_1 (venue VARCHAR2, champion VARCHAR2)
At what venues did Lorena Ochoa win the championship?
SELECT venue FROM table_1520559_1 WHERE champion = "Lorena Ochoa"
SELECT "venue" FROM "table_1520559_1" WHERE "Lorena Ochoa" = "champion"
0.069336
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
how many female patients are diagnosed with disrup-external op wound?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Disrup-external op wound"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Disrup-external op wound" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "F" = "demographic"."gender"
0.224609
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
what number of patients admitted before the year 2200 had procedure under procedure icd9 code 3612?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2200" AND procedures.icd9_code = "3612"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "3612" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "2200" > "demographic"."admityear"
0.211914
CREATE TABLE table_name_50 (position VARCHAR2, name VARCHAR2)
What is the position of Allen Gamboa?
SELECT position FROM table_name_50 WHERE name = "allen gamboa"
SELECT "position" FROM "table_name_50" WHERE "allen gamboa" = "name"
0.066406
CREATE TABLE event (Event_ID NUMBER, Date CLOB, Venue CLOB, Name CLOB, Event_Attendance NUMBER) CREATE TABLE journalist (journalist_ID NUMBER, Name CLOB, Nationality CLOB, Age CLOB, Years_working NUMBER) CREATE TABLE news_report (journalist_ID NUMBER, Event_ID NUMBER, Work_Type CLOB)
Bar graph to show the number of nationality from different nationality, and rank from low to high by the Y.
SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY COUNT(Nationality)
SELECT "Nationality", COUNT("Nationality") FROM "journalist" GROUP BY "Nationality" ORDER BY COUNT("Nationality")
0.110352
CREATE TABLE table_7305 ("Place" FLOAT, "Team" CLOB, "Played" FLOAT, "Draw" FLOAT, "Lost" FLOAT, "Goals Scored" FLOAT, "Goals Conceded" FLOAT, "Points" FLOAT)
What is the highest games Played where the Place is 10 and Points are less than 17?
SELECT MAX("Played") FROM table_7305 WHERE "Place" = '10' AND "Points" < '17'
SELECT MAX("Played") FROM "table_7305" WHERE "Place" = '10' AND "Points" < '17'
0.077148
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
how many patients were in careunit micu in 2104.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'micu' AND STRFTIME('%y', transfers.intime) = '2104')
WITH "_u_0" AS (SELECT "transfers"."hadm_id" FROM "transfers" WHERE "transfers"."careunit" = 'micu' AND STRFTIME('%y', "transfers"."intime") = '2104' GROUP BY "hadm_id") SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "admissions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "admissions"."hadm_id" WHERE NOT "_u_0"."" IS NULL
0.318359
CREATE TABLE table_60100 ("Edition" CLOB, "Round" CLOB, "Date" CLOB, "Against" CLOB, "Surface" CLOB, "Opponent" CLOB, "Result" CLOB)
What round had a amtch against cyprus and an edition of 2010 davis cup europe/africa group ii?
SELECT "Round" FROM table_60100 WHERE "Edition" = '2010 davis cup europe/africa group ii' AND "Against" = 'cyprus'
SELECT "Round" FROM "table_60100" WHERE "Against" = 'cyprus' AND "Edition" = '2010 davis cup europe/africa group ii'
0.113281
CREATE TABLE table_44216 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Attendance" CLOB)
What was the attendance total for week 10?
SELECT "Attendance" FROM table_44216 WHERE "Week" = '10'
SELECT "Attendance" FROM "table_44216" WHERE "Week" = '10'
0.056641
CREATE TABLE table_43891 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Ground" CLOB, "Date" CLOB, "Time" CLOB)
What is Home Team, when Home Team Score is 22.15 (147)?
SELECT "Home team" FROM table_43891 WHERE "Home team score" = '22.15 (147)'
SELECT "Home team" FROM "table_43891" WHERE "Home team score" = '22.15 (147)'
0.075195
CREATE TABLE market (Market_ID NUMBER, Country CLOB, Number_cities NUMBER) CREATE TABLE film_market_estimation (Estimation_ID NUMBER, Low_Estimate FLOAT, High_Estimate FLOAT, Film_ID NUMBER, Type CLOB, Market_ID NUMBER, Year NUMBER) CREATE TABLE film (Film_ID NUMBER, Title CLOB, Studio CLOB, Director CLOB, Gross_in_dollar NUMBER)
List the studios of each film and the number of films produced by that studio by a bar chart, and order from low to high by the Y.
SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY COUNT(*)
SELECT "Studio", COUNT(*) FROM "film" GROUP BY "Studio" ORDER BY COUNT(*)
0.071289
CREATE TABLE table_19072602_3 (team_europe VARCHAR2, team_usa VARCHAR2)
When chris barnes is on team usa how many europe teams are there?
SELECT COUNT(team_europe) FROM table_19072602_3 WHERE team_usa = "Chris Barnes"
SELECT COUNT("team_europe") FROM "table_19072602_3" WHERE "Chris Barnes" = "team_usa"
0.083008
CREATE TABLE mountain (mountain_id NUMBER, name CLOB, height NUMBER, prominence NUMBER, range CLOB, country CLOB) CREATE TABLE climber (climber_id NUMBER, name CLOB, country CLOB, time CLOB, points NUMBER, mountain_id NUMBER)
What are the countries that have both mountains that are higher than 5600 and lower than 5200?
SELECT country FROM mountain WHERE height > 5600 INTERSECT SELECT country FROM mountain WHERE height < 5200
SELECT "country" FROM "mountain" WHERE "height" > 5600 INTERSECT SELECT "country" FROM "mountain" WHERE "height" < 5200
0.116211
CREATE TABLE table_1612760_1 (operator VARCHAR2, destination VARCHAR2)
Who is the operator to Highbury & Islington?
SELECT operator FROM table_1612760_1 WHERE destination = "Highbury & Islington"
SELECT "operator" FROM "table_1612760_1" WHERE "Highbury & Islington" = "destination"
0.083008
CREATE TABLE table_20726262_2 (production_code VARCHAR2, no_in_series VARCHAR2)
What was the production code for episode #1?
SELECT production_code FROM table_20726262_2 WHERE no_in_series = 1
SELECT "production_code" FROM "table_20726262_2" WHERE "no_in_series" = 1
0.071289
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER) CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
Total posted and accepted answers by Year.
SELECT YEAR(a.CreationDate) AS "year", COUNT(*) AS "number_of_answers", (SELECT COUNT(*) AS "number_of_answers" FROM Posts AS aa JOIN Posts AS qq ON aa.ParentId = qq.Id INNER JOIN Users ON Users.Id = aa.OwnerUserId WHERE (aa.OwnerUserId = @UserId AND aa.PostTypeId = 2 AND qq.AcceptedAnswerId = aa.Id) AND YEAR(aa.CreationDate) = YEAR(a.CreationDate)) AS "number_of_accepted_answers" FROM Posts AS a INNER JOIN Users ON Users.Id = a.OwnerUserId WHERE a.OwnerUserId = @UserId GROUP BY YEAR(a.CreationDate) ORDER BY YEAR(a.CreationDate) DESC
WITH "_u_0" AS (SELECT COUNT(*) AS "number_of_answers", YEAR("aa"."CreationDate") AS "_u_1" FROM "Posts" "aa" JOIN "Users" ON "Users"."Id" = "aa"."OwnerUserId" JOIN "Posts" "qq" ON "aa"."Id" = "qq"."AcceptedAnswerId" AND "aa"."ParentId" = "qq"."Id" WHERE "aa"."OwnerUserId" = @UserId AND "aa"."PostTypeId" = 2 GROUP BY YEAR("aa"."CreationDate")) SELECT YEAR("a"."CreationDate") AS "year", COUNT(*) AS "number_of_answers", COALESCE("_u_0"."number_of_answers", 0) AS "number_of_accepted_answers" FROM "Posts" "a" JOIN "Users" ON "Users"."Id" = "a"."OwnerUserId" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."_u_1" = YEAR("a"."CreationDate") WHERE "a"."OwnerUserId" = @UserId GROUP BY YEAR("a"."CreationDate") ORDER BY YEAR("a"."CreationDate") DESC
0.716797
CREATE TABLE table_dev_40 ("id" NUMBER, "tc" NUMBER, "ldl_cholesterol" NUMBER, "systolic_blood_pressure_sbp" NUMBER, "untreated_hyperlipidemia" BOOLEAN, "hemoglobin_a1c_hba1c" FLOAT, "platelets" NUMBER, "neutropenia" NUMBER, "thrombocytopenia" FLOAT, "diastolic_blood_pressure_dbp" NUMBER, "tgc" NUMBER, "lymphopenia" NUMBER, "insulin_requirement" FLOAT, "ldl" NUMBER, "fasting_serum_lipoprotein" BOOLEAN, "triglyceride_tg" FLOAT, "hypertension" BOOLEAN, "NOUSE" FLOAT)
untreated hyperlipidemia _ tc > 200 mg / dl, tgc > 200 mg / dl or ldl > 130 mg / dl
SELECT * FROM table_dev_40 WHERE untreated_hyperlipidemia = 1 OR tc > 200 OR tgc > 200 OR ldl > 130
SELECT * FROM "table_dev_40" WHERE "ldl" > 130 OR "tc" > 200 OR "tgc" > 200 OR "untreated_hyperlipidemia" = 1
0.106445