db_id
stringclasses 127
values | query
stringlengths 20
523
| question
stringlengths 16
224
| schema
stringclasses 127
values |
---|---|---|---|
csu_1
|
SELECT campus FROM degrees GROUP BY campus ORDER BY sum(degrees) DESC LIMIT 1
|
Which campus has the most degrees conferred in all times?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT campus FROM degrees GROUP BY campus ORDER BY sum(degrees) DESC LIMIT 1
|
What campus has the most degrees conferrred over its entire existence?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1
|
Which campus has the most faculties in year 2003?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1
|
What campus has the most faculties in 2003?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT avg(campusfee) FROM csu_fees WHERE YEAR = 1996
|
Find the average fee on a CSU campus in 1996
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT avg(campusfee) FROM csu_fees WHERE YEAR = 1996
|
What is the average fee for a CSU campus in the year of 1996?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT avg(campusfee) FROM csu_fees WHERE YEAR = 2005
|
What is the average fee on a CSU campus in 2005?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT avg(campusfee) FROM csu_fees WHERE YEAR = 2005
|
What is the average fee for a CSU campus in the year of 2005?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus
|
report the total number of degrees granted between 1998 and 2002.
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus
|
how many degrees were conferred between 1998 and 2002?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = "Orange" AND T2.year >= 2000 GROUP BY T1.campus
|
For each Orange county campus, report the number of degrees granted after 2000.
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = "Orange" AND T2.year >= 2000 GROUP BY T1.campus
|
What is the total number of degrees granted after 2000 for each Orange county campus?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT max(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = "Orange")
|
Find the names of the campus which has more faculties in 2002 than every campus in Orange county.
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT max(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = "Orange")
|
What are the names of the campus that have more faculties in 2002 than the maximum number in Orange county?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200
|
What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200
|
What campus started in year 1956, has more than 200 full time students, and more than 400 students enrolled?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT count(*) FROM campuses WHERE county = "Los Angeles"
|
How many campuses are there in Los Angeles county?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT count(*) FROM campuses WHERE county = "Los Angeles"
|
How many campuses exist are in the county of LA?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT campus FROM campuses WHERE county = "Los Angeles"
|
List the campuses in Los Angeles county.
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT campus FROM campuses WHERE county = "Los Angeles"
|
What campuses are in Los Angeles county?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Jose State University" AND t2.year = 2000
|
How many degrees were conferred in "San Jose State University" in 2000?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Jose State University" AND t2.year = 2000
|
How many degrees were conferred at San Jose State University in 2000?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Francisco State University" AND t2.year = 2001
|
What are the degrees conferred in "San Francisco State University" in 2001.
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Francisco State University" AND t2.year = 2001
|
What degrees were conferred in San Francisco State University in the year 2001?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT sum(faculty) FROM faculty WHERE YEAR = 2002
|
How many faculty is there in total in the year of 2002?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT sum(faculty) FROM faculty WHERE YEAR = 2002
|
How many faculty, in total, are there in the year 2002?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = "Long Beach State University"
|
What is the number of faculty lines in campus "Long Beach State University" in 2002?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = "Long Beach State University"
|
What is the number of faculty at Long Beach State University in 2002?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = "San Francisco State University"
|
How many faculty lines are there in "San Francisco State University" in year 2004?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = "San Francisco State University"
|
How many faculty lines are there at San Francisco State University in 2004?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004
|
List the campus that have between 600 and 1000 faculty lines in year 2004.
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004
|
What are the campuses that had between 600 and 1000 faculty members in 2004?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1
|
How many faculty lines are there in the university that conferred the most number of degrees in year 2002?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1
|
How many faculty members did the university that conferred the most degrees in 2002 have?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees LIMIT 1
|
How many faculty lines are there in the university that conferred the least number of degrees in year 2001?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees LIMIT 1
|
How many faculty members are at the university that gave the least number of degrees in 2001?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT sum(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Jose State University"
|
How many undergraduates are there in "San Jose State University" in year 2004?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT sum(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Jose State University"
|
How many undergraduates are there at San Jose State
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT sum(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Francisco State University"
|
What is the number of graduates in "San Francisco State University" in year 2004?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT sum(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Francisco State University"
|
How many people graduated from San Francisco State University in 2004?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Francisco State University" AND t1.year = 2000
|
What is the campus fee of "San Francisco State University" in year 2000?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Francisco State University" AND t1.year = 2000
|
In the year 2000, what is the campus fee for San Francisco State University?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Jose State University" AND t1.year = 2000
|
Find the campus fee of "San Jose State University" in year 2000.
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Jose State University" AND t1.year = 2000
|
What is the campus fee in the year 2000 for San Jose State University?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT count(*) FROM campuses
|
How many CSU campuses are there?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
csu_1
|
SELECT count(*) FROM campuses
|
What is the total number of campuses?
|
CREATE TABLE "Campuses" (
"Id" INTEGER PRIMARY KEY,
"Campus" TEXT,
"Location" TEXT,
"County" TEXT,
"Year" INTEGER
);
CREATE TABLE "csu_fees" (
"Campus" INTEGER PRIMARY KEY,
"Year" INTEGER,
"CampusFee" INTEGER,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "degrees" (
"Year" INTEGER,
"Campus" INTEGER,
"Degrees" INTEGER,
PRIMARY KEY (Year, Campus),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "discipline_enrollments" (
"Campus" INTEGER,
"Discipline" INTEGER,
"Year" INTEGER,
"Undergraduate" INTEGER,
"Graduate" INTEGER,
PRIMARY KEY (Campus, Discipline),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "enrollments" (
"Campus" INTEGER,
"Year" INTEGER,
"TotalEnrollment_AY" INTEGER,
"FTE_AY" INTEGER,
PRIMARY KEY(Campus, Year),
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
CREATE TABLE "faculty" (
"Campus" INTEGER,
"Year" INTEGER,
"Faculty" REAL,
FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);
INSERT INTO Campuses VALUES [(1, 'California State University-Bakersfield', 'Bakersfield', 'Kern', 1965), (2, 'California State University-Channel Islands', 'Camarillo', 'Ventura', 2002)]
INSERT INTO csu_fees VALUES [(1, 1996, 1951), (2, 2003, 1868)]
INSERT INTO degrees VALUES [(1990, 1, 701), (1991, 1, 681)]
INSERT INTO discipline_enrollments VALUES [(1, 4, 2004, 248, 0), (1, 5, 2004, 811, 73)]
INSERT INTO enrollments VALUES [(1, 1956, 384, 123), (1, 1957, 432, 151)]
INSERT INTO faculty VALUES [(1, 2002, 357.1), (2, 2002, 48.4)]
|
candidate_poll
|
SELECT count(*) FROM candidate
|
How many candidates are there?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT count(*) FROM candidate
|
Count the number of candidates.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY count(*) DESC LIMIT 1
|
Which poll resource provided the most number of candidate information?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY count(*) DESC LIMIT 1
|
Return the poll resource associated with the most candidates.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3
|
what are the top 3 highest support rates?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3
|
Return the top 3 greatest support rates.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1
|
Find the id of the candidate who got the lowest oppose rate.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1
|
What is the id of the candidate with the lowest oppose rate?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT Support_rate , Consider_rate , Oppose_rate FROM candidate ORDER BY unsure_rate
|
Please list support, consider, and oppose rates for each candidate in ascending order by unsure rate.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT Support_rate , Consider_rate , Oppose_rate FROM candidate ORDER BY unsure_rate
|
What are the support, consider, and oppose rates of each candidate, ordered ascending by their unsure rate?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1
|
which poll source does the highest oppose rate come from?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1
|
Return the poll source corresponding to the candidate who has the oppose rate.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT name FROM people ORDER BY date_of_birth
|
List all people names in the order of their date of birth from old to young.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT name FROM people ORDER BY date_of_birth
|
What are the names of all people, ordered by their date of birth?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT avg(height) , avg(weight) FROM people WHERE sex = 'M'
|
Find the average height and weight for all males (sex is M).
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT avg(height) , avg(weight) FROM people WHERE sex = 'M'
|
What are the average height and weight across males (sex is M)?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT name FROM people WHERE height > 200 OR height < 190
|
find the names of people who are taller than 200 or lower than 190.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT name FROM people WHERE height > 200 OR height < 190
|
What are the names of people who have a height greater than 200 or less than 190?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT avg(weight) , min(weight) , sex FROM people GROUP BY sex
|
Find the average and minimum weight for each gender.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT avg(weight) , min(weight) , sex FROM people GROUP BY sex
|
What are the average and minimum weights for people of each sex?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT t1.name , t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1
|
Find the name and gender of the candidate who got the highest support rate.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT t1.name , t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1
|
What is the name and sex of the candidate with the highest support rate?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT t1.name , t1.sex , min(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex
|
Find the name of the candidates whose oppose percentage is the lowest for each sex.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT t1.name , t1.sex , min(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex
|
For each sex, what is the name and sex of the candidate with the oppose rate for their sex?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY avg(t2.unsure_rate) DESC LIMIT 1
|
which gender got the highest average uncertain ratio.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY avg(t2.unsure_rate) DESC LIMIT 1
|
What is the sex of the candidate who had the highest unsure rate?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT name FROM people WHERE people_id NOT IN (SELECT people_id FROM candidate)
|
what are the names of people who did not participate in the candidate election.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT name FROM people WHERE people_id NOT IN (SELECT people_id FROM candidate)
|
Give the names of people who did not participate in the candidate election.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate
|
Find the names of the candidates whose support percentage is lower than their oppose rate.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate
|
What are the names of candidates who have a lower support rate than oppose rate?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT count(*) , sex FROM people WHERE weight > 85 GROUP BY sex
|
how many people are there whose weight is higher than 85 for each gender?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT count(*) , sex FROM people WHERE weight > 85 GROUP BY sex
|
Count the number of people of each sex who have a weight higher than 85.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT max(support_rate) , min(consider_rate) , min(oppose_rate) FROM candidate
|
find the highest support percentage, lowest consider rate and oppose rate of all candidates.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT max(support_rate) , min(consider_rate) , min(oppose_rate) FROM candidate
|
Return the maximum support rate, minimum consider rate, and minimum oppose rate across all candidates?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name
|
list all female (sex is F) candidate names in the alphabetical order.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name
|
What are the names of all female candidates in alphabetical order (sex is F)?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT name FROM people WHERE height < (SELECT avg(height) FROM people)
|
find the name of people whose height is lower than the average.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT name FROM people WHERE height < (SELECT avg(height) FROM people)
|
What are the names of people who are shorter than average?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT * FROM people
|
List all info about all people.
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
candidate_poll
|
SELECT * FROM people
|
What is all the information about all people?
|
PRAGMA foreign_keys = ON;
CREATE TABLE "candidate" (
"Candidate_ID" int,
"People_ID" int,
"Poll_Source" text,
"Date" text,
"Support_rate" real,
"Consider_rate" real,
"Oppose_rate" real,
"Unsure_rate" real,
PRIMARY KEY ("Candidate_ID"),
FOREIGN KEY ("People_ID") REFERENCES "people"("People_ID")
);
CREATE TABLE "people" (
"People_ID" int,
"Sex" text,
"Name" text,
"Date_of_Birth" text,
"Height" real,
"Weight" real,
PRIMARY KEY ("People_ID")
);
INSERT INTO "people" VALUES (1,"M","Hubert Henno","06.10.1976","188","83");
INSERT INTO "candidate" VALUES (1,1,"WNBC/Marist Poll","Feb 12β15, 2007","0.25","0.30","0.43","0.2");
|
movie_1
|
SELECT title FROM Movie WHERE director = 'Steven Spielberg'
|
Find the titles of all movies directed by steven spielberg.
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT title FROM Movie WHERE director = 'Steven Spielberg'
|
What are the names of all movies directed by Steven Spielberg?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000
|
What is the name of the movie produced after 2000 and directed by James Cameron?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000
|
What are the titles of all movies that James Cameron directed after 2000?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT count(*) FROM Movie WHERE YEAR < 2000
|
How many movies were made before 2000?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT count(*) FROM Movie WHERE YEAR < 2000
|
How many movies were made before 2000?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT director FROM Movie WHERE title = 'Avatar'
|
Who is the director of movie Avatar?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT director FROM Movie WHERE title = 'Avatar'
|
Who directed Avatar?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT count(*) FROM Reviewer
|
How many reviewers listed?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT count(*) FROM Reviewer
|
How many reviewers are there?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT rID FROM Reviewer WHERE name LIKE "%Mike%"
|
What is the id of the reviewer whose name has substring βMikeβ?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT rID FROM Reviewer WHERE name LIKE "%Mike%"
|
What is the id of the reviewer whose name includes the word "Mike"?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT rID FROM Reviewer WHERE name = "Daniel Lewis"
|
What is the reviewer id of Daniel Lewis?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
movie_1
|
SELECT rID FROM Reviewer WHERE name = "Daniel Lewis"
|
What is the id of the reviewer named Daniel Lewis?
|
-- dbext:type=SQLITE:dbname=movie_rating.db
/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;
/* Create the schema for our tables */
create table Movie(
mID int primary key,
title text,
year int,
director text
);
create table Reviewer(
rID int primary key,
name text);
create table Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer(rID)
);
/* Populate the tables with our data */
insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.