db_id
stringclasses 31
values | schema
stringclasses 22
values | schemaComEx
stringclasses 22
values | question
stringlengths 18
181
| query
stringlengths 20
577
| answer
stringlengths 14
41.7k
⌀ | complexity
stringclasses 4
values | distinct
bool 2
classes | like
bool 2
classes | between
bool 2
classes | order_by
bool 2
classes | limit
bool 2
classes | grouby_by
bool 2
classes | having
bool 2
classes | single_join
bool 2
classes | multiple_join
bool 2
classes | multiple_select
bool 2
classes | intersect
bool 2
classes | except
bool 2
classes | union
bool 2
classes |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | Count the number of likes for each student id. | SELECT student_id , count(*) FROM Likes GROUP BY student_id | [{'student_id': 1025, 'count(*)': 1}, {'student_id': 1247, 'count(*)': 1}, {'student_id': 1316, 'count(*)': 1}, {'student_id': 1501, 'count(*)': 1}, {'student_id': 1641, 'count(*)': 1}, {'student_id': 1689, 'count(*)': 1}, {'student_id': 1709, 'count(*)': 1}, {'student_id': 1782, 'count(*)': 1}, {'student_id': 1911, 'count(*)': 1}, {'student_id': 1934, 'count(*)': 1}] | Easy | false | false | false | false | false | true | false | false | false | false | false | false | false |
network_1 |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
) |
CREATE TABLE "Friend" (
student_id INTEGER,
friend_id INTEGER,
PRIMARY KEY (student_id, friend_id),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(friend_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Friend table:
student_id friend_id
1510 1381
1510 1689
*/
CREATE TABLE "Highschooler" (
"ID" INTEGER,
name TEXT,
grade INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from Highschooler table:
ID name grade
1510 Jordan 9
1689 Gabriel 9
*/
CREATE TABLE "Likes" (
student_id INTEGER,
liked_id INTEGER,
PRIMARY KEY (student_id, liked_id),
FOREIGN KEY(liked_id) REFERENCES "Highschooler" ("ID"),
FOREIGN KEY(student_id) REFERENCES "Highschooler" ("ID")
)
/*
2 rows from Likes table:
student_id liked_id
1689 1709
1709 1689
*/ | How many likes correspond to each student id? | SELECT student_id , count(*) FROM Likes GROUP BY student_id | [{'student_id': 1025, 'count(*)': 1}, {'student_id': 1247, 'count(*)': 1}, {'student_id': 1316, 'count(*)': 1}, {'student_id': 1501, 'count(*)': 1}, {'student_id': 1641, 'count(*)': 1}, {'student_id': 1689, 'count(*)': 1}, {'student_id': 1709, 'count(*)': 1}, {'student_id': 1782, 'count(*)': 1}, {'student_id': 1911, 'count(*)': 1}, {'student_id': 1934, 'count(*)': 1}] | Easy | false | false | false | false | false | true | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | List the emails of the professionals who live in the state of Hawaii or the state of Wisconsin. | SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin' | [{'email_address': 'uboehm@example.org'}, {'email_address': 'mekhi.little@example.org'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What are the emails of the professionals living in either the state of Hawaii or the state of Wisconsin? | SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin' | [{'email_address': 'uboehm@example.org'}, {'email_address': 'mekhi.little@example.org'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What are the arriving date and the departing date of all the dogs? | SELECT date_arrived , date_departed FROM Dogs | [{'date_arrived': '2017-09-08 20:10:13', 'date_departed': '2018-03-25 06:58:44'}, {'date_arrived': '2017-12-22 05:02:02', 'date_departed': '2018-03-25 02:11:32'}, {'date_arrived': '2017-06-25 10:14:05', 'date_departed': '2018-03-25 10:25:46'}, {'date_arrived': '2017-04-20 00:58:55', 'date_departed': '2018-03-24 19:12:22'}, {'date_arrived': '2017-10-25 00:55:34', 'date_departed': '2018-03-25 04:50:22'}, {'date_arrived': '2017-04-15 09:25:31', 'date_departed': '2018-03-25 13:07:04'}, {'date_arrived': '2017-05-06 08:03:52', 'date_departed': '2018-03-25 06:29:10'}, {'date_arrived': '2017-10-16 20:06:21', 'date_departed': '2018-03-25 02:47:40'}, {'date_arrived': '2018-01-17 11:44:16', 'date_departed': '2018-03-25 06:46:07'}, {'date_arrived': '2017-12-29 06:08:26', 'date_departed': '2018-03-25 04:42:14'}, {'date_arrived': '2017-07-25 15:19:07', 'date_departed': '2018-03-25 15:05:16'}, {'date_arrived': '2017-10-24 04:45:13', 'date_departed': '2018-03-25 14:15:41'}, {'date_arrived': '2018-01-02 03:15:29', 'date_departed': '2018-03-25 05:07:47'}, {'date_arrived': '2017-06-18 19:45:38', 'date_departed': '2018-03-24 23:48:59'}, {'date_arrived': '2017-12-29 23:24:13', 'date_departed': '2018-03-24 19:36:59'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | List the arrival date and the departure date for all the dogs. | SELECT date_arrived , date_departed FROM Dogs | [{'date_arrived': '2017-09-08 20:10:13', 'date_departed': '2018-03-25 06:58:44'}, {'date_arrived': '2017-12-22 05:02:02', 'date_departed': '2018-03-25 02:11:32'}, {'date_arrived': '2017-06-25 10:14:05', 'date_departed': '2018-03-25 10:25:46'}, {'date_arrived': '2017-04-20 00:58:55', 'date_departed': '2018-03-24 19:12:22'}, {'date_arrived': '2017-10-25 00:55:34', 'date_departed': '2018-03-25 04:50:22'}, {'date_arrived': '2017-04-15 09:25:31', 'date_departed': '2018-03-25 13:07:04'}, {'date_arrived': '2017-05-06 08:03:52', 'date_departed': '2018-03-25 06:29:10'}, {'date_arrived': '2017-10-16 20:06:21', 'date_departed': '2018-03-25 02:47:40'}, {'date_arrived': '2018-01-17 11:44:16', 'date_departed': '2018-03-25 06:46:07'}, {'date_arrived': '2017-12-29 06:08:26', 'date_departed': '2018-03-25 04:42:14'}, {'date_arrived': '2017-07-25 15:19:07', 'date_departed': '2018-03-25 15:05:16'}, {'date_arrived': '2017-10-24 04:45:13', 'date_departed': '2018-03-25 14:15:41'}, {'date_arrived': '2018-01-02 03:15:29', 'date_departed': '2018-03-25 05:07:47'}, {'date_arrived': '2017-06-18 19:45:38', 'date_departed': '2018-03-24 23:48:59'}, {'date_arrived': '2017-12-29 23:24:13', 'date_departed': '2018-03-24 19:36:59'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | How many dogs went through any treatments? | SELECT count(DISTINCT dog_id) FROM Treatments | [{'count(DISTINCT dog_id)': 9}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Count the number of dogs that went through a treatment. | SELECT count(DISTINCT dog_id) FROM Treatments | [{'count(DISTINCT dog_id)': 9}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | How many professionals have performed any treatment to dogs? | SELECT count(DISTINCT professional_id) FROM Treatments | [{'count(DISTINCT professional_id)': 8}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Find the number of professionals who have ever treated dogs. | SELECT count(DISTINCT professional_id) FROM Treatments | [{'count(DISTINCT professional_id)': 8}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Which professionals live in a city containing the substring 'West'? List his or her role, street, city and state. | SELECT role_code , street , city , state FROM professionals WHERE city LIKE '%West%' | [{'role_code': 'Employee', 'street': '6915 Oberbrunner Point Suite 491\nGleasonville, LA ', 'city': 'West Heidi', 'state': 'Indiana'}] | Easy | false | true | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Find the role, street, city and state of the professionals living in a city that contains the substring 'West'. | SELECT role_code , street , city , state FROM professionals WHERE city LIKE '%West%' | [{'role_code': 'Employee', 'street': '6915 Oberbrunner Point Suite 491\nGleasonville, LA ', 'city': 'West Heidi', 'state': 'Indiana'}] | Easy | false | true | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Which owners live in the state whose name contains the substring 'North'? List his first name, last name and email. | SELECT first_name , last_name , email_address FROM Owners WHERE state LIKE '%North%' | [{'first_name': 'Johann', 'last_name': 'Fisher', 'email_address': 'zboncak.madonna@example.net'}, {'first_name': 'Cindy', 'last_name': 'Schmitt', 'email_address': 'wpfeffer@example.net'}] | Easy | false | true | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Return the first name, last name and email of the owners living in a state whose name contains the substring 'North'. | SELECT first_name , last_name , email_address FROM Owners WHERE state LIKE '%North%' | [{'first_name': 'Johann', 'last_name': 'Fisher', 'email_address': 'zboncak.madonna@example.net'}, {'first_name': 'Cindy', 'last_name': 'Schmitt', 'email_address': 'wpfeffer@example.net'}] | Easy | false | true | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | How much does the most recent treatment cost? | SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1 | [{'cost_of_treatment': 407}] | Easy | false | false | false | true | true | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Show me the cost of the most recently performed treatment. | SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1 | [{'cost_of_treatment': 407}] | Easy | false | false | false | true | true | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | List the dog name, age and weight of the dogs who have been abandoned? 1 stands for yes, and 0 stands for no. | SELECT name , age , weight FROM Dogs WHERE abandoned_yn = 1 | [{'name': 'Kacey', 'age': '6', 'weight': '7.57'}, {'name': 'Lyric', 'age': '4', 'weight': '4.36'}, {'name': 'Evangeline', 'age': '1', 'weight': '4.01'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What are the dog name, age and weight of the dogs that were abandoned? Note that 1 stands for yes, and 0 stands for no in the tables. | SELECT name , age , weight FROM Dogs WHERE abandoned_yn = 1 | [{'name': 'Kacey', 'age': '6', 'weight': '7.57'}, {'name': 'Lyric', 'age': '4', 'weight': '4.36'}, {'name': 'Evangeline', 'age': '1', 'weight': '4.01'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What is the average age of all the dogs? | SELECT avg(age) FROM Dogs | [{'avg(age)': 5.066666666666666}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Compute the average age of all the dogs. | SELECT avg(age) FROM Dogs | [{'avg(age)': 5.066666666666666}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What is the age of the oldest dog? | SELECT max(age) FROM Dogs | [{'max(age)': '9'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Tell me the age of the oldest dog. | SELECT max(age) FROM Dogs | [{'max(age)': '9'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | How much does each charge type costs? List both charge type and amount. | SELECT charge_type , charge_amount FROM Charges | [{'charge_type': 'Daily Accommodation', 'charge_amount': 98}, {'charge_type': 'Drugs', 'charge_amount': 322}, {'charge_type': 'Health Check', 'charge_amount': 640}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | List each charge type and its amount. | SELECT charge_type , charge_amount FROM Charges | [{'charge_type': 'Daily Accommodation', 'charge_amount': 98}, {'charge_type': 'Drugs', 'charge_amount': 322}, {'charge_type': 'Health Check', 'charge_amount': 640}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | How much does the most expensive charge type costs? | SELECT max(charge_amount) FROM Charges | [{'max(charge_amount)': 640}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What is the charge amount of the most expensive charge type? | SELECT max(charge_amount) FROM Charges | [{'max(charge_amount)': 640}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | List the email, cell phone and home phone of all the professionals. | SELECT email_address , cell_number , home_phone FROM professionals | [{'email_address': 'deanna.schuster@example.com', 'cell_number': '(275)939-2435x80863', 'home_phone': '+71(6)2898266914'}, {'email_address': 'lucile.shanahan@example.org', 'cell_number': '889-940-2676', 'home_phone': '+02(1)0259033559'}, {'email_address': 'uboehm@example.org', 'cell_number': '(369)908-7311x065', 'home_phone': '325-155-0801x7005'}, {'email_address': 'lourdes.lowe@example.net', 'cell_number': '00230569697', 'home_phone': '312.216.3352'}, {'email_address': 'mekhi.little@example.org', 'cell_number': '011.193.9081x3186', 'home_phone': '1-609-566-2752x25197'}, {'email_address': 'jacynthe.mclaughlin@example.net', 'cell_number': '139-321-7313', 'home_phone': '+43(5)1132733868'}, {'email_address': 'lambert62@example.org', 'cell_number': '499-434-0215x1628', 'home_phone': '022.529.0550x1319'}, {'email_address': 'goyette.roosevelt@example.net', 'cell_number': '328.842.3792', 'home_phone': '891.475.2256'}, {'email_address': 'schneider.kathryne@example.org', 'cell_number': '962-983-8109x3509', 'home_phone': '320-508-6023'}, {'email_address': 'jerrod.bahringer@example.org', 'cell_number': '461-801-2600', 'home_phone': '(230)338-3342x585'}, {'email_address': 'west.eula@example.net', 'cell_number': '609-405-2990', 'home_phone': '(920)304-4499x59146'}, {'email_address': 'marquardt.furman@example.org', 'cell_number': '1-181-670-9466', 'home_phone': '246-951-0080x76716'}, {'email_address': 'delphine29@example.com', 'cell_number': '880-659-7577x736', 'home_phone': '346.594.3739'}, {'email_address': 'cole.margarita@example.org', 'cell_number': '1-185-137-1945x409', 'home_phone': '971.048.3763x9404'}, {'email_address': 'jeichmann@example.com', 'cell_number': '1-258-285-4707x8020', 'home_phone': '1-138-287-3775'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What are the email, cell phone and home phone of each professional? | SELECT email_address , cell_number , home_phone FROM professionals | [{'email_address': 'deanna.schuster@example.com', 'cell_number': '(275)939-2435x80863', 'home_phone': '+71(6)2898266914'}, {'email_address': 'lucile.shanahan@example.org', 'cell_number': '889-940-2676', 'home_phone': '+02(1)0259033559'}, {'email_address': 'uboehm@example.org', 'cell_number': '(369)908-7311x065', 'home_phone': '325-155-0801x7005'}, {'email_address': 'lourdes.lowe@example.net', 'cell_number': '00230569697', 'home_phone': '312.216.3352'}, {'email_address': 'mekhi.little@example.org', 'cell_number': '011.193.9081x3186', 'home_phone': '1-609-566-2752x25197'}, {'email_address': 'jacynthe.mclaughlin@example.net', 'cell_number': '139-321-7313', 'home_phone': '+43(5)1132733868'}, {'email_address': 'lambert62@example.org', 'cell_number': '499-434-0215x1628', 'home_phone': '022.529.0550x1319'}, {'email_address': 'goyette.roosevelt@example.net', 'cell_number': '328.842.3792', 'home_phone': '891.475.2256'}, {'email_address': 'schneider.kathryne@example.org', 'cell_number': '962-983-8109x3509', 'home_phone': '320-508-6023'}, {'email_address': 'jerrod.bahringer@example.org', 'cell_number': '461-801-2600', 'home_phone': '(230)338-3342x585'}, {'email_address': 'west.eula@example.net', 'cell_number': '609-405-2990', 'home_phone': '(920)304-4499x59146'}, {'email_address': 'marquardt.furman@example.org', 'cell_number': '1-181-670-9466', 'home_phone': '246-951-0080x76716'}, {'email_address': 'delphine29@example.com', 'cell_number': '880-659-7577x736', 'home_phone': '346.594.3739'}, {'email_address': 'cole.margarita@example.org', 'cell_number': '1-185-137-1945x409', 'home_phone': '971.048.3763x9404'}, {'email_address': 'jeichmann@example.com', 'cell_number': '1-258-285-4707x8020', 'home_phone': '1-138-287-3775'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | What are all the possible breed type and size type combinations? | SELECT DISTINCT breed_code , size_code FROM dogs | [{'breed_code': 'ESK', 'size_code': 'LGE'}, {'breed_code': 'BUL', 'size_code': 'LGE'}, {'breed_code': 'BUL', 'size_code': 'MED'}, {'breed_code': 'HUS', 'size_code': 'MED'}, {'breed_code': 'ESK', 'size_code': 'SML'}, {'breed_code': 'HUS', 'size_code': 'SML'}, {'breed_code': 'ESK', 'size_code': 'MED'}] | Easy | true | false | false | false | false | false | false | false | false | false | false | false | false |
dog_kennels |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
) |
CREATE TABLE "Breeds" (
breed_code VARCHAR(10),
breed_name VARCHAR(80),
PRIMARY KEY (breed_code)
)
/*
2 rows from Breeds table:
breed_code breed_name
ESK Eskimo
HUS Husky
*/
CREATE TABLE "Charges" (
charge_id INTEGER,
charge_type VARCHAR(10),
charge_amount DECIMAL(19, 4),
PRIMARY KEY (charge_id)
)
/*
2 rows from Charges table:
charge_id charge_type charge_amount
1 Daily Accommodation 98.0000
2 Drugs 322.0000
*/
CREATE TABLE "Dogs" (
dog_id INTEGER,
owner_id INTEGER NOT NULL,
abandoned_yn VARCHAR(1),
breed_code VARCHAR(10) NOT NULL,
size_code VARCHAR(10) NOT NULL,
name VARCHAR(50),
age VARCHAR(20),
date_of_birth DATETIME,
gender VARCHAR(1),
weight VARCHAR(20),
date_arrived DATETIME,
date_adopted DATETIME,
date_departed DATETIME,
PRIMARY KEY (dog_id),
FOREIGN KEY(owner_id) REFERENCES "Owners" (owner_id),
FOREIGN KEY(size_code) REFERENCES "Sizes" (size_code),
FOREIGN KEY(breed_code) REFERENCES "Breeds" (breed_code)
)
/*
2 rows from Dogs table:
dog_id owner_id abandoned_yn breed_code size_code name age date_of_birth gender weight date_arrived date_adopted date_departed
1 3 1 ESK LGE Kacey 6 2012-01-27 05:11:53 1 7.57 2017-09-08 20:10:13 2018-03-06 16:32:11 2018-03-25 06:58:44
2 11 0 BUL LGE Hipolito 9 2013-02-13 05:15:21 0 1.72 2017-12-22 05:02:02 2018-03-25 08:12:51 2018-03-25 02:11:32
*/
CREATE TABLE "Owners" (
owner_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (owner_id)
)
/*
2 rows from Owners table:
owner_id first_name last_name street city state zip_code email_address home_phone cell_number
1 Nora Haley 0647 Hintz Village Apt. 024 Lake Tia Wisconsin 93165 lynn81@example.org 1-682-845-0116x63235 478.978.0729
2 Melisa DuBuque 1204 Mae Highway Apt. 107 Port Reannamouth Virginia 45244 ykris@example.com (799)563-0260x454 (722)768-5439x484
*/
CREATE TABLE "Professionals" (
professional_id INTEGER,
role_code VARCHAR(10) NOT NULL,
first_name VARCHAR(50),
street VARCHAR(50),
city VARCHAR(50),
state VARCHAR(20),
zip_code VARCHAR(20),
last_name VARCHAR(50),
email_address VARCHAR(50),
home_phone VARCHAR(20),
cell_number VARCHAR(20),
PRIMARY KEY (professional_id)
)
/*
2 rows from Professionals table:
professional_id role_code first_name street city state zip_code last_name email_address home_phone cell_number
1 Employee Taryn 6915 Oberbrunner Point Suite 491
Gleasonville, LA West Heidi Indiana 06646 Braun deanna.schuster@example.com +71(6)2898266914 (275)939-2435x80863
2 Employee Jayson 88665 Terence Lodge Apt. 904
Corneliusfort, NC 194 North Odellfurt Connecticut 43129 Ullrich lucile.shanahan@example.org +02(1)0259033559 889-940-2676
*/
CREATE TABLE "Sizes" (
size_code VARCHAR(10),
size_description VARCHAR(80),
PRIMARY KEY (size_code)
)
/*
2 rows from Sizes table:
size_code size_description
SML Small
MED Medium
*/
CREATE TABLE "Treatment_Types" (
treatment_type_code VARCHAR(10),
treatment_type_description VARCHAR(80),
PRIMARY KEY (treatment_type_code)
)
/*
2 rows from Treatment_Types table:
treatment_type_code treatment_type_description
EXAM Physical examination
VAC Vaccination
*/
CREATE TABLE "Treatments" (
treatment_id INTEGER,
dog_id INTEGER NOT NULL,
professional_id INTEGER NOT NULL,
treatment_type_code VARCHAR(10) NOT NULL,
date_of_treatment DATETIME,
cost_of_treatment DECIMAL(19, 4),
PRIMARY KEY (treatment_id),
FOREIGN KEY(dog_id) REFERENCES "Dogs" (dog_id),
FOREIGN KEY(professional_id) REFERENCES "Professionals" (professional_id),
FOREIGN KEY(treatment_type_code) REFERENCES "Treatment_Types" (treatment_type_code)
)
/*
2 rows from Treatments table:
treatment_id dog_id professional_id treatment_type_code date_of_treatment cost_of_treatment
1 14 9 WALK 2018-03-19 04:39:54 567.0000
2 4 10 VAC 2018-03-15 20:25:34 147.0000
*/ | Find the distinct breed type and size type combinations for dogs. | SELECT DISTINCT breed_code , size_code FROM dogs | [{'breed_code': 'ESK', 'size_code': 'LGE'}, {'breed_code': 'BUL', 'size_code': 'LGE'}, {'breed_code': 'BUL', 'size_code': 'MED'}, {'breed_code': 'HUS', 'size_code': 'MED'}, {'breed_code': 'ESK', 'size_code': 'SML'}, {'breed_code': 'HUS', 'size_code': 'SML'}, {'breed_code': 'ESK', 'size_code': 'MED'}] | Easy | true | false | false | false | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | How many singers are there? | SELECT count(*) FROM singer | [{'count(*)': 8}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What is the count of singers? | SELECT count(*) FROM singer | [{'count(*)': 8}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | List the name of singers in ascending order of net worth. | SELECT Name FROM singer ORDER BY Net_Worth_Millions ASC | [{'Name': 'Abigail Johnson'}, {'Name': 'Susanne Klatten'}, {'Name': 'Gina Rinehart'}, {'Name': 'Iris Fontbona'}, {'Name': 'Jacqueline Mars'}, {'Name': 'Alice Walton'}, {'Name': 'Christy Walton'}, {'Name': 'Liliane Bettencourt'}] | Easy | false | false | false | true | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What are the names of singers ordered by ascending net worth? | SELECT Name FROM singer ORDER BY Net_Worth_Millions ASC | [{'Name': 'Abigail Johnson'}, {'Name': 'Susanne Klatten'}, {'Name': 'Gina Rinehart'}, {'Name': 'Iris Fontbona'}, {'Name': 'Jacqueline Mars'}, {'Name': 'Alice Walton'}, {'Name': 'Christy Walton'}, {'Name': 'Liliane Bettencourt'}] | Easy | false | false | false | true | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What are the birth year and citizenship of singers? | SELECT Birth_Year , Citizenship FROM singer | [{'Birth_Year': 1944.0, 'Citizenship': 'France'}, {'Birth_Year': 1948.0, 'Citizenship': 'United States'}, {'Birth_Year': 1949.0, 'Citizenship': 'United States'}, {'Birth_Year': 1942.0, 'Citizenship': 'Chile'}, {'Birth_Year': 1940.0, 'Citizenship': 'United States'}, {'Birth_Year': 1953.0, 'Citizenship': 'Australia'}, {'Birth_Year': 1962.0, 'Citizenship': 'Germany'}, {'Birth_Year': 1961.0, 'Citizenship': 'United States'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What are the birth years and citizenships of the singers? | SELECT Birth_Year , Citizenship FROM singer | [{'Birth_Year': 1944.0, 'Citizenship': 'France'}, {'Birth_Year': 1948.0, 'Citizenship': 'United States'}, {'Birth_Year': 1949.0, 'Citizenship': 'United States'}, {'Birth_Year': 1942.0, 'Citizenship': 'Chile'}, {'Birth_Year': 1940.0, 'Citizenship': 'United States'}, {'Birth_Year': 1953.0, 'Citizenship': 'Australia'}, {'Birth_Year': 1962.0, 'Citizenship': 'Germany'}, {'Birth_Year': 1961.0, 'Citizenship': 'United States'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | List the name of singers whose citizenship is not "France". | SELECT Name FROM singer WHERE Citizenship != "France" | [{'Name': 'Christy Walton'}, {'Name': 'Alice Walton'}, {'Name': 'Iris Fontbona'}, {'Name': 'Jacqueline Mars'}, {'Name': 'Gina Rinehart'}, {'Name': 'Susanne Klatten'}, {'Name': 'Abigail Johnson'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What are the names of the singers who are not French citizens? | SELECT Name FROM singer WHERE Citizenship != "France" | [{'Name': 'Christy Walton'}, {'Name': 'Alice Walton'}, {'Name': 'Iris Fontbona'}, {'Name': 'Jacqueline Mars'}, {'Name': 'Gina Rinehart'}, {'Name': 'Susanne Klatten'}, {'Name': 'Abigail Johnson'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | Show the name of singers whose birth year is either 1948 or 1949? | SELECT Name FROM singer WHERE Birth_Year = 1948 OR Birth_Year = 1949 | [{'Name': 'Christy Walton'}, {'Name': 'Alice Walton'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What are the names of the singers whose birth years are either 1948 or 1949? | SELECT Name FROM singer WHERE Birth_Year = 1948 OR Birth_Year = 1949 | [{'Name': 'Christy Walton'}, {'Name': 'Alice Walton'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What is the name of the singer with the largest net worth? | SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC LIMIT 1 | [{'Name': 'Liliane Bettencourt'}] | Easy | false | false | false | true | true | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What is the name of the singer who is worth the most? | SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC LIMIT 1 | [{'Name': 'Liliane Bettencourt'}] | Easy | false | false | false | true | true | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | Show different citizenship of singers and the number of singers of each citizenship. | SELECT Citizenship , COUNT(*) FROM singer GROUP BY Citizenship | [{'Citizenship': 'Australia', 'COUNT(*)': 1}, {'Citizenship': 'Chile', 'COUNT(*)': 1}, {'Citizenship': 'France', 'COUNT(*)': 1}, {'Citizenship': 'Germany', 'COUNT(*)': 1}, {'Citizenship': 'United States', 'COUNT(*)': 4}] | Easy | false | false | false | false | false | true | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | For each citizenship, how many singers are from that country? | SELECT Citizenship , COUNT(*) FROM singer GROUP BY Citizenship | [{'Citizenship': 'Australia', 'COUNT(*)': 1}, {'Citizenship': 'Chile', 'COUNT(*)': 1}, {'Citizenship': 'France', 'COUNT(*)': 1}, {'Citizenship': 'Germany', 'COUNT(*)': 1}, {'Citizenship': 'United States', 'COUNT(*)': 4}] | Easy | false | false | false | false | false | true | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | Please show the most common citizenship of singers. | SELECT Citizenship FROM singer GROUP BY Citizenship ORDER BY COUNT(*) DESC LIMIT 1 | [{'Citizenship': 'United States'}] | Easy | false | false | false | true | true | true | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What is the most common singer citizenship ? | SELECT citizenship FROM singer GROUP BY citizenship ORDER BY count(*) DESC LIMIT 1 | [{'Citizenship': 'United States'}] | Easy | false | false | false | true | true | true | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | Show different citizenships and the maximum net worth of singers of each citizenship. | SELECT Citizenship , max(Net_Worth_Millions) FROM singer GROUP BY Citizenship | [{'Citizenship': 'Australia', 'max(Net_Worth_Millions)': 17.0}, {'Citizenship': 'Chile', 'max(Net_Worth_Millions)': 17.4}, {'Citizenship': 'France', 'max(Net_Worth_Millions)': 30.0}, {'Citizenship': 'Germany', 'max(Net_Worth_Millions)': 14.3}, {'Citizenship': 'United States', 'max(Net_Worth_Millions)': 28.8}] | Easy | false | false | false | false | false | true | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | For each citizenship, what is the maximum net worth? | SELECT Citizenship , max(Net_Worth_Millions) FROM singer GROUP BY Citizenship | [{'Citizenship': 'Australia', 'max(Net_Worth_Millions)': 17.0}, {'Citizenship': 'Chile', 'max(Net_Worth_Millions)': 17.4}, {'Citizenship': 'France', 'max(Net_Worth_Millions)': 30.0}, {'Citizenship': 'Germany', 'max(Net_Worth_Millions)': 14.3}, {'Citizenship': 'United States', 'max(Net_Worth_Millions)': 28.8}] | Easy | false | false | false | false | false | true | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | List the name of singers that do not have any song. | SELECT Name FROM singer WHERE Singer_ID NOT IN (SELECT Singer_ID FROM song) | [{'Name': 'Alice Walton'}, {'Name': 'Abigail Johnson'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
singer |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
) |
CREATE TABLE singer (
"Singer_ID" INTEGER,
"Name" TEXT,
"Birth_Year" REAL,
"Net_Worth_Millions" REAL,
"Citizenship" TEXT,
PRIMARY KEY ("Singer_ID")
)
/*
2 rows from singer table:
Singer_ID Name Birth_Year Net_Worth_Millions Citizenship
1 Liliane Bettencourt 1944.0 30.0 France
2 Christy Walton 1948.0 28.8 United States
*/
CREATE TABLE song (
"Song_ID" INTEGER,
"Title" TEXT,
"Singer_ID" INTEGER,
"Sales" REAL,
"Highest_Position" REAL,
PRIMARY KEY ("Song_ID"),
FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID")
)
/*
2 rows from song table:
Song_ID Title Singer_ID Sales Highest_Position
1 Do They Know It's Christmas 1 1094000.0 1.0
2 F**k It (I Don't Want You Back) 1 552407.0 1.0
*/ | What is the sname of every sing that does not have any song? | SELECT Name FROM singer WHERE Singer_ID NOT IN (SELECT Singer_ID FROM song) | [{'Name': 'Alice Walton'}, {'Name': 'Abigail Johnson'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
real_estate_properties |
CREATE TABLE "Other_Available_Features" (
feature_id INTEGER,
feature_type_code VARCHAR(20) NOT NULL,
feature_name VARCHAR(80),
feature_description VARCHAR(80),
PRIMARY KEY (feature_id),
FOREIGN KEY(feature_type_code) REFERENCES "Ref_Feature_Types" (feature_type_code)
)
CREATE TABLE "Other_Property_Features" (
property_id INTEGER NOT NULL,
feature_id INTEGER NOT NULL,
property_feature_description VARCHAR(80),
FOREIGN KEY(property_id) REFERENCES "Properties" (property_id),
FOREIGN KEY(feature_id) REFERENCES "Other_Available_Features" (feature_id)
)
CREATE TABLE "Properties" (
property_id INTEGER,
property_type_code VARCHAR(20) NOT NULL,
date_on_market DATETIME,
date_sold DATETIME,
property_name VARCHAR(80),
property_address VARCHAR(255),
room_count INTEGER,
vendor_requested_price DECIMAL(19, 4),
buyer_offered_price DECIMAL(19, 4),
agreed_selling_price DECIMAL(19, 4),
apt_feature_1 VARCHAR(255),
apt_feature_2 VARCHAR(255),
apt_feature_3 VARCHAR(255),
fld_feature_1 VARCHAR(255),
fld_feature_2 VARCHAR(255),
fld_feature_3 VARCHAR(255),
hse_feature_1 VARCHAR(255),
hse_feature_2 VARCHAR(255),
hse_feature_3 VARCHAR(255),
oth_feature_1 VARCHAR(255),
oth_feature_2 VARCHAR(255),
oth_feature_3 VARCHAR(255),
shp_feature_1 VARCHAR(255),
shp_feature_2 VARCHAR(255),
shp_feature_3 VARCHAR(255),
other_property_details VARCHAR(255),
PRIMARY KEY (property_id),
FOREIGN KEY(property_type_code) REFERENCES "Ref_Property_Types" (property_type_code)
)
CREATE TABLE "Ref_Feature_Types" (
feature_type_code VARCHAR(20),
feature_type_name VARCHAR(80),
PRIMARY KEY (feature_type_code)
)
CREATE TABLE "Ref_Property_Types" (
property_type_code VARCHAR(20),
property_type_description VARCHAR(80),
PRIMARY KEY (property_type_code)
) |
CREATE TABLE "Other_Available_Features" (
feature_id INTEGER,
feature_type_code VARCHAR(20) NOT NULL,
feature_name VARCHAR(80),
feature_description VARCHAR(80),
PRIMARY KEY (feature_id),
FOREIGN KEY(feature_type_code) REFERENCES "Ref_Feature_Types" (feature_type_code)
)
/*
2 rows from Other_Available_Features table:
feature_id feature_type_code feature_name feature_description
2 Amenity AirCon Air Conditioning.
3 Amenity Pool Swimming Pool.
*/
CREATE TABLE "Other_Property_Features" (
property_id INTEGER NOT NULL,
feature_id INTEGER NOT NULL,
property_feature_description VARCHAR(80),
FOREIGN KEY(property_id) REFERENCES "Properties" (property_id),
FOREIGN KEY(feature_id) REFERENCES "Other_Available_Features" (feature_id)
)
/*
2 rows from Other_Property_Features table:
property_id feature_id property_feature_description
15 3 dolorem
12 4 earum
*/
CREATE TABLE "Properties" (
property_id INTEGER,
property_type_code VARCHAR(20) NOT NULL,
date_on_market DATETIME,
date_sold DATETIME,
property_name VARCHAR(80),
property_address VARCHAR(255),
room_count INTEGER,
vendor_requested_price DECIMAL(19, 4),
buyer_offered_price DECIMAL(19, 4),
agreed_selling_price DECIMAL(19, 4),
apt_feature_1 VARCHAR(255),
apt_feature_2 VARCHAR(255),
apt_feature_3 VARCHAR(255),
fld_feature_1 VARCHAR(255),
fld_feature_2 VARCHAR(255),
fld_feature_3 VARCHAR(255),
hse_feature_1 VARCHAR(255),
hse_feature_2 VARCHAR(255),
hse_feature_3 VARCHAR(255),
oth_feature_1 VARCHAR(255),
oth_feature_2 VARCHAR(255),
oth_feature_3 VARCHAR(255),
shp_feature_1 VARCHAR(255),
shp_feature_2 VARCHAR(255),
shp_feature_3 VARCHAR(255),
other_property_details VARCHAR(255),
PRIMARY KEY (property_id),
FOREIGN KEY(property_type_code) REFERENCES "Ref_Property_Types" (property_type_code)
)
/*
2 rows from Properties table:
property_id property_type_code date_on_market date_sold property_name property_address room_count vendor_requested_price buyer_offered_price agreed_selling_price apt_feature_1 apt_feature_2 apt_feature_3 fld_feature_1 fld_feature_2 fld_feature_3 hse_feature_1 hse_feature_2 hse_feature_3 oth_feature_1 oth_feature_2 oth_feature_3 shp_feature_1 shp_feature_2 shp_feature_3 other_property_details
1 House 1991-06-21 23:52:10 1979-05-13 16:58:06 park 4745 Emerson Stravenue Suite 829
South Garret, IN 16772-5682 7 372652.2909 1.6800 4201.8000 aut suscipit None None None None None None None None None None None None None None
2 House 1990-05-25 23:01:51 1990-11-14 19:16:38 the cole 098 Tremaine Highway Suite 569
South Wilford, NJ 46587-3537 1 661536468.4429 8.7122 21769471.8328 est est None None None None None None None None None None None None None None
*/
CREATE TABLE "Ref_Feature_Types" (
feature_type_code VARCHAR(20),
feature_type_name VARCHAR(80),
PRIMARY KEY (feature_type_code)
)
/*
2 rows from Ref_Feature_Types table:
feature_type_code feature_type_name
Amenity Amenity, eg Pool.
Security Securiyt, eg Burglar Alarm.
*/
CREATE TABLE "Ref_Property_Types" (
property_type_code VARCHAR(20),
property_type_description VARCHAR(80),
PRIMARY KEY (property_type_code)
)
/*
2 rows from Ref_Property_Types table:
property_type_code property_type_description
House House, Bungalow, etc.
Apartment Apartment, Flat, Condo, etc.
*/ | How many available features are there in total? | SELECT count(*) FROM Other_Available_Features | [{'count(*)': 3}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Find the abbreviation and country of the airline that has fewest number of flights? | SELECT T1.Abbreviation , T1.Country FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY count(*) LIMIT 1 | [{'Abbreviation': 'AirTran', 'Country': 'USA'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What is the abbreviation of the airilne has the fewest flights and what country is it in? | SELECT T1.Abbreviation , T1.Country FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY count(*) LIMIT 1 | [{'Abbreviation': 'AirTran', 'Country': 'USA'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What are airlines that have some flight departing from airport 'AHD'? | SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "AHD" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Which airlines have a flight with source airport AHD? | SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.SourceAirport = "AHD" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What are airlines that have flights arriving at airport 'AHD'? | SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.DestAirport = "AHD" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Which airlines have a flight with destination airport AHD? | SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.DestAirport = "AHD" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Find all airlines that have at least 10 flights. | SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) > 10 | [{'Airline': 'AirTran Airways'}, {'Airline': 'Allegiant Air'}, {'Airline': 'American Airlines'}, {'Airline': 'Continental Airlines'}, {'Airline': 'Delta Airlines'}, {'Airline': 'Frontier Airlines'}, {'Airline': 'JetBlue Airways'}, {'Airline': 'Northwest Airlines'}, {'Airline': 'Southwest Airlines'}, {'Airline': 'US Airways'}, {'Airline': 'United Airlines'}, {'Airline': 'Virgin America'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Which airlines have at least 10 flights? | SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) > 10 | [{'Airline': 'AirTran Airways'}, {'Airline': 'Allegiant Air'}, {'Airline': 'American Airlines'}, {'Airline': 'Continental Airlines'}, {'Airline': 'Delta Airlines'}, {'Airline': 'Frontier Airlines'}, {'Airline': 'JetBlue Airways'}, {'Airline': 'Northwest Airlines'}, {'Airline': 'Southwest Airlines'}, {'Airline': 'US Airways'}, {'Airline': 'United Airlines'}, {'Airline': 'Virgin America'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Find all airlines that have fewer than 200 flights. | SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) < 200 | [{'Airline': 'AirTran Airways'}, {'Airline': 'Allegiant Air'}, {'Airline': 'American Airlines'}, {'Airline': 'Continental Airlines'}, {'Airline': 'Delta Airlines'}, {'Airline': 'Frontier Airlines'}, {'Airline': 'JetBlue Airways'}, {'Airline': 'Northwest Airlines'}, {'Airline': 'Southwest Airlines'}, {'Airline': 'US Airways'}, {'Airline': 'United Airlines'}, {'Airline': 'Virgin America'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Which airlines have less than 200 flights? | SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) < 200 | [{'Airline': 'AirTran Airways'}, {'Airline': 'Allegiant Air'}, {'Airline': 'American Airlines'}, {'Airline': 'Continental Airlines'}, {'Airline': 'Delta Airlines'}, {'Airline': 'Frontier Airlines'}, {'Airline': 'JetBlue Airways'}, {'Airline': 'Northwest Airlines'}, {'Airline': 'Southwest Airlines'}, {'Airline': 'US Airways'}, {'Airline': 'United Airlines'}, {'Airline': 'Virgin America'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What are flight numbers of Airline "United Airlines"? | SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T2.uid = T1.Airline WHERE T2.Airline = "United Airlines" | [{'FlightNo': 28}, {'FlightNo': 29}, {'FlightNo': 44}, {'FlightNo': 45}, {'FlightNo': 54}, {'FlightNo': 55}, {'FlightNo': 90}, {'FlightNo': 91}, {'FlightNo': 108}, {'FlightNo': 109}, {'FlightNo': 142}, {'FlightNo': 143}, {'FlightNo': 148}, {'FlightNo': 149}, {'FlightNo': 198}, {'FlightNo': 199}, {'FlightNo': 226}, {'FlightNo': 227}, {'FlightNo': 276}, {'FlightNo': 277}, {'FlightNo': 308}, {'FlightNo': 309}, {'FlightNo': 326}, {'FlightNo': 327}, {'FlightNo': 370}, {'FlightNo': 371}, {'FlightNo': 414}, {'FlightNo': 415}, {'FlightNo': 424}, {'FlightNo': 425}, {'FlightNo': 470}, {'FlightNo': 471}, {'FlightNo': 520}, {'FlightNo': 521}, {'FlightNo': 556}, {'FlightNo': 557}, {'FlightNo': 560}, {'FlightNo': 561}, {'FlightNo': 604}, {'FlightNo': 605}, {'FlightNo': 608}, {'FlightNo': 609}, {'FlightNo': 626}, {'FlightNo': 627}, {'FlightNo': 658}, {'FlightNo': 659}, {'FlightNo': 708}, {'FlightNo': 709}, {'FlightNo': 744}, {'FlightNo': 745}, {'FlightNo': 754}, {'FlightNo': 755}, {'FlightNo': 786}, {'FlightNo': 787}, {'FlightNo': 810}, {'FlightNo': 811}, {'FlightNo': 828}, {'FlightNo': 829}, {'FlightNo': 878}, {'FlightNo': 879}, {'FlightNo': 888}, {'FlightNo': 889}, {'FlightNo': 900}, {'FlightNo': 901}, {'FlightNo': 924}, {'FlightNo': 925}, {'FlightNo': 946}, {'FlightNo': 947}, {'FlightNo': 996}, {'FlightNo': 997}, {'FlightNo': 1000}, {'FlightNo': 1001}, {'FlightNo': 1026}, {'FlightNo': 1027}, {'FlightNo': 1062}, {'FlightNo': 1063}, {'FlightNo': 1068}, {'FlightNo': 1069}, {'FlightNo': 1100}, {'FlightNo': 1101}, {'FlightNo': 1144}, {'FlightNo': 1145}, {'FlightNo': 1166}, {'FlightNo': 1167}, {'FlightNo': 1168}, {'FlightNo': 1169}, {'FlightNo': 1192}, {'FlightNo': 1193}, {'FlightNo': 1208}, {'FlightNo': 1209}, {'FlightNo': 1216}, {'FlightNo': 1217}, {'FlightNo': 1250}, {'FlightNo': 1251}, {'FlightNo': 1274}, {'FlightNo': 1275}, {'FlightNo': 1284}, {'FlightNo': 1285}, {'FlightNo': 1328}, {'FlightNo': 1329}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Which flight numbers correspond to United Airlines flights? | SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T2.uid = T1.Airline WHERE T2.Airline = "United Airlines" | [{'FlightNo': 28}, {'FlightNo': 29}, {'FlightNo': 44}, {'FlightNo': 45}, {'FlightNo': 54}, {'FlightNo': 55}, {'FlightNo': 90}, {'FlightNo': 91}, {'FlightNo': 108}, {'FlightNo': 109}, {'FlightNo': 142}, {'FlightNo': 143}, {'FlightNo': 148}, {'FlightNo': 149}, {'FlightNo': 198}, {'FlightNo': 199}, {'FlightNo': 226}, {'FlightNo': 227}, {'FlightNo': 276}, {'FlightNo': 277}, {'FlightNo': 308}, {'FlightNo': 309}, {'FlightNo': 326}, {'FlightNo': 327}, {'FlightNo': 370}, {'FlightNo': 371}, {'FlightNo': 414}, {'FlightNo': 415}, {'FlightNo': 424}, {'FlightNo': 425}, {'FlightNo': 470}, {'FlightNo': 471}, {'FlightNo': 520}, {'FlightNo': 521}, {'FlightNo': 556}, {'FlightNo': 557}, {'FlightNo': 560}, {'FlightNo': 561}, {'FlightNo': 604}, {'FlightNo': 605}, {'FlightNo': 608}, {'FlightNo': 609}, {'FlightNo': 626}, {'FlightNo': 627}, {'FlightNo': 658}, {'FlightNo': 659}, {'FlightNo': 708}, {'FlightNo': 709}, {'FlightNo': 744}, {'FlightNo': 745}, {'FlightNo': 754}, {'FlightNo': 755}, {'FlightNo': 786}, {'FlightNo': 787}, {'FlightNo': 810}, {'FlightNo': 811}, {'FlightNo': 828}, {'FlightNo': 829}, {'FlightNo': 878}, {'FlightNo': 879}, {'FlightNo': 888}, {'FlightNo': 889}, {'FlightNo': 900}, {'FlightNo': 901}, {'FlightNo': 924}, {'FlightNo': 925}, {'FlightNo': 946}, {'FlightNo': 947}, {'FlightNo': 996}, {'FlightNo': 997}, {'FlightNo': 1000}, {'FlightNo': 1001}, {'FlightNo': 1026}, {'FlightNo': 1027}, {'FlightNo': 1062}, {'FlightNo': 1063}, {'FlightNo': 1068}, {'FlightNo': 1069}, {'FlightNo': 1100}, {'FlightNo': 1101}, {'FlightNo': 1144}, {'FlightNo': 1145}, {'FlightNo': 1166}, {'FlightNo': 1167}, {'FlightNo': 1168}, {'FlightNo': 1169}, {'FlightNo': 1192}, {'FlightNo': 1193}, {'FlightNo': 1208}, {'FlightNo': 1209}, {'FlightNo': 1216}, {'FlightNo': 1217}, {'FlightNo': 1250}, {'FlightNo': 1251}, {'FlightNo': 1274}, {'FlightNo': 1275}, {'FlightNo': 1284}, {'FlightNo': 1285}, {'FlightNo': 1328}, {'FlightNo': 1329}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What are flight numbers of flights departing from City "Aberdeen "? | SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = "Aberdeen" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Give the flight numbers of flights leaving from Aberdeen. | SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport = T2.AirportCode WHERE T2.City = "Aberdeen" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What are flight numbers of flights arriving at City "Aberdeen"? | SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = "Aberdeen" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Give the flight numbers of flights arriving in Aberdeen. | SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = "Aberdeen" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Find the number of flights landing in the city of Aberdeen or Abilene. | SELECT count(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = "Aberdeen" OR T2.city = "Abilene" | [{'count(*)': 0}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | How many flights land in Aberdeen or Abilene? | SELECT count(*) FROM Flights AS T1 JOIN Airports AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.city = "Aberdeen" OR T2.city = "Abilene" | [{'count(*)': 0}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | find the name of employee who was awarded the most times in the evaluation. | SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID GROUP BY t2.Employee_ID ORDER BY count(*) DESC LIMIT 1 | [{'Name': 'George Chuter'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Which employee received the most awards in evaluations? Give me the employee name. | SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID GROUP BY t2.Employee_ID ORDER BY count(*) DESC LIMIT 1 | [{'Name': 'George Chuter'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Find the name of the employee who got the highest one time bonus. | SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID ORDER BY t2.bonus DESC LIMIT 1 | [{'Name': 'Louis Deacon'}] | Medium | false | false | false | true | true | false | false | true | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Which employee received the biggest bonus? Give me the employee name. | SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID = t2.Employee_ID ORDER BY t2.bonus DESC LIMIT 1 | [{'Name': 'Louis Deacon'}] | Medium | false | false | false | true | true | false | false | true | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | What is the name of the shop that is hiring the largest number of employees? | SELECT t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t1.shop_id ORDER BY count(*) DESC LIMIT 1 | [{'Name': 'FC Haka'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Which shop has the most employees? Give me the shop name. | SELECT t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t1.shop_id ORDER BY count(*) DESC LIMIT 1 | [{'Name': 'FC Haka'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Find the number of employees hired in each shop; show the shop name as well. | SELECT count(*) , t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t2.name | [{'count(*)': 2, 'Name': 'FC Haka'}, {'count(*)': 1, 'Name': 'FC Inter'}, {'count(*)': 1, 'Name': 'FC KooTeePee'}, {'count(*)': 1, 'Name': 'FC Lahti'}, {'count(*)': 1, 'Name': 'FF Jaro'}, {'count(*)': 1, 'Name': 'HJK'}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | For each shop, return the number of employees working there and the name of the shop. | SELECT count(*) , t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t2.name | [{'count(*)': 2, 'Name': 'FC Haka'}, {'count(*)': 1, 'Name': 'FC Inter'}, {'count(*)': 1, 'Name': 'FC KooTeePee'}, {'count(*)': 1, 'Name': 'FC Lahti'}, {'count(*)': 1, 'Name': 'FF Jaro'}, {'count(*)': 1, 'Name': 'HJK'}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | How many documents are using the template with type code 'PPT'? | SELECT count(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT' | [{'count(*)': 3}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Count the number of documents that use the PPT template type. | SELECT count(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID = T2.Template_ID WHERE T2.Template_Type_Code = 'PPT' | [{'count(*)': 3}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | What is the id and type code for the template used by the most documents? | SELECT T1.template_id , T2.Template_Type_Code FROM Documents AS T1 JOIN Templates AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_id ORDER BY count(*) DESC LIMIT 1 | [{'Template_ID': 25, 'Template_Type_Code': 'PP'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Return the id and type code of the template that is used for the greatest number of documents. | SELECT T1.template_id , T2.Template_Type_Code FROM Documents AS T1 JOIN Templates AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_id ORDER BY count(*) DESC LIMIT 1 | [{'Template_ID': 25, 'Template_Type_Code': 'PP'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | What is the template type code of the template used by document with the name "Data base"? | SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T2.document_name = "Data base" | [{'Template_Type_Code': 'BK'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Return the template type code of the template that is used by a document named Data base. | SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T2.document_name = "Data base" | [{'Template_Type_Code': 'BK'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Show all document names using templates with template type code BK. | SELECT T2.document_name FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T1.template_type_code = "BK" | [{'Document_Name': 'Robbin CV'}, {'Document_Name': 'Data base'}, {'Document_Name': 'How to read a book'}, {'Document_Name': 'Palm reading'}, {'Document_Name': 'About Korea'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | What are the names of documents that use templates with the code BK? | SELECT T2.document_name FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id WHERE T1.template_type_code = "BK" | [{'Document_Name': 'Robbin CV'}, {'Document_Name': 'Data base'}, {'Document_Name': 'How to read a book'}, {'Document_Name': 'Palm reading'}, {'Document_Name': 'About Korea'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Show all template type codes and the number of documents using each type. | SELECT T1.template_type_code , count(*) FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code | [{'Template_Type_Code': 'AD', 'count(*)': 3}, {'Template_Type_Code': 'BK', 'count(*)': 5}, {'Template_Type_Code': 'PP', 'count(*)': 4}, {'Template_Type_Code': 'PPT', 'count(*)': 3}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | What are the different template type codes, and how many documents use each type? | SELECT T1.template_type_code , count(*) FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code | [{'Template_Type_Code': 'AD', 'count(*)': 3}, {'Template_Type_Code': 'BK', 'count(*)': 5}, {'Template_Type_Code': 'PP', 'count(*)': 4}, {'Template_Type_Code': 'PPT', 'count(*)': 3}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Which template type code is used by most number of documents? | SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code ORDER BY count(*) DESC LIMIT 1 | [{'Template_Type_Code': 'BK'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Return the code of the template type that is most commonly used in documents. | SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_type_code ORDER BY count(*) DESC LIMIT 1 | [{'Template_Type_Code': 'BK'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | What are the template ids with template type description "Presentation". | SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code WHERE T1.template_type_description = "Presentation" | [{'Template_ID': 6}, {'Template_ID': 7}, {'Template_ID': 10}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Return the ids corresponding to templates with the description 'Presentation'. | SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code WHERE T1.template_type_description = "Presentation" | [{'Template_ID': 6}, {'Template_ID': 7}, {'Template_ID': 10}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | How many paragraphs for the document with name 'Summer Show'? | SELECT count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID = T2.document_ID WHERE T2.document_name = 'Summer Show' | [{'count(*)': 1}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Count the number of paragraphs in the document named 'Summer Show'. | SELECT count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID = T2.document_ID WHERE T2.document_name = 'Summer Show' | [{'count(*)': 1}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Show all paragraph ids and texts for the document with name 'Welcome to NY'. | SELECT T1.paragraph_id , T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.Document_Name = 'Welcome to NY' | [{'Paragraph_ID': 16615, 'Paragraph_Text': 'Japan'}, {'Paragraph_ID': 608931827, 'Paragraph_Text': 'Micronesia'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | What are the ids and texts of paragraphs in the document titled 'Welcome to NY'? | SELECT T1.paragraph_id , T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.Document_Name = 'Welcome to NY' | [{'Paragraph_ID': 16615, 'Paragraph_Text': 'Japan'}, {'Paragraph_ID': 608931827, 'Paragraph_Text': 'Micronesia'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Show all paragraph texts for the document "Customer reviews". | SELECT T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = "Customer reviews" | [{'Paragraph_Text': 'Korea'}, {'Paragraph_Text': 'Ukraine'}, {'Paragraph_Text': 'Korea'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | What are the paragraph texts for the document with the name 'Customer reviews'? | SELECT T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = "Customer reviews" | [{'Paragraph_Text': 'Korea'}, {'Paragraph_Text': 'Ukraine'}, {'Paragraph_Text': 'Korea'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Show all document ids, names and the number of paragraphs in each document. | SELECT T1.document_id , T2.document_name , count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id | [{'Document_ID': 3, 'Document_Name': 'Summer Show', 'count(*)': 1}, {'Document_ID': 80, 'Document_Name': 'Welcome to NY', 'count(*)': 2}, {'Document_ID': 2394, 'Document_Name': 'Customer reviews', 'count(*)': 3}, {'Document_ID': 3830, 'Document_Name': 'Do not panic', 'count(*)': 1}, {'Document_ID': 33930, 'Document_Name': 'How Google people work', 'count(*)': 1}, {'Document_ID': 50123, 'Document_Name': 'Learning French', 'count(*)': 1}, {'Document_ID': 651512, 'Document_Name': 'How to write a CV', 'count(*)': 2}, {'Document_ID': 3540024, 'Document_Name': 'Palm reading', 'count(*)': 1}, {'Document_ID': 16514113, 'Document_Name': 'A history of Arts', 'count(*)': 2}, {'Document_ID': 385906526, 'Document_Name': 'About Korea', 'count(*)': 1}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | What are the ids and names of each document, as well as the number of paragraphs in each? | SELECT T1.document_id , T2.document_name , count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id | [{'Document_ID': 3, 'Document_Name': 'Summer Show', 'count(*)': 1}, {'Document_ID': 80, 'Document_Name': 'Welcome to NY', 'count(*)': 2}, {'Document_ID': 2394, 'Document_Name': 'Customer reviews', 'count(*)': 3}, {'Document_ID': 3830, 'Document_Name': 'Do not panic', 'count(*)': 1}, {'Document_ID': 33930, 'Document_Name': 'How Google people work', 'count(*)': 1}, {'Document_ID': 50123, 'Document_Name': 'Learning French', 'count(*)': 1}, {'Document_ID': 651512, 'Document_Name': 'How to write a CV', 'count(*)': 2}, {'Document_ID': 3540024, 'Document_Name': 'Palm reading', 'count(*)': 1}, {'Document_ID': 16514113, 'Document_Name': 'A history of Arts', 'count(*)': 2}, {'Document_ID': 385906526, 'Document_Name': 'About Korea', 'count(*)': 1}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | What is the document id and name with greatest number of paragraphs? | SELECT T1.document_id , T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id = T2.document_id GROUP BY T1.document_id ORDER BY count(*) DESC LIMIT 1 | [{'Document_ID': 2394, 'Document_Name': 'Customer reviews'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |