ajayk007/querysmith-spider-bird huggingface dataset:
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE customers (
  CustomerID integer PRIMARY KEY,
  First text,
  Last text,
  StreetAddress text,
  City text,
  State text,
  ZipCode integer,
  Email text,
  PhoneNumber text,
  FirstPurchaseDate date,
  SubscribedToEmailList text,
  Gender text
);
CREATE TABLE geolocation (
  LocationID integer PRIMARY KEY,
  Latitude real,
  Longitude real
);
CREATE TABLE location (
  LocationID integer PRIMARY KEY,
  LocationName text,
  StreetAddress text,
  City text,
  State text,
  ZipCode integer
);
CREATE TABLE rootbeerbrand (
  BrandID integer PRIMARY KEY,
  BrandName text,
  FirstBrewedYear integer,
  BreweryName text,
  City text,
  State text,
  Country text,
  Description text,
  CaneSugar text,
  CornSyrup text,
  Honey text,
  ArtificialSweetener text,
  Caffeinated text,
  Alcoholic text,
  AvailableInCans text,
  AvailableInBottles text,
  AvailableInKegs text,
  Website text,
  FacebookPage text,
  Twitter text,
  WholesaleCost real,
  CurrentRetailPrice real
);
CREATE TABLE rootbeer (
  RootBeerID integer PRIMARY KEY,
  BrandID integer,
  ContainerType text,
  LocationID integer,
  PurchaseDate date
);
CREATE TABLE rootbeerreview (
  CustomerID integer PRIMARY KEY,
  BrandID integer PRIMARY KEY,
  StarRating integer,
  ReviewDate date,
  Review text
);
CREATE TABLE transaction (
  TransactionID integer PRIMARY KEY,
  CreditCardNumber integer,
  CustomerID integer,
  TransactionDate date,
  CreditCardType text,
  LocationID integer,
  RootBeerID integer,
  PurchasePrice real
);
-- foreign keys: geolocation.LocationID -> location.LocationID; location.LocationID -> geolocation.LocationID; rootbeer.BrandID -> rootbeerbrand.BrandID; rootbeer.LocationID -> location.LocationID; rootbeer.LocationID -> geolocation.LocationID; rootbeerreview.BrandID -> rootbeerbrand.BrandID; rootbeerreview.CustomerID -> customers.CustomerID; transaction.RootBeerID -> rootbeer.RootBeerID; transaction.LocationID -> location.LocationID; transaction.CustomerID -> customers.CustomerID

Hint: lowest star rating refers to MIN(StarRating); "Too spicy!" review refers to Review = 'Too Spicy!';

Question: Which brand has the lowest star rating with a "Too spicy!" review?

assistant: SELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T2.BrandID = T1.BrandID WHERE T2.StarRating = 1 AND T2.Review = 'Too Spicy!'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE course (
  course_id integer PRIMARY KEY,
  name text,
  credit integer,
  diff integer
);
CREATE TABLE prof (
  prof_id integer PRIMARY KEY,
  gender text,
  first_name text,
  last_name text,
  email text,
  popularity integer,
  teachingability integer,
  graduate_from text
);
CREATE TABLE RA (
  student_id integer PRIMARY KEY,
  capability integer,
  prof_id integer PRIMARY KEY,
  salary text
);
CREATE TABLE registration (
  course_id integer PRIMARY KEY,
  student_id integer PRIMARY KEY,
  grade text,
  sat integer
);
CREATE TABLE student (
  student_id integer PRIMARY KEY,
  f_name text,
  l_name text,
  phone_number text,
  email text,
  intelligence integer,
  gpa real,
  type text
);
-- foreign keys: RA.student_id -> student.student_id; RA.prof_id -> prof.prof_id; registration.student_id -> student.student_id; registration.course_id -> course.course_id

Hint: high salary refers to salary = 'high'; GPA higher than 3 refers to gpa > 3;

Question: Among the students with high salary, what is total number of students with a GPA higher than 3?

assistant: SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high' AND T2.gpa > 3
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
PRAGMA foreign_keys = ON;

CREATE TABLE Customers (
Customer_ID INTEGER NOT NULL,
Customer_name VARCHAR(40),
PRIMARY KEY (Customer_ID)
);

Question: Count the total number of policies used by the customer named "Dayana Robel".

