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_46102 ("Rank" CLOB, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
What is the average Gold, when Silver is less than 107, when Bronze is greater than 42, and when Rank is 3?
SELECT AVG("Gold") FROM table_46102 WHERE "Silver" < '107' AND "Bronze" > '42' AND "Rank" = '3'
SELECT AVG("Gold") FROM "table_46102" WHERE "Bronze" > '42' AND "Rank" = '3' AND "Silver" < '107'
0.094727
CREATE TABLE table_8141 ("Volume:Issue" CLOB, "Issue Date ( s ) " CLOB, "Weeks on Top" CLOB, "Song" CLOB, "Artist" CLOB)
How many weeks on top was OMC?
SELECT "Weeks on Top" FROM table_8141 WHERE "Artist" = 'omc'
SELECT "Weeks on Top" FROM "table_8141" WHERE "Artist" = 'omc'
0.060547
CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB) 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)
Visualize a pie chart about the proportion of All_Road and School_ID.
SELECT All_Road, School_ID FROM basketball_match
SELECT "All_Road", "School_ID" FROM "basketball_match"
0.052734
CREATE TABLE table_1342249_32 (result VARCHAR2, district VARCHAR2)
Name the result for new york 1
SELECT result FROM table_1342249_32 WHERE district = "New York 1"
SELECT "result" FROM "table_1342249_32" WHERE "New York 1" = "district"
0.069336
CREATE TABLE table_43114 ("Player" CLOB, "Club" CLOB, "League" FLOAT, "FA Cup" FLOAT, "FA Trophy" FLOAT, "League Cup" FLOAT, "Total" FLOAT)
How many FA Trophy has a Total larger than 17 and a Player of david gamble and a League Cup larger than 0?
SELECT COUNT("FA Trophy") FROM table_43114 WHERE "Total" > '17' AND "Player" = 'david gamble' AND "League Cup" > '0'
SELECT COUNT("FA Trophy") FROM "table_43114" WHERE "League Cup" > '0' AND "Player" = 'david gamble' AND "Total" > '17'
0.115234
CREATE TABLE table_4588 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
When the Home team score was 8.15 (63), what is the total Crowd?
SELECT COUNT("Crowd") FROM table_4588 WHERE "Home team score" = '8.15 (63)'
SELECT COUNT("Crowd") FROM "table_4588" WHERE "Home team score" = '8.15 (63)'
0.075195
CREATE TABLE table_name_70 (result VARCHAR2, date VARCHAR2)
What is Result, when Date is 'December 12'?
SELECT result FROM table_name_70 WHERE date = "december 12"
SELECT "result" FROM "table_name_70" WHERE "date" = "december 12"
0.063477
CREATE TABLE table_52723 ("Tournament" CLOB, "Starts" FLOAT, "Top-10s" FLOAT, "Wins" FLOAT, "Earnings ( $ ) " CLOB)
In the tournament of HSBC Champions, what was the sum of the Starts with Wins lower than 0?
SELECT SUM("Starts") FROM table_52723 WHERE "Tournament" = 'hsbc champions' AND "Wins" < '0'
SELECT SUM("Starts") FROM "table_52723" WHERE "Tournament" = 'hsbc champions' AND "Wins" < '0'
0.091797
CREATE TABLE table_55785 ("Ordinary income rate" CLOB, "Long-term capital gain rate" CLOB, "Short-term capital gain rate" CLOB, "Long-term gain on commercial buildings*" CLOB, "Long-term gain on collectibles" CLOB)
What is long-term gain for commercial buildings when long-term gain on collectible sis 28% and ordinary income rate is 35%?
SELECT "Long-term gain on commercial buildings*" FROM table_55785 WHERE "Long-term gain on collectibles" = '28%' AND "Ordinary income rate" = '35%'
SELECT "Long-term gain on commercial buildings*" FROM "table_55785" WHERE "Long-term gain on collectibles" = '28%' AND "Ordinary income rate" = '35%'
0.145508
CREATE TABLE table_name_72 (date VARCHAR2, team VARCHAR2)
What is Date, when Team is 'Orlando'?
SELECT date FROM table_name_72 WHERE team = "orlando"
SELECT "date" FROM "table_name_72" WHERE "orlando" = "team"
0.057617
CREATE TABLE table_20497 ("No." FLOAT, "Date" CLOB, "Tournament" CLOB, "Winning score" CLOB, "To par" CLOB, "Margin of victory" CLOB, "Runner ( s ) -up" CLOB)
What was the winning score for the tournament with runner-up Rory Sabbatini?
SELECT "Winning score" FROM table_20497 WHERE "Runner(s)-up" = 'Rory Sabbatini'
SELECT "Winning score" FROM "table_20497" WHERE "Runner(s)-up" = 'Rory Sabbatini'
0.079102
CREATE TABLE table_name_2 (city VARCHAR2, opponent VARCHAR2)
What city did Yugoslavia play Norway in?
SELECT city FROM table_name_2 WHERE opponent = "norway"
SELECT "city" FROM "table_name_2" WHERE "norway" = "opponent"
0.05957
CREATE TABLE table_37794 ("County" CLOB, "Irish name" CLOB, "County town" CLOB, "Most populous city/town" CLOB, "Province" CLOB, "Region" CLOB)
County town of castlebar has the most populous city/town?
SELECT "Most populous city/town" FROM table_37794 WHERE "County town" = 'castlebar'
SELECT "Most populous city/town" FROM "table_37794" WHERE "County town" = 'castlebar'
0.083008
CREATE TABLE table_22474 ("Township" CLOB, "County" CLOB, "Pop. ( 2010 ) " FLOAT, "Land ( sqmi ) " CLOB, "Water ( sqmi ) " CLOB, "Latitude" CLOB, "Longitude" CLOB, "GEO ID" FLOAT, "ANSI code" FLOAT)
What longitudes associated with a water (sqmi) area of 0.068?
SELECT "Longitude" FROM table_22474 WHERE "Water (sqmi)" = '0.068'
SELECT "Longitude" FROM "table_22474" WHERE "Water (sqmi)" = '0.068'
0.066406
CREATE TABLE buildings (id NUMBER, name CLOB, City CLOB, Height NUMBER, Stories NUMBER, Status CLOB) CREATE TABLE Office_locations (building_id NUMBER, company_id NUMBER, move_in_year NUMBER) CREATE TABLE Companies (id NUMBER, name CLOB, Headquarters CLOB, Industry CLOB, Sales_billion FLOAT, Profits_billion FLOAT, Assets_billion FLOAT, Market_Value_billion CLOB)
List the number of each company whose office is in the building in a bar chart, list by the x-axis in asc.
SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name ORDER BY T3.name
SELECT "T3"."name", COUNT("T3"."name") FROM "Office_locations" "T1" JOIN "buildings" "T2" ON "T1"."building_id" = "T2"."id" JOIN "Companies" "T3" ON "T1"."company_id" = "T3"."id" GROUP BY "T3"."name" ORDER BY "T3"."name"
0.214844
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE d_icd_procedures (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 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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) 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 d_labitems (row_id NUMBER, itemid NUMBER, label 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 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 d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto 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 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 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 patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
what were the top three most frequent procedures that patients took in the same month after receiving open liver biopsy since 2102?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open liver biopsy') AND STRFTIME('%y', procedures_icd.charttime) >= '2102') AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.icd9_code, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', procedures_icd.charttime) >= '2102') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 3)
WITH "t2" AS (SELECT "admissions"."subject_id", "procedures_icd"."icd9_code", "procedures_icd"."charttime" FROM "procedures_icd" JOIN "admissions" ON "admissions"."hadm_id" = "procedures_icd"."hadm_id" WHERE STRFTIME('%y', "procedures_icd"."charttime") >= '2102'), "t3" AS (SELECT "t2"."icd9_code", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'open liver biopsy' JOIN "admissions" ON "admissions"."hadm_id" = "procedures_icd"."hadm_id" JOIN "t2" "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND "procedures_icd"."charttime" < "t2"."charttime" AND DATETIME("procedures_icd"."charttime", 'start of month') = DATETIME("t2"."charttime", 'start of month') WHERE STRFTIME('%y', "procedures_icd"."charttime") >= '2102' GROUP BY "t2"."icd9_code"), "_u_1" AS (SELECT "t3"."icd9_code" FROM "t3" "t3" WHERE "t3"."c1" <= 3 GROUP BY "icd9_code") SELECT "d_icd_procedures"."short_title" FROM "d_icd_procedures" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "d_icd_procedures"."icd9_code" WHERE NOT "_u_1"."" IS NULL
1.132813
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2) CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2) CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB) CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2) CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2) CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2) CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB) CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB) CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER) CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER) CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER) CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB) CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2) CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2) CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2) CREATE TABLE code_description (code VARCHAR2, description CLOB) CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER) CREATE TABLE month (month_number NUMBER, month_name CLOB) CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER) CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER) CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER) CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER) CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB) CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
yes i would like to find what flights are available from ATLANTA to BOSTON on the morning of 7 7
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 7 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 7 AND "date_day"."month_number" = 7 AND "date_day"."year" = 1991 JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'ATLANTA' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" AND "flight"."departure_time" <= 1200 AND "flight"."departure_time" >= 0 JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'BOSTON'
0.762695
CREATE TABLE table_name_85 (played NUMBER, draws VARCHAR2, scored VARCHAR2, position VARCHAR2)
Which Played has a Scored larger than 25 and a Position of 1, and Draws smaller than 5?
SELECT MAX(played) FROM table_name_85 WHERE scored > 25 AND position = 1 AND draws < 5
SELECT MAX("played") FROM "table_name_85" WHERE "draws" < 5 AND "position" = 1 AND "scored" > 25
0.09375
CREATE TABLE station (id NUMBER, name CLOB, lat NUMBER, long NUMBER, dock_count NUMBER, city CLOB, installation_date CLOB) CREATE TABLE status (station_id NUMBER, bikes_available NUMBER, docks_available NUMBER, time CLOB) 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 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)
For each city, what is the highest latitude for its stations. Visualize by bar chart.
SELECT city, MAX(lat) FROM station GROUP BY city
SELECT "city", MAX("lat") FROM "station" GROUP BY "city"
0.054688
CREATE TABLE table_30390 ("Position" FLOAT, "Club" CLOB, "Played" FLOAT, "Won" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Pts For" FLOAT, "Pts Agst" FLOAT, "Points" FLOAT, "Percent" CLOB)
How many points did the team that won 5 games make?
SELECT "Pts For" FROM table_30390 WHERE "Won" = '5'
SELECT "Pts For" FROM "table_30390" WHERE "Won" = '5'
0.051758
CREATE TABLE table_13258876_2 (record VARCHAR2, date VARCHAR2)
What was the Seahawks record on September 18, 1983?
SELECT record FROM table_13258876_2 WHERE date = "September 18, 1983"
SELECT "record" FROM "table_13258876_2" WHERE "September 18, 1983" = "date"
0.073242
CREATE TABLE table_203_573 (id NUMBER, "name" CLOB, "rank - 2000" NUMBER, "number" NUMBER, "country of origin" CLOB, "england - 2001" CLOB)
what is the english american name that the most people have ?
SELECT "name" FROM table_203_573 ORDER BY "number" DESC LIMIT 1
SELECT "name" FROM "table_203_573" ORDER BY "number" DESC FETCH FIRST 1 ROWS ONLY
0.079102
CREATE TABLE table_8372 ("Scorer" CLOB, "Club" CLOB, "League goals" CLOB, "FA Cup goals" FLOAT, "League Cup goals" FLOAT, "Total" FLOAT)
What is the lowest number of FA Cup goals for players with 12 League goals and 14 total goals?
SELECT MIN("FA Cup goals") FROM table_8372 WHERE "League goals" = '12' AND "Total" = '14'
SELECT MIN("FA Cup goals") FROM "table_8372" WHERE "League goals" = '12' AND "Total" = '14'
0.088867
CREATE TABLE PersonFriend (name VARCHAR2, friend VARCHAR2, year NUMBER) CREATE TABLE Person (name VARCHAR2, age NUMBER, city CLOB, gender CLOB, job CLOB)
How old is the youngest person for each job Visualize by bar chart, could you list in ascending by the names?
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job
SELECT "job", MIN("age") FROM "Person" GROUP BY "job" ORDER BY "job"
0.066406
CREATE TABLE table_name_27 (interface VARCHAR2, controller VARCHAR2, codename VARCHAR2)
Which interface uses Sandforce with a code name of Sierra Star?
SELECT interface FROM table_name_27 WHERE controller = "sandforce" AND codename = "sierra star"
SELECT "interface" FROM "table_name_27" WHERE "codename" = "sierra star" AND "controller" = "sandforce"
0.100586
CREATE TABLE table_name_77 (ends VARCHAR2, since VARCHAR2, name VARCHAR2)
WHAT IS THE ENDS IN 2007 AND NAMED MILITO?
SELECT ends FROM table_name_77 WHERE since = 2007 AND name = "milito"
SELECT "ends" FROM "table_name_77" WHERE "milito" = "name" AND "since" = 2007
0.075195
CREATE TABLE table_10412 ("Class" CLOB, "Type" CLOB, "Quantity" FLOAT, "Date" CLOB, "LNER Class" CLOB, "1946 LNER nos." CLOB)
Which class has less in quantity than 174 between the years 1921 23?
SELECT "Class" FROM table_10412 WHERE "Quantity" < '174' AND "Date" = '1921–23'
SELECT "Class" FROM "table_10412" WHERE "Date" = '1921–23' AND "Quantity" < '174'
0.079102
CREATE TABLE table_32653 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
When the crowd was larger than 20,915 what did the Away team score?
SELECT "Away team score" FROM table_32653 WHERE "Crowd" > '20,915'
SELECT "Away team score" FROM "table_32653" WHERE "Crowd" > '20,915'
0.066406
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, 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)
what is the number of patients whose marital status is divorced and drug route is iv?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "DIVORCED" AND prescriptions.route = "IV"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "IV" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "DIVORCED" = "demographic"."marital_status"
0.223633
CREATE TABLE table_55704 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
What was the score for the home team that played at Moorabbin Oval?
SELECT "Home team score" FROM table_55704 WHERE "Venue" = 'moorabbin oval'
SELECT "Home team score" FROM "table_55704" WHERE "Venue" = 'moorabbin oval'
0.074219
CREATE TABLE table_31696 ("Region" CLOB, "Host" CLOB, "Venue" CLOB, "City" CLOB, "State" CLOB)
What is the host in Georgia?
SELECT "Host" FROM table_31696 WHERE "State" = 'georgia'
SELECT "Host" FROM "table_31696" WHERE "State" = 'georgia'
0.056641
CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB) 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)
Show the relation between school id and all_games_percent for each Team_Name using a scatter chart
SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY Team_Name
SELECT "School_ID", "All_Games_Percent" FROM "basketball_match" GROUP BY "Team_Name"
0.082031
CREATE TABLE Purchases (purchase_transaction_id NUMBER, purchase_details VARCHAR2) CREATE TABLE Sales (sales_transaction_id NUMBER, sales_details VARCHAR2) CREATE TABLE Transactions (transaction_id NUMBER, investor_id NUMBER, transaction_type_code VARCHAR2, date_of_transaction DATETIME, amount_of_transaction NUMBER, share_count VARCHAR2, other_details VARCHAR2) CREATE TABLE Investors (investor_id NUMBER, Investor_details VARCHAR2) CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR2, transaction_type_description VARCHAR2) CREATE TABLE Lots (lot_id NUMBER, investor_id NUMBER, lot_details VARCHAR2) CREATE TABLE Transactions_Lots (transaction_id NUMBER, lot_id NUMBER)
Show the number of the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000.
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count > 100 OR amount_of_transaction > 1000
SELECT "date_of_transaction", COUNT("date_of_transaction") FROM "Transactions" WHERE "amount_of_transaction" > 1000 OR "share_count" > 100
0.134766
CREATE TABLE table_49336 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" CLOB, "To par" CLOB, "Money ( $ ) " FLOAT)
what is the to par when the place is t10 and the score is 72-74-71-69=286?
SELECT "To par" FROM table_49336 WHERE "Place" = 't10' AND "Score" = '72-74-71-69=286'
SELECT "To par" FROM "table_49336" WHERE "Place" = 't10' AND "Score" = '72-74-71-69=286'
0.085938
CREATE TABLE table_28630 ("Channel" FLOAT, "Channel name" CLOB, "Callsign" CLOB, "Signal power" CLOB, "Broadcast area" CLOB)
What is the broadcast are for channel 1?
SELECT "Broadcast area" FROM table_28630 WHERE "Channel" = '1'
SELECT "Broadcast area" FROM "table_28630" WHERE "Channel" = '1'
0.0625
CREATE TABLE table_204_801 (id NUMBER, "year" NUMBER, "derby\ winner" CLOB, "galaxy" NUMBER, "draw" NUMBER, "chivas" NUMBER)
in what year did chivas have the same number of wins as in 2012 ?
SELECT "year" FROM table_204_801 WHERE "year" <> 2012 AND "chivas" = (SELECT "chivas" FROM table_204_801 WHERE "year" = 2012)
SELECT "year" FROM "table_204_801" WHERE "chivas" = (SELECT "chivas" FROM "table_204_801" WHERE "year" = 2012) AND "year" <> 2012
0.125977
CREATE TABLE table_name_78 (tournament VARCHAR2, surface VARCHAR2, date VARCHAR2)
Which tournament has hard as the surface and apr. 12, 1998 as the date?
SELECT tournament FROM table_name_78 WHERE surface = "hard" AND date = "apr. 12, 1998"
SELECT "tournament" FROM "table_name_78" WHERE "apr. 12, 1998" = "date" AND "hard" = "surface"
0.091797
CREATE TABLE PostTags (PostId NUMBER, TagId 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 FlagTypes (Id NUMBER, Name CLOB, Description 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 ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE CloseReasonTypes (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 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 PostTypes (Id NUMBER, Name CLOB) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount 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 Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE VoteTypes (Id NUMBER, Name 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 PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId 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 PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense 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 PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
Count of Tags relevant to Taxonomist. Returns the number of tags that would be eligible for awarding Taxonomist if it could be awarded multiple times
SELECT COUNT(*) AS Tag_Count FROM Tags AS t WHERE t.Count >= 50
SELECT COUNT(*) AS "Tag_Count" FROM "Tags" "t" WHERE "t"."Count" >= 50
0.068359
CREATE TABLE table_5249 ("Position" FLOAT, "Team" CLOB, "Points" FLOAT, "Played" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Against" FLOAT, "Difference" CLOB)
How many draws took place for team Corinthians with more than 5 losses?
SELECT COUNT("Drawn") FROM table_5249 WHERE "Team" = 'corinthians' AND "Lost" > '5'
SELECT COUNT("Drawn") FROM "table_5249" WHERE "Lost" > '5' AND "Team" = 'corinthians'
0.083008
CREATE TABLE table_62199 ("Player" CLOB, "Height" FLOAT, "Position" CLOB, "Year born ( Age ) " CLOB, "Current Club" CLOB)
What year was Rowan Barrett born?
SELECT "Year born (Age)" FROM table_62199 WHERE "Player" = 'rowan barrett'
SELECT "Year born (Age)" FROM "table_62199" WHERE "Player" = 'rowan barrett'
0.074219
CREATE TABLE table_39336 ("Rank" FLOAT, "Country/Territory" CLOB, "Miss World" FLOAT, "1st Runner-up" FLOAT, "2nd Runner-up" FLOAT, "3rd Runner-up" FLOAT, "4th Runner-up" FLOAT, "5th Runner-up" FLOAT, "6th Runner-up" FLOAT, "Semifinalists" FLOAT, "Total" FLOAT)
Rank larger than 3, and a 6th Runner-up larger than 0, and a 5th Runner-up smaller than 1 has which lowest 1st Runner-up?
SELECT MIN("1st Runner-up") FROM table_39336 WHERE "Rank" > '3' AND "6th Runner-up" > '0' AND "5th Runner-up" < '1'
SELECT MIN("1st Runner-up") FROM "table_39336" WHERE "5th Runner-up" < '1' AND "6th Runner-up" > '0' AND "Rank" > '3'
0.114258
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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
mention the diagnosis long title of subject id 74463.
SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "74463"
SELECT "diagnoses"."long_title" FROM "diagnoses" WHERE "74463" = "diagnoses"."subject_id"
0.086914
CREATE TABLE table_8993 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" FLOAT, "To par" CLOB)
Where did Celestino Tugot place?
SELECT "Place" FROM table_8993 WHERE "Player" = 'celestino tugot'
SELECT "Place" FROM "table_8993" WHERE "Player" = 'celestino tugot'
0.06543
CREATE TABLE table_name_15 (competition VARCHAR2, first_match VARCHAR2)
What competition had its first match on December 20, 2007?
SELECT competition FROM table_name_15 WHERE first_match = "december 20, 2007"
SELECT "competition" FROM "table_name_15" WHERE "december 20, 2007" = "first_match"
0.081055
CREATE TABLE table_71277 ("Rank" FLOAT, "Team" CLOB, "Country" CLOB, "Value ( $M ) " FLOAT, "Debt as %of value" FLOAT, "% change on year" CLOB, "Revenue ( $M ) " FLOAT, "Operating income ( $m ) " FLOAT)
What was the sum of Value ($M), when the Revenue ($M) was less than 307, the Team was Valencia, and the Rank was smaller than 19?
SELECT SUM("Value ($M)") FROM table_71277 WHERE "Revenue ($M)" < '307' AND "Team" = 'valencia' AND "Rank" < '19'
SELECT SUM("Value ($M)") FROM "table_71277" WHERE "Rank" < '19' AND "Revenue ($M)" < '307' AND "Team" = 'valencia'
0.111328
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount 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 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 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 d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title 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 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_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) 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 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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
when has patient 1489 received the first lab test during their last hospital visit?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1489 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY labevents.charttime LIMIT 1
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 1489 AND NOT "admissions"."dischtime" IS NULL GROUP BY "hadm_id" ORDER BY "admissions"."admittime" DESC FETCH FIRST 1 ROWS ONLY) SELECT "labevents"."charttime" FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."hadm_id" WHERE NOT "_u_0"."" IS NULL ORDER BY "labevents"."charttime" FETCH FIRST 1 ROWS ONLY
0.410156
CREATE TABLE table_204_584 (id NUMBER, "pos" CLOB, "no" NUMBER, "driver" CLOB, "constructor" CLOB, "laps" NUMBER, "time/retired" CLOB, "grid" NUMBER, "points" NUMBER)
who had the best time driving a ferrari ?
SELECT "driver" FROM table_204_584 WHERE "constructor" = 'ferrari' ORDER BY "pos" LIMIT 1
SELECT "driver" FROM "table_204_584" WHERE "constructor" = 'ferrari' ORDER BY "pos" FETCH FIRST 1 ROWS ONLY
0.104492
CREATE TABLE table_name_23 (state VARCHAR2, major_series VARCHAR2, track VARCHAR2)
What is the State with the imsa gt as the Major Series and a track in new orleans?
SELECT state FROM table_name_23 WHERE major_series = "imsa gt" AND track = "new orleans"
SELECT "state" FROM "table_name_23" WHERE "imsa gt" = "major_series" AND "new orleans" = "track"
0.09375
CREATE TABLE table_37116 ("Outcome" CLOB, "Date" CLOB, "Tournament" CLOB, "Surface" CLOB, "Opponent" CLOB, "Score" CLOB)
What is the outcome for the Hershey tournament?
SELECT "Outcome" FROM table_37116 WHERE "Tournament" = 'hershey'
SELECT "Outcome" FROM "table_37116" WHERE "Tournament" = 'hershey'
0.064453
CREATE TABLE table_5342 ("Nation" CLOB, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
Gold of 0, and a Total larger than 0, and a Silver larger than 1 and what is the highest bronze?
SELECT MAX("Bronze") FROM table_5342 WHERE "Gold" = '0' AND "Total" > '0' AND "Silver" > '1'
SELECT MAX("Bronze") FROM "table_5342" WHERE "Gold" = '0' AND "Silver" > '1' AND "Total" > '0'
0.091797
CREATE TABLE table_12266 ("Draft" FLOAT, "Round" CLOB, "Pick" FLOAT, "Player" CLOB, "Nationality" CLOB)
What is the pick of player don waddell from round 7?
SELECT "Pick" FROM table_12266 WHERE "Round" = '7' AND "Player" = 'don waddell'
SELECT "Pick" FROM "table_12266" WHERE "Player" = 'don waddell' AND "Round" = '7'
0.079102
CREATE TABLE table_62055 ("Round" FLOAT, "Race" CLOB, "Circuit" CLOB, "Date" CLOB, "Event" CLOB, "Winning driver" CLOB)
What is the round for the Int. Adac-Preis Der Tourenwagen Von Sachsen-Anhalt?
SELECT "Round" FROM table_62055 WHERE "Race" = 'int. adac-preis der tourenwagen von sachsen-anhalt'
SELECT "Round" FROM "table_62055" WHERE "Race" = 'int. adac-preis der tourenwagen von sachsen-anhalt'
0.098633
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2) CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER) CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2) CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER) CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER) CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER) CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, and sort in ascending by the Y-axis please.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY COUNT(JOB_ID)
SELECT "JOB_ID", COUNT("JOB_ID") FROM "employees" WHERE NOT "EMPLOYEE_ID" IN (SELECT "EMPLOYEE_ID" FROM "job_history") GROUP BY "JOB_ID" ORDER BY COUNT("JOB_ID")
0.157227
CREATE TABLE table_name_65 (worldwide_gross VARCHAR2, director VARCHAR2)
What was the worldwide gross for the film directed by joe pytka?
SELECT worldwide_gross FROM table_name_65 WHERE director = "joe pytka"
SELECT "worldwide_gross" FROM "table_name_65" WHERE "director" = "joe pytka"
0.074219
CREATE TABLE Elimination (Elimination_ID CLOB, Wrestler_ID CLOB, Team CLOB, Eliminated_By CLOB, Elimination_Move CLOB, Time CLOB) CREATE TABLE wrestler (Wrestler_ID NUMBER, Name CLOB, Reign CLOB, Days_held CLOB, Location CLOB, Event CLOB)
Bar graph to show the total number from different team, and list in ascending by the bar.
SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY Team
SELECT "Team", COUNT(*) FROM "Elimination" GROUP BY "Team" ORDER BY "Team"
0.072266
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) 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 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 microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) 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 cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
the number of times that patient 035-166 had been prescribed morphine inj in 04/2104.
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-166')) AND medication.drugname = 'morphine inj' AND STRFTIME('%y-%m', medication.drugstarttime) = '2104-04'
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '035-166' 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(*) FROM "medication" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "medication"."patientunitstayid" WHERE "medication"."drugname" = 'morphine inj' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m', "medication"."drugstarttime") = '2104-04'
0.581055
CREATE TABLE ReviewTaskStates (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 CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) 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 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 PostTypes (Id NUMBER, Name CLOB) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE ReviewTaskTypes (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 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 Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE PostHistoryTypes (Id NUMBER, Name 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 PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description 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)
Crusader's crossbow: smite unanswered questions by finding worthy questions (by user).
SELECT Id AS "post_link", Tags FROM Posts WHERE Id IN (SELECT ParentId FROM Posts WHERE ParentId IN (SELECT Q.Id FROM Posts AS Q INNER JOIN Posts AS A ON (A.ParentId = Q.Id) WHERE Q.PostTypeId = 1 AND A.PostTypeId = 2 AND Q.OwnerUserId = '##UserId##' AND A.Score <= 0 AND Q.AcceptedAnswerId IS NULL AND DATEDIFF(day, Q.CreationDate, GETDATE()) >= 180 AND Q.ClosedDate IS NULL) GROUP BY ParentId HAVING MAX(Score) <= 0)
SELECT "Id" AS "post_link", "Tags" FROM "Posts" WHERE "Id" IN (SELECT "ParentId" FROM "Posts" WHERE "ParentId" IN (SELECT "Q"."Id" FROM "Posts" "Q" JOIN "Posts" "A" ON "A"."ParentId" = "Q"."Id" AND "A"."PostTypeId" = 2 AND "A"."Score" <= 0 WHERE "Q"."AcceptedAnswerId" IS NULL AND "Q"."ClosedDate" IS NULL AND "Q"."OwnerUserId" = '##UserId##' AND "Q"."PostTypeId" = 1 AND DATEDIFF(CAST("day" AS DATETIME), CAST("Q"."CreationDate" AS DATETIME), GETDATE()) >= 180) GROUP BY "ParentId" HAVING MAX("Score") <= 0)
0.496094
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) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) 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 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) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
how many hours has it been since the last time carvedilol 6.25 mg po tabs was prescribed to patient 010-16572 in the current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-16572') AND patient.hospitaldischargetime IS NULL) AND medication.drugname = 'carvedilol 6.25 mg po tabs' ORDER BY medication.drugstarttime DESC LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '010-16572' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE "patient"."hospitaldischargetime" IS NULL AND NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "medication"."drugstarttime")) FROM "medication" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "medication"."patientunitstayid" WHERE "medication"."drugname" = 'carvedilol 6.25 mg po tabs' AND NOT "_u_1"."" IS NULL ORDER BY "medication"."drugstarttime" DESC FETCH FIRST 1 ROWS ONLY
0.71875
CREATE TABLE table_8177 ("Game" FLOAT, "February" FLOAT, "Opponent" CLOB, "Score" CLOB, "Record" CLOB)
What is the highest Game, when Record is '21-30-11'?
SELECT MAX("Game") FROM table_8177 WHERE "Record" = '21-30-11'
SELECT MAX("Game") FROM "table_8177" WHERE "Record" = '21-30-11'
0.0625
CREATE TABLE table_name_11 (date VARCHAR2, raiders_points VARCHAR2)
What day did the Raiders score 17?
SELECT date FROM table_name_11 WHERE raiders_points = 17
SELECT "date" FROM "table_name_11" WHERE "raiders_points" = 17
0.060547
CREATE TABLE table_27329061_2 (version VARCHAR2, codename VARCHAR2)
What is the version when the codename is ada?
SELECT version FROM table_27329061_2 WHERE codename = "Ada"
SELECT "version" FROM "table_27329061_2" WHERE "Ada" = "codename"
0.063477
CREATE TABLE table_name_74 (silver NUMBER, bronze VARCHAR2, total VARCHAR2, gold VARCHAR2)
With 1 Gold, more than 2 Bronze and Total greater than 1, what is the Silver?
SELECT AVG(silver) FROM table_name_74 WHERE total > 1 AND gold = 1 AND bronze > 2
SELECT AVG("silver") FROM "table_name_74" WHERE "bronze" > 2 AND "gold" = 1 AND "total" > 1
0.088867
CREATE TABLE table_12148147_2 (first_year VARCHAR2, third_year VARCHAR2)
What is the first year course in the program where geometry is taken in the third year?
SELECT first_year FROM table_12148147_2 WHERE third_year = "Geometry"
SELECT "first_year" FROM "table_12148147_2" WHERE "Geometry" = "third_year"
0.073242
CREATE TABLE table_13762 ("Score" CLOB, "Shooter" CLOB, "Date" CLOB, "Comp" CLOB, "Place" CLOB)
What's the comp when the score was 393?
SELECT "Comp" FROM table_13762 WHERE "Score" = '393'
SELECT "Comp" FROM "table_13762" WHERE "Score" = '393'
0.052734
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime 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 cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) 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 medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime 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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
show me the top five most commonly prescribed drugs for patients over the age of 60 or above until 2103?
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', medication.drugstarttime) <= '2103' GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 5
WITH "_u_0" AS (SELECT "patient"."patientunitstayid" FROM "patient" WHERE "patient"."age" >= 60 GROUP BY "patientunitstayid"), "t1" AS (SELECT "medication"."drugname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "medication" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "medication"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y', "medication"."drugstarttime") <= '2103' GROUP BY "medication"."drugname") SELECT "t1"."drugname" FROM "t1" "t1" WHERE "t1"."c1" <= 5
0.476563
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) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
For patient id 26285, specify his or her primary disease and discharge location
SELECT demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "26285"
SELECT "demographic"."discharge_location", "demographic"."diagnosis" FROM "demographic" WHERE "26285" = "demographic"."subject_id"
0.126953
CREATE TABLE table_53144 ("Driver" CLOB, "Constructor" CLOB, "Laps" FLOAT, "Time/Retired" CLOB, "Grid" FLOAT)
What is the grid total for jean-pierre beltoise?
SELECT COUNT("Grid") FROM table_53144 WHERE "Driver" = 'jean-pierre beltoise'
SELECT COUNT("Grid") FROM "table_53144" WHERE "Driver" = 'jean-pierre beltoise'
0.077148
CREATE TABLE country (Country_id NUMBER, Country_name CLOB, Capital CLOB, Official_native_language CLOB) CREATE TABLE player (Player_ID NUMBER, Player CLOB, Years_Played CLOB, Total_WL CLOB, Singles_WL CLOB, Doubles_WL CLOB, Team NUMBER) CREATE TABLE match_season (Season FLOAT, Player CLOB, Position CLOB, Country NUMBER, Team NUMBER, Draft_Pick_Number NUMBER, Draft_Class CLOB, College CLOB) CREATE TABLE team (Team_id NUMBER, Name CLOB)
What are the draft pick numbers and draft classes for players who play the Defender position Show bar chart, and could you order x-axis in descending order?
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class DESC
SELECT "Draft_Class", "Draft_Pick_Number" FROM "match_season" WHERE "Defender" = "Position" ORDER BY "Draft_Class" DESC
0.116211
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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime 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 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 lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
what were the three most often used procedures for patients who had previously been diagnosed with s/p oral surgery procedure within 2 months, since 2105?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 's/p oral surgery procedure' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmentname, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', treatment.treatmenttime) >= '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.treatmenttime AND DATETIME(t2.treatmenttime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month') GROUP BY t2.treatmentname) AS t3 WHERE t3.c1 <= 3
WITH "t2" AS (SELECT "patient"."uniquepid", "treatment"."treatmentname", "treatment"."treatmenttime" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" WHERE STRFTIME('%y', "treatment"."treatmenttime") >= '2105'), "t3" AS (SELECT "t2"."treatmentname", 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"."treatmenttime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime") <= DATETIME("t2"."treatmenttime") AND DATETIME("diagnosis"."diagnosistime", '+2 month') >= DATETIME("t2"."treatmenttime") WHERE "diagnosis"."diagnosisname" = 's/p oral surgery procedure' AND STRFTIME('%y', "diagnosis"."diagnosistime") >= '2105' GROUP BY "t2"."treatmentname") SELECT "t3"."treatmentname" FROM "t3" "t3" WHERE "t3"."c1" <= 3
0.922852
CREATE TABLE table_40926 ("From" FLOAT, "Goal" CLOB, "Round 1" CLOB, "Round 2" CLOB, "Round 3" CLOB, "Round 4" CLOB, "Round 5" CLOB, "Round 6+" CLOB)
What is Round 2 from 1999?
SELECT "Round 2" FROM table_40926 WHERE "From" = '1999'
SELECT "Round 2" FROM "table_40926" WHERE "From" = '1999'
0.055664
CREATE TABLE COURSE (CRS_CODE VARCHAR2, DEPT_CODE VARCHAR2, CRS_DESCRIPTION VARCHAR2, CRS_CREDIT FLOAT) CREATE TABLE PROFESSOR (EMP_NUM NUMBER, DEPT_CODE VARCHAR2, PROF_OFFICE VARCHAR2, PROF_EXTENSION VARCHAR2, PROF_HIGH_DEGREE VARCHAR2) CREATE TABLE CLASS (CLASS_CODE VARCHAR2, CRS_CODE VARCHAR2, CLASS_SECTION VARCHAR2, CLASS_TIME VARCHAR2, CLASS_ROOM VARCHAR2, PROF_NUM NUMBER) CREATE TABLE ENROLL (CLASS_CODE VARCHAR2, STU_NUM NUMBER, ENROLL_GRADE VARCHAR2) CREATE TABLE DEPARTMENT (DEPT_CODE VARCHAR2, DEPT_NAME VARCHAR2, SCHOOL_CODE VARCHAR2, EMP_NUM NUMBER, DEPT_ADDRESS VARCHAR2, DEPT_EXTENSION VARCHAR2) CREATE TABLE EMPLOYEE (EMP_NUM NUMBER, EMP_LNAME VARCHAR2, EMP_FNAME VARCHAR2, EMP_INITIAL VARCHAR2, EMP_JOBCODE VARCHAR2, EMP_HIREDATE DATETIME, EMP_DOB DATETIME) CREATE TABLE STUDENT (STU_NUM NUMBER, STU_LNAME VARCHAR2, STU_FNAME VARCHAR2, STU_INIT VARCHAR2, STU_DOB DATETIME, STU_HRS NUMBER, STU_CLASS VARCHAR2, STU_GPA FLOAT, STU_TRANSFER NUMBER, DEPT_CODE VARCHAR2, STU_PHONE VARCHAR2, PROF_NUM NUMBER)
How many students are in each department Visualize by bar chart, could you show by the total number in ascending please?
SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY COUNT(*)
SELECT "DEPT_CODE", COUNT(*) FROM "STUDENT" GROUP BY "DEPT_CODE" ORDER BY COUNT(*)
0.080078
CREATE TABLE table_14465871_1 (cmdexe___commandcom VARCHAR2, unix_shell VARCHAR2)
What are all values of CMD.EXE / COMMAND.COM for the unix shell echo?
SELECT cmdexe___commandcom FROM table_14465871_1 WHERE unix_shell = "echo"
SELECT "cmdexe___commandcom" FROM "table_14465871_1" WHERE "echo" = "unix_shell"
0.078125
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE CloseReasonTypes (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 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 SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId 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 PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE FlagTypes (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 ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewTaskResultTypes (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 Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE PostTags (PostId NUMBER, TagId 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 PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description 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 SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
Mentions of ThreeTen by Ole V.V. Test.
SELECT Comments.Id, Comments.Id AS "comment_link", CreationDate FROM Comments WHERE Text LIKE '%ThreeTen%' AND UserId = 5772882 LIMIT 3
SELECT "Comments"."Id", "Comments"."Id" AS "comment_link", "CreationDate" FROM "Comments" WHERE "Text" LIKE '%ThreeTen%' AND "UserId" = 5772882 FETCH FIRST 3 ROWS ONLY
0.163086
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2) CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER) CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER) CREATE TABLE month (month_number NUMBER, month_name CLOB) CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB) CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER) CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB) CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2) CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER) CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2) CREATE TABLE code_description (code VARCHAR2, description CLOB) CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB) CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB) CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER) CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB) CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER) CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2) CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER) CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER) CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2) CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2) CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB) CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2) CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
what ground transportation is available in DENVER
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
SELECT DISTINCT "ground_service"."transport_type" FROM "city" JOIN "ground_service" ON "city"."city_code" = "ground_service"."city_code" WHERE "city"."city_name" = 'DENVER'
0.167969
CREATE TABLE table_9019 ("Verb" CLOB, "2 ( VF ) " CLOB, "2 ( F ) " CLOB, "3 ( F ) " CLOB, "2/3 ( P ) " CLOB)
Which 2 (F) has a 3 (F) of khelto?
SELECT "2 (F)" FROM table_9019 WHERE "3 (F)" = 'সে khelto'
SELECT "2 (F)" FROM "table_9019" WHERE "3 (F)" = 'সে khelto'
0.058594
CREATE TABLE table_24463470_1 (conditions VARCHAR2, circuit VARCHAR2)
What are the conditions for the athens circuit?
SELECT conditions FROM table_24463470_1 WHERE circuit = "Athens"
SELECT "conditions" FROM "table_24463470_1" WHERE "Athens" = "circuit"
0.068359
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) 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 intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime 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 vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
how many patients during this year received mechanical ventilation within the same hospital visit after a diagnosis of metabolic acidosis - lactic acidosis?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'metabolic acidosis - lactic acidosis' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mechanical ventilation' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t2 WHERE t1.diagnosistime < t2.treatmenttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid
WITH "t2" AS (SELECT "treatment"."treatmenttime", "patient"."patienthealthsystemstayid" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" WHERE "treatment"."treatmentname" = 'mechanical ventilation' AND DATETIME("treatment"."treatmenttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."treatmenttime" AND "patient"."patienthealthsystemstayid" = "t2"."patienthealthsystemstayid" WHERE "diagnosis"."diagnosisname" = 'metabolic acidosis - lactic acidosis' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
0.821289
CREATE TABLE table_27537518_9 (date VARCHAR2, record VARCHAR2)
On which date was the record of 27-28-11 set?
SELECT date FROM table_27537518_9 WHERE record = "27-28-11"
SELECT "date" FROM "table_27537518_9" WHERE "27-28-11" = "record"
0.063477
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2) CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req 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 offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER) CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2) CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2) 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 jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) 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 program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE area (course_id NUMBER, area VARCHAR2) CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2) 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) CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER) 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)
Beginning next semester ; which classes will be taught by Dr. Giorgio Bertellini ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Giorgio Bertellini%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester 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 "offering_instructor" ON "course_offering"."offering_id" = "offering_instructor"."offering_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'FA' AND "semester"."year" = 2016 JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id" AND "instructor"."name" LIKE '%Giorgio Bertellini%'
0.532227
CREATE TABLE table_261642_3 (c__nf_km_ VARCHAR2, l__mh_km_ VARCHAR2)
what is the c (nf/km) when the l (mh/km) is 0.6099?
SELECT c__nf_km_ FROM table_261642_3 WHERE l__mh_km_ = "0.6099"
SELECT "c__nf_km_" FROM "table_261642_3" WHERE "0.6099" = "l__mh_km_"
0.067383
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime 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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value 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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE d_icd_procedures (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 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 cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost 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 d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount 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 patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
what are the three most frequent medicines that were prescribed within 2 months to the female patients of age 60 or above after they have been diagnosed with ch obst asth w (ac) exac in 2100?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ch obst asth w (ac) exac') AND STRFTIME('%y', diagnoses_icd.charttime) = '2100') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id IN (SELECT patients.subject_id FROM patients WHERE patients.gender = 'f') AND admissions.age >= 60 AND STRFTIME('%y', prescriptions.startdate) = '2100') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3
WITH "_u_1" AS (SELECT "patients"."subject_id" FROM "patients" WHERE "patients"."gender" = 'f' GROUP BY "subject_id"), "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."drug", "prescriptions"."startdate" FROM "prescriptions" JOIN "admissions" ON "admissions"."age" >= 60 AND "admissions"."hadm_id" = "prescriptions"."hadm_id" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "admissions"."subject_id" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y', "prescriptions"."startdate") = '2100'), "t3" AS (SELECT "t2"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'ch obst asth w (ac) exac' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND "diagnoses_icd"."charttime" < "t2"."startdate" AND DATETIME("diagnoses_icd"."charttime") <= DATETIME("t2"."startdate") AND DATETIME("diagnoses_icd"."charttime", '+2 month') >= DATETIME("t2"."startdate") WHERE STRFTIME('%y', "diagnoses_icd"."charttime") = '2100' GROUP BY "t2"."drug") SELECT "t3"."drug" FROM "t3" "t3" WHERE "t3"."c1" <= 3
1.189453
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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name 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_labitems (row_id NUMBER, itemid NUMBER, label CLOB) 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 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_icd_procedures (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 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 chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id 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_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
in this year, how many patients were prescribed with hydrochlorothiazide within 2 months after receiving appl ext fix-tib/fibula?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'appl ext fix-tib/fibula') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'hydrochlorothiazide' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month')
WITH "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."startdate" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" WHERE "prescriptions"."drug" = 'hydrochlorothiazide' AND DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'appl ext fix-tib/fibula' JOIN "admissions" ON "admissions"."hadm_id" = "procedures_icd"."hadm_id" JOIN "t2" "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND "procedures_icd"."charttime" < "t2"."startdate" AND DATETIME("procedures_icd"."charttime") <= DATETIME("t2"."startdate") AND DATETIME("procedures_icd"."charttime", '+2 month') >= DATETIME("t2"."startdate") WHERE DATETIME("procedures_icd"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
1.000977
CREATE TABLE table_name_11 (year NUMBER, finish VARCHAR2, percentage VARCHAR2)
What is the average Year for the Finish of lost 2001 alcs and the Percentage is over 0.716?
SELECT AVG(year) FROM table_name_11 WHERE finish = "lost 2001 alcs" AND percentage > 0.716
SELECT AVG("year") FROM "table_name_11" WHERE "finish" = "lost 2001 alcs" AND "percentage" > 0.716
0.095703
CREATE TABLE table_56470 ("Driver" CLOB, "Constructor" CLOB, "Laps" FLOAT, "Time/retired" CLOB, "Grid" FLOAT)
How many grids have a Constructor of talbot-lago - talbot, a Laps under 83, and a driver of johnny claes?
SELECT COUNT("Grid") FROM table_56470 WHERE "Constructor" = 'talbot-lago - talbot' AND "Laps" < '83' AND "Driver" = 'johnny claes'
SELECT COUNT("Grid") FROM "table_56470" WHERE "Constructor" = 'talbot-lago - talbot' AND "Driver" = 'johnny claes' AND "Laps" < '83'
0.128906
CREATE TABLE table_204_338 (id NUMBER, "location" CLOB, "coordinates" CLOB, "type" CLOB, "built" CLOB, "details" CLOB)
what is the only location with a coordination of 60 16 &#8242; 31.65 &#8243; n 30 32 &#8242; 45.66 &#8243; e / 60.2754583 n 30.5460167 e ?
SELECT "location" FROM table_204_338 WHERE "coordinates" = '60°16′31.65′′n 30°32′45.66′′e\ufeff / \ufeff60.2754583°n 30.5460167°e'
SELECT "location" FROM "table_204_338" WHERE "coordinates" = '60°16′31.65′′n 30°32′45.66′′e\ufeff / \ufeff60.2754583°n 30.5460167°e'
0.128906
CREATE TABLE table_name_81 (team VARCHAR2, captain VARCHAR2)
Which team has the team captain Jon Newsome?
SELECT team FROM table_name_81 WHERE captain = "jon newsome"
SELECT "team" FROM "table_name_81" WHERE "captain" = "jon newsome"
0.064453
CREATE TABLE manager_award_vote (award_id CLOB, year NUMBER, league_id CLOB, player_id CLOB, points_won NUMBER, points_max NUMBER, votes_first NUMBER) CREATE TABLE player_award_vote (award_id CLOB, year NUMBER, league_id CLOB, player_id CLOB, points_won NUMBER, points_max NUMBER, votes_first NUMBER) CREATE TABLE home_game (year NUMBER, league_id CLOB, team_id CLOB, park_id CLOB, span_first CLOB, span_last CLOB, games NUMBER, openings NUMBER, attendance NUMBER) CREATE TABLE pitching (player_id CLOB, year NUMBER, stint NUMBER, team_id CLOB, league_id CLOB, w NUMBER, l NUMBER, g NUMBER, gs NUMBER, cg NUMBER, sho NUMBER, sv NUMBER, ipouts NUMBER, h NUMBER, er NUMBER, hr NUMBER, bb NUMBER, so NUMBER, baopp NUMBER, era NUMBER, ibb NUMBER, wp NUMBER, hbp NUMBER, bk NUMBER, bfp NUMBER, gf NUMBER, r NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER) CREATE TABLE all_star (player_id CLOB, year NUMBER, game_num NUMBER, game_id CLOB, team_id CLOB, league_id CLOB, gp NUMBER, starting_pos NUMBER) CREATE TABLE batting (player_id CLOB, year NUMBER, stint NUMBER, team_id CLOB, league_id CLOB, g NUMBER, ab NUMBER, r NUMBER, h NUMBER, double NUMBER, triple NUMBER, hr NUMBER, rbi NUMBER, sb NUMBER, cs NUMBER, bb NUMBER, so NUMBER, ibb NUMBER, hbp NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER) CREATE TABLE batting_postseason (year NUMBER, round CLOB, player_id CLOB, team_id CLOB, league_id CLOB, g NUMBER, ab NUMBER, r NUMBER, h NUMBER, double NUMBER, triple NUMBER, hr NUMBER, rbi NUMBER, sb NUMBER, cs NUMBER, bb NUMBER, so NUMBER, ibb NUMBER, hbp NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER) CREATE TABLE appearances (year NUMBER, team_id CLOB, league_id CLOB, player_id CLOB, g_all NUMBER, gs NUMBER, g_batting NUMBER, g_defense NUMBER, g_p NUMBER, g_c NUMBER, g_1b NUMBER, g_2b NUMBER, g_3b NUMBER, g_ss NUMBER, g_lf NUMBER, g_cf NUMBER, g_rf NUMBER, g_of NUMBER, g_dh NUMBER, g_ph NUMBER, g_pr NUMBER) CREATE TABLE park (park_id CLOB, park_name CLOB, park_alias CLOB, city CLOB, state CLOB, country CLOB) CREATE TABLE hall_of_fame (player_id CLOB, yearid NUMBER, votedby CLOB, ballots NUMBER, needed NUMBER, votes NUMBER, inducted CLOB, category CLOB, needed_note CLOB) CREATE TABLE salary (year NUMBER, team_id CLOB, league_id CLOB, player_id CLOB, salary NUMBER) CREATE TABLE player_award (player_id CLOB, award_id CLOB, year NUMBER, league_id CLOB, tie CLOB, notes CLOB) CREATE TABLE college (college_id CLOB, name_full CLOB, city CLOB, state CLOB, country CLOB) CREATE TABLE team (year NUMBER, league_id CLOB, team_id CLOB, franchise_id CLOB, div_id CLOB, rank NUMBER, g NUMBER, ghome NUMBER, w NUMBER, l NUMBER, div_win CLOB, wc_win CLOB, lg_win CLOB, ws_win CLOB, r NUMBER, ab NUMBER, h NUMBER, double NUMBER, triple NUMBER, hr NUMBER, bb NUMBER, so NUMBER, sb NUMBER, cs NUMBER, hbp NUMBER, sf NUMBER, ra NUMBER, er NUMBER, era NUMBER, cg NUMBER, sho NUMBER, sv NUMBER, ipouts NUMBER, ha NUMBER, hra NUMBER, bba NUMBER, soa NUMBER, e NUMBER, dp NUMBER, fp NUMBER, name CLOB, park CLOB, attendance NUMBER, bpf NUMBER, ppf NUMBER, team_id_br CLOB, team_id_lahman45 CLOB, team_id_retro CLOB) CREATE TABLE fielding_postseason (player_id CLOB, year NUMBER, team_id CLOB, league_id CLOB, round CLOB, pos CLOB, g NUMBER, gs NUMBER, inn_outs NUMBER, po NUMBER, a NUMBER, e NUMBER, dp NUMBER, tp NUMBER, pb NUMBER, sb NUMBER, cs NUMBER) CREATE TABLE manager (player_id CLOB, year NUMBER, team_id CLOB, league_id CLOB, inseason NUMBER, g NUMBER, w NUMBER, l NUMBER, rank NUMBER, plyr_mgr CLOB) CREATE TABLE team_half (year NUMBER, league_id CLOB, team_id CLOB, half NUMBER, div_id CLOB, div_win CLOB, rank NUMBER, g NUMBER, w NUMBER, l NUMBER) CREATE TABLE team_franchise (franchise_id CLOB, franchise_name CLOB, active CLOB, na_assoc CLOB) CREATE TABLE fielding_outfield (player_id CLOB, year NUMBER, stint NUMBER, glf NUMBER, gcf NUMBER, grf NUMBER) CREATE TABLE manager_half (player_id CLOB, year NUMBER, team_id CLOB, league_id CLOB, inseason NUMBER, half NUMBER, g NUMBER, w NUMBER, l NUMBER, rank NUMBER) CREATE TABLE postseason (year NUMBER, round CLOB, team_id_winner CLOB, league_id_winner CLOB, team_id_loser CLOB, league_id_loser CLOB, wins NUMBER, losses NUMBER, ties NUMBER) CREATE TABLE fielding (player_id CLOB, year NUMBER, stint NUMBER, team_id CLOB, league_id CLOB, pos CLOB, g NUMBER, gs NUMBER, inn_outs NUMBER, po NUMBER, a NUMBER, e NUMBER, dp NUMBER, pb NUMBER, wp NUMBER, sb NUMBER, cs NUMBER, zr NUMBER) CREATE TABLE manager_award (player_id CLOB, award_id CLOB, year NUMBER, league_id CLOB, tie CLOB, notes NUMBER) CREATE TABLE pitching_postseason (player_id CLOB, year NUMBER, round CLOB, team_id CLOB, league_id CLOB, w NUMBER, l NUMBER, g NUMBER, gs NUMBER, cg NUMBER, sho NUMBER, sv NUMBER, ipouts NUMBER, h NUMBER, er NUMBER, hr NUMBER, bb NUMBER, so NUMBER, baopp CLOB, era NUMBER, ibb NUMBER, wp NUMBER, hbp NUMBER, bk NUMBER, bfp NUMBER, gf NUMBER, r NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER) CREATE TABLE player (player_id CLOB, birth_year NUMBER, birth_month NUMBER, birth_day NUMBER, birth_country CLOB, birth_state CLOB, birth_city CLOB, death_year NUMBER, death_month NUMBER, death_day NUMBER, death_country CLOB, death_state CLOB, death_city CLOB, name_first CLOB, name_last CLOB, name_given CLOB, weight NUMBER, height NUMBER, bats CLOB, throws CLOB, debut CLOB, final_game CLOB, retro_id CLOB, bbref_id CLOB) CREATE TABLE player_college (player_id CLOB, college_id CLOB, year NUMBER)
Show me the trend about what is the number of wins the team Boston Red Stockings got in the postseasons each year in history?
SELECT year, COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year
SELECT "year", COUNT(*) FROM "postseason" "T1" JOIN "team" "T2" ON "T1"."team_id_winner" = "T2"."team_id_br" AND "T2"."name" = 'Boston Red Stockings' GROUP BY "T1"."year"
0.166016
CREATE TABLE table_name_80 (byes NUMBER, wins VARCHAR2, against VARCHAR2, ntfa_div_2 VARCHAR2)
Which Byes have an Against smaller than 1647, and an NTFA Div 2 of fingal valley, and Wins smaller than 14?
SELECT MAX(byes) FROM table_name_80 WHERE against < 1647 AND ntfa_div_2 = "fingal valley" AND wins < 14
SELECT MAX("byes") FROM "table_name_80" WHERE "against" < 1647 AND "fingal valley" = "ntfa_div_2" AND "wins" < 14
0.110352
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE 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)
what is the average total hospital cost that includes the epithelial cells during the previous year?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'epithelial cells')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY cost.hadm_id) AS t1
WITH "_u_0" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'epithelial cells' GROUP BY "itemid"), "_u_1" AS (SELECT "labevents"."hadm_id" FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."itemid" WHERE NOT "_u_0"."" IS NULL GROUP BY "hadm_id"), "t1" AS (SELECT SUM("cost"."cost") AS "c1" FROM "cost" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "cost"."hadm_id" WHERE DATETIME("cost"."chargetime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL GROUP BY "cost"."hadm_id") SELECT AVG("t1"."c1") FROM "t1" "t1"
0.59082
CREATE TABLE table_62836 ("Region" CLOB, "Date" CLOB, "Label" CLOB, "Format" CLOB, "Catalog" CLOB)
What's the date in the United Kingdom having a catalog of reveal50cd/lp?
SELECT "Date" FROM table_62836 WHERE "Catalog" = 'reveal50cd/lp' AND "Region" = 'united kingdom'
SELECT "Date" FROM "table_62836" WHERE "Catalog" = 'reveal50cd/lp' AND "Region" = 'united kingdom'
0.095703
CREATE TABLE table_29986 ("Pick" FLOAT, "Player" CLOB, "Position" CLOB, "Nationality" CLOB, "NHL team" CLOB, "College/junior/club team" CLOB)
For player is john jakopin mention the total number of position
SELECT COUNT("Position") FROM table_29986 WHERE "Player" = 'John Jakopin'
SELECT COUNT("Position") FROM "table_29986" WHERE "Player" = 'John Jakopin'
0.073242
CREATE TABLE table_204_196 (id NUMBER, "outcome" CLOB, "no." NUMBER, "date" NUMBER, "championship" CLOB, "surface" CLOB, "partner" CLOB, "opponents in the final" CLOB, "score in the final" CLOB)
in what year did roche win his first doubles title ?
SELECT MIN("date") FROM table_204_196 WHERE "outcome" = 'winner'
SELECT MIN("date") FROM "table_204_196" WHERE "outcome" = 'winner'
0.064453
CREATE TABLE table_name_43 (round NUMBER, overall VARCHAR2, pick__number VARCHAR2, college VARCHAR2)
Which average Round has a Pick # larger than 20, and a College of virginia, and an Overall larger than 127?
SELECT AVG(round) FROM table_name_43 WHERE pick__number > 20 AND college = "virginia" AND overall > 127
SELECT AVG("round") FROM "table_name_43" WHERE "college" = "virginia" AND "overall" > 127 AND "pick__number" > 20
0.110352
CREATE TABLE table_44287 ("Game" FLOAT, "Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Location" CLOB, "Record" CLOB)
How many games have 61-16 as the record?
SELECT COUNT("Game") FROM table_44287 WHERE "Record" = '61-16'
SELECT COUNT("Game") FROM "table_44287" WHERE "Record" = '61-16'
0.0625
CREATE TABLE swimmer (ID NUMBER, name CLOB, Nationality CLOB, meter_100 FLOAT, meter_200 CLOB, meter_300 CLOB, meter_400 CLOB, meter_500 CLOB, meter_600 CLOB, meter_700 CLOB, Time CLOB) CREATE TABLE event (ID NUMBER, Name CLOB, Stadium_ID NUMBER, Year CLOB) CREATE TABLE record (ID NUMBER, Result CLOB, Swimmer_ID NUMBER, Event_ID NUMBER) CREATE TABLE stadium (ID NUMBER, name CLOB, Capacity NUMBER, City CLOB, Country CLOB, Opening_year NUMBER)
Give me the comparison about ID over the Time by a bar chart, sort X from high to low order.
SELECT Time, ID FROM swimmer ORDER BY Time DESC
SELECT "Time", "ID" FROM "swimmer" ORDER BY "Time" DESC
0.053711
CREATE TABLE table_name_16 (average NUMBER, caps VARCHAR2, goals VARCHAR2)
What is the sum of the averages when there are 68 caps and less than 9 goals?
SELECT SUM(average) FROM table_name_16 WHERE caps = 68 AND goals < 9
SELECT SUM("average") FROM "table_name_16" WHERE "caps" = 68 AND "goals" < 9
0.074219
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 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 lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
give me the number of patients whose year of birth is less than 2089 and lab test fluid is other body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2089" AND lab.fluid = "Other Body Fluid"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Other Body Fluid" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2089" > "demographic"."dob_year"
0.198242
CREATE TABLE table_name_72 (engine VARCHAR2, series VARCHAR2)
Which engine is responsible for the USAC Championship Car?
SELECT engine FROM table_name_72 WHERE series = "usac championship car"
SELECT "engine" FROM "table_name_72" WHERE "series" = "usac championship car"
0.075195
CREATE TABLE table_17942 ("Year" FLOAT, "Starts" FLOAT, "Wins ( Majors ) " CLOB, "2nd" FLOAT, "3rd" FLOAT, "Earnings ( $ ) " FLOAT, "Money list rank" CLOB, "Scoring average" CLOB)
What is the money list rank for 1966?
SELECT "Money list rank" FROM table_17942 WHERE "Year" = '1966'
SELECT "Money list rank" FROM "table_17942" WHERE "Year" = '1966'
0.063477
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER) CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER) CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER) CREATE TABLE code_description (code VARCHAR2, description CLOB) CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2) CREATE TABLE month (month_number NUMBER, month_name CLOB) CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB) CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2) CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2) CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB) CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER) CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB) CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2) CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2) CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER) CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER) CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER) CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2) CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB) CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB) CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2) CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2) CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2) CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
EA flies from ATLANTA to DENVER what type of aircraft do you use before 1800
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.departure_time < 1800 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND equipment_sequence.aircraft_code = aircraft.aircraft_code AND flight.aircraft_code_sequence = equipment_sequence.aircraft_code_sequence AND flight.airline_code = 'EA'
SELECT DISTINCT "aircraft"."aircraft_code" FROM "aircraft" JOIN "equipment_sequence" ON "aircraft"."aircraft_code" = "equipment_sequence"."aircraft_code" JOIN "flight" ON "equipment_sequence"."aircraft_code_sequence" = "flight"."aircraft_code_sequence" AND "flight"."airline_code" = 'EA' AND "flight"."departure_time" < 1800 JOIN "airport_service" "AIRPORT_SERVICE_0" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'ATLANTA' JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'DENVER'
0.749023