input stringlengths 193 2.69k | output stringlengths 24 744 |
|---|---|
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: What are t... | SELECT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T2.app_id = 7324884708820020000; |
[INST] Here is a database schema:
app_events :
event_id [ INTEGER ] app_events.event_id = events.event_id
app_id [ INTEGER ]
is_installed [ bool ]
is_active [ bool ]
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :... | SELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id INNER JOIN app_events AS T3 ON T2.app_id = T3.app_id WHERE T3.is_active = 0 AND T1.category = 'Property Industry 1.0' AND T3.event_id = 2; |
[INST] Here is a database schema:
app_events :
event_id [ INTEGER ] app_events.event_id = events.event_id
app_id [ INTEGER ]
is_installed [ bool ]
is_active [ bool ]
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :... | SELECT COUNT(*) FROM ( SELECT COUNT(DISTINCT T1.category) AS result FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id INNER JOIN app_events AS T3 ON T2.app_id = T3.app_id WHERE T3.event_id = 2 AND T3.is_active = 0 GROUP BY T1.category ) T; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT T.device_model FROM ( SELECT T2.device_model, COUNT(T2.device_model) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age > 30 AND T1.gender = 'F' GROUP BY T2.device_model ) AS T ORDER BY T.num DESC LIMIT 1; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that answers the following question:... | SELECT T2.device_model FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.longitude = 121 AND T1.latitude = 31; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: What are t... | SELECT T.category FROM ( SELECT T2.category, COUNT(T1.app_id) AS num FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id GROUP BY T2.category ) AS T ORDER BY T.num DESC LIMIT 3; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
Please w... | SELECT T2.event_id FROM gender_age AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.device_id ORDER BY T1.age DESC LIMIT 1; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
Please w... | SELECT COUNT(T1.event_id) FROM events AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T2.gender = 'F' GROUP BY T1.event_id, T2.age ORDER BY T2.age LIMIT 1; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
Please w... | SELECT COUNT(T1.device_id) FROM events AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T1.timestamp = '2016-05-01' AND T2.gender = 'M'; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: Which cate... | SELECT IIF(SUM(IIF(T2.category = 'Securities', 1, 0)) - SUM(IIF(T2.category = 'Finance', 1, 0)) > 0, 'Securities', 'Finance') AS diff FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT AVG(T1.age) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo' AND T1.gender = 'F'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT SUM(IIF(T1.gender = 'M', 1, 0)) / SUM(IIF(T1.gender = 'F', 1, 0)) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo'; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is th... | SELECT SUM(IIF(T2.category = 'Securities', 1, 0)) / SUM(IIF(T2.category = 'Finance', 1, 0)) AS per FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id; |
[INST] Here is a database schema:
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is the label ID of "Third-party card management" category? [/INST] | SELECT label_id FROM label_categories WHERE category = 'Third-party card management'; |
[INST] Here is a database schema:
app_events :
event_id [ INTEGER ] app_events.event_id = events.event_id
app_id [ INTEGER ]
is_installed [ bool ]
is_active [ bool ]
Please write me a SQL statement that answers the following question: What is the ratio of active and inactive app users of the event ID "58"? [/INST] | SELECT SUM(IIF(is_active = 1, 1, 0)) / SUM(IIF(is_active = 0, 1, 0)) AS per FROM app_events WHERE event_id = 58; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL statement that answers the following question: How many events did the device ID "3915082290673130000" join? [/INST] | SELECT COUNT(event_id) FROM events WHERE device_id = 3915082290673130000; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
Please write me a SQL statement that answers the following question: Calculate the percentage of male users among all device users. ... | SELECT SUM(IIF(gender = 'M', 1, 0)) / COUNT(device_id) AS per FROM gender_age; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL statement that answers the following question: How many events were participated by the users at longitude of "-156"? [/INST] | SELECT COUNT(event_id) FROM events WHERE longitude = -156; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
Please write me a SQL statement that answers the following question: How many app users belong to label ID of "48"? [/INST] | SELECT COUNT(app_id) FROM app_labels WHERE label_id = 48; |
[INST] Here is a database schema:
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many category names start with the word "game"? [/INST] | SELECT COUNT(label_id) FROM label_categories WHERE category LIKE 'game%'; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL statement that answers the following question: Provide the number of events participated by the device users at coordinates of (80,37). [/I... | SELECT COUNT(event_id) FROM events WHERE longitude = 80 AND latitude = 37; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: List down ... | SELECT T1.label_id, T2.category FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T1.app_id = 5758400314709850000; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: List down ... | SELECT T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'game-Rowing'; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: What are t... | SELECT T1.label_id, T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'Chinese Classical Mythology'; |
[INST] Here is a database schema:
app_events :
event_id [ INTEGER ] app_events.event_id = events.event_id
app_id [ INTEGER ]
is_installed [ bool ]
is_active [ bool ]
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL stateme... | SELECT COUNT(T1.app_id), T2.longitude, T2.latitude FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE T1.event_id = 79641 GROUP BY T2.longitude, T2.latitude; |
[INST] Here is a database schema:
app_events :
event_id [ INTEGER ] app_events.event_id = events.event_id
app_id [ INTEGER ]
is_installed [ bool ]
is_active [ bool ]
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL stateme... | SELECT T1.longitude, T1.latitude, T1.timestamp FROM events AS T1 INNER JOIN app_events AS T2 ON T1.event_id = T2.event_id WHERE T2.app_id = 8715964299802120000; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT SUM(IIF(T1.gender = 'M', 1, 0)) / SUM(IIF(T1.gender = 'F', 1, 0)) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo' AND T2.device_model = 'X5Pro'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT T2.phone_brand, T2.device_model FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age < 10; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT SUM(IIF(T1.gender = 'F' AND T1.age > 80, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'HTC'; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that answers the following question:... | SELECT T2.phone_brand, T2.device_model FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.event_id = 6701; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
Please w... | SELECT T.age, T.gender FROM ( SELECT T2.age, T2.gender, COUNT(T1.device_id) AS num FROM events AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T1.device_id BETWEEN -9215352913819630000 AND -9222956879900150000 GROUP BY T2.age, T2.gender ) AS T ORDER BY T.num DESC LIMIT 1; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL statement that answers the following question: List out the time of the event id 12. [/INST] | SELECT timestamp FROM events WHERE event_id = 12; |
[INST] Here is a database schema:
app_events :
event_id [ INTEGER ] app_events.event_id = events.event_id
app_id [ INTEGER ]
is_installed [ bool ]
is_active [ bool ]
Please write me a SQL statement that answers the following question: How many active users are there in the event? [/INST] | SELECT COUNT(app_id) FROM app_events WHERE is_active = 1; |
[INST] Here is a database schema:
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that answers the following question: How many devices belong to model "A51"? [/INST] | SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE device_model = 'A51'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
Please write me a SQL statement that answers the following question: State the gender of users who use the device "-9222956879900150... | SELECT gender FROM gender_age WHERE device_id = -9222956879900150000; |
[INST] Here is a database schema:
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many labels belong to the game-card category? [/INST] | SELECT COUNT(label_id) FROM label_categories WHERE category = 'game-card'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 2' AND T1.age < 30; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT SUM(IIF(T1.age < 50, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'OPPO'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT SUM(T1.age) / COUNT(T1.device_id) AS avg FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'R7'; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is th... | SELECT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T2.app_id = 5902120154267990000; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: State the ... | SELECT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T2.app_id = 4955831798976240000; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' AND T2.device_model = 'MI 3'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Desire 820' AND T1.gender = 'M'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'ELIFE E7 Mini' AND T1.age > 20; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 50 AND T2.device_model = 'Galaxy Premier'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'M' AND T2.phone_brand = 'HTC'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 60 AND T2.phone_brand = 'TCL'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT SUM(IIF(T1.age > 20, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'SUGAR'; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL statement that answers the following question: Indicate the location of all the events that occurred on April 30, 2016. [/INST] | SELECT longitude, latitude FROM events WHERE date(timestamp) = '2016-04-30'; |
[INST] Here is a database schema:
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that answers the following question: How many different models does the HTC brand have? [/INST] | SELECT COUNT(device_model) FROM phone_brand_device_model2 WHERE phone_brand = 'HTC'; |
[INST] Here is a database schema:
app_events :
event_id [ INTEGER ] app_events.event_id = events.event_id
app_id [ INTEGER ]
is_installed [ bool ]
is_active [ bool ]
Please write me a SQL statement that answers the following question: Identify all installed and activated apps by their id. [/INST] | SELECT app_id FROM app_events WHERE is_active = 1 AND is_installed = 1; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
Please write me a SQL statement that answers the following question: How many apps are labeled 7? [/INST] | SELECT COUNT(app_id) FROM app_labels WHERE label_id = 7; |
[INST] Here is a database schema:
gender_age_train :
device_id [ INTEGER ] primary_key
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
Please write me a SQL statement that answers the following question: Identify by their id all the devices that are used by women who are in the age range of 29 to 31 years. [/INST] | SELECT device_id FROM gender_age_train WHERE age BETWEEN 29 AND 31 AND gender = 'F'; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: Identify b... | SELECT T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'game-stress reliever'; |
[INST] Here is a database schema:
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_relevant.device_id = gender_age.device_id
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_i... | SELECT T.timestamp FROM ( SELECT T2.timestamp, COUNT(T2.event_id) AS num FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'M' AND T1.age = 40 GROUP BY T2.timestamp ) AS T ORDER BY T.num DESC LIMIT 1; |
[INST] Here is a database schema:
app_events_relevant :
event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id
app_id [ INTEGER ] app_events_relevant.app_id = app_all.app_id
is_installed [ bool ]
is_active [ bool ]
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_rel... | SELECT T.phone_brand FROM ( SELECT T1.phone_brand, COUNT(T4.is_active) AS num FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id INNER JOIN events_relevant AS T3 ON T2.device_id = T3.device_id INNER JOIN app_events_relevant AS T4 ON T3.event_id = T4.event_id WHERE T4.is_acti... |
[INST] Here is a database schema:
app_events_relevant :
event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id
app_id [ INTEGER ] app_events_relevant.app_id = app_all.app_id
is_installed [ bool ]
is_active [ bool ]
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_rel... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T1.gender = 'M' AND T3.is_active = 0 AND T1.age < 23; |
[INST] Here is a database schema:
app_events_relevant :
event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id
app_id [ INTEGER ] app_events_relevant.app_id = app_all.app_id
is_installed [ bool ]
is_active [ bool ]
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_rel... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T1.age < 23 AND T1.gender = 'F' AND T3.is_active = 0 AND T3.is_installed = 1; |
[INST] Here is a database schema:
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_relevant.device_id = gender_age.device_id
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_i... | SELECT T.gender FROM ( SELECT T1.gender, COUNT(T1.device_id) AS num FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE date(T2.timestamp) BETWEEN '2016-05-01' AND '2016-05-10' GROUP BY T1.gender ) AS T ORDER BY T.num DESC LIMIT 1; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age > 50 AND T2.device_model != 'One M8 Eye' AND T2.phone_brand != 'HTC'; |
[INST] Here is a database schema:
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_relevant.device_id = gender_age.device_id
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_i... | SELECT T1.device_id FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' AND T1.age < 30; |
[INST] Here is a database schema:
app_events_relevant :
event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id
app_id [ INTEGER ] app_events_relevant.app_id = app_all.app_id
is_installed [ bool ]
is_active [ bool ]
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_rel... | SELECT SUM(IIF(T1.gender = 'F', 1, 0)) / SUM(IIF(T1.gender = 'M', 1, 0)) AS per FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T3.is_installed = 0; |
[INST] Here is a database schema:
app_events_relevant :
event_id [ INTEGER ] app_events_relevant.event_id = events_relevant.event_id
app_id [ INTEGER ] app_events_relevant.app_id = app_all.app_id
is_installed [ bool ]
is_active [ bool ]
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_rel... | SELECT AVG(T1.age) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T3.is_installed = 1 AND T3.is_active = 0; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL statement that answers the following question: Please list any three events that happened on the 1st of May 2016 that have the same latitud... | SELECT event_id FROM events WHERE timestamp LIKE '2016-05-01%' AND latitude = 31 LIMIT 3; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL statement that answers the following question: Please list any three events that have the longitude and latitude of 0. [/INST] | SELECT event_id FROM events WHERE longitude = 0 AND latitude = 0 LIMIT 3; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL statement that answers the following question: What is the difference between the events of device number -9222956879900150000 that can be ... | SELECT SUM(IIF(latitude != 0 AND longitude != 0, 1, 0)) - SUM(IIF(latitude = 0 AND longitude = 0, 1, 0)) AS diff FROM events WHERE device_id = '-922956879900150000'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
Please write me a SQL statement that answers the following question: Please list any three devices that are owned by female users. [... | SELECT device_id FROM gender_age WHERE gender = 'F' LIMIT 3; |
[INST] Here is a database schema:
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: Please list any five app categories that are related to games, along with their label ID. [/INST] | SELECT category, label_id FROM label_categories WHERE category LIKE '%game%' LIMIT 5; |
[INST] Here is a database schema:
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that answers the following question: Please list any three OPPO device models. [/INST] | SELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 3; |
[INST] Here is a database schema:
app_events :
event_id [ INTEGER ] app_events.event_id = events.event_id
app_id [ INTEGER ]
is_installed [ bool ]
is_active [ bool ]
Please write me a SQL statement that answers the following question: What is the percentage of users who experienced event number 6 who have the app inst... | SELECT SUM(IIF(is_installed = 1 AND is_active = 0, 1, 0)) / COUNT(app_id) AS perrcent FROM app_events WHERE event_id = 6; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT IIF(SUM(IIF(T1.gender = 'M', 1, 0)) - SUM(IIF(T1.gender = 'F', 1, 0)) > 0, 'M', 'F') AS gender FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 2'; |
[INST] Here is a database schema:
app_events :
event_id [ INTEGER ] app_events.event_id = events.event_id
app_id [ INTEGER ]
is_installed [ bool ]
is_active [ bool ]
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL stateme... | SELECT COUNT(T1.app_id) AS num FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE T1.event_id = 2 AND T1.is_active = 1 GROUP BY T2.timestamp; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: Which beha... | SELECT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T2.app_id = 5902120154267990000; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many u... | SELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'comics'; |
[INST] Here is a database schema:
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_relevant.device_id = gender_age.device_id
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_i... | SELECT T1.age, T1.gender FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T1.device_id = 29182687948017100 AND T2.event_id = 1; |
[INST] Here is a database schema:
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_relevant.device_id = gender_age.device_id
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_i... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T2.longitude = 114 AND T1.gender = 'M'; |
[INST] Here is a database schema:
app_events :
event_id [ INTEGER ] app_events.event_id = events.event_id
app_id [ INTEGER ]
is_installed [ bool ]
is_active [ bool ]
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_relevant.device_id = gender_age.device_id
timestamp [ DATETIME ]
longitude... | SELECT T1.timestamp FROM events_relevant AS T1 INNER JOIN app_events AS T2 ON T1.event_id = T2.event_id WHERE T2.app_id = -8022267440849930000 AND T1.event_id = 7; |
[INST] Here is a database schema:
app_all :
app_id [ INTEGER ] primary_key
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that a... | SELECT T3.category FROM app_all AS T1 INNER JOIN app_labels AS T2 ON T1.app_id = T2.app_id INNER JOIN label_categories AS T3 ON T2.label_id = T3.label_id WHERE T1.app_id = -9222198347540750000; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT T1.gender FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Desire 826' AND T2.phone_brand = 'HTC'; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: What is th... | SELECT SUM(IIF(T1.category = 'Academic Information', 1.0, 0)) / COUNT(T2.app_id) AS per FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id; |
[INST] Here is a database schema:
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that answers the following question: How many OPPO devices are there? [/INST] | SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO'; |
[INST] Here is a database schema:
events :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ]
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
Please write me a SQL statement that answers the following question: How many events does the device "4069764298338760000" have? [/INST] | SELECT COUNT(event_id) FROM events WHERE device_id = 4069764298338760000; |
[INST] Here is a database schema:
app_labels :
app_id [ INTEGER ] app_labels.app_id = app_all.app_id
label_id [ INTEGER ] app_labels.label_id = label_categories.label_id
label_categories :
label_id [ INTEGER ] primary_key
category [ TEXT ]
Please write me a SQL statement that answers the following question: How many o... | SELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T2.category = 'Equity Fund'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 3' AND T1.gender = 'M'; |
[INST] Here is a database schema:
events_relevant :
event_id [ INTEGER ] primary_key
device_id [ INTEGER ] events_relevant.device_id = gender_age.device_id
timestamp [ DATETIME ]
longitude [ REAL ]
latitude [ REAL ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please wri... | SELECT T1.phone_brand, T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T2.timestamp = '2016-05-07 06:03:22'; |
[INST] Here is a database schema:
gender_age :
device_id [ INTEGER ] primary_key gender_age.device_id = phone_brand_device_model2.device_id
gender [ TEXT ]
age [ INTEGER ]
group [ TEXT ]
phone_brand_device_model2 :
device_id [ INTEGER ]
phone_brand [ TEXT ]
device_model [ TEXT ]
Please write me a SQL statement that an... | SELECT T.phone_brand FROM ( SELECT T2.phone_brand, COUNT(T2.phone_brand) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 30 GROUP BY T2.phone_brand ) AS T ORDER BY T.num DESC LIMIT 1; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Keyword :
episode_id [ TEXT ] Keyword.episode_id = Ep... | SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Refuge: Part 1'; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Keyword :
episode_id [ TEXT ] Keyword.episode_id = Ep... | SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.season = 9 AND T1.episode = 23; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Keyword :
episode_id [ TEXT ] Keyword.episode_id = Ep... | SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = 'laundering money'; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Keyword :
episode_id [ TEXT ] Keyword.episode_id = Ep... | SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.rating > 8; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Vote :
episode_id [ TEXT ] Vote.episode_id = Episode.... | SELECT T2.votes FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished' AND T2.stars = 10; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Vote :
episode_id [ TEXT ] Vote.episode_id = Episode.... | SELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished'; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Vote :
episode_id [ TEXT ] Vote.episode_id = Episode.... | SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 ORDER BY T2.votes DESC LIMIT 1; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Person :
person_id [ TEXT ] primary_key
name [ TEXT ]... | SELECT T2.role FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Cherished' AND T3.name = 'Park Dietz' AND T2.credited = 'true'; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Credit :
episode_id [ TEXT ] Credit.episode_id = Epis... | SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished' AND T2.credited = 'false'; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Person :
person_id [ TEXT ] primary_key
name [ TEXT ]... | SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Cherished' AND T2.credited = 'true' AND T2.role = 'technical advisor'; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Person :
person_id [ TEXT ] primary_key
name [ TEXT ]... | SELECT COUNT(T3.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'true' AND T3.name = 'Park Dietz'; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Person :
person_id [ TEXT ] primary_key
name [ TEXT ]... | SELECT T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'true' AND T3.name = 'Park Dietz'; |
[INST] Here is a database schema:
Person :
person_id [ TEXT ] primary_key
name [ TEXT ]
birthdate [ DATE ]
birth_name [ TEXT ]
birth_place [ TEXT ]
birth_region [ TEXT ]
birth_country [ TEXT ]
height_meters [ REAL ]
nickname [ TEXT ]
Credit :
episode_id [ TEXT ] Credit.episode_id = Episode.episode_id
person_id [ TEXT ]... | SELECT T1.credited FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Anthony Azzara' AND T1.episode_id = 'tt0629204'; |
[INST] Here is a database schema:
Episode :
episode_id [ TEXT ] primary_key
series [ TEXT ]
season [ INTEGER ]
episode [ INTEGER ]
number_in_series [ INTEGER ]
title [ TEXT ]
summary [ TEXT ]
air_date [ DATE ]
episode_image [ TEXT ]
rating [ REAL ]
votes [ INTEGER ]
Keyword :
episode_id [ TEXT ] Keyword.episode_id = Ep... | SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Disciple'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.