assistant: SELECT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Dayana Robel"
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE langs (
  lid integer PRIMARY KEY,
  lang text,
  locale text,
  pages integer,
  words integer
);
CREATE TABLE pages (
  pid integer PRIMARY KEY,
  lid integer,
  page integer,
  revision integer,
  title text,
  words integer
);
CREATE TABLE words (
  wid integer PRIMARY KEY,
  word text,
  occurrences integer
);
CREATE TABLE langs_words (
  lid integer PRIMARY KEY,
  wid integer PRIMARY KEY,
  occurrences integer
);
CREATE TABLE pages_words (
  pid integer PRIMARY KEY,
  wid integer PRIMARY KEY,
  occurrences integer
);
CREATE TABLE biwords (
  lid integer PRIMARY KEY,
  w1st integer PRIMARY KEY,
  w2nd integer PRIMARY KEY,
  occurrences integer
);
-- foreign keys: pages.lid -> langs.lid; langs_words.wid -> words.wid; langs_words.lid -> langs.lid; pages_words.wid -> words.wid; pages_words.pid -> pages.pid; biwords.w2nd -> words.wid; biwords.w1st -> words.wid; biwords.lid -> langs.lid

Hint: repeated times of 2593 refers to occurrences = 2593;

Question: State the total pages of the words that has repeated times of 2593.

assistant: SELECT COUNT(T1.pages) FROM langs AS T1 INNER JOIN langs_words AS T2 ON T1.lid = T2.lid WHERE T2.occurrences = 2593
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
PRAGMA foreign_keys = ON;


CREATE TABLE "event" (
    "Event_ID" int,
    "Date" text,
    "Venue" text,
    "Name" text,
    "Event_Attendance" int,
    PRIMARY KEY ("Event_ID")
);

CREATE TABLE "journalist" (
    "journalist_ID" int,
    "Name" text,
    "Nationality" text,
    "Age" text,
    "Years_working" int,
    PRIMARY KEY ("journalist_ID")
);

Question: List the event venues and names that have the top 2 most number of people attended.

assistant: SELECT venue , name FROM event ORDER BY Event_Attendance DESC LIMIT 2
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE people (
  Customer ID text PRIMARY KEY,
  Customer Name text,
  Segment text,
  Country text,
  City text,
  State text,
  Postal Code integer,
  Region text PRIMARY KEY
);
CREATE TABLE product (
  Product ID text PRIMARY KEY,
  Product Name text,
  Category text,
  Sub-Category text,
  Region text PRIMARY KEY
);
CREATE TABLE central_superstore (
  Row ID integer PRIMARY KEY,
  Order ID text,
  Order Date date,
  Ship Date date,
  Ship Mode text,
  Customer ID text,
  Region text,
  Product ID text,
  Sales real,
  Quantity integer,
  Discount real,
  Profit real
);
CREATE TABLE east_superstore (
  Row ID integer PRIMARY KEY,
  Order ID text,
  Order Date date,
  Ship Date date,
  Ship Mode text,
  Customer ID text,
  Region text,
  Product ID text,
  Sales real,
  Quantity integer,
  Discount real,
  Profit real
);
CREATE TABLE south_superstore (
  Row ID integer PRIMARY KEY,
  Order ID text,
  Order Date date,
  Ship Date date,
  Ship Mode text,
  Customer ID text,
  Region text,
  Product ID text,
  Sales real,
  Quantity integer,
  Discount real,
  Profit real
);
CREATE TABLE west_superstore (
  Row ID integer PRIMARY KEY,
  Order ID text,
  Order Date date,
  Ship Date date,
  Ship Mode text,
  Customer ID text,
  Region text,
  Product ID text,
  Sales real,
  Quantity integer,
  Discount real,
  Profit real
);
-- foreign keys: central_superstore.Product ID -> product.Product ID; central_superstore.Region -> product.Region; central_superstore.Customer ID -> people.Customer ID; central_superstore.Region -> people.Region; east_superstore.Product ID -> product.Product ID; east_superstore.Region -> product.Region; east_superstore.Customer ID -> people.Customer ID; east_superstore.Region -> people.Region; south_superstore.Product ID -> product.Product ID; south_superstore.Region -> product.Region; south_superstore.Customer ID -> people.Customer ID; south_superstore.Region -> people.Region; west_superstore.Product ID -> product.Product ID; west_superstore.Region -> product.Region; west_superstore.Customer ID -> people.Customer ID; west_superstore.Region -> people.Region

