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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 name of the document with the most 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 |
course_teach |
CREATE TABLE course (
"Course_ID" INTEGER,
"Staring_Date" TEXT,
"Course" TEXT,
PRIMARY KEY ("Course_ID")
)
CREATE TABLE course_arrange (
"Course_ID" INTEGER,
"Teacher_ID" INTEGER,
"Grade" INTEGER,
PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"),
FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"),
FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID")
)
CREATE TABLE teacher (
"Teacher_ID" INTEGER,
"Name" TEXT,
"Age" TEXT,
"Hometown" TEXT,
PRIMARY KEY ("Teacher_ID")
) |
CREATE TABLE course (
"Course_ID" INTEGER,
"Staring_Date" TEXT,
"Course" TEXT,
PRIMARY KEY ("Course_ID")
)
/*
2 rows from course table:
Course_ID Staring_Date Course
1 5 May Language Arts
2 6 May Math
*/
CREATE TABLE course_arrange (
"Course_ID" INTEGER,
"Teacher_ID" INTEGER,
"Grade" INTEGER,
PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"),
FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"),
FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID")
)
/*
2 rows from course_arrange table:
Course_ID Teacher_ID Grade
2 5 1
2 3 3
*/
CREATE TABLE teacher (
"Teacher_ID" INTEGER,
"Name" TEXT,
"Age" TEXT,
"Hometown" TEXT,
PRIMARY KEY ("Teacher_ID")
)
/*
2 rows from teacher table:
Teacher_ID Name Age Hometown
1 Joseph Huts 32 Blackrod Urban District
2 Gustaaf Deloor 29 Bolton County Borough
*/ | Show names of teachers and the number of courses they teach. | SELECT T2.Name , COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name | [{'Name': 'Anne Walker', 'COUNT(*)': 2}, {'Name': 'Gustaaf Deloor', 'COUNT(*)': 1}, {'Name': 'Kearsley Brown', 'COUNT(*)': 1}, {'Name': 'Lucy Wong', 'COUNT(*)': 1}, {'Name': 'Vicente Carretero', 'COUNT(*)': 1}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
course_teach |
CREATE TABLE course (
"Course_ID" INTEGER,
"Staring_Date" TEXT,
"Course" TEXT,
PRIMARY KEY ("Course_ID")
)
CREATE TABLE course_arrange (
"Course_ID" INTEGER,
"Teacher_ID" INTEGER,
"Grade" INTEGER,
PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"),
FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"),
FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID")
)
CREATE TABLE teacher (
"Teacher_ID" INTEGER,
"Name" TEXT,
"Age" TEXT,
"Hometown" TEXT,
PRIMARY KEY ("Teacher_ID")
) |
CREATE TABLE course (
"Course_ID" INTEGER,
"Staring_Date" TEXT,
"Course" TEXT,
PRIMARY KEY ("Course_ID")
)
/*
2 rows from course table:
Course_ID Staring_Date Course
1 5 May Language Arts
2 6 May Math
*/
CREATE TABLE course_arrange (
"Course_ID" INTEGER,
"Teacher_ID" INTEGER,
"Grade" INTEGER,
PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"),
FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"),
FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID")
)
/*
2 rows from course_arrange table:
Course_ID Teacher_ID Grade
2 5 1
2 3 3
*/
CREATE TABLE teacher (
"Teacher_ID" INTEGER,
"Name" TEXT,
"Age" TEXT,
"Hometown" TEXT,
PRIMARY KEY ("Teacher_ID")
)
/*
2 rows from teacher table:
Teacher_ID Name Age Hometown
1 Joseph Huts 32 Blackrod Urban District
2 Gustaaf Deloor 29 Bolton County Borough
*/ | What are the names of the teachers and how many courses do they teach? | SELECT T2.Name , COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name | [{'Name': 'Anne Walker', 'COUNT(*)': 2}, {'Name': 'Gustaaf Deloor', 'COUNT(*)': 1}, {'Name': 'Kearsley Brown', 'COUNT(*)': 1}, {'Name': 'Lucy Wong', 'COUNT(*)': 1}, {'Name': 'Vicente Carretero', 'COUNT(*)': 1}] | Medium | false | false | false | false | false | true | false | true | false | false | false | false | false |
course_teach |
CREATE TABLE course (
"Course_ID" INTEGER,
"Staring_Date" TEXT,
"Course" TEXT,
PRIMARY KEY ("Course_ID")
)
CREATE TABLE course_arrange (
"Course_ID" INTEGER,
"Teacher_ID" INTEGER,
"Grade" INTEGER,
PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"),
FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"),
FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID")
)
CREATE TABLE teacher (
"Teacher_ID" INTEGER,
"Name" TEXT,
"Age" TEXT,
"Hometown" TEXT,
PRIMARY KEY ("Teacher_ID")
) |
CREATE TABLE course (
"Course_ID" INTEGER,
"Staring_Date" TEXT,
"Course" TEXT,
PRIMARY KEY ("Course_ID")
)
/*
2 rows from course table:
Course_ID Staring_Date Course
1 5 May Language Arts
2 6 May Math
*/
CREATE TABLE course_arrange (
"Course_ID" INTEGER,
"Teacher_ID" INTEGER,
"Grade" INTEGER,
PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"),
FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"),
FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID")
)
/*
2 rows from course_arrange table:
Course_ID Teacher_ID Grade
2 5 1
2 3 3
*/
CREATE TABLE teacher (
"Teacher_ID" INTEGER,
"Name" TEXT,
"Age" TEXT,
"Hometown" TEXT,
PRIMARY KEY ("Teacher_ID")
)
/*
2 rows from teacher table:
Teacher_ID Name Age Hometown
1 Joseph Huts 32 Blackrod Urban District
2 Gustaaf Deloor 29 Bolton County Borough
*/ | Show names of teachers that teach at least two courses. | SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*) >= 2 | [{'Name': 'Anne Walker'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
course_teach |
CREATE TABLE course (
"Course_ID" INTEGER,
"Staring_Date" TEXT,
"Course" TEXT,
PRIMARY KEY ("Course_ID")
)
CREATE TABLE course_arrange (
"Course_ID" INTEGER,
"Teacher_ID" INTEGER,
"Grade" INTEGER,
PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"),
FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"),
FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID")
)
CREATE TABLE teacher (
"Teacher_ID" INTEGER,
"Name" TEXT,
"Age" TEXT,
"Hometown" TEXT,
PRIMARY KEY ("Teacher_ID")
) |
CREATE TABLE course (
"Course_ID" INTEGER,
"Staring_Date" TEXT,
"Course" TEXT,
PRIMARY KEY ("Course_ID")
)
/*
2 rows from course table:
Course_ID Staring_Date Course
1 5 May Language Arts
2 6 May Math
*/
CREATE TABLE course_arrange (
"Course_ID" INTEGER,
"Teacher_ID" INTEGER,
"Grade" INTEGER,
PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"),
FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"),
FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID")
)
/*
2 rows from course_arrange table:
Course_ID Teacher_ID Grade
2 5 1
2 3 3
*/
CREATE TABLE teacher (
"Teacher_ID" INTEGER,
"Name" TEXT,
"Age" TEXT,
"Hometown" TEXT,
PRIMARY KEY ("Teacher_ID")
)
/*
2 rows from teacher table:
Teacher_ID Name Age Hometown
1 Joseph Huts 32 Blackrod Urban District
2 Gustaaf Deloor 29 Bolton County Borough
*/ | What are the names of the teachers who teach at least two courses? | SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID = T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*) >= 2 | [{'Name': 'Anne Walker'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
museum_visit |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
) |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
/*
2 rows from museum table:
Museum_ID Name Num_of_Staff Open_Year
1 Plaza Museum 62 2000
2 Capital Plaza Museum 25 2012
*/
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
/*
2 rows from visit table:
Museum_ID visitor_ID Num_of_Ticket Total_spent
1 5 20 320.14
2 5 4 89.98
*/
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from visitor table:
ID Name Level_of_membership Age
1 Gonzalo Higuaín 8 35
2 Guti Midfielder 5 28
*/ | find the id, name and age for visitors who visited some museums more than once. | SELECT t1.id , t1.name , t1.age FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id GROUP BY t1.id HAVING count(*) > 1 | [{'ID': 3, 'Name': 'Arjen Robben', 'Age': 27}, {'ID': 5, 'Name': 'Fernando Gago', 'Age': 36}, {'ID': 6, 'Name': 'Rafael van der Vaart', 'Age': 25}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
museum_visit |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
) |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
/*
2 rows from museum table:
Museum_ID Name Num_of_Staff Open_Year
1 Plaza Museum 62 2000
2 Capital Plaza Museum 25 2012
*/
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
/*
2 rows from visit table:
Museum_ID visitor_ID Num_of_Ticket Total_spent
1 5 20 320.14
2 5 4 89.98
*/
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from visitor table:
ID Name Level_of_membership Age
1 Gonzalo Higuaín 8 35
2 Guti Midfielder 5 28
*/ | What are the id, name and membership level of visitors who have spent the largest amount of money in total in all museum tickets? | SELECT t2.visitor_id , t1.name , t1.Level_of_membership FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id GROUP BY t2.visitor_id ORDER BY sum(t2.Total_spent) DESC LIMIT 1 | [{'visitor_ID': '3', 'Name': 'Arjen Robben', 'Level_of_membership': 1}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
museum_visit |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
) |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
/*
2 rows from museum table:
Museum_ID Name Num_of_Staff Open_Year
1 Plaza Museum 62 2000
2 Capital Plaza Museum 25 2012
*/
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
/*
2 rows from visit table:
Museum_ID visitor_ID Num_of_Ticket Total_spent
1 5 20 320.14
2 5 4 89.98
*/
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from visitor table:
ID Name Level_of_membership Age
1 Gonzalo Higuaín 8 35
2 Guti Midfielder 5 28
*/ | What are the id and name of the museum visited most times? | SELECT t2.Museum_ID , t1.name FROM museum AS t1 JOIN visit AS t2 ON t1.Museum_ID = t2.Museum_ID GROUP BY t2.Museum_ID ORDER BY count(*) DESC LIMIT 1 | [{'Museum_ID': 2, 'Name': 'Capital Plaza Museum'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
museum_visit |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
) |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
/*
2 rows from museum table:
Museum_ID Name Num_of_Staff Open_Year
1 Plaza Museum 62 2000
2 Capital Plaza Museum 25 2012
*/
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
/*
2 rows from visit table:
Museum_ID visitor_ID Num_of_Ticket Total_spent
1 5 20 320.14
2 5 4 89.98
*/
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from visitor table:
ID Name Level_of_membership Age
1 Gonzalo Higuaín 8 35
2 Guti Midfielder 5 28
*/ | Find the name and age of the visitor who bought the most tickets at once. | SELECT t1.name , t1.age FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id ORDER BY t2.num_of_ticket DESC LIMIT 1 | [{'Name': 'Arjen Robben', 'Age': 27}] | Medium | false | false | false | true | true | false | false | true | false | false | false | false | false |
museum_visit |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
) |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
/*
2 rows from museum table:
Museum_ID Name Num_of_Staff Open_Year
1 Plaza Museum 62 2000
2 Capital Plaza Museum 25 2012
*/
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
/*
2 rows from visit table:
Museum_ID visitor_ID Num_of_Ticket Total_spent
1 5 20 320.14
2 5 4 89.98
*/
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from visitor table:
ID Name Level_of_membership Age
1 Gonzalo Higuaín 8 35
2 Guti Midfielder 5 28
*/ | What is the total ticket expense of the visitors whose membership level is 1? | SELECT sum(t2.Total_spent) FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id WHERE t1.Level_of_membership = 1 | [{'sum(t2.Total_spent)': 570.84}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
museum_visit |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
) |
CREATE TABLE museum (
"Museum_ID" INTEGER,
"Name" TEXT,
"Num_of_Staff" INTEGER,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
)
/*
2 rows from museum table:
Museum_ID Name Num_of_Staff Open_Year
1 Plaza Museum 62 2000
2 Capital Plaza Museum 25 2012
*/
CREATE TABLE visit (
"Museum_ID" INTEGER,
"visitor_ID" TEXT,
"Num_of_Ticket" INTEGER,
"Total_spent" REAL,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY("visitor_ID") REFERENCES visitor ("ID"),
FOREIGN KEY("Museum_ID") REFERENCES museum ("Museum_ID")
)
/*
2 rows from visit table:
Museum_ID visitor_ID Num_of_Ticket Total_spent
1 5 20 320.14
2 5 4 89.98
*/
CREATE TABLE visitor (
"ID" INTEGER,
"Name" TEXT,
"Level_of_membership" INTEGER,
"Age" INTEGER,
PRIMARY KEY ("ID")
)
/*
2 rows from visitor table:
ID Name Level_of_membership Age
1 Gonzalo Higuaín 8 35
2 Guti Midfielder 5 28
*/ | Find the number of visitors who did not visit any museum opened after 2010. | SELECT count(*) FROM visitor WHERE id NOT IN (SELECT t2.visitor_id FROM museum AS t1 JOIN visit AS t2 ON t1.Museum_ID = t2.Museum_ID WHERE t1.open_year > 2010) | [{'count(*)': 3}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
battle_death |
CREATE TABLE battle (
id INTEGER,
name TEXT,
date TEXT,
bulgarian_commander TEXT,
latin_commander TEXT,
result TEXT,
PRIMARY KEY (id)
)
CREATE TABLE death (
caused_by_ship_id INTEGER,
id INTEGER,
note TEXT,
killed INTEGER,
injured INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(caused_by_ship_id) REFERENCES ship (id)
)
CREATE TABLE ship (
lost_in_battle INTEGER,
id INTEGER,
name TEXT,
tonnage TEXT,
ship_type TEXT,
location TEXT,
disposition_of_ship TEXT,
PRIMARY KEY (id),
FOREIGN KEY(lost_in_battle) REFERENCES battle (id)
) |
CREATE TABLE battle (
id INTEGER,
name TEXT,
date TEXT,
bulgarian_commander TEXT,
latin_commander TEXT,
result TEXT,
PRIMARY KEY (id)
)
/*
2 rows from battle table:
id name date bulgarian_commander latin_commander result
1 Battle of Adrianople 14 April 1205 Kaloyan Baldwin I Bulgarian victory
2 Battle of Serres June 1205 Kaloyan Unknown Bulgarian victory
*/
CREATE TABLE death (
caused_by_ship_id INTEGER,
id INTEGER,
note TEXT,
killed INTEGER,
injured INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(caused_by_ship_id) REFERENCES ship (id)
)
/*
2 rows from death table:
caused_by_ship_id id note killed injured
1 1 Dantewada, Chhattisgarh 8 0
2 2 Dantewada, Chhattisgarh 3 0
*/
CREATE TABLE ship (
lost_in_battle INTEGER,
id INTEGER,
name TEXT,
tonnage TEXT,
ship_type TEXT,
location TEXT,
disposition_of_ship TEXT,
PRIMARY KEY (id),
FOREIGN KEY(lost_in_battle) REFERENCES battle (id)
)
/*
2 rows from ship table:
lost_in_battle id name tonnage ship_type location disposition_of_ship
8 1 Lettice t Brig English Channel Captured
7 2 Bon Accord t Brig English Channel Captured
*/ | What are the death and injury situations caused by the ship with tonnage 't'? | SELECT T1.killed , T1.injured FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id = T2.id WHERE T2.tonnage = 't' | [{'killed': 8, 'injured': 0}, {'killed': 3, 'injured': 0}, {'killed': 25, 'injured': 0}, {'killed': 2, 'injured': 0}, {'killed': 0, 'injured': 0}, {'killed': 4, 'injured': 5}, {'killed': 0, 'injured': 0}, {'killed': 29, 'injured': 0}, {'killed': 0, 'injured': 0}, {'killed': 0, 'injured': 0}, {'killed': 14, 'injured': 0}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
battle_death |
CREATE TABLE battle (
id INTEGER,
name TEXT,
date TEXT,
bulgarian_commander TEXT,
latin_commander TEXT,
result TEXT,
PRIMARY KEY (id)
)
CREATE TABLE death (
caused_by_ship_id INTEGER,
id INTEGER,
note TEXT,
killed INTEGER,
injured INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(caused_by_ship_id) REFERENCES ship (id)
)
CREATE TABLE ship (
lost_in_battle INTEGER,
id INTEGER,
name TEXT,
tonnage TEXT,
ship_type TEXT,
location TEXT,
disposition_of_ship TEXT,
PRIMARY KEY (id),
FOREIGN KEY(lost_in_battle) REFERENCES battle (id)
) |
CREATE TABLE battle (
id INTEGER,
name TEXT,
date TEXT,
bulgarian_commander TEXT,
latin_commander TEXT,
result TEXT,
PRIMARY KEY (id)
)
/*
2 rows from battle table:
id name date bulgarian_commander latin_commander result
1 Battle of Adrianople 14 April 1205 Kaloyan Baldwin I Bulgarian victory
2 Battle of Serres June 1205 Kaloyan Unknown Bulgarian victory
*/
CREATE TABLE death (
caused_by_ship_id INTEGER,
id INTEGER,
note TEXT,
killed INTEGER,
injured INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(caused_by_ship_id) REFERENCES ship (id)
)
/*
2 rows from death table:
caused_by_ship_id id note killed injured
1 1 Dantewada, Chhattisgarh 8 0
2 2 Dantewada, Chhattisgarh 3 0
*/
CREATE TABLE ship (
lost_in_battle INTEGER,
id INTEGER,
name TEXT,
tonnage TEXT,
ship_type TEXT,
location TEXT,
disposition_of_ship TEXT,
PRIMARY KEY (id),
FOREIGN KEY(lost_in_battle) REFERENCES battle (id)
)
/*
2 rows from ship table:
lost_in_battle id name tonnage ship_type location disposition_of_ship
8 1 Lettice t Brig English Channel Captured
7 2 Bon Accord t Brig English Channel Captured
*/ | What are the different ids and names of the battles that lost any 'Brig' type shipes? | SELECT DISTINCT T1.id , T1.name FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.ship_type = 'Brig' | [{'id': 8, 'name': 'Siege of Constantinople'}, {'id': 7, 'name': 'Battle of Philippopolis'}, {'id': 6, 'name': 'Battle of Boruy'}, {'id': 5, 'name': 'Battle of Messinopolis'}, {'id': 4, 'name': 'Battle of Rodosto'}] | Medium | true | false | false | false | false | false | false | true | false | false | false | false | false |
battle_death |
CREATE TABLE battle (
id INTEGER,
name TEXT,
date TEXT,
bulgarian_commander TEXT,
latin_commander TEXT,
result TEXT,
PRIMARY KEY (id)
)
CREATE TABLE death (
caused_by_ship_id INTEGER,
id INTEGER,
note TEXT,
killed INTEGER,
injured INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(caused_by_ship_id) REFERENCES ship (id)
)
CREATE TABLE ship (
lost_in_battle INTEGER,
id INTEGER,
name TEXT,
tonnage TEXT,
ship_type TEXT,
location TEXT,
disposition_of_ship TEXT,
PRIMARY KEY (id),
FOREIGN KEY(lost_in_battle) REFERENCES battle (id)
) |
CREATE TABLE battle (
id INTEGER,
name TEXT,
date TEXT,
bulgarian_commander TEXT,
latin_commander TEXT,
result TEXT,
PRIMARY KEY (id)
)
/*
2 rows from battle table:
id name date bulgarian_commander latin_commander result
1 Battle of Adrianople 14 April 1205 Kaloyan Baldwin I Bulgarian victory
2 Battle of Serres June 1205 Kaloyan Unknown Bulgarian victory
*/
CREATE TABLE death (
caused_by_ship_id INTEGER,
id INTEGER,
note TEXT,
killed INTEGER,
injured INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(caused_by_ship_id) REFERENCES ship (id)
)
/*
2 rows from death table:
caused_by_ship_id id note killed injured
1 1 Dantewada, Chhattisgarh 8 0
2 2 Dantewada, Chhattisgarh 3 0
*/
CREATE TABLE ship (
lost_in_battle INTEGER,
id INTEGER,
name TEXT,
tonnage TEXT,
ship_type TEXT,
location TEXT,
disposition_of_ship TEXT,
PRIMARY KEY (id),
FOREIGN KEY(lost_in_battle) REFERENCES battle (id)
)
/*
2 rows from ship table:
lost_in_battle id name tonnage ship_type location disposition_of_ship
8 1 Lettice t Brig English Channel Captured
7 2 Bon Accord t Brig English Channel Captured
*/ | What is the ship id and name that caused most total injuries? | SELECT T2.id , T2.name FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id = T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1 | [{'id': 5, 'name': 'Three Brothers'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | Which department offers the most number of degrees? List department name and id. | SELECT T2.department_name , T1.department_id FROM Degree_Programs AS T1 JOIN Departments AS T2 ON T1.department_id = T2.department_id GROUP BY T1.department_id ORDER BY count(*) DESC LIMIT 1 | [{'department_name': 'statistics', 'department_id': 8}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What is the name and id of the department with the most number of degrees ? | SELECT t2.department_name , t1.department_id FROM degree_programs AS t1 JOIN departments AS t2 ON t1.department_id = t2.department_id GROUP BY t1.department_id ORDER BY count(*) DESC LIMIT 1 | [{'department_name': 'statistics', 'department_id': 8}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | How many degrees does the engineering department offer? | SELECT count(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id WHERE T1.department_name = 'engineer' | [{'count(*)': 0}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | How many degrees does the engineering department have? | SELECT count(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id WHERE T1.department_name = 'engineer' | [{'count(*)': 0}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What are the names and id of courses having at most 2 sections? | SELECT T1.course_name , T1.course_id FROM Courses AS T1 JOIN Sections AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id HAVING count(*) <= 2 | [{'course_name': 'ds', 'course_id': 1}, {'course_name': 'math', 'course_id': 2}, {'course_name': 'en', 'course_id': 4}, {'course_name': 'fr', 'course_id': 5}, {'course_name': 'la', 'course_id': 6}, {'course_name': 'cal', 'course_id': 7}, {'course_name': 'nlp', 'course_id': 8}, {'course_name': 'dl', 'course_id': 9}, {'course_name': 'ml', 'course_id': 10}, {'course_name': 'db', 'course_id': 12}, {'course_name': 'pl', 'course_id': 14}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What are the names and ids of every course with less than 2 sections? | SELECT T1.course_name , T1.course_id FROM Courses AS T1 JOIN Sections AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id HAVING count(*) <= 2 | [{'course_name': 'ds', 'course_id': 1}, {'course_name': 'math', 'course_id': 2}, {'course_name': 'en', 'course_id': 4}, {'course_name': 'fr', 'course_id': 5}, {'course_name': 'la', 'course_id': 6}, {'course_name': 'cal', 'course_id': 7}, {'course_name': 'nlp', 'course_id': 8}, {'course_name': 'dl', 'course_id': 9}, {'course_name': 'ml', 'course_id': 10}, {'course_name': 'db', 'course_id': 12}, {'course_name': 'pl', 'course_id': 14}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What is the semester which most student registered in? Show both the name and the id. | SELECT T1.semester_name , T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id = T2.semester_id GROUP BY T1.semester_id ORDER BY count(*) DESC LIMIT 1 | [{'semester_name': 'summer 2010', 'semester_id': 2}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | For each semester, what is the name and id of the one with the most students registered? | SELECT T1.semester_name , T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id = T2.semester_id GROUP BY T1.semester_id ORDER BY count(*) DESC LIMIT 1 | [{'semester_name': 'summer 2010', 'semester_id': 2}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | Who are enrolled in 2 degree programs in one semester? List the first name, middle name and last name and the id. | SELECT T1.first_name , T1.middle_name , T1.last_name , T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) = 2 | [{'first_name': 'Jarvis', 'middle_name': 'Aaliyah', 'last_name': 'Carroll', 'student_id': 4}, {'first_name': 'Reva', 'middle_name': 'Golda', 'last_name': 'Osinski', 'student_id': 9}, {'first_name': 'Jordy', 'middle_name': 'Osborne', 'last_name': 'Rempel', 'student_id': 14}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What are the first, middle, and last names, along with the ids, of all students who enrolled in 2 degree programs in one semester? | SELECT T1.first_name , T1.middle_name , T1.last_name , T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) = 2 | [{'first_name': 'Jarvis', 'middle_name': 'Aaliyah', 'last_name': 'Carroll', 'student_id': 4}, {'first_name': 'Reva', 'middle_name': 'Golda', 'last_name': 'Osinski', 'student_id': 9}, {'first_name': 'Jordy', 'middle_name': 'Osborne', 'last_name': 'Rempel', 'student_id': 14}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | Find the kind of program which most number of students are enrolled in? | SELECT T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_summary_name ORDER BY count(*) DESC LIMIT 1 | [{'degree_summary_name': 'Bachelor'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What is the degree summary name that has the most number of students enrolled? | SELECT T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_summary_name ORDER BY count(*) DESC LIMIT 1 | [{'degree_summary_name': 'Bachelor'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | Find the program which most number of students are enrolled in. List both the id and the summary. | SELECT T1.degree_program_id , T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_program_id ORDER BY count(*) DESC LIMIT 1 | [{'degree_program_id': 9, 'degree_summary_name': 'Bachelor'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What is the program id and the summary of the degree that has the most students enrolled? | SELECT T1.degree_program_id , T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_program_id ORDER BY count(*) DESC LIMIT 1 | [{'degree_program_id': 9, 'degree_summary_name': 'Bachelor'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | Which student has enrolled for the most times in any program? List the id, first name, middle name, last name, the number of enrollments and student id. | SELECT T1.student_id , T1.first_name , T1.middle_name , T1.last_name , count(*) , T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 | [{'student_id': 7, 'first_name': 'Frida', 'middle_name': 'Aisha', 'last_name': 'Huel', 'count(*)': 3}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What is the first, middle, and last name, along with the id and number of enrollments, for the student who enrolled the most in any program? | SELECT T1.student_id , T1.first_name , T1.middle_name , T1.last_name , count(*) , T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 | [{'student_id': 7, 'first_name': 'Frida', 'middle_name': 'Aisha', 'last_name': 'Huel', 'count(*)': 3}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What are all the course names of the courses which ever have students enrolled in? | SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id | [{'course_name': 'la'}, {'course_name': 'pl'}, {'course_name': 'ai'}, {'course_name': 'math'}, {'course_name': 'ml'}, {'course_name': 'os'}, {'course_name': 'en'}, {'course_name': 'nlp'}, {'course_name': 'rs'}, {'course_name': 'db'}] | Medium | true | false | false | false | false | false | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What are the names of all courses that have some students enrolled? | SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id | [{'course_name': 'la'}, {'course_name': 'pl'}, {'course_name': 'ai'}, {'course_name': 'math'}, {'course_name': 'ml'}, {'course_name': 'os'}, {'course_name': 'en'}, {'course_name': 'nlp'}, {'course_name': 'rs'}, {'course_name': 'db'}] | Medium | true | false | false | false | false | false | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What's the name of the course with most number of enrollments? | SELECT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY count(*) DESC LIMIT 1 | [{'course_name': 'rs'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What is the name of the course with the most students enrolled? | SELECT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY count(*) DESC LIMIT 1 | [{'course_name': 'rs'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | Show the date and id of the transcript with at least 2 course results. | SELECT T2.transcript_date , T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id HAVING count(*) >= 2 | [{'transcript_date': '2013-06-30 13:01:40', 'transcript_id': 5}, {'transcript_date': '2010-12-13 10:55:15', 'transcript_id': 6}, {'transcript_date': '1975-05-06 12:04:47', 'transcript_id': 8}, {'transcript_date': '1998-11-22 12:18:29', 'transcript_id': 15}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What is the date and id of the transcript with at least 2 courses listed? | SELECT T2.transcript_date , T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id HAVING count(*) >= 2 | [{'transcript_date': '2013-06-30 13:01:40', 'transcript_id': 5}, {'transcript_date': '2010-12-13 10:55:15', 'transcript_id': 6}, {'transcript_date': '1975-05-06 12:04:47', 'transcript_id': 8}, {'transcript_date': '1998-11-22 12:18:29', 'transcript_id': 15}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | Which address holds the most number of students currently? List the address id and all lines. | SELECT T1.address_id , T1.line_1 , T1.line_2 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.current_address_id GROUP BY T1.address_id ORDER BY count(*) DESC LIMIT 1 | [{'address_id': 9, 'line_1': '0643 Muller Vista', 'line_2': 'Suite 383'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What is the id, line 1, and line 2 of the address with the most students? | SELECT T1.address_id , T1.line_1 , T1.line_2 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.current_address_id GROUP BY T1.address_id ORDER BY count(*) DESC LIMIT 1 | [{'address_id': 9, 'line_1': '0643 Muller Vista', 'line_2': 'Suite 383'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | Show the date of the transcript which shows the least number of results, also list the id. | SELECT T2.transcript_date , T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id ORDER BY count(*) ASC LIMIT 1 | [{'transcript_date': '1975-10-28 15:16:51', 'transcript_id': 2}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What is the date and id of the transcript with the least number of results? | SELECT T2.transcript_date , T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id ORDER BY count(*) ASC LIMIT 1 | [{'transcript_date': '1975-10-28 15:16:51', 'transcript_id': 2}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | Find the first name of the students who permanently live in the country Haiti or have the cell phone number 09700166582 . | SELECT t1.first_name FROM students AS t1 JOIN addresses AS t2 ON t1.permanent_address_id = t2.address_id WHERE t2.country = 'haiti' OR t1.cell_mobile_number = '09700166582' | [{'first_name': 'Jarvis'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
student_transcripts_tracking |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
) |
CREATE TABLE "Addresses" (
address_id INTEGER,
line_1 VARCHAR(255),
line_2 VARCHAR(255),
line_3 VARCHAR(255),
city VARCHAR(255),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(255),
country VARCHAR(255),
other_address_details VARCHAR(255),
PRIMARY KEY (address_id)
)
/*
2 rows from Addresses table:
address_id line_1 line_2 line_3 city zip_postcode state_province_county country other_address_details
1 2294 Grant Square Apt. 235 Apt. 370 None Port Chelsea 148 Virginia Iceland None
2 3999 Aufderhar Ways Suite 593 Apt. 388 None Lake Laishafurt 943 Kentucky Burundi None
*/
CREATE TABLE "Courses" (
course_id INTEGER,
course_name VARCHAR(255),
course_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (course_id)
)
/*
2 rows from Courses table:
course_id course_name course_description other_details
1 ds p None
2 math q None
*/
CREATE TABLE "Degree_Programs" (
degree_program_id INTEGER,
department_id INTEGER NOT NULL,
degree_summary_name VARCHAR(255),
degree_summary_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (degree_program_id),
FOREIGN KEY(department_id) REFERENCES "Departments" (department_id)
)
/*
2 rows from Degree_Programs table:
degree_program_id department_id degree_summary_name degree_summary_description other_details
1 13 Master architecto None
2 2 Master cumque None
*/
CREATE TABLE "Departments" (
department_id INTEGER,
department_name VARCHAR(255),
department_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (department_id)
)
/*
2 rows from Departments table:
department_id department_name department_description other_details
1 computer science error None
2 history nostrum None
*/
CREATE TABLE "Sections" (
section_id INTEGER,
course_id INTEGER NOT NULL,
section_name VARCHAR(255),
section_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (section_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Sections table:
section_id course_id section_name section_description other_details
1 9 a non None
2 2 b voluptatem None
*/
CREATE TABLE "Semesters" (
semester_id INTEGER,
semester_name VARCHAR(255),
semester_description VARCHAR(255),
other_details VARCHAR(255),
PRIMARY KEY (semester_id)
)
/*
2 rows from Semesters table:
semester_id semester_name semester_description other_details
1 spring 2010 x None
2 summer 2010 g None
*/
CREATE TABLE "Student_Enrolment" (
student_enrolment_id INTEGER,
degree_program_id INTEGER NOT NULL,
semester_id INTEGER NOT NULL,
student_id INTEGER NOT NULL,
other_details VARCHAR(255),
PRIMARY KEY (student_enrolment_id),
FOREIGN KEY(student_id) REFERENCES "Students" (student_id),
FOREIGN KEY(semester_id) REFERENCES "Semesters" (semester_id),
FOREIGN KEY(degree_program_id) REFERENCES "Degree_Programs" (degree_program_id)
)
/*
2 rows from Student_Enrolment table:
student_enrolment_id degree_program_id semester_id student_id other_details
1 12 13 14 None
2 4 2 9 None
*/
CREATE TABLE "Student_Enrolment_Courses" (
student_course_id INTEGER,
course_id INTEGER NOT NULL,
student_enrolment_id INTEGER NOT NULL,
PRIMARY KEY (student_course_id),
FOREIGN KEY(student_enrolment_id) REFERENCES "Student_Enrolment" (student_enrolment_id),
FOREIGN KEY(course_id) REFERENCES "Courses" (course_id)
)
/*
2 rows from Student_Enrolment_Courses table:
student_course_id course_id student_enrolment_id
0 6 2
1 6 8
*/
CREATE TABLE "Students" (
student_id INTEGER,
current_address_id INTEGER NOT NULL,
permanent_address_id INTEGER NOT NULL,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
ssn VARCHAR(40),
date_first_registered DATETIME,
date_left DATETIME,
other_student_details VARCHAR(255),
PRIMARY KEY (student_id),
FOREIGN KEY(permanent_address_id) REFERENCES "Addresses" (address_id),
FOREIGN KEY(current_address_id) REFERENCES "Addresses" (address_id)
)
/*
2 rows from Students table:
student_id current_address_id permanent_address_id first_name middle_name last_name cell_mobile_number email_address ssn date_first_registered date_left other_student_details
1 10 15 Timmothy Anna Ward (096)889-8954x524 erwin.zboncak@example.com 965 1971-02-05 07:28:23 1971-05-17 19:28:49 quia
2 12 5 Hobart Lorenz Balistreri 1-009-710-5151 swift.kolby@example.com 304246 1976-10-26 02:33:06 2013-10-05 17:41:28 autem
*/
CREATE TABLE "Transcript_Contents" (
student_course_id INTEGER NOT NULL,
transcript_id INTEGER NOT NULL,
FOREIGN KEY(transcript_id) REFERENCES "Transcripts" (transcript_id),
FOREIGN KEY(student_course_id) REFERENCES "Student_Enrolment_Courses" (student_course_id)
)
/*
2 rows from Transcript_Contents table:
student_course_id transcript_id
0 2
96 8
*/
CREATE TABLE "Transcripts" (
transcript_id INTEGER,
transcript_date DATETIME,
other_details VARCHAR(255),
PRIMARY KEY (transcript_id)
)
/*
2 rows from Transcripts table:
transcript_id transcript_date other_details
1 1988-04-30 01:19:47 None
2 1975-10-28 15:16:51 None
*/ | What are the first names of the students who live in Haiti permanently or have the cell phone number 09700166582 ? | SELECT t1.first_name FROM students AS t1 JOIN addresses AS t2 ON t1.permanent_address_id = t2.address_id WHERE t2.country = 'haiti' OR t1.cell_mobile_number = '09700166582' | [{'first_name': 'Jarvis'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
tvshow |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
) |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from Cartoon table:
id Title Directed_by Written_by Original_air_date Production_code Channel
1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700
2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701
*/
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
/*
2 rows from TV_Channel table:
id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option
700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia
701 Sky Music Italy Italian music 4:3 no no Sky Famiglia
*/
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from TV_series table:
id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel
1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700
2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701
*/ | What is the TV Channel that shows the cartoon "The Rise of the Blue Beetle!"? List the TV Channel's series name. | SELECT T1.series_name FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Title = "The Rise of the Blue Beetle!"; | [{'series_name': 'Sky Radio'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
tvshow |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
) |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from Cartoon table:
id Title Directed_by Written_by Original_air_date Production_code Channel
1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700
2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701
*/
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
/*
2 rows from TV_Channel table:
id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option
700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia
701 Sky Music Italy Italian music 4:3 no no Sky Famiglia
*/
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from TV_series table:
id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel
1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700
2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701
*/ | What is the series name of the TV Channel that shows the cartoon "The Rise of the Blue Beetle"? | SELECT T1.series_name FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Title = "The Rise of the Blue Beetle!"; | [{'series_name': 'Sky Radio'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
tvshow |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
) |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from Cartoon table:
id Title Directed_by Written_by Original_air_date Production_code Channel
1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700
2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701
*/
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
/*
2 rows from TV_Channel table:
id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option
700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia
701 Sky Music Italy Italian music 4:3 no no Sky Famiglia
*/
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from TV_series table:
id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel
1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700
2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701
*/ | List the title of all Cartoons showed on TV Channel with series name "Sky Radio". | SELECT T2.Title FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio"; | [{'Title': 'The Rise of the Blue Beetle!'}, {'Title': 'Return of the Fearsome Fangs!'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
tvshow |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
) |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from Cartoon table:
id Title Directed_by Written_by Original_air_date Production_code Channel
1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700
2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701
*/
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
/*
2 rows from TV_Channel table:
id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option
700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia
701 Sky Music Italy Italian music 4:3 no no Sky Famiglia
*/
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from TV_series table:
id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel
1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700
2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701
*/ | What is the title of all the cartools that are on the TV Channel with the series name "Sky Radio"? | SELECT T2.Title FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio"; | [{'Title': 'The Rise of the Blue Beetle!'}, {'Title': 'Return of the Fearsome Fangs!'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
tvshow |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
) |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from Cartoon table:
id Title Directed_by Written_by Original_air_date Production_code Channel
1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700
2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701
*/
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
/*
2 rows from TV_Channel table:
id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option
700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia
701 Sky Music Italy Italian music 4:3 no no Sky Famiglia
*/
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from TV_series table:
id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel
1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700
2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701
*/ | What is the TV Channel of TV series with Episode "A Love of a Lifetime"? List the TV Channel's series name. | SELECT T1.series_name FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T2.Episode = "A Love of a Lifetime"; | [{'series_name': 'Sky Radio'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
tvshow |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
) |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from Cartoon table:
id Title Directed_by Written_by Original_air_date Production_code Channel
1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700
2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701
*/
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
/*
2 rows from TV_Channel table:
id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option
700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia
701 Sky Music Italy Italian music 4:3 no no Sky Famiglia
*/
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from TV_series table:
id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel
1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700
2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701
*/ | What is the name of the series that has the episode "A Love of a Lifetime"? | SELECT T1.series_name FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T2.Episode = "A Love of a Lifetime"; | [{'series_name': 'Sky Radio'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
tvshow |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
) |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from Cartoon table:
id Title Directed_by Written_by Original_air_date Production_code Channel
1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700
2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701
*/
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
/*
2 rows from TV_Channel table:
id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option
700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia
701 Sky Music Italy Italian music 4:3 no no Sky Famiglia
*/
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from TV_series table:
id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel
1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700
2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701
*/ | List the Episode of all TV series showed on TV Channel with series name "Sky Radio". | SELECT T2.Episode FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio"; | [{'Episode': 'A Love of a Lifetime'}, {'Episode': 'Keepers'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
tvshow |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
) |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from Cartoon table:
id Title Directed_by Written_by Original_air_date Production_code Channel
1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700
2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701
*/
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
/*
2 rows from TV_Channel table:
id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option
700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia
701 Sky Music Italy Italian music 4:3 no no Sky Famiglia
*/
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from TV_series table:
id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel
1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700
2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701
*/ | What is the episode for the TV series named "Sky Radio"? | SELECT T2.Episode FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio"; | [{'Episode': 'A Love of a Lifetime'}, {'Episode': 'Keepers'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
tvshow |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
) |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from Cartoon table:
id Title Directed_by Written_by Original_air_date Production_code Channel
1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700
2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701
*/
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
/*
2 rows from TV_Channel table:
id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option
700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia
701 Sky Music Italy Italian music 4:3 no no Sky Famiglia
*/
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from TV_series table:
id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel
1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700
2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701
*/ | which countries' tv channels are playing some cartoon written by Todd Casey? | SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey' | [{'Country': 'United Kingdom'}, {'Country': 'Italy'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
tvshow |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
) |
CREATE TABLE "Cartoon" (
id REAL,
"Title" TEXT,
"Directed_by" TEXT,
"Written_by" TEXT,
"Original_air_date" TEXT,
"Production_code" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from Cartoon table:
id Title Directed_by Written_by Original_air_date Production_code Channel
1.0 The Rise of the Blue Beetle! Ben Jones Michael Jelenic November14,2008 101.0 700
2.0 Terror on Dinosaur Island! Brandon Vietti Steven Melching November21,2008 102.0 701
*/
CREATE TABLE "TV_Channel" (
id TEXT,
series_name TEXT,
"Country" TEXT,
"Language" TEXT,
"Content" TEXT,
"Pixel_aspect_ratio_PAR" TEXT,
"Hight_definition_TV" TEXT,
"Pay_per_view_PPV" TEXT,
"Package_Option" TEXT,
PRIMARY KEY (id)
)
/*
2 rows from TV_Channel table:
id series_name Country Language Content Pixel_aspect_ratio_PAR Hight_definition_TV Pay_per_view_PPV Package_Option
700 Sky Radio Italy Italian music 4:3 no no Sky Famiglia
701 Sky Music Italy Italian music 4:3 no no Sky Famiglia
*/
CREATE TABLE "TV_series" (
id REAL,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" TEXT,
"Share" REAL,
"18_49_Rating_Share" TEXT,
"Viewers_m" TEXT,
"Weekly_Rank" REAL,
"Channel" TEXT,
PRIMARY KEY (id),
FOREIGN KEY("Channel") REFERENCES "TV_Channel" (id)
)
/*
2 rows from TV_series table:
id Episode Air_Date Rating Share 18_49_Rating_Share Viewers_m Weekly_Rank Channel
1.0 A Love of a Lifetime September 24, 2007 5.8 9.0 3.5/9 9.16 43.0 700
2.0 Friendly Skies October 1, 2007 5.3 9.0 3.2/8 8.23 50.0 701
*/ | What are the countries that have cartoons on TV that were written by Todd Casey? | SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey' | [{'Country': 'United Kingdom'}, {'Country': 'Italy'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | What are the names of poker players? | SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID | [{'Name': 'Aleksey Ostapenko'}, {'Name': 'Teodor Salparov'}, {'Name': 'Yevgeni Sivozhelez'}, {'Name': 'Maksim Botin'}, {'Name': 'Semen Poltavskiy'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | Return the names of all the poker players. | SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID | [{'Name': 'Aleksey Ostapenko'}, {'Name': 'Teodor Salparov'}, {'Name': 'Yevgeni Sivozhelez'}, {'Name': 'Maksim Botin'}, {'Name': 'Semen Poltavskiy'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | What are the names of poker players whose earnings is higher than 300000? | SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Earnings > 300000 | [{'Name': 'Aleksey Ostapenko'}, {'Name': 'Maksim Botin'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | Give the names of poker players who have earnings above 300000. | SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Earnings > 300000 | [{'Name': 'Aleksey Ostapenko'}, {'Name': 'Maksim Botin'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | List the names of poker players ordered by the final tables made in ascending order. | SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Final_Table_Made | [{'Name': 'Teodor Salparov'}, {'Name': 'Maksim Botin'}, {'Name': 'Yevgeni Sivozhelez'}, {'Name': 'Semen Poltavskiy'}, {'Name': 'Aleksey Ostapenko'}] | Medium | false | false | false | true | false | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | What are the names of poker players, ordered ascending by the number of final tables they have made? | SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Final_Table_Made | [{'Name': 'Teodor Salparov'}, {'Name': 'Maksim Botin'}, {'Name': 'Yevgeni Sivozhelez'}, {'Name': 'Semen Poltavskiy'}, {'Name': 'Aleksey Ostapenko'}] | Medium | false | false | false | true | false | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | What is the birth date of the poker player with the lowest earnings? | SELECT T1.Birth_Date FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings ASC LIMIT 1 | [{'Birth_Date': 'August 8, 1986'}] | Medium | false | false | false | true | true | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | Return the birth date of the poker player with the lowest earnings. | SELECT T1.Birth_Date FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings ASC LIMIT 1 | [{'Birth_Date': 'August 8, 1986'}] | Medium | false | false | false | true | true | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | What is the money rank of the tallest poker player? | SELECT T2.Money_Rank FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1 | [{'Money_Rank': 68.0}] | Medium | false | false | false | true | true | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | Return the money rank of the poker player with the greatest height. | SELECT T2.Money_Rank FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1 | [{'Money_Rank': 68.0}] | Medium | false | false | false | true | true | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | What is the average earnings of poker players with height higher than 200? | SELECT avg(T2.Earnings) FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 200 | [{'avg(T2.Earnings)': 309445.0}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | Give average earnings of poker players who are taller than 200. | SELECT avg(T2.Earnings) FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 200 | [{'avg(T2.Earnings)': 309445.0}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | What are the names of poker players in descending order of earnings? | SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings DESC | [{'Name': 'Maksim Botin'}, {'Name': 'Aleksey Ostapenko'}, {'Name': 'Teodor Salparov'}, {'Name': 'Semen Poltavskiy'}, {'Name': 'Yevgeni Sivozhelez'}] | Medium | false | false | false | true | false | false | false | true | false | false | false | false | false |
poker_player |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
) |
CREATE TABLE people (
"People_ID" INTEGER,
"Nationality" TEXT,
"Name" TEXT,
"Birth_Date" TEXT,
"Height" REAL,
PRIMARY KEY ("People_ID")
)
/*
2 rows from people table:
People_ID Nationality Name Birth_Date Height
1 Russia Aleksey Ostapenko May 26, 1986 207.0
2 Bulgaria Teodor Salparov August 16, 1982 182.0
*/
CREATE TABLE poker_player (
"Poker_Player_ID" INTEGER,
"People_ID" INTEGER,
"Final_Table_Made" REAL,
"Best_Finish" REAL,
"Money_Rank" REAL,
"Earnings" REAL,
PRIMARY KEY ("Poker_Player_ID"),
FOREIGN KEY("People_ID") REFERENCES people ("People_ID")
)
/*
2 rows from poker_player table:
Poker_Player_ID People_ID Final_Table_Made Best_Finish Money_Rank Earnings
1 1 42.0 1.0 68.0 476090.0
2 2 10.0 2.0 141.0 189233.0
*/ | Return the names of poker players sorted by their earnings descending. | SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings DESC | [{'Name': 'Maksim Botin'}, {'Name': 'Aleksey Ostapenko'}, {'Name': 'Teodor Salparov'}, {'Name': 'Semen Poltavskiy'}, {'Name': 'Yevgeni Sivozhelez'}] | Medium | false | false | false | true | false | false | false | true | false | false | false | false | false |
voter_1 |
CREATE TABLE "AREA_CODE_STATE" (
area_code INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
PRIMARY KEY (area_code)
)
CREATE TABLE "CONTESTANTS" (
contestant_number INTEGER,
contestant_name VARCHAR(50) NOT NULL,
PRIMARY KEY (contestant_number)
)
CREATE TABLE "VOTES" (
vote_id INTEGER NOT NULL,
phone_number INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
contestant_number INTEGER NOT NULL,
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (vote_id),
FOREIGN KEY(contestant_number) REFERENCES "CONTESTANTS" (contestant_number),
FOREIGN KEY(state) REFERENCES "AREA_CODE_STATE" (state)
) |
CREATE TABLE "AREA_CODE_STATE" (
area_code INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
PRIMARY KEY (area_code)
)
/*
2 rows from AREA_CODE_STATE table:
area_code state
201 NJ
202 DC
*/
CREATE TABLE "CONTESTANTS" (
contestant_number INTEGER,
contestant_name VARCHAR(50) NOT NULL,
PRIMARY KEY (contestant_number)
)
/*
2 rows from CONTESTANTS table:
contestant_number contestant_name
1 Edwina Burnam
2 Tabatha Gehling
*/
CREATE TABLE "VOTES" (
vote_id INTEGER NOT NULL,
phone_number INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
contestant_number INTEGER NOT NULL,
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (vote_id),
FOREIGN KEY(contestant_number) REFERENCES "CONTESTANTS" (contestant_number),
FOREIGN KEY(state) REFERENCES "AREA_CODE_STATE" (state)
)
/*
2 rows from VOTES table:
vote_id phone_number state contestant_number created
1 7182887233 NY 2 2018-03-09 19:03:21
2 7148407040 NY 3 2018-03-09 19:03:36
*/ | What are the contestant numbers and names of the contestants who had at least two votes? | SELECT T1.contestant_number , T1.contestant_name FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number GROUP BY T1.contestant_number HAVING count(*) >= 2 | [{'contestant_number': 3, 'contestant_name': 'Kelly Clauss'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
voter_1 |
CREATE TABLE "AREA_CODE_STATE" (
area_code INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
PRIMARY KEY (area_code)
)
CREATE TABLE "CONTESTANTS" (
contestant_number INTEGER,
contestant_name VARCHAR(50) NOT NULL,
PRIMARY KEY (contestant_number)
)
CREATE TABLE "VOTES" (
vote_id INTEGER NOT NULL,
phone_number INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
contestant_number INTEGER NOT NULL,
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (vote_id),
FOREIGN KEY(contestant_number) REFERENCES "CONTESTANTS" (contestant_number),
FOREIGN KEY(state) REFERENCES "AREA_CODE_STATE" (state)
) |
CREATE TABLE "AREA_CODE_STATE" (
area_code INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
PRIMARY KEY (area_code)
)
/*
2 rows from AREA_CODE_STATE table:
area_code state
201 NJ
202 DC
*/
CREATE TABLE "CONTESTANTS" (
contestant_number INTEGER,
contestant_name VARCHAR(50) NOT NULL,
PRIMARY KEY (contestant_number)
)
/*
2 rows from CONTESTANTS table:
contestant_number contestant_name
1 Edwina Burnam
2 Tabatha Gehling
*/
CREATE TABLE "VOTES" (
vote_id INTEGER NOT NULL,
phone_number INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
contestant_number INTEGER NOT NULL,
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (vote_id),
FOREIGN KEY(contestant_number) REFERENCES "CONTESTANTS" (contestant_number),
FOREIGN KEY(state) REFERENCES "AREA_CODE_STATE" (state)
)
/*
2 rows from VOTES table:
vote_id phone_number state contestant_number created
1 7182887233 NY 2 2018-03-09 19:03:21
2 7148407040 NY 3 2018-03-09 19:03:36
*/ | Of all the contestants who got voted, what is the contestant number and name of the contestant who got least votes? | SELECT T1.contestant_number , T1.contestant_name FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number GROUP BY T1.contestant_number ORDER BY count(*) ASC LIMIT 1 | [{'contestant_number': 2, 'contestant_name': 'Tabatha Gehling'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
voter_1 |
CREATE TABLE "AREA_CODE_STATE" (
area_code INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
PRIMARY KEY (area_code)
)
CREATE TABLE "CONTESTANTS" (
contestant_number INTEGER,
contestant_name VARCHAR(50) NOT NULL,
PRIMARY KEY (contestant_number)
)
CREATE TABLE "VOTES" (
vote_id INTEGER NOT NULL,
phone_number INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
contestant_number INTEGER NOT NULL,
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (vote_id),
FOREIGN KEY(contestant_number) REFERENCES "CONTESTANTS" (contestant_number),
FOREIGN KEY(state) REFERENCES "AREA_CODE_STATE" (state)
) |
CREATE TABLE "AREA_CODE_STATE" (
area_code INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
PRIMARY KEY (area_code)
)
/*
2 rows from AREA_CODE_STATE table:
area_code state
201 NJ
202 DC
*/
CREATE TABLE "CONTESTANTS" (
contestant_number INTEGER,
contestant_name VARCHAR(50) NOT NULL,
PRIMARY KEY (contestant_number)
)
/*
2 rows from CONTESTANTS table:
contestant_number contestant_name
1 Edwina Burnam
2 Tabatha Gehling
*/
CREATE TABLE "VOTES" (
vote_id INTEGER NOT NULL,
phone_number INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
contestant_number INTEGER NOT NULL,
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (vote_id),
FOREIGN KEY(contestant_number) REFERENCES "CONTESTANTS" (contestant_number),
FOREIGN KEY(state) REFERENCES "AREA_CODE_STATE" (state)
)
/*
2 rows from VOTES table:
vote_id phone_number state contestant_number created
1 7182887233 NY 2 2018-03-09 19:03:21
2 7148407040 NY 3 2018-03-09 19:03:36
*/ | What is the area code in which the most voters voted? | SELECT T1.area_code FROM area_code_state AS T1 JOIN votes AS T2 ON T1.state = T2.state GROUP BY T1.area_code ORDER BY count(*) DESC LIMIT 1 | [{'area_code': 212}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
voter_1 |
CREATE TABLE "AREA_CODE_STATE" (
area_code INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
PRIMARY KEY (area_code)
)
CREATE TABLE "CONTESTANTS" (
contestant_number INTEGER,
contestant_name VARCHAR(50) NOT NULL,
PRIMARY KEY (contestant_number)
)
CREATE TABLE "VOTES" (
vote_id INTEGER NOT NULL,
phone_number INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
contestant_number INTEGER NOT NULL,
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (vote_id),
FOREIGN KEY(contestant_number) REFERENCES "CONTESTANTS" (contestant_number),
FOREIGN KEY(state) REFERENCES "AREA_CODE_STATE" (state)
) |
CREATE TABLE "AREA_CODE_STATE" (
area_code INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
PRIMARY KEY (area_code)
)
/*
2 rows from AREA_CODE_STATE table:
area_code state
201 NJ
202 DC
*/
CREATE TABLE "CONTESTANTS" (
contestant_number INTEGER,
contestant_name VARCHAR(50) NOT NULL,
PRIMARY KEY (contestant_number)
)
/*
2 rows from CONTESTANTS table:
contestant_number contestant_name
1 Edwina Burnam
2 Tabatha Gehling
*/
CREATE TABLE "VOTES" (
vote_id INTEGER NOT NULL,
phone_number INTEGER NOT NULL,
state VARCHAR(2) NOT NULL,
contestant_number INTEGER NOT NULL,
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (vote_id),
FOREIGN KEY(contestant_number) REFERENCES "CONTESTANTS" (contestant_number),
FOREIGN KEY(state) REFERENCES "AREA_CODE_STATE" (state)
)
/*
2 rows from VOTES table:
vote_id phone_number state contestant_number created
1 7182887233 NY 2 2018-03-09 19:03:21
2 7148407040 NY 3 2018-03-09 19:03:36
*/ | What are the create dates, states, and phone numbers of the votes that were for the contestant named 'Tabatha Gehling'? | SELECT T2.created , T2.state , T2.phone_number FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number WHERE T1.contestant_name = 'Tabatha Gehling' | [{'created': '2018-03-09 19:03:21', 'state': 'NY', 'phone_number': 7182887233}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | Which region is the city Kabul located in? | SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = "Kabul" | [{'Region': 'Southern and Central Asia'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What region is Kabul in? | SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = "Kabul" | [{'Region': 'Southern and Central Asia'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | Which language is the most popular in Aruba? | SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba" ORDER BY Percentage DESC LIMIT 1 | [{'Language': 'Papiamento'}] | Medium | false | false | false | true | true | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What language is predominantly spoken in Aruba? | SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba" ORDER BY Percentage DESC LIMIT 1 | [{'Language': 'Papiamento'}] | Medium | false | false | false | true | true | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What is the total number of languages used in Aruba? | SELECT COUNT(T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba" | [{'COUNT(T2.Language)': 4}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | How many languages are spoken in Aruba? | SELECT COUNT(T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba" | [{'COUNT(T2.Language)': 4}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | How many official languages does Afghanistan have? | SELECT COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Afghanistan" AND IsOfficial = "T" | [{'COUNT(*)': 2}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | How many official languages are spoken in Afghanistan? | SELECT COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Afghanistan" AND IsOfficial = "T" | [{'COUNT(*)': 2}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What is name of the country that speaks the largest number of languages? | SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name ORDER BY COUNT(*) DESC LIMIT 1 | [{'Name': 'United States'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | Give the name of the nation that uses the greatest amount of languages. | SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name ORDER BY COUNT(*) DESC LIMIT 1 | [{'Name': 'United States'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | Which continent has the most diverse languages? | SELECT T1.Continent FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Continent ORDER BY COUNT(*) DESC LIMIT 1 | [{'Continent': 'Africa'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | Which continent speaks the most languages? | SELECT T1.Continent FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Continent ORDER BY COUNT(*) DESC LIMIT 1 | [{'Continent': 'Africa'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What is the number of distinct continents where Chinese is spoken? | SELECT COUNT( DISTINCT Continent) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Chinese" | [{'COUNT( DISTINCT Continent)': 4}] | Medium | true | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | How many continents speak Chinese? | SELECT COUNT( DISTINCT Continent) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Chinese" | [{'COUNT( DISTINCT Continent)': 4}] | Medium | true | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What are the regions that use English or Dutch? | SELECT DISTINCT T1.Region FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" OR T2.Language = "Dutch" | [{'Region': 'Caribbean'}, {'Region': 'Polynesia'}, {'Region': 'Australia and New Zealand'}, {'Region': 'Western Europe'}, {'Region': 'Middle East'}, {'Region': 'Central America'}, {'Region': 'North America'}, {'Region': 'Southeast Asia'}, {'Region': 'Nordic Countries'}, {'Region': 'South America'}, {'Region': 'British Islands'}, {'Region': 'Southern Europe'}, {'Region': 'Micronesia'}, {'Region': 'Eastern Asia'}, {'Region': 'Southern Africa'}, {'Region': 'Southern and Central Asia'}, {'Region': 'Western Africa'}, {'Region': 'Eastern Africa'}, {'Region': 'Micronesia/Caribbean'}, {'Region': 'Melanesia'}] | Medium | true | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | Which regions speak Dutch or English? | SELECT DISTINCT T1.Region FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" OR T2.Language = "Dutch" | [{'Region': 'Caribbean'}, {'Region': 'Polynesia'}, {'Region': 'Australia and New Zealand'}, {'Region': 'Western Europe'}, {'Region': 'Middle East'}, {'Region': 'Central America'}, {'Region': 'North America'}, {'Region': 'Southeast Asia'}, {'Region': 'Nordic Countries'}, {'Region': 'South America'}, {'Region': 'British Islands'}, {'Region': 'Southern Europe'}, {'Region': 'Micronesia'}, {'Region': 'Eastern Asia'}, {'Region': 'Southern Africa'}, {'Region': 'Southern and Central Asia'}, {'Region': 'Western Africa'}, {'Region': 'Eastern Africa'}, {'Region': 'Micronesia/Caribbean'}, {'Region': 'Melanesia'}] | Medium | true | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | Which language is the most popular on the Asian continent? | SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = "Asia" GROUP BY T2.Language ORDER BY COUNT (*) DESC LIMIT 1 | [{'Language': 'Arabic'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What is the language that is used by the largest number of Asian nations? | SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = "Asia" GROUP BY T2.Language ORDER BY COUNT (*) DESC LIMIT 1 | [{'Language': 'Arabic'}] | Medium | false | false | false | true | true | true | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | Which languages are spoken by only one country in republic governments? | SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GovernmentForm = "Republic" GROUP BY T2.Language HAVING COUNT(*) = 1 | [{'Language': 'Abhyasi'}, {'Language': 'Acholi'}, {'Language': 'Adja'}, {'Language': 'Aizo'}, {'Language': 'Ambo'}, {'Language': 'Amhara'}, {'Language': 'Ami'}, {'Language': 'Ane'}, {'Language': 'Arabic-French'}, {'Language': 'Arabic-French-English'}, {'Language': 'Araucan'}, {'Language': 'Assyrian'}, {'Language': 'Atayal'}, {'Language': 'Bajad'}, {'Language': 'Balante'}, {'Language': 'Bali'}, {'Language': 'Balochi'}, {'Language': 'Bambara'}, {'Language': 'Bamileke-bamum'}, {'Language': 'Banda'}, {'Language': 'Banja'}, {'Language': 'Bariba'}, {'Language': 'Bassa'}, {'Language': 'Batakki'}, {'Language': 'Bemba'}, {'Language': 'Bengali'}, {'Language': 'Berberi'}, {'Language': 'Bhojpuri'}, {'Language': 'Bicol'}, {'Language': 'Bilin'}, {'Language': 'Bislama'}, {'Language': 'Boa'}, {'Language': 'Brahui'}, {'Language': 'Bubi'}, {'Language': 'Bugi'}, {'Language': 'Bullom-sherbro'}, {'Language': 'Burmese'}, {'Language': 'Buryat'}, {'Language': 'Busansi'}, {'Language': 'Cakchiquel'}, {'Language': 'Caprivi'}, {'Language': 'Cebuano'}, {'Language': 'Chaga and Pare'}, {'Language': 'Chakma'}, {'Language': 'Chewa'}, {'Language': 'Chichewa'}, {'Language': 'Chin'}, {'Language': 'Chuabo'}, {'Language': 'Comorian'}, {'Language': 'Comorian-Arabic'}, {'Language': 'Comorian-French'}, {'Language': 'Comorian-Swahili'}, {'Language': 'Comorian-madagassi'}, {'Language': 'Cuna'}, {'Language': 'Czech'}, {'Language': 'Czech and Moravian'}, {'Language': 'Dagara'}, {'Language': 'Dariganga'}, {'Language': 'Dhivehi'}, {'Language': 'Dorbet'}, {'Language': 'Duala'}, {'Language': 'Dyula'}, {'Language': 'Embera'}, {'Language': 'Fijian'}, {'Language': 'Fon'}, {'Language': 'Friuli'}, {'Language': 'Ga-adangme'}, {'Language': 'Gagauzi'}, {'Language': 'Ganda'}, {'Language': 'Garifuna'}, {'Language': 'Garo'}, {'Language': 'Gbaya'}, {'Language': 'Georgiana'}, {'Language': 'Gio'}, {'Language': 'Gisu'}, {'Language': 'Gogo'}, {'Language': 'Gorane'}, {'Language': 'Grebo'}, {'Language': 'Guaymí'}, {'Language': 'Gur'}, {'Language': 'Gurage'}, {'Language': 'Gusii'}, {'Language': 'Ha'}, {'Language': 'Hadareb'}, {'Language': 'Hadjarai'}, {'Language': 'Haiti Creole'}, {'Language': 'Hakka'}, {'Language': 'Hassaniya'}, {'Language': 'Hausa'}, {'Language': 'Haya'}, {'Language': 'Hebrew'}, {'Language': 'Hehet'}, {'Language': 'Herero'}, {'Language': 'Hiligaynon'}, {'Language': 'Hindko'}, {'Language': 'Icelandic'}, {'Language': 'Ilocano'}, {'Language': 'Irish'}, {'Language': 'Javanese'}, {'Language': 'Kabyé'}, {'Language': 'Kachin'}, {'Language': 'Kalenjin'}, {'Language': 'Kamba'}, {'Language': 'Kanem-bornu'}, {'Language': 'Kanuri'}, {'Language': 'Karakalpak'}, {'Language': 'Karen'}, {'Language': 'Kavango'}, {'Language': 'Kayah'}, {'Language': 'Kekchí'}, {'Language': 'Khasi'}, {'Language': 'Khoekhoe'}, {'Language': 'Kiga'}, {'Language': 'Kikuyu'}, {'Language': 'Kirgiz'}, {'Language': 'Kirundi'}, {'Language': 'Kissi'}, {'Language': 'Kono-vai'}, {'Language': 'Korean'}, {'Language': 'Kotokoli'}, {'Language': 'Kuranko'}, {'Language': 'Lango'}, {'Language': 'Lao'}, {'Language': 'Lao-Soung'}, {'Language': 'Latvian'}, {'Language': 'Limba'}, {'Language': 'Lozi'}, {'Language': 'Luba'}, {'Language': 'Luchazi'}, {'Language': 'Lugbara'}, {'Language': 'Luguru'}, {'Language': 'Luhya'}, {'Language': 'Luimbe-nganguela'}, {'Language': 'Luo'}, {'Language': 'Luvale'}, {'Language': 'Madura'}, {'Language': 'Maguindanao'}, {'Language': 'Maka'}, {'Language': 'Makonde'}, {'Language': 'Makua'}, {'Language': 'Maltese'}, {'Language': 'Mam'}, {'Language': 'Mandara'}, {'Language': 'Mandarin Chinese'}, {'Language': 'Mandjia'}, {'Language': 'Mandyako'}, {'Language': 'Mano'}, {'Language': 'Maranao'}, {'Language': 'Marathi'}, {'Language': 'Marendje'}, {'Language': 'Marma'}, {'Language': 'Marshallese'}, {'Language': 'Masai'}, {'Language': 'Masana'}, {'Language': 'Mayo-kebbi'}, {'Language': 'Mboshi'}, {'Language': 'Mbum'}, {'Language': 'Mbundu'}, {'Language': 'Mende'}, {'Language': 'Meru'}, {'Language': 'Min'}, {'Language': 'Minangkabau'}, {'Language': 'Mixed Languages'}, {'Language': 'Moba'}, {'Language': 'Mon'}, {'Language': 'Mon-khmer'}, {'Language': 'Mongo'}, {'Language': 'Mongolian'}, {'Language': 'Moravian'}, {'Language': 'Mpongwe'}, {'Language': 'Nahua'}, {'Language': 'Nama'}, {'Language': 'Naudemba'}, {'Language': 'Nauru'}, {'Language': 'Ngala and Bangi'}, {'Language': 'Ngbaka'}, {'Language': 'Ngoni'}, {'Language': 'Nkole'}, {'Language': 'Northsotho'}, {'Language': 'Nsenga'}, {'Language': 'Nyakusa'}, {'Language': 'Nyamwesi'}, {'Language': 'Nyaneka-nkhumbi'}, {'Language': 'Nyika'}, {'Language': 'Oromo'}, {'Language': 'Osseetti'}, {'Language': 'Ouaddai'}, {'Language': 'Ovambo'}, {'Language': 'Ovimbundu'}, {'Language': 'Paiwan'}, {'Language': 'Palau'}, {'Language': 'Pampango'}, {'Language': 'Pangasinan'}, {'Language': 'Pashto'}, {'Language': 'Persian'}, {'Language': 'Philippene Languages'}, {'Language': 'Pilipino'}, {'Language': 'Punjabi'}, {'Language': 'Punu'}, {'Language': 'Punu-sira-nzebi'}, {'Language': 'Quiché'}, {'Language': 'Rakhine'}, {'Language': 'Rapa nui'}, {'Language': 'Ronga'}, {'Language': 'Rundi'}, {'Language': 'Saame'}, {'Language': 'Saho'}, {'Language': 'Sango'}, {'Language': 'Santhali'}, {'Language': 'Saraiki'}, {'Language': 'Sardinian'}, {'Language': 'Sena'}, {'Language': 'Senufo and Minianka'}, {'Language': 'Serer'}, {'Language': 'Seselwa'}, {'Language': 'Shambala'}, {'Language': 'Shan'}, {'Language': 'Sidamo'}, {'Language': 'Silesiana'}, {'Language': 'Sinaberberi'}, {'Language': 'Sindhi'}, {'Language': 'Singali'}, {'Language': 'Soga'}, {'Language': 'Somba'}, {'Language': 'Songhai'}, {'Language': 'Songhai-zerma'}, {'Language': 'Soqutri'}, {'Language': 'Southsotho'}, {'Language': 'Sranantonga'}, {'Language': 'Sumo'}, {'Language': 'Sunda'}, {'Language': 'Susu'}, {'Language': 'Swazi'}, {'Language': 'Swedish'}, {'Language': 'Tandjile'}, {'Language': 'Temne'}, {'Language': 'Teso'}, {'Language': 'Thai'}, {'Language': 'Tigre'}, {'Language': 'Tikar'}, {'Language': 'Tongan'}, {'Language': 'Tripuri'}, {'Language': 'Tswa'}, {'Language': 'Tukulor'}, {'Language': 'Turkana'}, {'Language': 'Turkmenian'}, {'Language': 'Ukrainian and Russian'}, {'Language': 'Urdu'}, {'Language': 'Venda'}, {'Language': 'Walaita'}, {'Language': 'Waray-waray'}, {'Language': 'Watyi'}, {'Language': 'Xhosa'}, {'Language': 'Yao'}, {'Language': 'Zande'}, {'Language': 'Zenaga'}, {'Language': 'Zulu'}, {'Language': '[South]Mande'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What languages are only used by a single country with a republic government? | SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GovernmentForm = "Republic" GROUP BY T2.Language HAVING COUNT(*) = 1 | [{'Language': 'Abhyasi'}, {'Language': 'Acholi'}, {'Language': 'Adja'}, {'Language': 'Aizo'}, {'Language': 'Ambo'}, {'Language': 'Amhara'}, {'Language': 'Ami'}, {'Language': 'Ane'}, {'Language': 'Arabic-French'}, {'Language': 'Arabic-French-English'}, {'Language': 'Araucan'}, {'Language': 'Assyrian'}, {'Language': 'Atayal'}, {'Language': 'Bajad'}, {'Language': 'Balante'}, {'Language': 'Bali'}, {'Language': 'Balochi'}, {'Language': 'Bambara'}, {'Language': 'Bamileke-bamum'}, {'Language': 'Banda'}, {'Language': 'Banja'}, {'Language': 'Bariba'}, {'Language': 'Bassa'}, {'Language': 'Batakki'}, {'Language': 'Bemba'}, {'Language': 'Bengali'}, {'Language': 'Berberi'}, {'Language': 'Bhojpuri'}, {'Language': 'Bicol'}, {'Language': 'Bilin'}, {'Language': 'Bislama'}, {'Language': 'Boa'}, {'Language': 'Brahui'}, {'Language': 'Bubi'}, {'Language': 'Bugi'}, {'Language': 'Bullom-sherbro'}, {'Language': 'Burmese'}, {'Language': 'Buryat'}, {'Language': 'Busansi'}, {'Language': 'Cakchiquel'}, {'Language': 'Caprivi'}, {'Language': 'Cebuano'}, {'Language': 'Chaga and Pare'}, {'Language': 'Chakma'}, {'Language': 'Chewa'}, {'Language': 'Chichewa'}, {'Language': 'Chin'}, {'Language': 'Chuabo'}, {'Language': 'Comorian'}, {'Language': 'Comorian-Arabic'}, {'Language': 'Comorian-French'}, {'Language': 'Comorian-Swahili'}, {'Language': 'Comorian-madagassi'}, {'Language': 'Cuna'}, {'Language': 'Czech'}, {'Language': 'Czech and Moravian'}, {'Language': 'Dagara'}, {'Language': 'Dariganga'}, {'Language': 'Dhivehi'}, {'Language': 'Dorbet'}, {'Language': 'Duala'}, {'Language': 'Dyula'}, {'Language': 'Embera'}, {'Language': 'Fijian'}, {'Language': 'Fon'}, {'Language': 'Friuli'}, {'Language': 'Ga-adangme'}, {'Language': 'Gagauzi'}, {'Language': 'Ganda'}, {'Language': 'Garifuna'}, {'Language': 'Garo'}, {'Language': 'Gbaya'}, {'Language': 'Georgiana'}, {'Language': 'Gio'}, {'Language': 'Gisu'}, {'Language': 'Gogo'}, {'Language': 'Gorane'}, {'Language': 'Grebo'}, {'Language': 'Guaymí'}, {'Language': 'Gur'}, {'Language': 'Gurage'}, {'Language': 'Gusii'}, {'Language': 'Ha'}, {'Language': 'Hadareb'}, {'Language': 'Hadjarai'}, {'Language': 'Haiti Creole'}, {'Language': 'Hakka'}, {'Language': 'Hassaniya'}, {'Language': 'Hausa'}, {'Language': 'Haya'}, {'Language': 'Hebrew'}, {'Language': 'Hehet'}, {'Language': 'Herero'}, {'Language': 'Hiligaynon'}, {'Language': 'Hindko'}, {'Language': 'Icelandic'}, {'Language': 'Ilocano'}, {'Language': 'Irish'}, {'Language': 'Javanese'}, {'Language': 'Kabyé'}, {'Language': 'Kachin'}, {'Language': 'Kalenjin'}, {'Language': 'Kamba'}, {'Language': 'Kanem-bornu'}, {'Language': 'Kanuri'}, {'Language': 'Karakalpak'}, {'Language': 'Karen'}, {'Language': 'Kavango'}, {'Language': 'Kayah'}, {'Language': 'Kekchí'}, {'Language': 'Khasi'}, {'Language': 'Khoekhoe'}, {'Language': 'Kiga'}, {'Language': 'Kikuyu'}, {'Language': 'Kirgiz'}, {'Language': 'Kirundi'}, {'Language': 'Kissi'}, {'Language': 'Kono-vai'}, {'Language': 'Korean'}, {'Language': 'Kotokoli'}, {'Language': 'Kuranko'}, {'Language': 'Lango'}, {'Language': 'Lao'}, {'Language': 'Lao-Soung'}, {'Language': 'Latvian'}, {'Language': 'Limba'}, {'Language': 'Lozi'}, {'Language': 'Luba'}, {'Language': 'Luchazi'}, {'Language': 'Lugbara'}, {'Language': 'Luguru'}, {'Language': 'Luhya'}, {'Language': 'Luimbe-nganguela'}, {'Language': 'Luo'}, {'Language': 'Luvale'}, {'Language': 'Madura'}, {'Language': 'Maguindanao'}, {'Language': 'Maka'}, {'Language': 'Makonde'}, {'Language': 'Makua'}, {'Language': 'Maltese'}, {'Language': 'Mam'}, {'Language': 'Mandara'}, {'Language': 'Mandarin Chinese'}, {'Language': 'Mandjia'}, {'Language': 'Mandyako'}, {'Language': 'Mano'}, {'Language': 'Maranao'}, {'Language': 'Marathi'}, {'Language': 'Marendje'}, {'Language': 'Marma'}, {'Language': 'Marshallese'}, {'Language': 'Masai'}, {'Language': 'Masana'}, {'Language': 'Mayo-kebbi'}, {'Language': 'Mboshi'}, {'Language': 'Mbum'}, {'Language': 'Mbundu'}, {'Language': 'Mende'}, {'Language': 'Meru'}, {'Language': 'Min'}, {'Language': 'Minangkabau'}, {'Language': 'Mixed Languages'}, {'Language': 'Moba'}, {'Language': 'Mon'}, {'Language': 'Mon-khmer'}, {'Language': 'Mongo'}, {'Language': 'Mongolian'}, {'Language': 'Moravian'}, {'Language': 'Mpongwe'}, {'Language': 'Nahua'}, {'Language': 'Nama'}, {'Language': 'Naudemba'}, {'Language': 'Nauru'}, {'Language': 'Ngala and Bangi'}, {'Language': 'Ngbaka'}, {'Language': 'Ngoni'}, {'Language': 'Nkole'}, {'Language': 'Northsotho'}, {'Language': 'Nsenga'}, {'Language': 'Nyakusa'}, {'Language': 'Nyamwesi'}, {'Language': 'Nyaneka-nkhumbi'}, {'Language': 'Nyika'}, {'Language': 'Oromo'}, {'Language': 'Osseetti'}, {'Language': 'Ouaddai'}, {'Language': 'Ovambo'}, {'Language': 'Ovimbundu'}, {'Language': 'Paiwan'}, {'Language': 'Palau'}, {'Language': 'Pampango'}, {'Language': 'Pangasinan'}, {'Language': 'Pashto'}, {'Language': 'Persian'}, {'Language': 'Philippene Languages'}, {'Language': 'Pilipino'}, {'Language': 'Punjabi'}, {'Language': 'Punu'}, {'Language': 'Punu-sira-nzebi'}, {'Language': 'Quiché'}, {'Language': 'Rakhine'}, {'Language': 'Rapa nui'}, {'Language': 'Ronga'}, {'Language': 'Rundi'}, {'Language': 'Saame'}, {'Language': 'Saho'}, {'Language': 'Sango'}, {'Language': 'Santhali'}, {'Language': 'Saraiki'}, {'Language': 'Sardinian'}, {'Language': 'Sena'}, {'Language': 'Senufo and Minianka'}, {'Language': 'Serer'}, {'Language': 'Seselwa'}, {'Language': 'Shambala'}, {'Language': 'Shan'}, {'Language': 'Sidamo'}, {'Language': 'Silesiana'}, {'Language': 'Sinaberberi'}, {'Language': 'Sindhi'}, {'Language': 'Singali'}, {'Language': 'Soga'}, {'Language': 'Somba'}, {'Language': 'Songhai'}, {'Language': 'Songhai-zerma'}, {'Language': 'Soqutri'}, {'Language': 'Southsotho'}, {'Language': 'Sranantonga'}, {'Language': 'Sumo'}, {'Language': 'Sunda'}, {'Language': 'Susu'}, {'Language': 'Swazi'}, {'Language': 'Swedish'}, {'Language': 'Tandjile'}, {'Language': 'Temne'}, {'Language': 'Teso'}, {'Language': 'Thai'}, {'Language': 'Tigre'}, {'Language': 'Tikar'}, {'Language': 'Tongan'}, {'Language': 'Tripuri'}, {'Language': 'Tswa'}, {'Language': 'Tukulor'}, {'Language': 'Turkana'}, {'Language': 'Turkmenian'}, {'Language': 'Ukrainian and Russian'}, {'Language': 'Urdu'}, {'Language': 'Venda'}, {'Language': 'Walaita'}, {'Language': 'Waray-waray'}, {'Language': 'Watyi'}, {'Language': 'Xhosa'}, {'Language': 'Yao'}, {'Language': 'Zande'}, {'Language': 'Zenaga'}, {'Language': 'Zulu'}, {'Language': '[South]Mande'}] | Medium | false | false | false | false | false | true | true | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | Find the city with the largest population that uses English. | SELECT T1.Name , T1.Population FROM city AS T1 JOIN countrylanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Language = "English" ORDER BY T1.Population DESC LIMIT 1 | [{'Name': 'New York', 'Population': 8008278}] | Medium | false | false | false | true | true | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What is the most populace city that speaks English? | SELECT T1.Name , T1.Population FROM city AS T1 JOIN countrylanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Language = "English" ORDER BY T1.Population DESC LIMIT 1 | [{'Name': 'New York', 'Population': 8008278}] | Medium | false | false | false | true | true | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What is average life expectancy in the countries where English is not the official language? | SELECT avg(LifeExpectancy) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND T2.IsOfficial = "T") | [{'avg(LifeExpectancy)': 65.48270270270272}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | Give the mean life expectancy of countries in which English is not the official language. | SELECT avg(LifeExpectancy) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND T2.IsOfficial = "T") | [{'avg(LifeExpectancy)': 65.48270270270272}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What is the total number of people living in the nations that do not use English? | SELECT sum(Population) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English") | [{'sum(Population)': 5451331150}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | How many people live in countries that do not speak English? | SELECT sum(Population) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English") | [{'sum(Population)': 5451331150}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What is the official language spoken in the country whose head of state is Beatrix? | SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = "Beatrix" AND T2.IsOfficial = "T" | [{'Language': 'Dutch'}, {'Language': 'Dutch'}, {'Language': 'Papiamento'}, {'Language': 'Dutch'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What is the official language used in the country the name of whose head of state is Beatrix. | SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = "Beatrix" AND T2.IsOfficial = "T" | [{'Language': 'Dutch'}, {'Language': 'Dutch'}, {'Language': 'Papiamento'}, {'Language': 'Dutch'}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | What is the total number of unique official languages spoken in the countries that are founded before 1930? | SELECT count(DISTINCT T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE IndepYear < 1930 AND T2.IsOfficial = "T" | [{'count(DISTINCT T2.Language)': 40}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |
world_1 |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
) |
CREATE TABLE city (
"ID" INTEGER NOT NULL,
"Name" CHAR(35) DEFAULT '' NOT NULL,
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"District" CHAR(20) DEFAULT '' NOT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
PRIMARY KEY ("ID"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from city table:
ID Name CountryCode District Population
1 Kabul AFG Kabol 1780000
2 Qandahar AFG Qandahar 237500
*/
CREATE TABLE country (
"Code" CHAR(3) DEFAULT '' NOT NULL,
"Name" CHAR(52) DEFAULT '' NOT NULL,
"Continent" TEXT DEFAULT 'Asia' NOT NULL,
"Region" CHAR(26) DEFAULT '' NOT NULL,
"SurfaceArea" FLOAT DEFAULT '0.00' NOT NULL,
"IndepYear" INTEGER DEFAULT NULL,
"Population" INTEGER DEFAULT '0' NOT NULL,
"LifeExpectancy" FLOAT DEFAULT NULL,
"GNP" FLOAT DEFAULT NULL,
"GNPOld" FLOAT DEFAULT NULL,
"LocalName" CHAR(45) DEFAULT '' NOT NULL,
"GovernmentForm" CHAR(45) DEFAULT '' NOT NULL,
"HeadOfState" CHAR(60) DEFAULT NULL,
"Capital" INTEGER DEFAULT NULL,
"Code2" CHAR(2) DEFAULT '' NOT NULL,
PRIMARY KEY ("Code")
)
/*
2 rows from country table:
Code Name Continent Region SurfaceArea IndepYear Population LifeExpectancy GNP GNPOld LocalName GovernmentForm HeadOfState Capital Code2
ABW Aruba North America Caribbean 193.0000000000 None 103000 78.4000000000 828.0000000000 793.0000000000 Aruba Nonmetropolitan Territory of The Netherlands Beatrix 129 AW
AFG Afghanistan Asia Southern and Central Asia 652090.0000000000 1919 22720000 45.9000000000 5976.0000000000 None Afganistan/Afqanestan Islamic Emirate Mohammad Omar 1 AF
*/
CREATE TABLE countrylanguage (
"CountryCode" CHAR(3) DEFAULT '' NOT NULL,
"Language" CHAR(30) DEFAULT '' NOT NULL,
"IsOfficial" TEXT DEFAULT 'F' NOT NULL,
"Percentage" FLOAT DEFAULT '0.0' NOT NULL,
PRIMARY KEY ("CountryCode", "Language"),
FOREIGN KEY("CountryCode") REFERENCES country ("Code")
)
/*
2 rows from countrylanguage table:
CountryCode Language IsOfficial Percentage
ABW Dutch T 5.3000000000
ABW English F 9.5000000000
*/ | For the countries founded before 1930, what is the total number of distinct official languages? | SELECT count(DISTINCT T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE IndepYear < 1930 AND T2.IsOfficial = "T" | [{'count(DISTINCT T2.Language)': 40}] | Medium | false | false | false | false | false | false | false | true | false | false | false | false | false |