schema
stringlengths
20
14.6k
query
stringlengths
17
2.58k
question
stringlengths
8
1.06k
<table0>[table_11960407_5] { <col0>[date]:[VARCHAR] <col1>[game]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 50
What is the date of Game 50?
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table2>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table3>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] } <table4>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] }
SELECT AVG( `<table3>`.age ) FROM `<table3>` WHERE `<table3>`.gender = "F" AND `<table3>`.discharge_location = "SHORT TERM HOSPITAL"
calculate the average age of female patients who had short term hospital discharge.
<table0>[table_20193855_2] { <col0>[book_title]:[VARCHAR] <col1>[publisher]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Black Car Publishing"
What is the title of the book when the publisher is black car publishing?
<table0>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table2>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table3>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table4>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table5>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table6>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table7>[PostsWithDeleted] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table8>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>[text]:[EmailHash] <col12>[text]:[AccountId] } <table9>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table10>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table11>[PostTags] { <col0>[PostId]:[number] <col1>[TagId]:[number] } <table12>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <table13>[PostHistoryTypes] { <col0>[number]:[text] } <table14>[PostFeedback] { <col0>[number]:[PostId] <col1>[number]:[IsAnonymous] <col2>[boolean]:[VoteTypeId] <col3>[number]:[CreationDate] } <table15>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table16>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table17>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table18>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table19>[FlagTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table20>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table21>[Posts] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table22>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table23>[VoteTypes] { <col0>[number]:[text] } <table24>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table25>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table26>[PostTypes] { <col0>[number]:[text] } <table27>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModeratorId] <col8>[number]:[ApprovalDate] <col9>[time]:[ApprovalModeratorId] <col10>[number]:[DeactivationDate] <col11>[time]:[DeactivationModeratorId] } <table28>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] }
SELECT SUM( c.Score ) FROM `<table9>` AS c WHERE c.UserId = '##UserId##'
Total comment score for a user.
<table0>[landfills] { <col0>[name]:[TEXT] <col1>[country]:[TEXT] <col2>[capacity]:[INTEGER] }
SELECT SUM( `<col2>` ) FROM `<table0>` WHERE `<col1>` = 'Japan';
What is the total capacity of all landfills in Japan?
<table0>[awards_players] { <col0>[playerID]:[text] <col1>[award]:[text] <col2>[year]:[integer] <col3>[lgID]:[text] <col4>[note]:[text] <col5>[pos]:[text] } <table1>[coaches] { <col0>[coachID]:[text] <col1>[year]:[integer] <col2>[tmID]:[text] <col3>[lgID]:[text] <col4>[stint]:[integer] <col5>[won]:[integer] <col6>[lost]:[integer] <col7>[post_wins]:[integer] <col8>[post_losses]:[integer] } <table2>[draft] { <col0>[integer]:[draftYear] <col1>[integer]:[draftRound] <col2>[integer]:[draftSelection] <col3>[integer]:[draftOverall] <col4>[integer]:[tmID] <col5>[text]:[firstName] <col6>[text]:[lastName] <col7>[text]:[suffixName] <col8>[text]:[playerID] <col9>[text]:[draftFrom] <col10>[text]:[lgID] } <table3>[player_allstar] { <col0>[playerID]:[text] <col1>[last_name]:[text] <col2>[first_name]:[text] <col3>[season_id]:[integer] <col4>[conference]:[text] <col5>[league_id]:[text] <col6>[games_played]:[integer] <col7>[minutes]:[integer] <col8>[points]:[integer] <col9>[o_rebounds]:[integer] <col10>[d_rebounds]:[integer] <col11>[rebounds]:[integer] <col12>[assists]:[integer] <col13>[steals]:[integer] <col14>[blocks]:[integer] <col15>[turnovers]:[integer] <col16>[personal_fouls]:[integer] <col17>[fg_attempted]:[integer] <col18>[fg_made]:[integer] <col19>[ft_attempted]:[integer] <col20>[ft_made]:[integer] <col21>[three_attempted]:[integer] <col22>[three_made]:[integer] } <table4>[players] { <col0>[playerID]:[text] <col1>[useFirst]:[text] <col2>[firstName]:[text] <col3>[middleName]:[text] <col4>[lastName]:[text] <col5>[nameGiven]:[text] <col6>[fullGivenName]:[text] <col7>[nameSuffix]:[text] <col8>[nameNick]:[text] <col9>[pos]:[text] <col10>[firstseason]:[integer] <col11>[lastseason]:[integer] <col12>[height]:[real] <col13>[weight]:[integer] <col14>[college]:[text] <col15>[collegeOther]:[text] <col16>[birthDate]:[date] <col17>[birthCity]:[text] <col18>[birthState]:[text] <col19>[birthCountry]:[text] <col20>[highSchool]:[text] <col21>[hsCity]:[text] <col22>[hsState]:[text] <col23>[hsCountry]:[text] <col24>[deathDate]:[date] <col25>[race]:[text] } <table5>[teams] { <col0>[year]:[integer] <col1>[lgID]:[text] <col2>[tmID]:[text] <col3>[franchID]:[text] <col4>[confID]:[text] <col5>[divID]:[text] <col6>[rank]:[integer] <col7>[confRank]:[integer] <col8>[playoff]:[text] <col9>[name]:[text] <col10>[o_fgm]:[integer] <col11>[o_ftm]:[integer] <col12>[o_pts]:[integer] <col13>[d_pts]:[integer] <col14>[homeWon]:[integer] <col15>[homeLost]:[integer] <col16>[awayWon]:[integer] <col17>[awayLost]:[integer] <col18>[won]:[integer] <col19>[lost]:[integer] <col20>[games]:[integer] <col21>[arena]:[text] } <table6>[awards_coaches] { <col0>[integer]:[year] <col1>[integer]:[coachID] <col2>[text]:[award] <col3>[text]:[lgID] <col4>[text]:[note] } <table7>[players_teams] { <col0>[integer]:[playerID] <col1>[text]:[year] <col2>[integer]:[stint] <col3>[integer]:[tmID] <col4>[text]:[lgID] <col5>[text]:[integer] <col6>[integer]:[minutes] <col7>[integer]:[points] <col8>[integer]:[oRebounds] <col9>[integer]:[dRebounds] <col10>[integer]:[rebounds] <col11>[integer]:[assists] <col12>[integer]:[steals] <col13>[integer]:[blocks] <col14>[integer]:[turnovers] <col15>[integer]:[integer] <col16>[fgAttempted]:[integer] <col17>[fgMade]:[integer] <col18>[ftAttempted]:[integer] <col19>[ftMade]:[integer] <col20>[threeAttempted]:[integer] <col21>[threeMade]:[integer] <col22>[PostGP]:[integer] <col23>[PostGS]:[integer] <col24>[PostMinutes]:[integer] <col25>[PostPoints]:[integer] <col26>[PostoRebounds]:[integer] <col27>[PostdRebounds]:[integer] <col28>[PostRebounds]:[integer] <col29>[PostAssists]:[integer] <col30>[PostSteals]:[integer] <col31>[PostBlocks]:[integer] <col32>[PostTurnovers]:[integer] <col33>[PostPF]:[integer] <col34>[PostfgAttempted]:[integer] <col35>[PostfgMade]:[integer] <col36>[PostftAttempted]:[integer] <col37>[PostftMade]:[integer] <col38>[PostthreeAttempted]:[integer] <col39>[PostthreeMade]:[integer] <col40>[note]:[text] } <table8>[series_post] { <col0>[integer]:[year] <col1>[integer]:[round] <col2>[text]:[series] <col3>[text]:[tmIDWinner] <col4>[text]:[lgIDWinner] <col5>[text]:[tmIDLoser] <col6>[text]:[lgIDLoser] <col7>[text]:[integer] }
SELECT CAST( SUM( IIF( T2.steals IS NOT NULL AND T1.tmID = 'LAL', 1, 0 ) ) AS REAL ) * 100 / COUNT( T1.tmID ) FROM `<table5>` AS T1 INNER JOIN players_`<table5>` AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year
How many percent of points were scored by NBA players who belonged to 'LAL' team and had performed steals movement.
<table0>[chemical_production] { <col0>[region]:[VARCHAR] <col1>[chemical]:[VARCHAR] <col2>[quantity]:[INT] } <table1>[environmental_impact] { <col0>[chemical]:[VARCHAR] <col1>[impact_score]:[INT] }
SELECT cp.chemical, cp.quantity FROM `<table0>` cp JOIN environmental_impact ei ON cp.chemical = ei.chemical WHERE cp.region = 'South America' AND ei.impact_score > 65;
Find the names and quantities of chemical substances that are both produced in the South America region and have an impact score greater than 65.
<table0>[Ingredients] { <col0>[IngredientID]:[INT] <col1>[TEXT]:[IsVegan] <col2>[BOOLEAN]:[SupplierID] } <table1>[Suppliers] { <col0>[SupplierID]:[INT] }
SELECT DISTINCT `<table1>`.Name FROM `<table1>` INNER JOIN Ingredients ON `<table1>`.SupplierID = Ingredients.SupplierID WHERE IsVegan = TRUE;
List all suppliers providing ingredients for a vegan-only menu.
<table0>[table_66745] { <col0>[Supplier]:[text] <col1>[Basic]:[shape] <col2>[text]:[Keys] <col3>[modes]:[text] <col4>[Wrist]:[pad] <col5>[text]:[Thumb] <col6>[stick]:[text] <col7>[Backlit]:[text] }
SELECT "Keys ( x `<col3>` )" FROM `<table0>` WHERE "Supplier" = 'wolfking'
Which keys (x modes) have a Supplier of wolfking?
<table0>[ENROLL] { <col0>[CLASS_CODE]:[varchar] <col1>[STU_NUM]:[int] <col2>[ENROLL_GRADE]:[varchar] } <table1>[PROFESSOR] { <col0>[EMP_NUM]:[int] <col1>[DEPT_CODE]:[varchar] <col2>[PROF_OFFICE]:[varchar] <col3>[PROF_EXTENSION]:[varchar] <col4>[PROF_HIGH_DEGREE]:[varchar] } <table2>[STUDENT] { <col0>[STU_NUM]:[int] <col1>[STU_LNAME]:[varchar] <col2>[STU_FNAME]:[varchar] <col3>[STU_INIT]:[varchar] <col4>[STU_DOB]:[datetime] <col5>[STU_HRS]:[int] <col6>[STU_CLASS]:[varchar] <col7>[STU_GPA]:[float] <col8>[STU_TRANSFER]:[numeric] <col9>[DEPT_CODE]:[varchar] <col10>[STU_PHONE]:[varchar] <col11>[PROF_NUM]:[int] } <table3>[CLASS] { <col0>[CLASS_CODE]:[varchar] <col1>[CRS_CODE]:[varchar] <col2>[CLASS_SECTION]:[varchar] <col3>[CLASS_TIME]:[varchar] <col4>[CLASS_ROOM]:[varchar] <col5>[PROF_NUM]:[int] } <table4>[DEPARTMENT] { <col0>[DEPT_CODE]:[varchar] <col1>[DEPT_NAME]:[varchar] <col2>[SCHOOL_CODE]:[varchar] <col3>[EMP_NUM]:[int] <col4>[DEPT_ADDRESS]:[varchar] <col5>[DEPT_EXTENSION]:[varchar] } <table5>[COURSE] { <col0>[CRS_CODE]:[varchar] <col1>[DEPT_CODE]:[varchar] <col2>[CRS_DESCRIPTION]:[varchar] <col3>[CRS_CREDIT]:[float] } <table6>[EMPLOYEE] { <col0>[EMP_NUM]:[int] <col1>[EMP_LNAME]:[varchar] <col2>[EMP_FNAME]:[varchar] <col3>[EMP_INITIAL]:[varchar] <col4>[EMP_JOBCODE]:[varchar] <col5>[EMP_HIREDATE]:[datetime] <col6>[EMP_DOB]:[datetime] }
SELECT CRS_CODE, COUNT( * ) FROM `<table3>` GROUP BY `<col1>` ORDER BY COUNT( * ) DESC
How many sections does each course has Visualize by bar chart, and rank y axis in descending order.
<table0>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table1>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4>[age]:[text] <col5>[ethnicity]:[text] <col6>[hospitalid]:[number] <col7>[wardid]:[number] <col8>[admissionheight]:[number] <col9>[admissionweight]:[number] <col10>[dischargeweight]:[number] <col11>[hospitaladmittime]:[time] <col12>[hospitaladmitsource]:[text] <col13>[unitadmittime]:[time] <col14>[unitdischargetime]:[time] <col15>[hospitaldischargetime]:[time] <col16>[hospitaldischargestatus]:[text] } <table2>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5>[chargetime]:[time] } <table3>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table4>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table5>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table6>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table7>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[number] <col5>[respiration]:[number] <col6>[systemicsystolic]:[number] <col7>[systemicdiastolic]:[number] <col8>[systemicmean]:[number] <col9>[observationtime]:[time] } <table8>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table9>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] }
SELECT COUNT( * ) FROM `<table6>` WHERE `<table6>`.`<table1>`unitstayid IN ( SELECT `<table1>`.`<table1>`unitstayid FROM `<table1>` WHERE `<table1>`.`<table1>`healthsystemstayid IN ( SELECT `<table1>`.`<table1>`healthsystemstayid FROM `<table1>` WHERE `<table1>`.uniquepid = '012-63986' ) ) AND DATETIME( `<table6>`.drugstarttime, 'start of month' ) = DATETIME( CURRENT_TIME( ), 'start of month', '-1 month' )
count the number of drugs a month before patient 012-63986 was prescribed.
<table0>[mines] { <col0>[INT]:[location] <col1>[VARCHAR]:[Gadolinium_prod] <col2>[FLOAT]:[datetime] <col3>[DATETIME]:[INSERT] }
SELECT a.location, AVG( a.Gadolinium_prod ) FROM `<table0>` a CROSS JOIN `<table0>` b GROUP BY a.location ORDER BY AVG( a.Gadolinium_prod ) DESC LIMIT 5;
Identify the top 5 mining locations with the highest average Gadolinium production in 2020, using a cross join.
<table0>[Buildings_2] { <col0>[INT]:[country] <col1>[VARCHAR]:[city] <col2>[VARCHAR]:[efficiency_score] <col3>[INT]:[INSERT] }
SELECT country, 100.0 * COUNT( * ) FILTER ( WHERE efficiency_score > 70 ) OVER ( PARTITION BY country ) / COUNT( * ) OVER ( PARTITION BY country ) AS percentage FROM Buildings_2;
What is the percentage of buildings that have an energy efficiency score above 70, for each country?
<table0>[public_parks] { <col0>[name]:[VARCHAR] <col1>[255]:[state] <col2>[VARCHAR]:[255] <col3>[established_year]:[INT] }
SELECT COUNT( * ) FROM `<table0>` WHERE state = 'NY' AND `<col3>` > 2010;
What is the total number of public parks in the state of New York that were established after the year 2010?
<table0>[table_name_27] { <col0>[crowd]:[INTEGER] <col1>[away_team]:[VARCHAR] }
SELECT SUM( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "north melbourne"
How many people were in the crowd when the away team was north melbourne?
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table2>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table3>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table4>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] }
SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` INNER JOIN procedures ON `<table4>`.hadm_id = procedures.hadm_id WHERE `<table4>`.admission_type = "ELECTIVE" AND procedures.icd9_code = "9229"
give the number of patients whose admission type is elective and procedure icd9 code is 9229.
<table0>[hotels] { <col0>[hotel_id]:[INT] <col1>[hotel_name]:[TEXT] } <table1>[bookings] { <col0>[booking_id]:[INT] <col1>[hotel_id]:[INT] <col2>[booking_channel]:[TEXT] }
SELECT `<table0>`.hotel_name, COUNT( bookings.booking_id ) FROM `<table0>` INNER JOIN bookings ON `<table0>`.hotel_id = bookings.hotel_id WHERE bookings.booking_channel = 'OTA' GROUP BY `<table0>`.hotel_name;
What is the number of bookings made through OTA channels for each hotel?
<table0>[table_name_63] { <col0>[score]:[VARCHAR] <col1>[set_3]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "29–27"
What was the overall score when the score of set 3 was 29 27?
<table0>[ethical_ai] { <col0>[country]:[VARCHAR] <col1>[score]:[INT] }
SELECT country, AVG( `<col1>` ) as avg_score FROM `<table0>` GROUP BY `<col0>` ORDER BY avg_score DESC;
What is the average ethical AI score for each country, ordered by the highest average score?
<table0>[Products] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Price]:[DECIMAL] <col3>[Manufacturer]:[INTEGER] } <table1>[Manufacturers] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Headquarter]:[VARCHAR] <col3>[255]:[Founder] <col4>[VARCHAR]:[255] <col5>[Revenue]:[REAL] }
SELECT T1.Name, T1.Code FROM `<table0>` AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code
For those records from the products and each product's manufacturer, show me about the distribution of name and code , and group by attribute founder in a bar chart, sort y-axis in ascending order.
<table0>[tickets] { <col0>[INT]:[salesperson_id] <col1>[INT]:[quantity] <col2>[INT]:[city] <col3>[VARCHAR]:[INSERT] }
DELETE FROM `<table0>` WHERE quantity < 50;
Delete all records from the tickets table where the quantity is less than 50.
<table0>[table_24510] { <col0>[Series]:[real] <col1>[Title]:[text] <col2>[Story]:[real] <col3>[Artist]:[text] <col4>[Strip]:[numbers] <col5>[text]:[Number] <col6>[strips]:[text] <col7>[Dates]:[original] <col8>[publication]:[strip] }
SELECT "Series #" FROM `<table0>` WHERE "Title" = 'The Golden Frog'
What is the series number for the Golden Frog?
<table0>[Mental_Health_Parity_Policies] { <col0>[Region]:[VARCHAR] <col1>[255]:[Topic] <col2>[VARCHAR]:[255] <col3>[Enactment_Date]:[DATE] }
SELECT Topic, `<col3>` FROM `<table0>` WHERE `<col0>` = 'East' UNION SELECT Topic, `<col3>` FROM `<table0>` WHERE `<col0>` = 'West Coast';
List the mental health parity policy topics for the East and West Coast regions and their respective policy enactment dates.
<table0>[table_204_171] { <col0>[number]:[wager] <col1>[text]:[winner] <col2>[text]:[loser] <col3>[text]:[location] <col4>[text]:[date] }
SELECT COUNT( * ) FROM `<table0>` WHERE "winner" = 'gran cochisse'
how many times has gran cochisse been a winner ?
<table0>[table_204_402] { <col0>[number]:[rank] <col1>[number]:[player] <col2>[text]:[text] <col3>[text]:[transfer] <col4>[fee]:[u20ac] <col5>[million]:[number] <col6>[year]:[number] }
SELECT ABS( ( SELECT "transfer fee\n( \u20ac `<col5>` )" FROM `<table0>` WHERE "rank" = 5 ) - ( SELECT "transfer fee\n( \u20ac `<col5>` )" FROM `<table0>` WHERE "rank" = 11 ) )
what is the difference between rank 5 and rank 11 transfer fee
<table0>[table_78047] { <col0>[Stage]:[text] <col1>[Winner]:[text] <col2>[General]:[classification] <col3>[text]:[Points] <col4>[classification]:[text] <col5>[Trofeo]:[Fast] <col6>[Team]:[text] }
SELECT "Trofeo Fast Team" FROM `<table0>` WHERE "Stage" = '10'
who was the trofeo fast team in stage 10?
<table0>[products] { <col0>[product_id]:[INT] <col1>[product_name]:[TEXT] <col2>[is_ethically_sourced]:[BOOLEAN] <col3>[price]:[DECIMAL] }
SELECT AVG( `<col3>` ) FROM `<table0>` WHERE `<col2>` = TRUE;
What is the average price of all products that are ethically sourced?
<table0>[table_204_541] { <col0>[number]:[name] <col1>[text]:[area] <col2>[text]:[height] <col3>[text]:[floors] <col4>[number]:[year] }
SELECT "name" FROM `<table0>` WHERE "height" = 48
of the buildings , which is only 48 meters tall ?
<table0>[table_name_20] { <col0>[airport]:[VARCHAR] }
SELECT AVG( 2008 ) FROM `<table0>` WHERE `<col0>` = "hurghada international airport"
Which 2008 has an Airport of hurghada international airport?
<table0>[biotech_startups] { <col0>[INT]:[name] <col1>[VARCHAR]:[budget] <col2>[DECIMAL]:[region] <col3>[VARCHAR]:[INSERT] }
SELECT SUM( budget ) FROM `<table0>` WHERE region = 'Brazil';
What is the total funding received by biotech startups in Brazil?
<table0>[decentralized_applications] { <col0>[INT]:[name] <col1>[VARCHAR]:[number_of_transactions] <col2>[INT]:[INSERT] }
SELECT *, RANK( ) OVER ( ORDER BY number_of_transactions DESC ) as rank FROM decentralized_applications;
Rank the decentralized applications by the total number of transactions, and assign a rank of 1 to the decentralized application with the highest number of transactions.
<table0>[table_204_262] { <col0>[number]:[rank] <col1>[number]:[athlete] <col2>[text]:[time] <col3>[text]:[notes] <col4>[text]:[text] }
SELECT COUNT( "athlete" ) FROM `<table0>` WHERE "time" < '5:56.21'
how many athletes have a time below 5:56:21 ?
<table0>[cost] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[event_type]:[text] <col4>[event_id]:[number] <col5>[chargetime]:[time] } <table1>[labevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[itemid]:[number] <col4>[charttime]:[time] <col5>[valuenum]:[number] <col6>[valueuom]:[text] } <table2>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table3>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[eventtype]:[text] <col5>[careunit]:[text] <col6>[wardid]:[number] <col7>[intime]:[time] <col8>[outtime]:[time] } <table4>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] } <table5>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] <col6>[value]:[number] } <table6>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table7>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table8>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table9>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table10>[microbiologyevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[charttime]:[time] <col4>[spec_type_desc]:[text] <col5>[org_name]:[text] } <table11>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[dischtime]:[time] <col5>[admission_type]:[text] <col6>[admission_location]:[text] <col7>[discharge_location]:[text] <col8>[insurance]:[text] <col9>[language]:[text] <col10>[marital_status]:[text] <col11>[ethnicity]:[text] <col12>[age]:[number] } <table12>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table13>[chartevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[itemid]:[number] <col5>[charttime]:[time] <col6>[valuenum]:[number] <col7>[valueuom]:[text] } <table14>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table15>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table16>[icustays] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[first_careunit]:[text] <col5>[last_careunit]:[text] <col6>[first_wardid]:[number] <col7>[last_wardid]:[number] <col8>[intime]:[time] <col9>[outtime]:[time] }
SELECT COUNT( * ) > 0 FROM `<table13>` WHERE `<table13>`.icustay_id IN ( SELECT `<table16>`.icustay_id FROM `<table16>` WHERE `<table16>`.hadm_id IN ( SELECT `<table11>`.hadm_id FROM `<table11>` WHERE `<table11>`.subject_id = 18159 ) ) AND `<table13>`.itemid IN ( SELECT `<table7>`.itemid FROM `<table7>` WHERE `<table7>`.label = 'heart rate' AND `<table7>`.linksto = '`<table13>`' ) AND `<table13>`.valuenum BETWEEN heart_rate_lower AND heart_rate_upper AND DATETIME( `<table13>`.charttime, 'start of month' ) = DATETIME( CURRENT_TIME( ), 'start of month', '-0 month' )
is the heart rate of patient 18159 was normal this month.
<table0>[table_32958] { <col0>[Institution]:[text] <col1>[Government]:[real] <col2>[Aided]:[real] <col3>[Unaided]:[real] <col4>[Total]:[real] }
SELECT MIN( "Total" ) FROM `<table0>` WHERE "Institution" = 'higher secondary school' AND "Aided" > '14'
Which higher secondary school listing has the lowest total and an Aided amount larger than 14?
<table0>[table_name_90] { <col0>[name]:[VARCHAR] <col1>[height]:[VARCHAR] <col2>[year]:[VARCHAR] <col3>[home_town]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col2>` = "freshman" AND `<col3>` = "los angeles, ca" AND `<col1>` = "6–4"
What is the Name with a Year with freshman, and a Home Town with los angeles, ca, and a Height of 6–4?
<table0>[days] { <col0>[days_code]:[varchar] <col1>[day_name]:[varchar] } <table1>[compartment_class] { <col0>[compartment]:[varchar] <col1>[class_type]:[varchar] } <table2>[month] { <col0>[month_number]:[int] <col1>[month_name]:[text] } <table3>[class_of_service] { <col0>[booking_class]:[varchar] <col1>[rank]:[int] <col2>[class_description]:[text] } <table4>[equipment_sequence] { <col0>[aircraft_code_sequence]:[varchar] <col1>[aircraft_code]:[varchar] } <table5>[time_zone] { <col0>[time_zone_code]:[text] <col1>[time_zone_name]:[text] <col2>[hours_from_gmt]:[int] } <table6>[date_day] { <col0>[month_number]:[int] <col1>[day_number]:[int] <col2>[year]:[int] <col3>[day_name]:[varchar] } <table7>[city] { <col0>[city_code]:[varchar] <col1>[city_name]:[varchar] <col2>[state_code]:[varchar] <col3>[country_name]:[varchar] <col4>[time_zone_code]:[varchar] } <table8>[dual_carrier] { <col0>[main_airline]:[varchar] <col1>[low_flight_number]:[int] <col2>[high_flight_number]:[int] <col3>[dual_airline]:[varchar] <col4>[service_name]:[text] } <table9>[fare_basis] { <col0>[fare_basis_code]:[text] <col1>[booking_class]:[text] <col2>[class_type]:[text] <col3>[premium]:[text] <col4>[economy]:[text] <col5>[discounted]:[text] <col6>[night]:[text] <col7>[season]:[text] <col8>[basis_days]:[text] } <table10>[flight_fare] { <col0>[flight_id]:[int] <col1>[fare_id]:[int] } <table11>[aircraft] { <col0>[aircraft_code]:[varchar] <col1>[aircraft_description]:[varchar] <col2>[manufacturer]:[varchar] <col3>[basic_type]:[varchar] <col4>[engines]:[int] <col5>[propulsion]:[varchar] <col6>[wide_body]:[varchar] <col7>[wing_span]:[int] <col8>[length]:[int] <col9>[weight]:[int] <col10>[capacity]:[int] <col11>[pay_load]:[int] <col12>[cruising_speed]:[int] <col13>[range_miles]:[int] <col14>[pressurized]:[varchar] } <table12>[airline] { <col0>[airline_code]:[varchar] <col1>[airline_name]:[text] <col2>[note]:[text] } <table13>[ground_service] { <col0>[city_code]:[text] <col1>[airport_code]:[text] <col2>[transport_type]:[text] <col3>[ground_fare]:[int] } <table14>[food_service] { <col0>[meal_code]:[text] <col1>[meal_number]:[int] <col2>[compartment]:[text] <col3>[meal_description]:[varchar] } <table15>[airport] { <col0>[airport_code]:[varchar] <col1>[airport_name]:[text] <col2>[airport_location]:[text] <col3>[state_code]:[varchar] <col4>[country_name]:[varchar] <col5>[time_zone_code]:[varchar] <col6>[minimum_connect_time]:[int] } <table16>[fare] { <col0>[fare_id]:[int] <col1>[from_airport]:[varchar] <col2>[to_airport]:[varchar] <col3>[fare_basis_code]:[text] <col4>[fare_airline]:[text] <col5>[restriction_code]:[text] <col6>[one_direction_cost]:[int] <col7>[round_trip_cost]:[int] <col8>[round_trip_required]:[varchar] } <table17>[state] { <col0>[state_code]:[text] <col1>[state_name]:[text] <col2>[country_name]:[text] } <table18>[airport_service] { <col0>[city_code]:[varchar] <col1>[airport_code]:[varchar] <col2>[miles_distant]:[int] <col3>[direction]:[varchar] <col4>[minutes_distant]:[int] } <table19>[flight] { <col0>[aircraft_code_sequence]:[text] <col1>[airline_code]:[varchar] } <table20>[time_interval] { <col0>[period]:[text] <col1>[begin_time]:[int] <col2>[end_time]:[int] } <table21>[flight_stop] { <col0>[flight_id]:[int] <col1>[stop_number]:[int] <col2>[stop_days]:[text] <col3>[stop_airport]:[text] <col4>[arrival_time]:[int] <col5>[arrival_airline]:[text] <col6>[arrival_flight_number]:[int] <col7>[departure_time]:[int] <col8>[departure_airline]:[text] <col9>[departure_flight_number]:[int] <col10>[stop_time]:[int] } <table22>[restriction] { <col0>[restriction_code]:[text] <col1>[advance_purchase]:[int] <col2>[stopovers]:[text] <col3>[saturday_stay_required]:[text] <col4>[minimum_stay]:[int] <col5>[maximum_stay]:[int] <col6>[application]:[text] <col7>[no_discounts]:[text] } <table23>[flight_leg] { <col0>[flight_id]:[int] <col1>[leg_number]:[int] <col2>[leg_flight]:[int] } <table24>[code_description] { <col0>[code]:[varchar] <col1>[description]:[text] }
SELECT DISTINCT flight.arrival_time, flight.departure_time FROM `<table18>` AS AIRPORT_SERVICE_0, `<table18>` 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 = 'BALTIMORE' AND flight.flight_number = 269 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code ) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
i'd like to travel from BOSTON to BALTIMORE on us air 269 please tell me the times
<table0>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table1>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table2>[PostTypes] { <col0>[number]:[text] } <table3>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table4>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table5>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <table6>[PostFeedback] { <col0>[number]:[PostId] <col1>[number]:[IsAnonymous] <col2>[boolean]:[VoteTypeId] <col3>[number]:[CreationDate] } <table7>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table8>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table9>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table10>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table11>[PostHistoryTypes] { <col0>[number]:[text] } <table12>[FlagTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table13>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table14>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table15>[Posts] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table16>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table17>[PostTags] { <col0>[PostId]:[number] <col1>[TagId]:[number] } <table18>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table19>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table20>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table21>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table22>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table23>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModeratorId] <col8>[number]:[ApprovalDate] <col9>[time]:[ApprovalModeratorId] <col10>[number]:[DeactivationDate] <col11>[time]:[DeactivationModeratorId] } <table24>[VoteTypes] { <col0>[number]:[text] } <table25>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table26>[PostsWithDeleted] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table27>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table28>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>[text]:[EmailHash] <col12>[text]:[AccountId] }
SELECT DATEFROMPARTS( YEAR( CreationDate ), MONTH( CreationDate ), 1 ) AS YearMonth, ( CAST( SUM( CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END ) AS FLOAT ) / NULLIF( CAST( SUM( CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END ) AS FLOAT ), 0 ) ) AS Ratio FROM `<table7>` WHERE CreationDate > '01-01-2015' AND CreationDate < '12-31-2020' GROUP BY DATEFROMPARTS( YEAR( CreationDate ), MONTH( CreationDate ), 1 ) ORDER BY DATEFROMPARTS( YEAR( CreationDate ), MONTH( CreationDate ), 1 )
Evolution of the up-/downvote ratio by year and month. Look at the Graph, to see the evolution of the upvote/downvote ratio.
<table0>[table_2477085_1] { <col0>[production]:[VARCHAR] <col1>[alpina_model]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "B10 4,6"
Name the production for alpina model being b10 4,6
<table0>[unique_products] { <col0>[supplier_id]:[INT] <col1>[product_id]:[INT] }
SELECT suppliers.supplier_name, COUNT( DISTINCT unique_products.product_id ) FROM suppliers JOIN unique_products ON suppliers.supplier_id = unique_products.supplier_id GROUP BY suppliers.supplier_id;
Get the number of unique products sold by each supplier?
<table0>[table_name_49] { <col0>[date]:[VARCHAR] <col1>[score_f_a]:[VARCHAR] <col2>[opponents]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "2–0" AND `<col2>` = "walsall"
Score F–A of 2–0, and a Opponents of walsall has what date?
<table0>[table_79991] { <col0>[Game]:[real] <col1>[Date]:[text] <col2>[Score]:[text] <col3>[Location]:[text] <col4>[Time]:[text] <col5>[Attendance]:[real] }
SELECT MIN( "Attendance" ) FROM `<table0>` WHERE "Time" = '2:13'
What was the Attendance when the Time was 2:13?
<table0>[basketball_match] { <col0>[Team_ID]:[int] <col1>[School_ID]:[int] <col2>[Team_Name]:[text] <col3>[ACC_Regular_Season]:[text] <col4>[ACC_Percent]:[text] <col5>[ACC_Home]:[text] <col6>[ACC_Road]:[text] <col7>[All_Games]:[text] <col8>[All_Games_Percent]:[int] <col9>[All_Home]:[text] <col10>[All_Road]:[text] <col11>[All_Neutral]:[text] } <table1>[university] { <col0>[School_ID]:[int] <col1>[School]:[text] <col2>[Location]:[text] <col3>[Founded]:[real] <col4>[Affiliation]:[text] <col5>[Enrollment]:[real] <col6>[Nickname]:[text] <col7>[Primary_conference]:[text] }
SELECT Team_ID, `<col4>` FROM `<table0>` GROUP BY `<col9>`
Visualize the relationship between Team_ID and ACC_Percent , and group by attribute All_Home.
<table0>[table_26842217_8] { <col0>[date]:[VARCHAR] <col1>[site]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Sanford Stadium β€’ Athens, GA"
If the site is sanford stadium β€’ athens, ga, what is the date?
<table0>[table_name_75] { <col0>[date]:[VARCHAR] <col1>[location_attendance]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "wachovia center"
When did they play at the wachovia center?
<table0>[exhibition_record] { <col0>[Exhibition_ID]:[int] <col1>[Date]:[text] <col2>[Attendance]:[int] } <table1>[exhibition] { <col0>[Exhibition_ID]:[int] <col1>[Year]:[int] <col2>[Theme]:[text] <col3>[Artist_ID]:[int] <col4>[Ticket_Price]:[real] } <table2>[artist] { <col0>[Artist_ID]:[int] <col1>[text]:[Country] <col2>[text]:[Year_Join] <col3>[int]:[Age] }
SELECT Country, AVG( Age ) FROM `<table2>` GROUP BY Country ORDER BY AVG( Age )
What are the average ages of artists by countries? Visualize the result with a histogram, and I want to display in asc by the total number.
<table0>[program_requirement] { <col0>[program_id]:[int] <col1>[category]:[varchar] <col2>[min_credit]:[int] <col3>[additional_req]:[varchar] } <table1>[student] { <col0>[student_id]:[int] <col1>[lastname]:[varchar] <col2>[firstname]:[varchar] <col3>[program_id]:[int] <col4>[declare_major]:[varchar] <col5>[total_credit]:[int] <col6>[total_gpa]:[float] <col7>[entered_as]:[varchar] <col8>[admit_term]:[int] <col9>[predicted_graduation_semester]:[int] <col10>[degree]:[varchar] <col11>[minor]:[varchar] <col12>[internship]:[varchar] } <table2>[instructor] { <col0>[instructor_id]:[int] <col1>[name]:[varchar] <col2>[uniqname]:[varchar] } <table3>[requirement] { <col0>[requirement_id]:[int] } <table4>[jobs] { <col0>[job_id]:[int] <col1>[job_title]:[varchar] <col2>[description]:[varchar] <col3>[requirement]:[varchar] <col4>[city]:[varchar] <col5>[state]:[varchar] <col6>[country]:[varchar] <col7>[zip]:[int] } <table5>[course] { <col0>[course_id]:[int] <col1>[name]:[varchar] <col2>[department]:[varchar] <col3>[number]:[varchar] <col4>[credits]:[varchar] <col5>[advisory_requirement]:[varchar] <col6>[enforced_requirement]:[varchar] <col7>[description]:[varchar] <col8>[num_semesters]:[int] <col9>[num_enrolled]:[int] <col10>[has_discussion]:[varchar] <col11>[has_lab]:[varchar] <col12>[has_projects]:[varchar] <col13>[has_exams]:[varchar] <col14>[num_reviews]:[int] <col15>[clarity_score]:[int] <col16>[easiness_score]:[int] <col17>[helpfulness_score]:[int] } <table6>[course_prerequisite] { <col0>[pre_course_id]:[int] <col1>[course_id]:[int] } <table7>[student_record] { <col0>[student_id]:[int] <col1>[course_id]:[int] <col2>[semester]:[int] <col3>[grade]:[varchar] <col4>[varchar]:[transfer_source] <col5>[varchar]:[earn_credit] <col6>[varchar]:[repeat_term] <col7>[varchar]:[test_id] } <table8>[course_offering] { <col0>[offering_id]:[int] <col1>[course_id]:[int] <col2>[semester]:[int] <col3>[section_number]:[int] <col4>[start_time]:[time] <col5>[end_time]:[time] <col6>[monday]:[varchar] <col7>[tuesday]:[varchar] <col8>[wednesday]:[varchar] <col9>[thursday]:[varchar] <col10>[friday]:[varchar] <col11>[saturday]:[varchar] <col12>[sunday]:[varchar] <col13>[has_final_project]:[varchar] <col14>[has_final_exam]:[varchar] <col15>[textbook]:[varchar] <col16>[class_address]:[varchar] <col17>[allow_audit]:[varchar] } <table9>[program_course] { <col0>[program_id]:[int] <col1>[course_id]:[int] <col2>[workload]:[int] <col3>[category]:[varchar] } <table10>[area] { <col0>[course_id]:[int] } <table11>[program] { <col0>[program_id]:[int] <col1>[name]:[varchar] <col2>[college]:[varchar] <col3>[introduction]:[varchar] } <table12>[offering_instructor] { <col0>[offering_instructor_id]:[int] <col1>[offering_id]:[int] <col2>[instructor_id]:[int] } <table13>[campus_job_id] { <col0>[int]:[student_id] <col1>[int]:[location] } <table14>[gsi] { <col0>[course_offering_id]:[int] <col1>[student_id]:[int] } <table15>[comment_instructor] { <col0>[instructor_id]:[int] <col1>[student_id]:[int] <col2>[score]:[int] <col3>[comment_text]:[varchar] } <table16>[semester] { <col0>[semester_id]:[int] } <table17>[course_tags_count] { <col0>[course_id]:[int] <col1>[clear_grading]:[int] <col2>[pop_quiz]:[int] <col3>[group_projects]:[int] <col4>[inspirational]:[int] <col5>[long_lectures]:[int] <col6>[extra_credit]:[int] <col7>[few_tests]:[int] <col8>[good_feedback]:[int] <col9>[tough_tests]:[int] <col10>[heavy_papers]:[int] <col11>[cares_for_students]:[int] <col12>[heavy_assignments]:[int] <col13>[respected]:[int] <col14>[participation]:[int] <col15>[heavy_reading]:[int] <col16>[tough_grader]:[int] <col17>[hilarious]:[int] <col18>[would_take_again]:[int] <col19>[good_lecture]:[int] <col20>[no_skip]:[int] }
SELECT DISTINCT student.firstname, student.lastname FROM `<table5>` INNER JOIN `<table5>`_offering ON `<table5>`.`<table5>`_id = `<table5>`_offering.`<table5>`_id INNER JOIN gsi ON gsi.`<table5>`_offering_id = `<table5>`_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = `<table5>`_offering.semester WHERE `<table5>`.department = 'MUSED' AND `<table5>`.number = 490 AND semester.semester = 'FA' AND semester.year = 2015
Last semester , the GSIs for MUSED 490 were who ?
<table0>[CREATE] { <col0>[SCHEMA]:[peace_operations] } <table1>[asean_operations] { <col0>[operation_name]:[VARCHAR] <col1>[year]:[INT] <col2>[organization]:[VARCHAR] <col3>[INSERT]:[peace_operations] }
SELECT AVG( year ) FROM peace_operations.asean_operations WHERE organization = 'ASEAN' AND year BETWEEN 2015 AND 2022 GROUP BY organization;
What is the average number of peacekeeping operations conducted per year by ASEAN countries between 2015 and 2022?
<table0>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table2>[PostFeedback] { <col0>[number]:[PostId] <col1>[number]:[IsAnonymous] <col2>[boolean]:[VoteTypeId] <col3>[number]:[CreationDate] } <table3>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table4>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table5>[PostTags] { <col0>[PostId]:[number] <col1>[TagId]:[number] } <table6>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table7>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table8>[VoteTypes] { <col0>[number]:[text] } <table9>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table10>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table11>[Posts] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table12>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModeratorId] <col8>[number]:[ApprovalDate] <col9>[time]:[ApprovalModeratorId] <col10>[number]:[DeactivationDate] <col11>[time]:[DeactivationModeratorId] } <table13>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table14>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>[text]:[EmailHash] <col12>[text]:[AccountId] } <table15>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table16>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table17>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table18>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table19>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table20>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <table21>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table22>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table23>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table24>[FlagTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table25>[PostTypes] { <col0>[number]:[text] } <table26>[PostsWithDeleted] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table27>[PostHistoryTypes] { <col0>[number]:[text] } <table28>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] }
SELECT PostId AS "post_link", Id AS "comment_link", 'text', 'creationdate' FROM `<table17>` WHERE Text LIKE '%##SearchString##%' ORDER BY CreationDate DESC
Search for text in comments (with parameters).
<table0>[agri_innovation] { <col0>[INT]:[project] <col1>[TEXT]:[location] <col2>[TEXT]:[INSERT] }
SELECT COUNT( * ) FROM `<table0>` WHERE location = 'Europe';
What is the number of agricultural innovation projects in 'Europe'?
<table0>[CybersecurityIncidents] { <col0>[INT]:[Month] <col1>[VARCHAR]:[Incidents] <col2>[INT]:[Year] <col3>[INT]:[INSERT] }
SELECT AVG( Incidents ) FROM `<table0>` WHERE Year = 2020 GROUP BY Month;
What is the average number of cybersecurity incidents per month in 2020?
<table0>[PostTypes] { <col0>[number]:[text] } <table1>[PostHistoryTypes] { <col0>[number]:[text] } <table2>[VoteTypes] { <col0>[number]:[text] } <table3>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table4>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table5>[FlagTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table6>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table7>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table8>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table9>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table10>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table11>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>[text]:[EmailHash] <col12>[text]:[AccountId] } <table12>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table13>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <table14>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table15>[PostTags] { <col0>[PostId]:[number] <col1>[TagId]:[number] } <table16>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModeratorId] <col8>[number]:[ApprovalDate] <col9>[time]:[ApprovalModeratorId] <col10>[number]:[DeactivationDate] <col11>[time]:[DeactivationModeratorId] } <table17>[PostsWithDeleted] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table18>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table19>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table20>[PostFeedback] { <col0>[number]:[PostId] <col1>[number]:[IsAnonymous] <col2>[boolean]:[VoteTypeId] <col3>[number]:[CreationDate] } <table21>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table22>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table23>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table24>[Posts] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table25>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table26>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table27>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table28>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] }
SELECT ROW_NUMBER( ) OVER ( ORDER BY Reputation DESC ) AS "#", Id AS "user_link", Reputation FROM `<table11>` WHERE ( LOWER( Location ) LIKE '%malaysia%' ) ORDER BY Reputation DESC
Search Malaysia Users by Reputation.
<table0>[table_5461] { <col0>[Car]:[plate] <col1>[starting]:[1937] <col2>[text]:[Voivodeship] <col3>[city]:[text] <col4>[Capital]:[text] <col5>[Area]:[1930] <col6>[000skm]:[text] <col7>[Population]:[1931] <col8>[000s]:[text] }
SELECT "s `<col0>` plate ( `<col1>` 1937 )" FROM `<table0>` WHERE "Population ( 1931 ) in 1,000s" = '2,460.9'
Population (1931) in 1,000s of 2,460.9 what is the car plate (starting 1937)?
<table0>[icustays] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[first_careunit]:[text] <col5>[last_careunit]:[text] <col6>[first_wardid]:[number] <col7>[last_wardid]:[number] <col8>[intime]:[time] <col9>[outtime]:[time] } <table1>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table2>[microbiologyevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[charttime]:[time] <col4>[spec_type_desc]:[text] <col5>[org_name]:[text] } <table3>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[dischtime]:[time] <col5>[admission_type]:[text] <col6>[admission_location]:[text] <col7>[discharge_location]:[text] <col8>[insurance]:[text] <col9>[language]:[text] <col10>[marital_status]:[text] <col11>[ethnicity]:[text] <col12>[age]:[number] } <table4>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table5>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table6>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table7>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] } <table8>[chartevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[itemid]:[number] <col5>[charttime]:[time] <col6>[valuenum]:[number] <col7>[valueuom]:[text] } <table9>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table10>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table11>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] <col6>[value]:[number] } <table12>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table13>[cost] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[event_type]:[text] <col4>[event_id]:[number] <col5>[chargetime]:[time] } <table14>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[eventtype]:[text] <col5>[careunit]:[text] <col6>[wardid]:[number] <col7>[intime]:[time] <col8>[outtime]:[time] } <table15>[labevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[itemid]:[number] <col4>[charttime]:[time] <col5>[valuenum]:[number] <col6>[valueuom]:[text] } <table16>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] }
SELECT `<table2>`.charttime FROM `<table2>` WHERE `<table2>`.hadm_id IN ( SELECT `<table3>`.hadm_id FROM `<table3>` WHERE `<table3>`.subject_id = 70234 ) AND `<table2>`.spec_type_desc = 'blood culture' AND STRFTIME( '%y-%m', `<table2>`.charttime ) >= '2105-02' ORDER BY `<table2>`.charttime LIMIT 1
when did patient 70234 receive the first microbiological blood culture test since 02/2105?
<table0>[participations] { <col0>[initiative_id]:[INT] <col1>[launch_date]:[DATE] <col2>[num_participants]:[INT] }
SELECT AVG( `<col2>` ) FROM `<table0>` WHERE EXTRACT( QUARTER FROM `<col1>` ) = 1;
What is the average number of public participations for initiatives launched in Q1?
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table2>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table3>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] } <table4>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] }
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` INNER JOIN lab ON `<table3>`.hadm_id = lab.hadm_id WHERE `<table3>`.admission_location = "CLINIC REFERRAL/PREMATURE" AND lab.itemid = "50998"
how many office admitted patients have lab test item id 50998?
<table0>[table_23315] { <col0>[Verbs]:[text] <col1>[text]:[u00fa] <col2>[text]:[Vos] <col3>[text]:[u00c9l] <col4>[Ella]:[Usted] <col5>[text]:[Nosotros] <col6>[Nosotras]:[text] <col7>[Vosotros]:[Vosotras] <col8>[text]:[Ellos] <col9>[Ellas]:[Ustedes] }
SELECT COUNT( "Verbs" ) FROM `<table0>` WHERE "Yo" = 'sienta'
how many verbs have the yo form as sienta?
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table2>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table3>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] } <table4>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] }
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` INNER JOIN prescriptions ON `<table3>`.hadm_id = prescriptions.hadm_id WHERE `<table3>`.days_stay > "30" AND prescriptions.drug = "HYDROmorphone ( Dilaudid )"
provide the number of patients who had hydromorphone (dilaudid) prescription and stayed in hospital for more than 30 days.
<table0>[table_30120633_1] { <col0>[civil_parish]:[VARCHAR] <col1>[townland]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Ballymurphy North"
What is Ballymurphy North's civil parish?
<table0>[vessels] { <col0>[INT]:[name] <col1>[TEXT]:[type] <col2>[TEXT]:[cargo_capacity] <col3>[REAL]:[INSERT] }
SELECT id, name, type, cargo_capacity FROM `<table0>` WHERE type = 'Tanker' AND cargo_capacity > ( SELECT AVG( cargo_capacity ) FROM `<table0>` WHERE type = 'Tanker' );
Which tanker vessels have a higher cargo capacity than the average for tanker vessels?
<table0>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table1>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[number] <col5>[respiration]:[number] <col6>[systemicsystolic]:[number] <col7>[systemicdiastolic]:[number] <col8>[systemicmean]:[number] <col9>[observationtime]:[time] } <table2>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5>[chargetime]:[time] } <table3>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table4>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table5>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table6>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table7>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table8>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table9>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4>[age]:[text] <col5>[ethnicity]:[text] <col6>[hospitalid]:[number] <col7>[wardid]:[number] <col8>[admissionheight]:[number] <col9>[admissionweight]:[number] <col10>[dischargeweight]:[number] <col11>[hospitaladmittime]:[time] <col12>[hospitaladmitsource]:[text] <col13>[unitadmittime]:[time] <col14>[unitdischargetime]:[time] <col15>[hospitaldischargetime]:[time] <col16>[hospitaldischargestatus]:[text] }
SELECT t3.drugname FROM ( SELECT t2.drugname, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT patient.uniquepid, `<table3>`.`<table3>`time, patient.patienthealthsystemstayid FROM `<table3>` JOIN patient ON `<table3>`.patientunitstayid = patient.patientunitstayid WHERE `<table3>`.`<table3>`name = 'failure to wean' AND STRFTIME( '%y', `<table3>`.`<table3>`time ) >= '2104' ) AS t1 JOIN ( SELECT patient.uniquepid, `<table4>`.drugname, `<table4>`.drugstarttime, patient.patienthealthsystemstayid FROM `<table4>` JOIN patient ON `<table4>`.patientunitstayid = patient.patientunitstayid WHERE patient.gender = 'female' AND patient.age BETWEEN 40 AND 49 AND STRFTIME( '%y', `<table4>`.drugstarttime ) >= '2104' ) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.`<table3>`time < t2.drugstarttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.drugname ) AS t3 WHERE t3.c1 <= 4
what is the four most frequent drugs that were prescribed during the same hospital encounter to failure to wean female patients of age 40s after they have been diagnosed with failure to wean since 2104?
<table0>[university] { <col0>[School_ID]:[int] <col1>[School]:[text] <col2>[Location]:[text] <col3>[Founded]:[real] <col4>[Affiliation]:[text] <col5>[Enrollment]:[real] <col6>[Nickname]:[text] <col7>[Primary_conference]:[text] } <table1>[basketball_match] { <col0>[Team_ID]:[int] <col1>[School_ID]:[int] <col2>[Team_Name]:[text] <col3>[ACC_Regular_Season]:[text] <col4>[ACC_Percent]:[text] <col5>[ACC_Home]:[text] <col6>[ACC_Road]:[text] <col7>[All_Games]:[text] <col8>[All_Games_Percent]:[int] <col9>[All_Home]:[text] <col10>[All_Road]:[text] <col11>[All_Neutral]:[text] }
SELECT All_Neutral, `<col1>` FROM `<table1>` ORDER BY `<col1>` DESC
A bar chart shows the distribution of All_Neutral and School_ID , list in descending by the y axis.
<table0>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table1>[Posts] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table2>[PostTags] { <col0>[PostId]:[number] <col1>[TagId]:[number] } <table3>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table4>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table5>[PostsWithDeleted] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table6>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table7>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table8>[PostTypes] { <col0>[number]:[text] } <table9>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table10>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table11>[PostFeedback] { <col0>[number]:[PostId] <col1>[number]:[IsAnonymous] <col2>[boolean]:[VoteTypeId] <col3>[number]:[CreationDate] } <table12>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table13>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <table14>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table15>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table16>[PostHistoryTypes] { <col0>[number]:[text] } <table17>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table18>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table19>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table20>[FlagTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table21>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table22>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModeratorId] <col8>[number]:[ApprovalDate] <col9>[time]:[ApprovalModeratorId] <col10>[number]:[DeactivationDate] <col11>[time]:[DeactivationModeratorId] } <table23>[VoteTypes] { <col0>[number]:[text] } <table24>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table25>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table26>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>[text]:[EmailHash] <col12>[text]:[AccountId] } <table27>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table28>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] }
SELECT CONCAT( YEAR( P.CreationDate ), '-', MONTH( P.CreationDate ) ) AS YearMonth, 'MySQL' AS TagName, COUNT( * ) AS PostCount FROM `<table1>` AS P INNER JOIN PostTags AS PT ON ( P.Id = PT.PostId ) INNER JOIN Tags AS T ON ( PT.TagId = T.Id ) WHERE T.TagName LIKE 'mysql%' GROUP BY YEAR( P.CreationDate ), MONTH( P.CreationDate ) ORDER BY YEAR( P.CreationDate ) DESC, MONTH( P.CreationDate ) DESC
SO - Total Posts by Database Server Per Month - MySQL.
<table0>[table_2522473_1] { <col0>[home_ground]:[VARCHAR] <col1>[seasons]:[VARCHAR] <col2>[home_city]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 27 AND `<col2>` = "Trondheim"
What is the home ground for the team whose home city is Trondheim with 27 seasons?
<table0>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table1>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table2>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table3>[PostTags] { <col0>[PostId]:[number] <col1>[TagId]:[number] } <table4>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table5>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModeratorId] <col8>[number]:[ApprovalDate] <col9>[time]:[ApprovalModeratorId] <col10>[number]:[DeactivationDate] <col11>[time]:[DeactivationModeratorId] } <table6>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table7>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table8>[PostTypes] { <col0>[number]:[text] } <table9>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table10>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table11>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <table12>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table13>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table14>[PostHistoryTypes] { <col0>[number]:[text] } <table15>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table16>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table17>[PostFeedback] { <col0>[number]:[PostId] <col1>[number]:[IsAnonymous] <col2>[boolean]:[VoteTypeId] <col3>[number]:[CreationDate] } <table18>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table19>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table20>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table21>[Posts] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table22>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table23>[VoteTypes] { <col0>[number]:[text] } <table24>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table25>[PostsWithDeleted] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table26>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>[text]:[EmailHash] <col12>[text]:[AccountId] } <table27>[FlagTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table28>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] }
SELECT * FROM `<table26>` WHERE Location = 'Oberlin, OH' OR AboutMe LIKE '%Oberlin%'
People with a connection to Oberlin OH.
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] } <table1>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table2>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table3>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table4>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] }
SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` INNER JOIN lab ON `<table0>`.hadm_id = lab.hadm_id WHERE `<table0>`.days_stay > "11" AND lab.fluid = "Cerebrospinal Fluid ( CSF )"
give me the number of patients whose days of hospital stay is greater than 11 and lab test fluid is cerebrospinal fluid (csf)?
<table0>[table_name_28] { <col0>[type]:[VARCHAR] <col1>[principal_activities]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "health services"
Which Type has a Principal activities of health services?
<table0>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] } <table2>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table3>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table4>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] }
SELECT `<table1>`.marital_status FROM `<table1>` WHERE `<table1>`.name = "Jerry Deberry"
what is marital status of subject name jerry deberry?
<table0>[table_33823] { <col0>[Province]:[text] <col1>[Swimsuit]:[real] <col2>[Evening]:[Gown] <col3>[real]:[Interview] <col4>[real]:[Average] }
SELECT AVG( "Evening Gown" ) FROM `<table0>` WHERE "Swimsuit" < '7.99' AND "Interview" > '7.98'
WHich Evening Gown has a Swimsuit smaller than 7.99 and a Interview larger than 7.98?
<table0>[table_24353141_1] { <col0>[original_1st_us_tour_cast]:[VARCHAR] <col1>[original_tokyo___seoul_tour_cast]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Thomas Hettrick"
While the original toyko/seoul tour cast included thomas hettrick, who was in the original 1st us tour cast?
<table0>[table_1889619_5] { <col0>[total_footage_remaining_from_missing_episodes__mm]:[VARCHAR] <col1>[story_no]:[VARCHAR] <col2>[source]:[VARCHAR] }
SELECT `<col0>` AS :ss_ FROM `<table0>` WHERE `<col1>` = "018" AND `<col2>` = "Private individual"
When a private individual is the source and 018 is the story number what is the total footage remaining from missing episodes (mm:ss)?
<table0>[IoTDevices] { <col0>[region]:[VARCHAR] <col1>[255]:[device_id] <col2>[INT]:[firmware_version] <col3>[VARCHAR]:[255] }
SELECT ( COUNT( * ) * 100.0 / ( SELECT COUNT( * ) FROM `<table0>` WHERE `<col0>` = 'Europe' ) ) AS Percentage FROM `<table0>` WHERE `<col0>` = 'Europe' AND firmware_version LIKE '1.%';
Identify the percentage of IoT devices with firmware version 1.x.x in the 'Europe' region.
<table0>[co2_emissions_2022] { <col0>[date]:[DATE] <col1>[co2_emissions]:[DECIMAL] }
SELECT DATE_TRUNC( 'month', `<col0>` ) AS month, SUM( `<col1>` ) AS total_co2_emissions FROM `<table0>` WHERE `<col0>` >= '2022-01-01' AND `<col0>` < '2023-01-01' GROUP BY month;
What is the total CO2 emissions by month in 2022?
<table0>[table_58182] { <col0>[Nationality]:[text] <col1>[Position]:[text] <col2>[Tottenham]:[Hotspur] <col3>[career]:[text] <col4>[Club]:[Apps] <col5>[text]:[Goals] }
SELECT "Goals" FROM `<table0>` WHERE "Nationality" = 'england' AND "Position" = 'mf' AND "Club Apps" = '170'
How many goals did the player from England who played the position of mf and had 170 club apps had?
<table0>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table2>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table3>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table4>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] }
SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` WHERE `<table4>`.gender = "F" AND `<table4>`.admission_location = "PHYS REFERRAL/NORMAL DELI"
How many female patient are with admission location phys referral/normal deli?
<table0>[table_23294081_10] { <col0>[number]:[VARCHAR] }
SELECT COUNT( _number ) FROM `<table0>` WHERE no = 214
How many episodes were series episode 214?
<table0>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table1>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] } <table2>[cost] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[event_type]:[text] <col4>[event_id]:[number] <col5>[chargetime]:[time] } <table3>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table4>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] <col6>[value]:[number] } <table5>[icustays] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[first_careunit]:[text] <col5>[last_careunit]:[text] <col6>[first_wardid]:[number] <col7>[last_wardid]:[number] <col8>[intime]:[time] <col9>[outtime]:[time] } <table6>[chartevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[itemid]:[number] <col5>[charttime]:[time] <col6>[valuenum]:[number] <col7>[valueuom]:[text] } <table7>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table8>[microbiologyevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[charttime]:[time] <col4>[spec_type_desc]:[text] <col5>[org_name]:[text] } <table9>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table10>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[dischtime]:[time] <col5>[admission_type]:[text] <col6>[admission_location]:[text] <col7>[discharge_location]:[text] <col8>[insurance]:[text] <col9>[language]:[text] <col10>[marital_status]:[text] <col11>[ethnicity]:[text] <col12>[age]:[number] } <table11>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table12>[labevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[itemid]:[number] <col4>[charttime]:[time] <col5>[valuenum]:[number] <col6>[valueuom]:[text] } <table13>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table14>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table15>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table16>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[eventtype]:[text] <col5>[careunit]:[text] <col6>[wardid]:[number] <col7>[intime]:[time] <col8>[outtime]:[time] }
SELECT 1 * ( STRFTIME( '%j', CURRENT_TIME( ) ) - STRFTIME( '%j', `<table12>`.charttime ) ) FROM `<table12>` WHERE `<table12>`.itemid IN ( SELECT `<table15>`.itemid FROM `<table15>` WHERE `<table15>`.label = 'glucose' ) AND `<table12>`.hadm_id IN ( SELECT `<table10>`.hadm_id FROM `<table10>` WHERE `<table10>`.subject_id = 31854 AND `<table10>`.dischtime IS NULL ) ORDER BY `<table12>`.charttime DESC LIMIT 1
how many days has it been from the last time patient 31854 received a glucose lab test on this hospital encounter?
<table0>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] } <table1>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar] <col3>[EMAIL]:[varchar] <col4>[PHONE_NUMBER]:[varchar] <col5>[HIRE_DATE]:[date] <col6>[JOB_ID]:[varchar] <col7>[SALARY]:[decimal] <col8>[COMMISSION_PCT]:[decimal] <col9>[MANAGER_ID]:[decimal] <col10>[DEPARTMENT_ID]:[decimal] } <table2>[locations] { <col0>[LOCATION_ID]:[decimal] <col1>[STREET_ADDRESS]:[varchar] <col2>[POSTAL_CODE]:[varchar] <col3>[CITY]:[varchar] <col4>[STATE_PROVINCE]:[varchar] <col5>[COUNTRY_ID]:[varchar] } <table3>[job_history] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[START_DATE]:[date] <col2>[END_DATE]:[date] <col3>[JOB_ID]:[varchar] <col4>[DEPARTMENT_ID]:[decimal] } <table4>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table5>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table6>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar] }
SELECT HIRE_DATE, AVG( `<col7>` ) FROM `<table1>` WHERE `<col1>` LIKE '%D%' OR `<col1>` LIKE '%S%'
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday.
<table0>[minerals_extracted] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[mine_site_id] <col2>[INT]:[mineral] <col3>[VARCHAR]:[255] <col4>[quantity]:[INT] <col5>[extraction_year]:[INT] <col6>[FOREIGN]:[KEY] <col7>[mine_site_id]:[REFERENCES] } <table1>[environmental_impact] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[mine_site_id] <col2>[INT]:[pollution_level] <col3>[INT]:[CO2_emission] <col4>[INT]:[FOREIGN] <col5>[KEY]:[mine_site_id] <col6>[REFERENCES]:[mine_sites] }
SELECT AVG( e.CO2_emission ) as avg_co2 FROM `<table1>` e JOIN minerals_extracted m ON e.mine_site_id = m.mine_site_id WHERE m.mineral = 'gold' AND m.quantity > 1000 AND m.extraction_year = 2021;
What is the average CO2 emission for gold mines that extracted more than 1000 units of gold in 2021?
<table0>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5>[chargetime]:[time] } <table1>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table2>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table3>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table4>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table5>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table6>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table7>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table8>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4>[age]:[text] <col5>[ethnicity]:[text] <col6>[hospitalid]:[number] <col7>[wardid]:[number] <col8>[admissionheight]:[number] <col9>[admissionweight]:[number] <col10>[dischargeweight]:[number] <col11>[hospitaladmittime]:[time] <col12>[hospitaladmitsource]:[text] <col13>[unitadmittime]:[time] <col14>[unitdischargetime]:[time] <col15>[hospitaldischargetime]:[time] <col16>[hospitaldischargestatus]:[text] } <table9>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[number] <col5>[respiration]:[number] <col6>[systemicsystolic]:[number] <col7>[systemicdiastolic]:[number] <col8>[systemicmean]:[number] <col9>[observationtime]:[time] }
SELECT t1.`<table3>`name FROM ( SELECT `<table3>`.`<table3>`name, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM `<table3>` WHERE `<table3>`.`<table8>`unitstayid IN ( SELECT `<table8>`.`<table8>`unitstayid FROM `<table8>` WHERE `<table8>`.age BETWEEN 40 AND 49 ) AND STRFTIME( '%y', `<table3>`.`<table3>`resulttime ) <= '2102' GROUP BY `<table3>`.`<table3>`name ) AS t1 WHERE t1.c1 <= 3
among those with age 40s until 2102, what are the top three most frequent lab tests?
<table0>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModeratorId] <col8>[number]:[ApprovalDate] <col9>[time]:[ApprovalModeratorId] <col10>[number]:[DeactivationDate] <col11>[time]:[DeactivationModeratorId] } <table2>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table3>[FlagTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table4>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table5>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table6>[PostTypes] { <col0>[number]:[text] } <table7>[PostFeedback] { <col0>[number]:[PostId] <col1>[number]:[IsAnonymous] <col2>[boolean]:[VoteTypeId] <col3>[number]:[CreationDate] } <table8>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table9>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table10>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table11>[VoteTypes] { <col0>[number]:[text] } <table12>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table13>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table14>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table15>[PostsWithDeleted] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table16>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table17>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <table18>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table19>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table20>[PostTags] { <col0>[PostId]:[number] <col1>[TagId]:[number] } <table21>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table22>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>[text]:[EmailHash] <col12>[text]:[AccountId] } <table23>[PostHistoryTypes] { <col0>[number]:[text] } <table24>[Posts] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table25>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table26>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table27>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table28>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] }
SELECT COUNT( * ) FROM `<table24>`
Total number of posts by months.
<table0>[table_29241] { <col0>[City]:[text] <col1>[Population]:[real] <col2>[Registered]:[voters] <col3>[text]:[Democratic] <col4>[text]:[Republican] <col5>[text]:[u2013R] <col6>[spread]:[text] <col7>[text]:[party] <col8>[preference]:[text] }
SELECT "No party preference" FROM `<table0>` WHERE "Democratic" = '24.8%'
What is the percentage of 'no party preference' where the democratic percentage is 24.8%?
<table0>[Documents_with_Expenses] { <col0>[Document_ID]:[INTEGER] <col1>[Budget_Type_Code]:[CHAR] <col2>[Document_Details]:[VARCHAR] } <table1>[Projects] { <col0>[Project_ID]:[INTEGER] <col1>[Project_Details]:[VARCHAR] } <table2>[Ref_Budget_Codes] { <col0>[Budget_Type_Code]:[CHAR] <col1>[Budget_Type_Description]:[VARCHAR] } <table3>[Statements] { <col0>[Statement_ID]:[INTEGER] <col1>[Statement_Details]:[VARCHAR] } <table4>[Accounts] { <col0>[Account_ID]:[INTEGER] <col1>[Statement_ID]:[INTEGER] <col2>[Account_Details]:[VARCHAR] } <table5>[Documents] { <col0>[Document_ID]:[INTEGER] <col1>[Document_Type_Code]:[CHAR] <col2>[Project_ID]:[INTEGER] <col3>[Document_Date]:[DATETIME] <col4>[Document_Name]:[VARCHAR] <col5>[255]:[Document_Description] <col6>[VARCHAR]:[255] <col7>[Other_Details]:[VARCHAR] } <table6>[Ref_Document_Types] { <col0>[Document_Type_Code]:[CHAR] <col1>[Document_Type_Name]:[VARCHAR] <col2>[255]:[Document_Type_Description] <col3>[VARCHAR]:[255] }
SELECT T1.Project_Details, T1.Project_ID FROM `<table1>` AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_ID DESC
What is the project id and detail for the project with at least two documents Plot them as bar chart, and order by the y axis from high to low.
<table0>[dives] { <col0>[dive_id]:[INT] <col1>[diver_id]:[INT] <col2>[location]:[VARCHAR] <col3>[depth]:[FLOAT] <col4>[duration]:[INT] }
SELECT location, MAX( `<col3>` ) as max_depth FROM `<table0>` GROUP BY `<col2>` ORDER BY max_depth DESC LIMIT 1;
What is the deepest dive location and the maximum depth (in meters) reached at that location in the 'dives' table?
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[number] <col5>[respiration]:[number] <col6>[systemicsystolic]:[number] <col7>[systemicdiastolic]:[number] <col8>[systemicmean]:[number] <col9>[observationtime]:[time] } <table2>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table3>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4>[age]:[text] <col5>[ethnicity]:[text] <col6>[hospitalid]:[number] <col7>[wardid]:[number] <col8>[admissionheight]:[number] <col9>[admissionweight]:[number] <col10>[dischargeweight]:[number] <col11>[hospitaladmittime]:[time] <col12>[hospitaladmitsource]:[text] <col13>[unitadmittime]:[time] <col14>[unitdischargetime]:[time] <col15>[hospitaldischargetime]:[time] <col16>[hospitaldischargestatus]:[text] } <table4>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table5>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5>[chargetime]:[time] } <table6>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table7>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table8>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table9>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] }
SELECT AVG( `<table1>`.heartrate ) FROM `<table1>` WHERE `<table1>`.`<table3>`unitstayid IN ( SELECT `<table3>`.`<table3>`unitstayid FROM `<table3>` WHERE `<table3>`.`<table3>`healthsystemstayid IN ( SELECT `<table3>`.`<table3>`healthsystemstayid FROM `<table3>` WHERE `<table3>`.uniquepid = '012-29497' AND NOT `<table3>`.hospitaldischargetime IS NULL ORDER BY `<table3>`.hospitaladmittime LIMIT 1 ) ) AND NOT `<table1>`.heartrate IS NULL GROUP BY STRFTIME( '%y-%m-%d', `<table1>`.observationtime )
indicate the daily average amount of heartrate for patient 012-29497 during their first hospital visit.
<table0>[incident_counts] { <col0>[INT]:[category] <col1>[VARCHAR]:[255] <col2>[incident_count]:[INT] <col3>[incident_date]:[DATE] }
SELECT SUM( `<col2>` ) FROM `<table0>` WHERE category = 'Unpatched Systems' AND `<col3>` >= DATEADD( month, -1, GETDATE( ) );
What is the total number of security incidents in the 'Unpatched Systems' category in the last month?
<table0>[table_47820] { <col0>[Week]:[real] <col1>[Date]:[text] <col2>[Opponent]:[text] <col3>[Result]:[text] <col4>[Attendance]:[real] }
SELECT "Date" FROM `<table0>` WHERE "Attendance" > '41,863' AND "Week" = '9'
What is the date of the game on week 9 with attendance greater than 41,863?
<table0>[Categories] { <col0>[CategoryID]:[integer] <col1>[CategoryName]:[text] <col2>[Description]:[text] } <table1>[Customers] { <col0>[CustomerID]:[integer] <col1>[CustomerName]:[text] <col2>[ContactName]:[text] <col3>[Address]:[text] <col4>[City]:[text] <col5>[PostalCode]:[text] <col6>[Country]:[text] } <table2>[Employees] { <col0>[EmployeeID]:[integer] <col1>[LastName]:[text] <col2>[FirstName]:[text] <col3>[BirthDate]:[date] <col4>[Photo]:[text] <col5>[Notes]:[text] } <table3>[Shippers] { <col0>[ShipperID]:[integer] <col1>[ShipperName]:[text] <col2>[Phone]:[text] } <table4>[Suppliers] { <col0>[SupplierID]:[integer] <col1>[SupplierName]:[text] <col2>[ContactName]:[text] <col3>[Address]:[text] <col4>[City]:[text] <col5>[PostalCode]:[text] <col6>[Country]:[text] <col7>[Phone]:[text] } <table5>[Products] { <col0>[ProductID]:[integer] <col1>[ProductName]:[text] <col2>[SupplierID]:[integer] <col3>[CategoryID]:[integer] <col4>[Unit]:[text] <col5>[Price]:[real] } <table6>[Orders] { <col0>[OrderID]:[integer] <col1>[CustomerID]:[integer] <col2>[EmployeeID]:[integer] <col3>[OrderDate]:[datetime] <col4>[ShipperID]:[integer] } <table7>[OrderDetails] { <col0>[OrderDetailID]:[integer] <col1>[OrderID]:[integer] <col2>[ProductID]:[integer] <col3>[Quantity]:[integer] }
SELECT T3.CategoryName FROM `<table4>` AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T2.UnitsInStock > 100 AND T1.CompanyName = 'Exotic Liquids'
List all category name of Exotic Liquids 's product with units in stock over 100.
<table0>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[dischtime]:[time] <col5>[admission_type]:[text] <col6>[admission_location]:[text] <col7>[discharge_location]:[text] <col8>[insurance]:[text] <col9>[language]:[text] <col10>[marital_status]:[text] <col11>[ethnicity]:[text] <col12>[age]:[number] } <table1>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table2>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table3>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table4>[labevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[itemid]:[number] <col4>[charttime]:[time] <col5>[valuenum]:[number] <col6>[valueuom]:[text] } <table5>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table6>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table7>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table8>[microbiologyevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[charttime]:[time] <col4>[spec_type_desc]:[text] <col5>[org_name]:[text] } <table9>[icustays] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[first_careunit]:[text] <col5>[last_careunit]:[text] <col6>[first_wardid]:[number] <col7>[last_wardid]:[number] <col8>[intime]:[time] <col9>[outtime]:[time] } <table10>[cost] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[event_type]:[text] <col4>[event_id]:[number] <col5>[chargetime]:[time] } <table11>[chartevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[itemid]:[number] <col5>[charttime]:[time] <col6>[valuenum]:[number] <col7>[valueuom]:[text] } <table12>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table13>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table14>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] } <table15>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[eventtype]:[text] <col5>[careunit]:[text] <col6>[wardid]:[number] <col7>[intime]:[time] <col8>[outtime]:[time] } <table16>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] <col6>[value]:[number] }
SELECT DISTINCT `<table10>`.`<table10>` FROM `<table10>` WHERE `<table10>`.event_type = '`<table13>`' AND `<table10>`.event_id IN ( SELECT `<table13>`.row_id FROM `<table13>` WHERE `<table13>`.icd9_code = ( SELECT `<table12>`.icd9_code FROM `<table12>` WHERE `<table12>`.short_title = 'lap creat esoph sphinct' ) )
how much does it cost for a procedure called lap creat esoph sphinct?
<table0>[table_23347] { <col0>[Rank]:[real] <col1>[City]:[text] <col2>[1890]:[census] <col3>[text]:[1910] <col4>[census]:[real] <col5>[1920]:[census] <col6>[real]:[1930] <col7>[census]:[real] <col8>[1940]:[census] }
SELECT COUNT( "Rank" ) FROM `<table0>` WHERE "1940 census" = '400000'
How many cities had a census of 400000 in 1940?
<table0>[person_info] { <col0>[CSD]:[text] <col1>[CSRQ]:[time] <col2>[GJDM]:[text] <col3>[GJMC]:[text] <col4>[JGDM]:[text] <col5>[JGMC]:[text] <col6>[MZDM]:[text] <col7>[MZMC]:[text] <col8>[RYBH]:[text] <col9>[XBDM]:[number] <col10>[XBMC]:[text] <col11>[XLDM]:[text] <col12>[XLMC]:[text] <col13>[text]:[ZYLBDM] <col14>[text]:[ZYMC] } <table1>[jyjgzbb] { <col0>[BGDH]:[text] <col1>[BGRQ]:[time] <col2>[CKZFWDX]:[text] <col3>[CKZFWSX]:[number] <col4>[CKZFWXX]:[number] <col5>[JCFF]:[text] <col6>[JCRGH]:[text] <col7>[JCRXM]:[text] <col8>[JCXMMC]:[text] <col9>[JCZBDM]:[text] <col10>[JCZBJGDL]:[number] <col11>[JCZBJGDW]:[text] <col12>[JCZBJGDX]:[text] <col13>[JCZBMC]:[text] <col14>[JLDW]:[text] <col15>[JYRQ]:[time] <col16>[JYZBLSH]:[text] <col17>[SBBM]:[text] <col18>[SHRGH]:[text] <col19>[SHRXM]:[text] <col20>[YLJGDM]:[text] <col21>[YQBH]:[text] <col22>[YQMC]:[text] } <table2>[mzjzjlb] { <col0>[HXPLC]:[number] <col1>[HZXM]:[text] <col2>[JLSJ]:[time] <col3>[JZJSSJ]:[time] <col4>[JZKSBM]:[text] <col5>[JZKSMC]:[text] <col6>[JZKSRQ]:[time] <col7>[JZLSH]:[text] <col8>[JZZDBM]:[text] <col9>[JZZDSM]:[text] <col10>[JZZTDM]:[number] <col11>[JZZTMC]:[text] <col12>[text]:[KLX] <col13>[number]:[MJZH] <col14>[text]:[number] <col15>[MZZYZDZZBM]:[text] <col16>[MZZYZDZZMC]:[text] <col17>[NLS]:[number] <col18>[NLY]:[number] <col19>[QTJZYSGH]:[text] <col20>[number]:[SSY] <col21>[number]:[SZY] <col22>[number]:[number] <col23>[TXBZ]:[number] <col24>[number]:[WDBZ] <col25>[number]:[number] <col26>[YLJGDM]:[text] <col27>[ZSEBZ]:[number] <col28>[ZZBZ]:[number] <col29>[ZZYSGH]:[text] } <table3>[hz_info] { <col0>[text]:[KLX] <col1>[number]:[RYBH] <col2>[text]:[YLJGDM] } <table4>[wdmzjzjlb] { <col0>[CYBQDM]:[text] <col1>[CYBQMC]:[text] <col2>[CYCWH]:[text] <col3>[CYKSDM]:[text] <col4>[CYKSMC]:[text] <col5>[CYSJ]:[time] <col6>[CYZTDM]:[number] <col7>[HZXM]:[text] <col8>[JZKSDM]:[text] <col9>[JZKSMC]:[text] <col10>[JZLSH]:[number] <col11>[text]:[KLX] <col12>[number]:[MZBMLX] <col13>[number]:[MZJZLSH] <col14>[text]:[MZZDBM] <col15>[text]:[MZZDMC] <col16>[text]:[MZZYZDZZBM] <col17>[text]:[RYCWH] <col18>[text]:[RYDJSJ] <col19>[time]:[RYSJ] <col20>[time]:[RYTJDM] <col21>[number]:[RYTJMC] <col22>[text]:[RZBQDM] <col23>[text]:[RZBQMC] <col24>[text]:[YLJGDM] <col25>[number]:[ZYBMLX] <col26>[number]:[ZYZDBM] <col27>[text]:[ZYZDMC] <col28>[text]:[ZYZYZDZZBM] <col29>[text]:[ZYZYZDZZMC] } <table5>[bdmzjzjlb] { <col0>[CYBQDM]:[text] <col1>[CYBQMC]:[text] <col2>[CYCWH]:[text] <col3>[CYKSDM]:[text] <col4>[CYKSMC]:[text] <col5>[CYSJ]:[time] <col6>[CYZTDM]:[number] <col7>[HZXM]:[text] <col8>[JZKSDM]:[text] <col9>[JZKSMC]:[text] <col10>[JZLSH]:[number] <col11>[text]:[KLX] <col12>[number]:[MZBMLX] <col13>[number]:[MZJZLSH] <col14>[text]:[MZZDBM] <col15>[text]:[MZZDMC] <col16>[text]:[MZZYZDZZBM] <col17>[text]:[RYCWH] <col18>[text]:[RYDJSJ] <col19>[time]:[RYSJ] <col20>[time]:[RYTJDM] <col21>[number]:[RYTJMC] <col22>[text]:[RZBQDM] <col23>[text]:[RZBQMC] <col24>[text]:[YLJGDM] <col25>[number]:[ZYBMLX] <col26>[number]:[ZYZDBM] <col27>[text]:[ZYZDMC] <col28>[text]:[ZYZYZDZZBM] <col29>[text]:[ZYZYZDZZMC] } <table6>[jybgb] { <col0>[BBCJBW]:[text] <col1>[BBDM]:[text] <col2>[BBMC]:[text] <col3>[BBZT]:[number] <col4>[BGDH]:[text] <col5>[BGJGDM]:[text] <col6>[BGJGMC]:[text] <col7>[BGRGH]:[text] <col8>[BGRQ]:[time] <col9>[BGRXM]:[text] <col10>[BGSJ]:[time] <col11>[CJRQ]:[time] <col12>[JSBBRQSJ]:[time] <col13>[JSBBSJ]:[time] <col14>[JYBBH]:[text] <col15>[JYJGMC]:[text] <col16>[JYJSGH]:[text] <col17>[JYJSQM]:[text] <col18>[JYKSBM]:[text] <col19>[JYKSMC]:[text] <col20>[JYLX]:[number] <col21>[JYRQ]:[time] <col22>[JYSQJGMC]:[text] <col23>[JYXMDM]:[text] <col24>[JYXMMC]:[text] <col25>[JZLSH]:[text] <col26>[JZLSH_MZJZJLB]:[text] <col27>[JZLSH_ZYJZJLB]:[text] <col28>[JZLX]:[number] <col29>[KSBM]:[text] <col30>[KSMC]:[text] <col31>[SHRGH]:[text] <col32>[SHRXM]:[text] <col33>[SHSJ]:[time] <col34>[SQKS]:[text] <col35>[SQKSMC]:[text] <col36>[SQRGH]:[text] <col37>[SQRQ]:[time] <col38>[SQRXM]:[text] <col39>[YLJGDM]:[text] <col40>[YLJGDM_MZJZJLB]:[text] <col41>[YLJGDM_ZYJZJLB]:[text] }
SELECT wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM `<table0>` JOIN hz_info JOIN wdmzjzjlb ON `<table0>`.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE `<table0>`.XM = 'θ‘›ε’Œζ‚¦' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM `<table0>` JOIN hz_info JOIN bdmzjzjlb ON `<table0>`.RYBH = hz_info.RYBH AND hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_info.KH = bdmzjzjlb.KH AND hz_info.KLX = bdmzjzjlb.KLX WHERE `<table0>`.XM = 'θ‘›ε’Œζ‚¦'
δΉ‹ε‰οΌŒζ‚£θ€…θ‘›ε’Œζ‚¦ηš„δ½ι™’θ―Šζ–­ζƒ…ε†΅ε¦‚δ½•οΌŸ
<table0>[financial_institutions] { <col0>[name]:[TEXT] <col1>[location]:[TEXT] <col2>[debt]:[NUMERIC] <col3>[offers_wellbeing]:[BOOLEAN] }
SELECT SUM( `<col2>` ) FROM `<table0>` WHERE `<col3>` = TRUE AND `<col1>` LIKE 'Sub-Saharan% Africa';
What is the total debt of financial institutions in Sub-Saharan Africa that offer financial wellbeing programs?
<table0>[basketball_match] { <col0>[Team_ID]:[int] <col1>[School_ID]:[int] <col2>[Team_Name]:[text] <col3>[ACC_Regular_Season]:[text] <col4>[ACC_Percent]:[text] <col5>[ACC_Home]:[text] <col6>[ACC_Road]:[text] <col7>[All_Games]:[text] <col8>[All_Games_Percent]:[int] <col9>[All_Home]:[text] <col10>[All_Road]:[text] <col11>[All_Neutral]:[text] } <table1>[university] { <col0>[School_ID]:[int] <col1>[School]:[text] <col2>[Location]:[text] <col3>[Founded]:[real] <col4>[Affiliation]:[text] <col5>[Enrollment]:[real] <col6>[Nickname]:[text] <col7>[Primary_conference]:[text] }
SELECT ACC_Road, COUNT( `<col6>` ) FROM `<table0>` GROUP BY `<col6>` ORDER BY `<col6>` DESC
Bar chart x axis acc road y axis how many acc road, and could you sort from high to low by the names?
<table0>[table_name_93] { <col0>[induction]:[VARCHAR] <col1>[years]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "1975–1976"
What is the inductioin for 1975 1976?
<table0>[table_name_23] { <col0>[time_retired]:[VARCHAR] <col1>[laps]:[INTEGER] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` < 4
what is the time/retired when the laps is less than 4?
<table0>[table_16819] { <col0>[Model]:[name] <col1>[text]:[Power] <col2>[real]:[Torque] <col3>[rpm]:[text] <col4>[Displacement]:[u00b3] <col5>[real]:[Engine] <col6>[code]:[text] <col7>[Comment]:[text] }
SELECT COUNT( "Power ( ps )" ) FROM `<table0>` WHERE "Torque ( Nm@rpm )" = '240@2200-5000'
how many power (ps) with torque (nm@rpm) being 240@2200-5000
<table0>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table1>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar] <col3>[EMAIL]:[varchar] <col4>[PHONE_NUMBER]:[varchar] <col5>[HIRE_DATE]:[date] <col6>[JOB_ID]:[varchar] <col7>[SALARY]:[decimal] <col8>[COMMISSION_PCT]:[decimal] <col9>[MANAGER_ID]:[decimal] <col10>[DEPARTMENT_ID]:[decimal] } <table2>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] } <table3>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar] } <table4>[job_history] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[START_DATE]:[date] <col2>[END_DATE]:[date] <col3>[JOB_ID]:[varchar] <col4>[DEPARTMENT_ID]:[decimal] } <table5>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table6>[locations] { <col0>[LOCATION_ID]:[decimal] <col1>[STREET_ADDRESS]:[varchar] <col2>[POSTAL_CODE]:[varchar] <col3>[CITY]:[varchar] <col4>[STATE_PROVINCE]:[varchar] <col5>[COUNTRY_ID]:[varchar] }
SELECT JOB_ID, SUM( `<col9>` ) FROM `<table1>` WHERE `<col1>` LIKE '%D%' OR `<col1>` LIKE '%S%' GROUP BY `<col6>`
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id.
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table2>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table3>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table4>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] }
SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` INNER JOIN lab ON `<table4>`.hadm_id = lab.hadm_id WHERE `<table4>`.insurance = "Private" AND lab.label = "C3"
how many patients whose insurance is private and lab test name is c3?
<table0>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table2>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table3>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] } <table4>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] }
SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` WHERE `<table3>`.admission_location = "TRSF WITHIN THIS FACILITY" AND `<table3>`.dob_year < "1887"
what is the number of patients whose admission location is trsf within this facility and year of birth is less than 1887?
<table0>[table_73189] { <col0>[Series]:[real] <col1>[Episode]:[real] <col2>[Title]:[text] <col3>[Directed]:[text] <col4>[Written]:[text] <col5>[Original]:[airdate] }
SELECT "Episode #" FROM `<table0>` WHERE "Series #" = '17'
What is the episode number for series 17?
<table0>[table_name_90] { <col0>[years]:[VARCHAR] <col1>[area]:[VARCHAR] <col2>[authority]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "upper hutt" AND `<col2>` = "private"
What years is the private school in upper hutt?