Hint: made by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; the slowest delivery speed refers to "Ship Mode" = 'Standard Class';

Question: Among all the orders made by Aimee Bixby, how many of them chose the slowest delivery speed?

assistant: SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T2.`Ship Mode` = 'Standard Class'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE CBSA (
  CBSA integer PRIMARY KEY,
  CBSA_name text,
  CBSA_type text
);
CREATE TABLE state (
  abbreviation text PRIMARY KEY,
  name text
);
CREATE TABLE congress (
  cognress_rep_id text PRIMARY KEY,
  first_name text,
  last_name text,
  CID text,
  party text,
  state text,
  abbreviation text,
  House text,
  District integer,
  land_area real
);
CREATE TABLE zip_data (
  zip_code integer PRIMARY KEY,
  city text,
  state text,
  multi_county text,
  type text,
  organization text,
  time_zone text,
  daylight_savings text,
  latitude real,
  longitude real,
  elevation integer,
  state_fips integer,
  county_fips integer,
  region text,
  division text,
  population_2020 integer,
  population_2010 integer,
  households integer,
  avg_house_value integer,
  avg_income_per_household integer,
  persons_per_household real,
  white_population integer,
  black_population integer,
  hispanic_population integer,
  asian_population integer,
  american_indian_population integer,
  hawaiian_population integer,
  other_population integer,
  male_population integer,
  female_population integer,
  median_age real,
  male_median_age real,
  female_median_age real,
  residential_mailboxes integer,
  business_mailboxes integer,
  total_delivery_receptacles integer,
  businesses integer,
  1st_quarter_payroll integer,
  annual_payroll integer,
  employees integer,
  water_area real,
  land_area real,
  single_family_delivery_units integer,
  multi_family_delivery_units integer,
  total_beneficiaries integer,
  retired_workers integer,
  disabled_workers integer,
  parents_and_widowed integer,
  spouses integer,
  children integer,
  over_65 integer,
  monthly_benefits_all integer,
  monthly_benefits_retired_workers integer,
  monthly_benefits_widowed integer,
  CBSA integer
);
CREATE TABLE alias (
  zip_code integer PRIMARY KEY,
  alias text
);
CREATE TABLE area_code (
  zip_code integer PRIMARY KEY,
  area_code integer PRIMARY KEY
);
CREATE TABLE avoid (
  zip_code integer PRIMARY KEY,
  bad_alias text PRIMARY KEY
);
CREATE TABLE country (
  zip_code integer PRIMARY KEY,
  county text PRIMARY KEY,
  state text
);
CREATE TABLE zip_congress (
  zip_code integer PRIMARY KEY,
  district text PRIMARY KEY
);
-- foreign keys: congress.abbreviation -> state.abbreviation; zip_data.CBSA -> CBSA.CBSA; zip_data.state -> state.abbreviation; alias.zip_code -> zip_data.zip_code; area_code.zip_code -> zip_data.zip_code; avoid.zip_code -> zip_data.zip_code; country.state -> state.abbreviation; country.zip_code -> zip_data.zip_code; zip_congress.zip_code -> zip_data.zip_code; zip_congress.district -> congress.cognress_rep_id

Hint: "OUTAGAMIE" is the county

Question: Which state is Outagamie County in? Give the full name of the state.

assistant: SELECT DISTINCT T2.name FROM country AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.county = 'OUTAGAMIE'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
create table Student (
        StuID        INTEGER PRIMARY KEY,
        LName        VARCHAR(12),
        Fname        VARCHAR(12),
        Age      INTEGER,
        Sex      VARCHAR(1),
        Major        INTEGER,
        Advisor      INTEGER,
        city_code    VARCHAR(3)
 );
 

create table Dorm (
       dormid		INTEGER,
       dorm_name	VARCHAR(20),
       student_capacity	INTEGER,
       gender			VARCHAR(1)
) ;

create table Dorm_amenity (
       amenid			INTEGER,
       amenity_name		VARCHAR(25)
) ;

