db_id
stringclasses
146 values
question
stringlengths
3
224
sql
stringlengths
18
577
database_schema
stringclasses
146 values
university_basketball
Return the total and minimum enrollments across all schools.
SELECT sum(enrollment) , min(enrollment) FROM university
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
Find the total student enrollment for different affiliation type schools.
SELECT sum(enrollment) , affiliation FROM university GROUP BY affiliation
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
What are the total enrollments of universities of each affiliation type?
SELECT sum(enrollment) , affiliation FROM university GROUP BY affiliation
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
How many schools do not participate in the basketball match?
SELECT count(*) FROM university WHERE school_id NOT IN (SELECT school_id FROM basketball_match)
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
Count the number of universities that do not participate in the baketball match.
SELECT count(*) FROM university WHERE school_id NOT IN (SELECT school_id FROM basketball_match)
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
Find the schools that were either founded after 1850 or public.
SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
What are the schools that were either founded before 1850 or are public?
SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
Find how many different affiliation types there are.
SELECT count(DISTINCT affiliation) FROM university
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
Count the number of different affiliation types.
SELECT count(DISTINCT affiliation) FROM university
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
Find how many school locations have the word 'NY'.
SELECT count(*) FROM university WHERE LOCATION LIKE "%NY%"
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
How many universities have a location that contains NY?
SELECT count(*) FROM university WHERE LOCATION LIKE "%NY%"
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
Find the team names of the universities whose enrollments are smaller than the average enrollment size.
SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT avg(enrollment) FROM university)
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
What are the names of teams from universities that have a below average enrollment?
SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT avg(enrollment) FROM university)
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
Find the number of universities that have over a 20000 enrollment size for each affiliation type.
SELECT count(*) , affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
What are the different affiliations, and how many schools with each have an enrollment size of above 20000?
SELECT count(*) , affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type.
SELECT sum(Enrollment) , affiliation FROM university WHERE founded > 1850 GROUP BY affiliation
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
What are the different affiliations, and what is the total enrollment of schools founded after 1850 for each enrollment type?
SELECT sum(Enrollment) , affiliation FROM university WHERE founded > 1850 GROUP BY affiliation
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
What is the maximum enrollment across all schools?
SELECT max(Enrollment) FROM university
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
Return the maximum enrollment across all schools.
SELECT max(Enrollment) FROM university
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
List all information regarding the basketball match.
SELECT * FROM basketball_match
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
What is all the information about the basketball match?
SELECT * FROM basketball_match
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
List names of all teams in the basketball competition, ordered by all home scores in descending order.
SELECT team_name FROM basketball_match ORDER BY All_Home DESC
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
university_basketball
What are the names of all the teams in the basketball competition, sorted by all home scores in descending order?
SELECT team_name FROM basketball_match ORDER BY All_Home DESC
CREATE TABLE "basketball_match" ( "Team_ID" int, "School_ID" int, "Team_Name" text, "ACC_Regular_Season" text, "ACC_Percent" text, "ACC_Home" text, "ACC_Road" text, "All_Games" text, "All_Games_Percent" int, "All_Home" text, "All_Road" text, "All_Neutral" text, PRIMARY KEY ("Team_ID"), FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`) ) 3 rows from basketball_match table: Team_ID School_ID Team_Name ACC_Regular_Season ACC_Percent ACC_Home ACC_Road All_Games All_Games_Percent All_Home All_Road All_Neutral 1 1 North Carolina 14–2 .875 6–2 8–0 35–2 0.946 14–2 13–0 9–1 2 2 Duke 13–3 .813 7–1 6–2 28–6 0.824 15–1 8–2 5–3 3 4 Clemson 10–6 .625 7–1 3–5 24–10 0.706 14–2 6–5 4–3 CREATE TABLE "university" ( "School_ID" int, "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary_conference" text, PRIMARY KEY ("School_ID") ) 3 rows from university table: School_ID School Location Founded Affiliation Enrollment Nickname Primary_conference 1 University of Delaware Newark, DE 1743.0 Public 19067.0 Fightin' Blue Hens Colonial Athletic Association ( D-I ) 2 Lebanon Valley College Annville, PA 1866.0 Private/Methodist 2100.0 Flying Dutchmen MAC Commonwealth Conference ( D-III ) 3 University of Rhode Island Kingston, RI 1892.0 Public 19095.0 Rams Atlantic 10 Conference ( D-I )
phone_1
the names of models that launched between 2002 and 2004.
SELECT Model_name FROM chip_model WHERE Launch_year BETWEEN 2002 AND 2004;
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
Which model has the least amount of RAM? List the model name and the amount of RAM.
SELECT Model_name , RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC LIMIT 1;
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
What are the chip model and screen mode of the phone with hardware model name "LG-P760"?
SELECT chip_model , screen_mode FROM phone WHERE Hardware_Model_name = "LG-P760";
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
How many phone hardware models are produced by the company named "Nokia Corporation"?
SELECT count(*) FROM phone WHERE Company_name = "Nokia Corporation";
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
What is maximum and minimum RAM size of phone produced by company named "Nokia Corporation"?
SELECT max(T1.RAM_MiB) , min(T1.RAM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = "Nokia Corporation";
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
What is the average ROM size of phones produced by the company named "Nokia Corporation"?
SELECT avg(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = "Nokia Corporation";
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32.
SELECT T2.Hardware_Model_name , T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32;
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
Find all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name.
SELECT Hardware_Model_name , Company_name FROM phone WHERE Accreditation_type LIKE 'Full';
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is "LG-P760".
SELECT T1.Char_cells , T1.Pixels , T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = "LG-P760";
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
List the hardware model name and company name for the phone whose screen mode type is "Graphics."
SELECT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Graphics";
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
Find the name of the company that has the least number of phone models. List the company name and the number of phone model produced by that company.
SELECT Company_name , count(*) FROM phone GROUP BY Company_name ORDER BY count(*) ASC LIMIT 1;
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
List the name of the company that produced more than one phone model.
SELECT Company_name FROM phone GROUP BY Company_name HAVING count(*) > 1;
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
List the maximum, minimum and average number of used kb in screen mode.
SELECT max(used_kb) , min(used_kb) , avg(used_kb) FROM screen_mode;
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
List the name of the phone model launched in year 2002 and with the highest RAM size.
SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC LIMIT 1;
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
What are the wifi and screen mode type of the hardware model named "LG-P760"?
SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = "LG-P760";
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
List the hardware model name for the phones that have screen mode type "Text" or RAM size greater than 32.
SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = "Text" OR T1.RAM_MiB > 32;
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
List the hardware model name for the phones that were produced by "Nokia Corporation" or whose screen mode type is "Graphics."
SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Graphics" OR t2.Company_name = "Nokia Corporation"
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
List the hardware model name for the phons that were produced by "Nokia Corporation" but whose screen mode type is not Text.
SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name = "Nokia Corporation" AND T1.Type != "Text";
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
List the phone hardware model and company name for the phones whose screen usage in kb is between 10 and 15.
SELECT DISTINCT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15;
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
Find the number of phones for each accreditation type.
SELECT Accreditation_type , count(*) FROM phone GROUP BY Accreditation_type
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
How many phones belongs to each accreditation type?
SELECT Accreditation_type , count(*) FROM phone GROUP BY Accreditation_type
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
Find the accreditation level that more than 3 phones use.
SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING count(*) > 3
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
Find the details for all chip models.
SELECT * FROM chip_model
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
How many models do not have the wifi function?
SELECT count(*) FROM chip_model WHERE wifi = 'No'
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
Count the number of chip model that do not have wifi.
SELECT count(*) FROM chip_model WHERE wifi = 'No'
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
List all the model names sorted by their launch year.
SELECT model_name FROM chip_model ORDER BY launch_year
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
Find the average ram mib size of the chip models that are never used by any phone.
SELECT avg(RAM_MiB) FROM chip_model WHERE model_name NOT IN (SELECT chip_model FROM phone)
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
Find the names of the chip models that are not used by any phone with full accreditation type.
SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full'
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
phone_1
Find the pixels of the screen modes that are used by both phones with full accreditation types and phones with Provisional accreditation types.
SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Full'
CREATE TABLE "chip_model" ( "Model_name" text, "Launch_year" real, "RAM_MiB" real, "ROM_MiB" real, "Slots" text, "WiFi" text, "Bluetooth" text, PRIMARY KEY ("Model_name") ) 3 rows from chip_model table: Model_name Launch_year RAM_MiB ROM_MiB Slots WiFi Bluetooth X5 2002.0 32.0 32.0 1CFII,1SD No No X5 high end 2002.0 64.0 48.0 1CFII,1SD No No X3 Basic 2003.0 32.0 32.0 1SD No No CREATE TABLE "screen_mode" ( "Graphics_mode" real, "Char_cells" text, "Pixels" text, "Hardware_colours" real, "used_kb" real, "map" text, "Type" text, PRIMARY KEY ("Graphics_mode") ) 3 rows from screen_mode table: Graphics_mode Char_cells Pixels Hardware_colours used_kb map Type 0.0 80 Γ— 32 640 Γ— 256 2.0 20.0 3000–7FFF Graphics 1.0 40 Γ— 32 320 Γ— 256 4.0 20.0 3000–7FFF Graphics 2.0 20 Γ— 32 160 Γ— 256 8.0 20.0 3000–7FFF Graphics CREATE TABLE "phone" ( "Company_name" text, "Hardware_Model_name" text, "Accreditation_type" text, "Accreditation_level" text, "Date" text, "chip_model" text, "screen_mode" text, PRIMARY KEY("Hardware_Model_name"), FOREIGN KEY (`screen_mode`) REFERENCES `screen_mode`(`Graphics_mode`), FOREIGN KEY (`chip_model`) REFERENCES `chip_model`(`Model_name`) ) 3 rows from phone table: Company_name Hardware_Model_name Accreditation_type Accreditation_level Date chip_model screen_mode Sony Mobile Communications XPERIA T, XPERIA J Full joyn Hot Fixes Approved (awarded 15.11.12) X5 1 LG Electronics LG-P760 Full joyn Hot Fixes Approved (awarded 19.11.12) X51v 3 Nokia Corporation Lumia 920, Lumia 820, Lumia 620 Full joyn Hot Fixes Approved (awarded 05.12.12) X5 4
match_season
How many countries are there in total?
SELECT count(*) FROM country
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Count the number of countries.
SELECT count(*) FROM country
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the country name and capital of all countries.
SELECT Country_name , Capital FROM country
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What are the names and capitals of each country?
SELECT Country_name , Capital FROM country
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show all official native languages that contain the word "English".
SELECT Official_native_language FROM country WHERE Official_native_language LIKE "%English%"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What are the official native languages that contain the string "English".
SELECT Official_native_language FROM country WHERE Official_native_language LIKE "%English%"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show all distinct positions of matches.
SELECT DISTINCT POSITION FROM match_season
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What are the different positions for match season?
SELECT DISTINCT POSITION FROM match_season
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the players from college UCLA.
SELECT Player FROM match_season WHERE College = "UCLA"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Who are the players from UCLA?
SELECT Player FROM match_season WHERE College = "UCLA"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the distinct position of players from college UCLA or Duke.
SELECT DISTINCT POSITION FROM match_season WHERE College = "UCLA" OR College = "Duke"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What are the different positions of players from UCLA or Duke colleges?
SELECT DISTINCT POSITION FROM match_season WHERE College = "UCLA" OR College = "Duke"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the draft pick numbers and draft classes of players whose positions are defenders.
SELECT Draft_Pick_Number , Draft_Class FROM match_season WHERE POSITION = "Defender"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What are the draft pick numbers and draft classes for players who play the Defender position?
SELECT Draft_Pick_Number , Draft_Class FROM match_season WHERE POSITION = "Defender"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
How many distinct teams are involved in match seasons?
SELECT count(DISTINCT Team) FROM match_season
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Count the number of different teams involved in match season.
SELECT count(DISTINCT Team) FROM match_season
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the players and the years played.
SELECT Player , Years_Played FROM player
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Who are the different players and how many years has each played?
SELECT Player , Years_Played FROM player
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show all team names.
SELECT Name FROM Team
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What are the names of all teams?
SELECT Name FROM Team
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the season, the player, and the name of the country that player belongs to.
SELECT T2.Season , T2.Player , T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
For each player, what are their name, season, and country that they belong to?
SELECT T2.Season , T2.Player , T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Which players are from Indonesia?
SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = "Indonesia"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Who are the players from Indonesia?
SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = "Indonesia"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What are the distinct positions of the players from a country whose capital is Dublin?
SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = "Dublin"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Give the different positions of players who play for the country with the capital Dublin.
SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = "Dublin"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What are the official languages of the countries of players from Maryland or Duke college?
SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = "Maryland" OR T2.College = "Duke"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Return the official native languages of countries who have players from Maryland or Duke colleges.
SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = "Maryland" OR T2.College = "Duke"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
How many distinct official languages are there among countries of players whose positions are defenders.
SELECT count(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Count the number of different official languages corresponding to countries that players who play Defender are from.
SELECT count(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the season, the player, and the name of the team that players belong to.
SELECT T1.Season , T1.Player , T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Who are the different players, what season do they play in, and what is the name of the team they are on?
SELECT T1.Season , T1.Player , T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the positions of the players from the team with name "Ryley Goldner".
SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Ryley Goldner"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Return the positions of players on the team Ryley Goldner.
SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Ryley Goldner"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
How many distinct colleges are associated with players from the team with name "Columbus Crew".
SELECT count(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Count the number of different colleges that players who play for Columbus Crew are from.
SELECT count(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the players and years played for players from team "Columbus Crew".
SELECT T1.Player , T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What are the players who played for Columbus Crew, and how many years did each play for?
SELECT T1.Player , T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew"
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the position of players and the corresponding number of players.
SELECT POSITION , COUNT(*) FROM match_season GROUP BY POSITION
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
How many players played each position?
SELECT POSITION , COUNT(*) FROM match_season GROUP BY POSITION
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the country names and the corresponding number of players.
SELECT Country_name , COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
How many players are from each country?
SELECT Country_name , COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Return all players sorted by college in ascending alphabetical order.
SELECT player FROM match_season ORDER BY College ASC
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What are all the players who played in match season, sorted by college in ascending alphabetical order?
SELECT player FROM match_season ORDER BY College ASC
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the most common position of players in match seasons.
SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY count(*) DESC LIMIT 1
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What is the position that is most common among players in match seasons?
SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY count(*) DESC LIMIT 1
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
Show the top 3 most common colleges of players in match seasons.
SELECT College FROM match_season GROUP BY College ORDER BY count(*) DESC LIMIT 3
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1
match_season
What are the three colleges from which the most players are from?
SELECT College FROM match_season GROUP BY College ORDER BY count(*) DESC LIMIT 3
CREATE TABLE "country" ( "Country_id" int, "Country_name" text, "Capital" text, "Official_native_language" text, PRIMARY KEY ("Country_id") ) 3 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) 3 Iraq Baghdad Arabic ( Arabic script ) Kurdish CREATE TABLE `team` ( `Team_id` int, `Name` text, PRIMARY KEY (`Team_id`) ) 3 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil 3 Anais VonRueden CREATE TABLE "match_season" ( "Season" real, "Player" text, "Position" text, "Country" int, "Team" int, "Draft_Pick_Number" int, "Draft_Class" text, "College" text, PRIMARY KEY ("Season"), FOREIGN KEY (`Country`) REFERENCES `country`(`Country_id`), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV 1998.0 Ben Olsen Category:Articles with hCards Midfielder 4 3 2 Project-40 Virginia CREATE TABLE "player" ( "Player_ID" int, "Player" text, "Years_Played" text, "Total_WL" text, "Singles_WL" text, "Doubles_WL" text, "Team" int, PRIMARY KEY ("Player_ID"), FOREIGN KEY (`Team`) REFERENCES `team`(`Team_id`) ) 3 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 3 Im Kyu-tae (492) 8 (2003–2005, 2007–2011) 6–9 5–7 1–2 1