table
stringlengths 33
7.14k
| question
stringlengths 4
1.06k
| output
stringlengths 2
4.44k
⌀ |
---|---|---|
CREATE TABLE table_name_7 (
laps VARCHAR,
constructor VARCHAR,
driver VARCHAR
)
|
How many laps were there when the constructor was Renault, and when the Driver was Fernando Alonso?
|
SELECT laps FROM table_name_7 WHERE constructor = "renault" AND driver = "fernando alonso"
|
CREATE TABLE table_name_94 (
haat VARCHAR,
city_of_license VARCHAR
)
|
what is the HAAT of devils lake
|
SELECT haat FROM table_name_94 WHERE city_of_license = "devils lake"
|
CREATE TABLE table_2850912_12 (
college_junior_club_team VARCHAR,
nhl_team VARCHAR
)
|
To which organziation does the winnipeg jets belong to?
|
SELECT college_junior_club_team FROM table_2850912_12 WHERE nhl_team = "Winnipeg Jets"
|
CREATE TABLE table_36868 (
"Name" text,
"Faith" text,
"Type" text,
"Intake" real,
"DCSF number" real,
"Ofsted number" real
)
|
What is the lowest Ofsted number for a primary with a CE faith, intake of 30 and a DCSF number lower than 3349?
|
SELECT MIN("Ofsted number") FROM table_36868 WHERE "Type" = 'primary' AND "Faith" = 'ce' AND "Intake" = '30' AND "DCSF number" < '3349'
|
CREATE TABLE table_name_21 (
state VARCHAR,
royal_house VARCHAR,
name VARCHAR
)
|
What state had the name of wu for the royal house of ji?
|
SELECT state FROM table_name_21 WHERE royal_house = "ji" AND name = "wu"
|
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
|
provide the number of patients whose gender is m and procedure icd9 code is 5651?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "5651"
|
CREATE TABLE table_name_37 (
runner_s__up VARCHAR,
date VARCHAR
)
|
Who is Runner(s)-up that has a Date of may 24, 1999?
|
SELECT runner_s__up FROM table_name_37 WHERE date = "may 24, 1999"
|
CREATE TABLE table_21884 (
"Season" text,
"Date" text,
"Driver" text,
"Team" text,
"Chassis" text,
"Engine" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
|
When 1:34:01 is the race time what is the miles in kilometers?
|
SELECT "Miles (km)" FROM table_21884 WHERE "Race Time" = '1:34:01'
|
CREATE TABLE table_204_54 (
id number,
"pondicherry assembly" text,
"duration" text,
"name of m.l.a." text,
"party affiliation" text,
"election year" number
)
|
what party is represented the most ?
|
SELECT "party affiliation" FROM table_204_54 GROUP BY "party affiliation" ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE table_59220 (
"Physical property" text,
"Helium" text,
"Neon" text,
"Argon" text,
"Krypton" text,
"Xenon" text
)
|
Which Krypton has a Physical property of critical pressure (atm)?
|
SELECT "Krypton" FROM table_59220 WHERE "Physical property" = 'critical pressure (atm)'
|
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime 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 intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
|
what were the four most commonly prescribed drugs for patients 20s since 2100?
|
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 BETWEEN 20 AND 29) AND STRFTIME('%y', medication.drugstarttime) >= '2100' GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 4
|
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
|
For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the sum of manager_id , and group by attribute job_id, order Y-axis in desc order please.
|
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) DESC
|
CREATE TABLE table_15030 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
|
What is the latest year with more than 0 points?
|
SELECT MAX("Year") FROM table_15030 WHERE "Points" > '0'
|
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
|
tell me the procedure that patient 027-8953 last had during the last year?
|
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-8953')) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY treatment.treatmenttime DESC LIMIT 1
|
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
|
In Spring and Summer term how many 200 -level classes are being offered ?
|
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.semester AND semester.year = 2016
|
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
|
what is maximum age of patients whose admission type is urgent and insurance is medicare?
|
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Medicare"
|
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 text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
|
what were the top three most frequently performed procedures that the patient received within the same hospital visit after diagnosis of fx dorsal vertebra-close until 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, diagnoses_icd.charttime, admissions.hadm_id 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 = 'fx dorsal vertebra-close') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2102') AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.icd9_code, procedures_icd.charttime, admissions.hadm_id 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 t1.hadm_id = t2.hadm_id GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 3)
|
CREATE TABLE table_name_41 (
condition VARCHAR,
partial_thromboplastin_time VARCHAR,
bleeding_time VARCHAR
)
|
I want the condition that has a partial thromboplastin time of prolonged and unaffected bleeding time
|
SELECT condition FROM table_name_41 WHERE partial_thromboplastin_time = "prolonged" AND bleeding_time = "unaffected"
|
CREATE TABLE table_3988 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
|
What number episode in the series was titled 'Best Laid Plans'?
|
SELECT MAX("No. in series") FROM table_3988 WHERE "Title" = 'Best Laid Plans'
|
CREATE TABLE table_72550 (
"PowerShell (Cmdlet)" text,
"PowerShell (Alias)" text,
"CMD.EXE / COMMAND.COM" text,
"Unix shell" text,
"Description" text
)
|
How many values of powershell (cmdlet) are valid when unix shell is env, export, set, setenv?
|
SELECT COUNT("PowerShell (Cmdlet)") FROM table_72550 WHERE "Unix shell" = 'env, export, set, setenv'
|
CREATE TABLE organizations (
organization_id number,
parent_organization_id number,
organization_details text
)
CREATE TABLE timed_locations_of_things (
thing_id number,
date_and_time time,
location_code text
)
CREATE TABLE customer_events (
customer_event_id number,
customer_id number,
date_moved_in time,
property_id number,
resident_id number,
thing_id number
)
CREATE TABLE customers (
customer_id number,
customer_details text
)
CREATE TABLE timed_status_of_things (
thing_id number,
date_and_date time,
status_of_thing_code text
)
CREATE TABLE properties (
property_id number,
property_type_code text,
property_address text,
other_details text
)
CREATE TABLE customer_event_notes (
customer_event_note_id number,
customer_event_id number,
service_type_code text,
resident_id number,
property_id number,
date_moved_in time
)
CREATE TABLE things (
thing_id number,
organization_id number,
type_of_thing_code text,
service_type_code text,
service_details text
)
CREATE TABLE residents_services (
resident_id number,
service_id number,
date_moved_in time,
property_id number,
date_requested time,
date_provided time,
other_details text
)
CREATE TABLE services (
service_id number,
organization_id number,
service_type_code text,
service_details text
)
CREATE TABLE residents (
resident_id number,
property_id number,
date_moved_in time,
date_moved_out time,
other_details text
)
|
What are the resident details containing the substring 'Miss'?
|
SELECT other_details FROM residents WHERE other_details LIKE '%Miss%'
|
CREATE TABLE table_name_38 (
date VARCHAR,
fastest_lap VARCHAR
)
|
On what date did Gunnar Nilsson make the fastest lap?
|
SELECT date FROM table_name_38 WHERE fastest_lap = "gunnar nilsson"
|
CREATE TABLE table_72461 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
|
Who was the high rebounder against charlotte?
|
SELECT "High rebounds" FROM table_72461 WHERE "Team" = 'Charlotte'
|
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
|
Visualize a bar chart about the distribution of All_Home and School_ID , and group by attribute ACC_Road, and rank in desc by the x axis.
|
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC
|
CREATE TABLE table_65307 (
"World record" text,
"Snatch" text,
"Chen Yanqing ( CHN )" text,
"111kg" text,
"Doha , Qatar" text
)
|
What is the Doha, Qatar when the snatch is clean & jerk?
|
SELECT "Doha , Qatar" FROM table_65307 WHERE "Snatch" = 'clean & jerk'
|
CREATE TABLE table_14720 (
"Game" real,
"Date" text,
"Location" text,
"Time" text,
"Attendance" real
)
|
If time is 2:13 and attendance is less than 56,335, what is the largest game number?
|
SELECT MAX("Game") FROM table_14720 WHERE "Attendance" < '56,335' AND "Time" = '2:13'
|
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
|
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of employee_id bin hire_date by weekday in a bar chart, list by the total number in descending.
|
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(EMPLOYEE_ID) DESC
|
CREATE TABLE table_name_96 (
name VARCHAR,
launched_by VARCHAR,
propulsion VARCHAR,
year VARCHAR
)
|
What is the name of the anti-ship missile that had a turbojet propulsion that was launched by a surface, sub after 1985?
|
SELECT name FROM table_name_96 WHERE propulsion = "turbojet" AND year > 1985 AND launched_by = "surface, sub"
|
CREATE TABLE table_47581 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Primary Language(s)" text,
"Director" text,
"Result" text
)
|
What is Director, when Original Title is 'Sah '?
|
SELECT "Director" FROM table_47581 WHERE "Original title" = 'sahə'
|
CREATE TABLE table_66035 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
|
What is the game score when the tie no is 7?
|
SELECT "Score" FROM table_66035 WHERE "Tie no" = '7'
|
CREATE TABLE table_23512864_4 (
winning_party_coalition VARCHAR,
election_year VARCHAR
)
|
Who is the winning party/coalition name in election year 1980?
|
SELECT winning_party_coalition FROM table_23512864_4 WHERE election_year = 1980
|
CREATE TABLE table_name_68 (
player VARCHAR,
round VARCHAR,
position VARCHAR
)
|
After Round 5, which player was drafted for Defensive Tackle?
|
SELECT player FROM table_name_68 WHERE round > 5 AND position = "defensive tackle"
|
CREATE TABLE table_name_87 (
round INTEGER,
player VARCHAR
)
|
What is the largest round number for Dan Connor, the player?
|
SELECT MAX(round) FROM table_name_87 WHERE player = "dan connor"
|
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
|
Return the room and number of reservations made for each of the rooms to draw a bar chart, display X-axis in desc order.
|
SELECT Room, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY Room DESC
|
CREATE TABLE table_2436 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
)
|
Where was the tourney when UCLA won the regular season?
|
SELECT "Tournament Venue (City)" FROM table_2436 WHERE "Regular Season Winner" = 'UCLA'
|
CREATE TABLE table_name_25 (
record VARCHAR,
date VARCHAR
)
|
What was the record on june 29?
|
SELECT record FROM table_name_25 WHERE date = "june 29"
|
CREATE TABLE table_65469 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
|
What is the total heat number of sun yang, who has a lane less than 2?
|
SELECT COUNT("Heat") FROM table_65469 WHERE "Name" = 'sun yang' AND "Lane" < '2'
|
CREATE TABLE table_22915134_2 (
ignition_timing VARCHAR,
graphical VARCHAR
)
|
When 1-1-0-0-1-1-0-0- is the graphical how many ignition timings are there?
|
SELECT COUNT(ignition_timing) FROM table_22915134_2 WHERE graphical = "1-1-0-0-1-1-0-0-"
|
CREATE TABLE Finances (
Finance_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Channels (
Channel_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Assets_in_Events (
Asset_ID INTEGER,
Event_ID INTEGER
)
CREATE TABLE Parties_in_Events (
Party_ID INTEGER,
Event_ID INTEGER,
Role_Code CHAR(15)
)
CREATE TABLE Agreements (
Document_ID INTEGER,
Event_ID INTEGER
)
CREATE TABLE Parties (
Party_ID INTEGER,
Party_Details VARCHAR(255)
)
CREATE TABLE Products_in_Events (
Product_in_Event_ID INTEGER,
Event_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Locations (
Location_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Products (
Product_ID INTEGER,
Product_Type_Code CHAR(15),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4)
)
CREATE TABLE Addresses (
Address_ID INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Address_ID INTEGER,
Channel_ID INTEGER,
Event_Type_Code CHAR(15),
Finance_ID INTEGER,
Location_ID INTEGER
)
CREATE TABLE Assets (
Asset_ID INTEGER,
Other_Details VARCHAR(255)
)
|
Show the names of products and the number of events they are in by a bar chart, display from high to low by the x axis.
|
SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY Product_Name DESC
|
CREATE TABLE table_23821 (
"Barangay" text,
"District" text,
"Population (May 1, 2000)" real,
"Population (August 1, 2007)" real,
"Population (May 1, 2010)" text
)
|
Name th epopulation may for general terrero
|
SELECT "Population (May 1, 2000)" FROM table_23821 WHERE "Barangay" = 'General Terrero'
|
CREATE TABLE table_name_2 (
opponent VARCHAR,
game VARCHAR,
december VARCHAR
)
|
Who was the opponent on December 1, before Game 28?
|
SELECT opponent FROM table_name_2 WHERE game < 28 AND december = 1
|
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
|
Draw a pie chart for what is the average age for a male in each job?
|
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job
|
CREATE TABLE table_26708105_5 (
aa_length VARCHAR,
protein_name VARCHAR
)
|
What is the aa length when the protein name is c11orf73?
|
SELECT aa_length FROM table_26708105_5 WHERE protein_name = "C11orf73"
|
CREATE TABLE table_name_82 (
finish VARCHAR,
manager VARCHAR,
record VARCHAR
)
|
what is the finish when the manager is tom kotchman and record is 43-33?
|
SELECT finish FROM table_name_82 WHERE manager = "tom kotchman" AND record = "43-33"
|
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
|
Find the average age of male students (with sex M) from each city, show X-axis in ascending order.
|
SELECT city_code, AVG(Age) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY city_code
|
CREATE TABLE table_20088 (
"Locale" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." text
)
|
What was the top ends lost where the ends won 47?
|
SELECT MAX("Ends Lost") FROM table_20088 WHERE "Ends Won" = '47'
|
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number,
secretary_vote number,
treasurer_vote number,
class_president_vote number,
class_senator_vote number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
|
What are the distinct last names of the students who have president votes and have 8741 as the advisor?
|
SELECT DISTINCT T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = president_vote INTERSECT SELECT DISTINCT lname FROM student WHERE advisor = "8741"
|
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
|
What is the number of start date of each apartment booking for each year? Return a bar chart, could you display total number in asc order?
|
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id ORDER BY COUNT(booking_start_date)
|
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
|
Whose posts do I comment on?.
|
SELECT UserId AS "user_link", CommentCount, up.postCount, ROUND(CAST(CommentCount AS FLOAT) / up.postCount, 2) AS ratio FROM (SELECT COUNT(c.Id) AS commentCount, p.OwnerUserId AS userid FROM (SELECT Id, PostId FROM Comments WHERE UserId = '##userid##') AS c JOIN Posts AS p ON c.PostId = p.Id GROUP BY p.OwnerUserId) AS c JOIN (SELECT OwnerUserId, COUNT(Id) AS postCount FROM Posts GROUP BY OwnerUserId) AS up ON up.OwnerUserId = c.UserId WHERE CommentCount >= '##minCommentCount##' ORDER BY c.CommentCount DESC
|
CREATE TABLE table_15887683_10 (
content VARCHAR,
television_service VARCHAR,
dar VARCHAR,
package_option VARCHAR,
language VARCHAR
)
|
Name the content for sky famiglia for italian and dar 16:9 for mtv hits
|
SELECT content FROM table_15887683_10 WHERE package_option = "Sky Famiglia" AND language = "Italian" AND dar = "16:9" AND television_service = "MTV Hits"
|
CREATE TABLE table_name_24 (
laps INTEGER,
driver VARCHAR
)
|
What is the high lap total for pedro diniz?
|
SELECT MAX(laps) FROM table_name_24 WHERE driver = "pedro diniz"
|
CREATE TABLE table_14323347_1 (
points VARCHAR
)
|
Name the total number of 1992-93 for 115 points
|
SELECT COUNT(1992 AS _93) FROM table_14323347_1 WHERE points = 115
|
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
|
Show the county name and population of all counties Show bar chart, list Y-axis from high to low order.
|
SELECT County_name, Population FROM county ORDER BY Population DESC
|
CREATE TABLE table_name_16 (
away_team VARCHAR,
venue VARCHAR
)
|
Who was the away team at the game held at Arden Street Oval?
|
SELECT away_team FROM table_name_16 WHERE venue = "arden street oval"
|
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
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 text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
|
Number of badges awarded by badge name.
|
SELECT Name, COUNT(*) AS "number of badges" FROM Badges GROUP BY Name
|
CREATE TABLE table_16186152_1 (
percentage VARCHAR,
state_delegate VARCHAR
)
|
What's the percentage when the state delegate is 1662?
|
SELECT percentage FROM table_16186152_1 WHERE state_delegate = 1662
|
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
|
give the number of patients who are aged below 45 years whose admission location is phys referral/normal deli.
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.age < "45"
|
CREATE TABLE table_17827271_1 (
roleplay VARCHAR,
actor_required VARCHAR
)
|
How many RolePlay actors played the role requiring a 'male, younger' actor?
|
SELECT COUNT(roleplay) FROM table_17827271_1 WHERE actor_required = "Male, younger"
|
CREATE TABLE table_25358 (
"Order" real,
"Episode" text,
"Airdate" text,
"Rating" text,
"Share" real,
"Rating/Share (18\u201349)" text,
"Viewers (millions)" text,
"Rank (night)" real
)
|
Name the most share for 2.76 million viewers
|
SELECT MAX("Share") FROM table_25358 WHERE "Viewers (millions)" = '2.76'
|
CREATE TABLE table_1639689_2 (
kickoff VARCHAR,
date VARCHAR
)
|
What was the kickoff time on monday, may 13?
|
SELECT kickoff FROM table_1639689_2 WHERE date = "Monday, May 13"
|
CREATE TABLE table_67666 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
)
|
What team has the most wins with at least 18 goals and less than 5 losses?
|
SELECT MAX("Wins") FROM table_67666 WHERE "Goals For" = '18' AND "Losses" < '5'
|
CREATE TABLE table_30200 (
"No." real,
"Title" text,
"Lyricist" text,
"Composer" text,
"Arrangement" text,
"Sound Engineer" text,
"Length" text
)
|
What is the arrangement for bets3ab 3alia nafsy?
|
SELECT "Arrangement" FROM table_30200 WHERE "Title" = 'Bets3ab 3alia Nafsy'
|
CREATE TABLE table_203_790 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
)
|
what is the total number of wins ?
|
SELECT COUNT(*) FROM table_203_790 WHERE "result" = 'w'
|
CREATE TABLE table_24116 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Black Knights points" real,
"Opponents" real,
"Record" text
)
|
How many games have Air Force as the opponent?
|
SELECT MAX("Game") FROM table_24116 WHERE "Opponent" = 'Air Force'
|
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
|
how many patients whose marital status is married and procedure long title is closure of skin and subcutaneous tissue of other sites?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Closure of skin and subcutaneous tissue of other sites"
|
CREATE TABLE table_204_713 (
id number,
"rank" number,
"bib" number,
"athlete" text,
"country" text,
"time" text,
"deficit" text
)
|
the first time on the list is ?
|
SELECT "time" FROM table_204_713 WHERE id = 1
|
CREATE TABLE table_24192190_1 (
magnitude VARCHAR,
latitude VARCHAR
)
|
When 43.048 n is the latitude what is the magnitude?
|
SELECT magnitude FROM table_24192190_1 WHERE latitude = "43.048° N"
|
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_miles int,
pressurized varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
|
i'd like to leave ATLANTA in the afternoon and arrive in PHILADELPHIA at 1700
|
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, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.arrival_time = 1700 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 flight.departure_time BETWEEN 1200 AND 1800
|
CREATE TABLE tracklists (
albumid number,
position number,
songid number
)
CREATE TABLE instruments (
songid number,
bandmateid number,
instrument text
)
CREATE TABLE songs (
songid number,
title text
)
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
|
What is the first and last name of the artist who performed back stage for the song 'Der Kapitan'?
|
SELECT T2.firstname, T2.lastname FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.title = "Der Kapitan" AND T1.stageposition = "back"
|
CREATE TABLE table_name_74 (
points_won VARCHAR,
year VARCHAR,
total_matches VARCHAR
)
|
In 2007, how many points were won when more than 5 matches were played?
|
SELECT COUNT(points_won) FROM table_name_74 WHERE year = "2007" AND total_matches > 5
|
CREATE TABLE table_name_24 (
split__50m_ INTEGER,
name VARCHAR,
lane VARCHAR
)
|
What is the total sum of 50m splits for josefin lillhage in lanes above 8?
|
SELECT SUM(split__50m_) FROM table_name_24 WHERE name = "josefin lillhage" AND lane > 8
|
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
|
is on 12/16/this year patient 739's arterial bp [systolic] normal?
|
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') AND chartevents.valuenum BETWEEN systolic_bp_lower AND systolic_bp_upper AND DATETIME(chartevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', chartevents.charttime) = '12-16'
|
CREATE TABLE table_201_15 (
id number,
"year" number,
"single" text,
"chart positions\nspa" number,
"album" text
)
|
based on sales figures , what auryn album is the most popular ?
|
SELECT "album" FROM table_201_15 ORDER BY "chart positions\nspa" LIMIT 1
|
CREATE TABLE table_11404452_1 (
director VARCHAR,
us_viewers__millions_ VARCHAR
)
|
Who was the director when there were 13.66 million u.s viewers?
|
SELECT director FROM table_11404452_1 WHERE us_viewers__millions_ = "13.66"
|
CREATE TABLE table_28138035_4 (
womens_doubles VARCHAR,
mens_singles VARCHAR
)
|
Name the womens doubles for werner schlager
|
SELECT womens_doubles FROM table_28138035_4 WHERE mens_singles = "Werner Schlager"
|
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
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 text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
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 text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
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 text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
|
Reputation per answers, for users with at least x posts and y reputation.
|
SELECT Rank = ROW_NUMBER() OVER (ORDER BY ROUND((CAST('Total Score' AS FLOAT) / CAST('Total Answers' AS FLOAT)), 2) DESC), ROUND((CAST('Total Score' AS FLOAT) / CAST('Total Answers' AS FLOAT)), 2) AS "Score Per Answer", u.Id AS "user_link", u.Reputation, 'Total Answers', ROUND((CAST(u.Reputation AS FLOAT) / CAST('Total Answers' AS FLOAT)), 2) AS "Rep Per Answer" FROM Users AS u INNER JOIN (SELECT p.OwnerUserId, COUNT(p.OwnerUserId) AS "Total Answers", SUM(p.Score) AS "Total Score" FROM Posts AS p WHERE p.PostTypeId = 2 GROUP BY p.OwnerUserId HAVING COUNT(p.OwnerUserId) >= '##MinimumPosts##') AS q ON q.OwnerUserId = u.Id WHERE u.Reputation >= '##MinimumRep##' ORDER BY 'Score Per Answer' DESC
|
CREATE TABLE table_4881 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
|
What is the away team's score at brunswick street oval?
|
SELECT "Away team score" FROM table_4881 WHERE "Venue" = 'brunswick street oval'
|
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
|
count the number of patients whose death status is 1 and diagnoses icd9 code is 2864.
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "2864"
|
CREATE TABLE table_name_66 (
constructor VARCHAR,
time_retired VARCHAR
)
|
Who built the car that has a Time/Retired of 1:36:38.887?
|
SELECT constructor FROM table_name_66 WHERE time_retired = "1:36:38.887"
|
CREATE TABLE table_name_95 (
event VARCHAR,
class VARCHAR
)
|
What is the event when the class is time trial hc a?
|
SELECT event FROM table_name_95 WHERE class = "time trial hc a"
|
CREATE TABLE table_6604 (
"Player" text,
"Rating" real,
"Cmp." real,
"Att." real,
"Cmp. %" real,
"Yards" real,
"Int." real,
"Long" real
)
|
Which Cmp % has an Int smaller than 2 and a Cmpnsmaller than 1?
|
SELECT MIN("Cmp. %") FROM table_6604 WHERE "Int." < '2' AND "Cmp." < '1'
|
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
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 text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
|
when did patient 13528 receive his or her prescription for the last time since 12/2104?
|
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13528) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-12' ORDER BY prescriptions.startdate DESC LIMIT 1
|
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
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 text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
|
count the current patients whose age is 20s.
|
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 20 AND 29
|
CREATE TABLE table_name_30 (
competition VARCHAR,
year VARCHAR
)
|
Which Competition has a Year of 1993?
|
SELECT competition FROM table_name_30 WHERE year = 1993
|
CREATE TABLE table_64868 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
|
Which platforms can you play Portal 2 on?
|
SELECT "Platform(s)" FROM table_64868 WHERE "Game" = 'portal 2'
|
CREATE TABLE table_203_171 (
id number,
"place\n(posicion)" number,
"team\n(equipo)" text,
"played\n(pj)" number,
"won\n(pg)" number,
"draw\n(pe)" number,
"lost\n(pp)" number,
"goals scored\n(gf)" number,
"goals conceded\n(gc)" number,
"+/-\n(dif.)" number,
"points\n(pts.)" number
)
|
list each team with the most draws .
|
SELECT "team\n(equipo)" FROM table_203_171 WHERE "draw\n(pe)" = (SELECT MAX("draw\n(pe)") FROM table_203_171)
|
CREATE TABLE table_18123274_1 (
year__ceremony_ VARCHAR,
result VARCHAR,
director VARCHAR
)
|
Name the year for not nominated for alberto aruelo
|
SELECT year__ceremony_ FROM table_18123274_1 WHERE result = "Not Nominated" AND director = "Alberto Aruelo"
|
CREATE TABLE table_name_86 (
result VARCHAR,
opponent VARCHAR
)
|
What is the result against Clemson?
|
SELECT result FROM table_name_86 WHERE opponent = "clemson"
|
CREATE TABLE table_26224 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
|
Name the total number of open cup for 1996
|
SELECT COUNT("Open Cup") FROM table_26224 WHERE "Year" = '1996'
|
CREATE TABLE table_name_75 (
constructor VARCHAR,
date VARCHAR
)
|
Name the constructor for 10 august
|
SELECT constructor FROM table_name_75 WHERE date = "10 august"
|
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
|
Number of users created / day.
|
SELECT DATE(CreationDate), COUNT(*) AS Actual, MAX(Id) - MIN(Id) AS Expected, MIN(Id), MAX(Id) FROM Users GROUP BY DATE(CreationDate) ORDER BY 1 DESC
|
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
|
what procedure did patient 017-74343 the previous year receive for the first time?
|
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-74343')) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY treatment.treatmenttime LIMIT 1
|
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
|
How many document type for different document type description? Visualize with a bar chart, order in asc by the Y-axis.
|
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types GROUP BY Document_Type_Description ORDER BY COUNT(Document_Type_Description)
|
CREATE TABLE table_62198 (
"Player" text,
"Height" real,
"Position" text,
"Year born (Age)" text,
"Current Club" text
)
|
What is the current club with a position of sg/sf and a height less than 1.96?
|
SELECT "Current Club" FROM table_62198 WHERE "Position" = 'sg/sf' AND "Height" < '1.96'
|
CREATE TABLE table_13622 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"# / County" text
)
|
What is the IHSAA class for the school where the mascot is the Rebels?
|
SELECT "IHSAA Class" FROM table_13622 WHERE "Mascot" = 'rebels'
|
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
|
count the number of patients whose ethnicity is black/cape verdean and drug code is hydr20/100ns?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.formulary_drug_cd = "HYDR20/100NS"
|
CREATE TABLE news_report (
journalist_id number,
event_id number,
work_type text
)
CREATE TABLE event (
event_id number,
date text,
venue text,
name text,
event_attendance number
)
CREATE TABLE journalist (
journalist_id number,
name text,
nationality text,
age text,
years_working number
)
|
Show the names of journalists that have reported more than one event.
|
SELECT T3.name FROM news_report AS T1 JOIN event AS T2 ON T1.event_id = T2.event_id JOIN journalist AS T3 ON T1.journalist_id = T3.journalist_id GROUP BY T3.name HAVING COUNT(*) > 1
|
CREATE TABLE table_27409644_1 (
location VARCHAR,
ground VARCHAR
)
|
Where is lootospark from?
|
SELECT location FROM table_27409644_1 WHERE ground = "Lootospark"
|
CREATE TABLE Problem_Log (
problem_log_id INTEGER,
assigned_to_staff_id INTEGER,
problem_id INTEGER,
problem_category_code VARCHAR(20),
problem_status_code VARCHAR(20),
log_entry_date DATETIME,
log_entry_description VARCHAR(255),
log_entry_fix VARCHAR(255),
other_log_details VARCHAR(255)
)
CREATE TABLE Product (
product_id INTEGER,
product_name VARCHAR(80),
product_details VARCHAR(255)
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_first_name VARCHAR(80),
staff_last_name VARCHAR(80),
other_staff_details VARCHAR(255)
)
CREATE TABLE Problem_Status_Codes (
problem_status_code VARCHAR(20),
problem_status_description VARCHAR(80)
)
CREATE TABLE Problem_Category_Codes (
problem_category_code VARCHAR(20),
problem_category_description VARCHAR(80)
)
CREATE TABLE Problems (
problem_id INTEGER,
product_id INTEGER,
closure_authorised_by_staff_id INTEGER,
reported_by_staff_id INTEGER,
date_problem_reported DATETIME,
date_problem_closed DATETIME,
problem_description VARCHAR(255),
other_problem_details VARCHAR(255)
)
|
Draw a bar chart for what is the number of entry descriptions of each problem?, and show in descending by the X-axis.
|
SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description ORDER BY log_entry_description DESC
|
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
|
Top 50 users from Surat.
|
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%rajkot%' OR UPPER(Location) LIKE '%RAJKOT' ORDER BY Reputation DESC LIMIT 50
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.