create table Has_amenity (
       dormid			INTEGER,
       amenid				INTEGER,
	FOREIGN KEY (dormid) REFERENCES `Dorm`(dormid),
	FOREIGN KEY (amenid) REFERENCES `Dorm_amenity`(amenid)
);

create table Lives_in (
       stuid 	      INTEGER,
       dormid		INTEGER,
       room_number	INTEGER,
	FOREIGN KEY (stuid) REFERENCES `Student`(StuID),
        FOREIGN KEY (dormid) REFERENCES `Dorm`(dormid)
);

Question: What is the first name of the students who are in age 20 to 25 and living in PHL city?

assistant: SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE film_text (
  film_id integer PRIMARY KEY,
  title text,
  description text
);
CREATE TABLE actor (
  actor_id integer PRIMARY KEY,
  first_name text,
  last_name text,
  last_update datetime
);
CREATE TABLE address (
  address_id integer PRIMARY KEY,
  address text,
  address2 text,
  district text,
  city_id integer,
  postal_code text,
  phone text,
  last_update datetime
);
CREATE TABLE category (
  category_id integer PRIMARY KEY,
  name text,
  last_update datetime
);
CREATE TABLE city (
  city_id integer PRIMARY KEY,
  city text,
  country_id integer,
  last_update datetime
);
CREATE TABLE country (
  country_id integer PRIMARY KEY,
  country text,
  last_update datetime
);
CREATE TABLE customer (
  customer_id integer PRIMARY KEY,
  store_id integer,
  first_name text,
  last_name text,
  email text,
  address_id integer,
  active integer,
  create_date datetime,
  last_update datetime
);
CREATE TABLE film (
  film_id integer PRIMARY KEY,
  title text,
  description text,
  release_year text,
  language_id integer,
  original_language_id integer,
  rental_duration integer,
  rental_rate real,
  length integer,
  replacement_cost real,
  rating text,
  special_features text,
  last_update datetime
);
CREATE TABLE film_actor (
  actor_id integer PRIMARY KEY,
  film_id integer PRIMARY KEY,
  last_update datetime
);
CREATE TABLE film_category (
  film_id integer PRIMARY KEY,
  category_id integer PRIMARY KEY,
  last_update datetime
);
CREATE TABLE inventory (
  inventory_id integer PRIMARY KEY,
  film_id integer,
  store_id integer,
  last_update datetime
);
CREATE TABLE language (
  language_id integer PRIMARY KEY,
  name text,
  last_update datetime
);
CREATE TABLE payment (
  payment_id integer PRIMARY KEY,
  customer_id integer,
  staff_id integer,
  rental_id integer,
  amount real,
  payment_date datetime,
  last_update datetime
);
CREATE TABLE rental (
  rental_id integer PRIMARY KEY,
  rental_date datetime,
  inventory_id integer,
  customer_id integer,
  return_date datetime,
  staff_id integer,
  last_update datetime
);
CREATE TABLE staff (
  staff_id integer PRIMARY KEY,
  first_name text,
  last_name text,
  address_id integer,
  picture blob,
  email text,
  store_id integer,
  active integer,
  username text,
  password text,
  last_update datetime
);
CREATE TABLE store (
  store_id integer PRIMARY KEY,
  manager_staff_id integer,
  address_id integer,
  last_update datetime
);

Question: To which country does the address '1386 Nakhon Sawan Boulevard' belong?

assistant: SELECT T1.country FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id INNER JOIN address AS T3 ON T2.city_id = T3.city_id WHERE T3.address = '1386 Nakhon Sawan Boulevard'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE bool (
  name text PRIMARY KEY
);
CREATE TABLE person (
  name text PRIMARY KEY
);
CREATE TABLE disabled (
  name text PRIMARY KEY
);
CREATE TABLE enlist (
  name text,
  organ text
);
CREATE TABLE filed_for_bankrupcy (
  name text PRIMARY KEY
);
CREATE TABLE longest_absense_from_school (
  name text PRIMARY KEY,
  month integer
);
CREATE TABLE male (
  name text PRIMARY KEY
);
CREATE TABLE no_payment_due (
  name text PRIMARY KEY,
  bool text
);
CREATE TABLE unemployed (
  name text PRIMARY KEY
);
CREATE TABLE enrolled (
  name text PRIMARY KEY,
  school text PRIMARY KEY,
  month integer
);
-- foreign keys: disabled.name -> person.name; enlist.name -> person.name; filed_for_bankrupcy.name -> person.name; longest_absense_from_school.name -> person.name; male.name -> person.name; no_payment_due.bool -> bool.name; no_payment_due.name -> person.name; unemployed.name -> person.name; enrolled.name -> person.name

Hint: school debt status refers to bool; bool = 'pos' means has payment due; bool = 'neg' means doesn't has payment due; student appear in male.name means he is a male; student does not appear in male.name means she is a female;

Question: What is the employment, disability, gender and school debt status for student180 and student117?

assistant: SELECT ( SELECT COUNT(name) FROM disabled WHERE name IN ('student180', 'student117') ), ( SELECT COUNT(name) FROM unemployed WHERE name IN ('student180', 'student117') ), ( SELECT COUNT(name) FROM male WHERE name IN ('student180', 'student117') ), ( SELECT COUNT(name) FROM no_payment_due WHERE name IN ('student180', 'student117'))
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE characters (
  movie_title text PRIMARY KEY,
  release_date text,
  hero text,
  villian text,
  song text
);
CREATE TABLE director (
  name text PRIMARY KEY,
  director text
);
CREATE TABLE movies_total_gross (
  movie_title text PRIMARY KEY,
  release_date text PRIMARY KEY,
  genre text,
  MPAA_rating text,
  total_gross text,
  inflation_adjusted_gross text
);
CREATE TABLE revenue (
  Year integer PRIMARY KEY,
  Studio Entertainment[NI 1] real,
  Disney Consumer Products[NI 2] real,
  Disney Interactive[NI 3][Rev 1] integer,
  Walt Disney Parks and Resorts real,
  Disney Media Networks text,
  Total integer
);
CREATE TABLE voice-actors (
  character text PRIMARY KEY,
  voice-actor text,
  movie text
);
-- foreign keys: characters.hero -> voice-actors.character; director.name -> characters.movie_title; movies_total_gross.movie_title -> characters.movie_title; voice-actors.movie -> characters.movie_title

Hint: Elsa is the main character of the movie which refers to hero = 'Elsa'; title refers to movie_title;

Question: Provide the title, total gross, and MPAA rating of the movie which has a hero named Elsa.

assistant: SELECT T1.movie_title, T1.total_gross, T1.MPAA_rating FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title INNER JOIN director AS T3 ON T3.name = T1.movie_title WHERE T2.hero = 'Elsa'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
PRAGMA foreign_keys = ON;
CREATE TABLE `Course_Authors_and_Tutors` (
`author_id` INTEGER PRIMARY KEY,
`author_tutor_ATB` VARCHAR(3),
`login_name` VARCHAR(40),
`password` VARCHAR(40),
`personal_name` VARCHAR(80),
`middle_name` VARCHAR(80),
`family_name` VARCHAR(80),
`gender_mf` VARCHAR(1),
`address_line_1` VARCHAR(80)
);

Question: List the dates of enrollment and completion of the student with family name "Zieme" and personal name "Bernie".

assistant: SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = "Zieme" AND T2.personal_name = "Bernie"
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
PRAGMA foreign_keys = ON;
CREATE TABLE `Addresses` (
`address_id` INTEGER PRIMARY KEY,
`address_details` VARCHAR(255)
);

Question: Return the name, phone number and email address for the customer with the most orders.

assistant: SELECT T1.customer_name , T1.customer_phone , T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY count(*) DESC LIMIT 1
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
PRAGMA foreign_keys = ON;
CREATE TABLE Ref_Hotel_Star_Ratings (
star_rating_code CHAR(15) NOT NULL,
star_rating_description VARCHAR(80),
PRIMARY KEY (star_rating_code),
UNIQUE (star_rating_code)
);


CREATE TABLE Locations (
Location_ID INTEGER NOT NULL,
Location_Name VARCHAR(255),
Address VARCHAR(255),
Other_Details VARCHAR(255),
PRIMARY KEY (Location_ID)
);

Question: Find the details of all the markets that are accessible by walk or bus.

assistant: SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = "walk" OR T2.How_to_Get_There = "bus"
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
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) 
);

Question: What campus has the most degrees  conferrred over its entire existence?

assistant: SELECT campus FROM degrees GROUP BY campus ORDER BY sum(degrees) DESC LIMIT 1