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 chapters (
  id integer PRIMARY KEY,
  Act integer,
  Scene integer,
  Description text,
  work_id integer
);
CREATE TABLE characters (
  id integer PRIMARY KEY,
  CharName text,
  Abbrev text,
  Description text
);
CREATE TABLE paragraphs (
  id integer PRIMARY KEY,
  ParagraphNum integer,
  PlainText text,
  character_id integer,
  chapter_id integer
);
CREATE TABLE works (
  id integer PRIMARY KEY,
  Title text,
  LongTitle text,
  Date integer,
  GenreType text
);

Hint: a year greater than the 89% of average year refers to DATE > multiply(divide(SUM(DATE) , COUNT(DATE)), 0.89)

Question: List the chapter ID of the works with a year greater than the 89% of average year of all listed works of Shakespeare.

assistant: SELECT T2.id FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.DATE > ( SELECT AVG(DATE) FROM works ) * 0.89
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 Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
);

Question: How many events did not have any participants?

assistant: SELECT count(*) FROM EVENTS WHERE event_id NOT IN (SELECT event_id FROM Participants_in_Events)
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 Author (
  Id integer PRIMARY KEY,
  Name text,
  Affiliation text
);
CREATE TABLE Conference (
  Id integer PRIMARY KEY,
  ShortName text,
  FullName text,
  HomePage text
);
CREATE TABLE Journal (
  Id integer PRIMARY KEY,
  ShortName text,
  FullName text,
  HomePage text
);
CREATE TABLE Paper (
  Id integer PRIMARY KEY,
  Title text,
  Year integer,
  ConferenceId integer,
  JournalId integer,
  Keyword text
);
CREATE TABLE PaperAuthor (
  PaperId integer,
  AuthorId integer,
  Name text,
  Affiliation text
);
-- foreign keys: Paper.JournalId -> Journal.Id; Paper.ConferenceId -> Conference.Id; PaperAuthor.AuthorId -> Author.Id; PaperAuthor.PaperId -> Paper.Id

Hint: conference ID less than 100 refers to ConferenceId < 100; in year 2006 refers to Year = 2006

Question: What is the title and author ID of paper with conference ID less than 100 in year 2006?

assistant: SELECT DISTINCT T1.Title, T2.AuthorId FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Year = 2006 AND T1.ConferenceId < 100
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 Scientists (
  SSN int,
  Name Char(30) not null,
  Primary Key (SSN)
);

Create table Projects (
  Code Char(4),
  Name Char(50) not null,
  Hours int,
  Primary Key (Code)
);
	
create table AssignedTo (
  Scientist int not null,
  Project char(4) not null,
  Primary Key (Scientist, Project),
  Foreign Key (Scientist) references Scientists (SSN),
  Foreign Key (Project) references Projects (Code)
);

Question: What is the total number of hours for all projects?

assistant: SELECT sum(hours) FROM projects
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:
-- phpMyAdmin SQL Dump
-- version 4.0.10.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 20, 2015 at 01:43 AM
-- Server version: 5.5.34-cll-lve
-- PHP Version: 5.4.23



/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
CREATE TABLE IF NOT EXISTS `regions` (
  `REGION_ID` decimal(5,0) NOT NULL,
  `REGION_NAME` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`REGION_ID`)
);

--
-- Dumping data for table `regions`
--

Question: What is all the information regarding employees who are managers?

assistant: SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id
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 `Third_Party_Companies` (
`company_id` INTEGER PRIMARY KEY ,
`company_type` VARCHAR(5) NOT NULL,
`company_name` VARCHAR(255),
`company_address` VARCHAR(255),
`other_company_details` VARCHAR(255)
);

Question: For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description.

assistant: SELECT T1.fault_short_name , T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id
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,
`line_1_number_building` VARCHAR(80),
`city` VARCHAR(50),
`zip_postcode` VARCHAR(20),
`state_province_county` VARCHAR(50),
`country` VARCHAR(50)
);

Question: What are the phone numbers and email addresses of all customers who have an outstanding balance of more than 2000?

assistant: SELECT phone_number , email_address FROM Customers WHERE amount_outstanding > 2000;
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 authors (
  au_id text PRIMARY KEY,
  au_lname text,
  au_fname text,
  phone text,
  address text,
  city text,
  state text,
  zip text,
  contract text
);
CREATE TABLE jobs (
  job_id integer PRIMARY KEY,
  job_desc text,
  min_lvl integer,
  max_lvl integer
);
CREATE TABLE publishers (
  pub_id text PRIMARY KEY,
  pub_name text,
  city text,
  state text,
  country text
);
CREATE TABLE employee (
  emp_id text PRIMARY KEY,
  fname text,
  minit text,
  lname text,
  job_id integer,
  job_lvl integer,
  pub_id text,
  hire_date datetime
);
CREATE TABLE pub_info (
  pub_id text PRIMARY KEY,
  logo blob,
  pr_info text
);
CREATE TABLE stores (
  stor_id text PRIMARY KEY,
  stor_name text,
  stor_address text,
  city text,
  state text,
  zip text
);
CREATE TABLE discounts (
  discounttype text,
  stor_id text,
  lowqty integer,
  highqty integer,
  discount real
);
CREATE TABLE titles (
  title_id text PRIMARY KEY,
  title text,
  type text,
  pub_id text,
  price real,
  advance real,
  royalty integer,
  ytd_sales integer,
  notes text,
  pubdate datetime
);
CREATE TABLE roysched (
  title_id text,
  lorange integer,
  hirange integer,
  royalty integer
);
CREATE TABLE sales (
  stor_id text PRIMARY KEY,
  ord_num text PRIMARY KEY,
  ord_date datetime,
  qty integer,
  payterms text,
  title_id text PRIMARY KEY
);
CREATE TABLE titleauthor (
  au_id text PRIMARY KEY,
  title_id text PRIMARY KEY,
  au_ord integer,
  royaltyper integer
);
-- foreign keys: employee.pub_id -> publishers.pub_id; employee.job_id -> jobs.job_id; pub_info.pub_id -> publishers.pub_id; discounts.stor_id -> stores.stor_id; titles.pub_id -> publishers.pub_id; roysched.title_id -> titles.title_id; sales.title_id -> titles.title_id; sales.stor_id -> stores.stor_id; titleauthor.title_id -> titles.title_id; titleauthor.au_id -> authors.au_id

Hint: store name refers to stor_name

Question: Please list the stores that ordered the book "Life Without Fear".

assistant: SELECT T2.stor_name FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id INNER JOIN titles AS T3 ON T1.title_id = T3.title_id WHERE T3.title = 'Life Without Fear'
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 Activity (
  actid INTEGER PRIMARY KEY,
  activity_name varchar(25)
);

create table Participates_in (
  stuid INTEGER,
  actid INTEGER,
  FOREIGN KEY(stuid) REFERENCES Student(StuID),
  FOREIGN KEY(actid) REFERENCES Activity(actid)
);

create table Faculty_Participates_in (
  FacID INTEGER,
  actid INTEGER,
  FOREIGN KEY(FacID) REFERENCES Faculty(FacID),
  FOREIGN KEY(actid) REFERENCES Activity(actid)
);

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 Faculty (
       FacID 	       INTEGER PRIMARY KEY,
       Lname		VARCHAR(15),
       Fname		VARCHAR(15),
       Rank		VARCHAR(15),
       Sex		VARCHAR(1),
       Phone		INTEGER,
       Room		VARCHAR(5),
       Building		VARCHAR(13)
);

Question: Show all the activity names and the number of faculty involved in each activity.

assistant: SELECT T1.activity_name , count(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID
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 geographic (
  city text PRIMARY KEY,
  county text,
  region text
);
CREATE TABLE generalinfo (
  id_restaurant integer PRIMARY KEY,
  label text,
  food_type text,
  city text,
  review real
);
CREATE TABLE location (
  id_restaurant integer PRIMARY KEY,
  street_num integer,
  street_name text,
  city text
);
-- foreign keys: generalinfo.city -> geographic.city; location.id_restaurant -> generalinfo.id_restaurant; location.city -> geographic.city

Question: How many streets with restaurants are there in the Northern California region?

assistant: SELECT COUNT(T1.city) FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'northern california'
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 "captain" (
"Captain_ID" int,
"Name" text,
"Ship_ID" int,
"age" text,
"Class" text,
"Rank" text,
PRIMARY KEY ("Captain_ID"),
FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID")
);

CREATE TABLE "Ship" (
"Ship_ID" int,
"Name" text,
"Type" text,
"Built_Year" real,
"Class" text,
"Flag" text,
PRIMARY KEY ("Ship_ID")
);

Question: What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?

assistant: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
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:
/* 
 * SQL scripts for CS61 Intro to SQL lectures
 * FILENAME SOCCER2.SQL
 */

DROP TABLE  IF EXISTS Player;
DROP TABLE  IF EXISTS Tryout;
DROP TABLE  IF EXISTS College;

CREATE TABLE 	College 
  ( cName   	varchar(20) NOT NULL,
    state   	varchar(2),
    enr     	numeric(5,0),
    PRIMARY KEY (cName)
  );

CREATE TABLE 	Player
  ( pID			numeric(5,0) NOT NULL,
  	pName   	varchar(20),
    yCard   	varchar(3),
    HS      	numeric(5,0),
    PRIMARY KEY (pID)
  );

CREATE TABLE 	Tryout
  ( pID			numeric(5,0),
  	cName   	varchar(20),
    pPos    	varchar(8),
    decision    varchar(3),
    PRIMARY KEY (pID, cName),
    FOREIGN KEY (pID) REFERENCES Player(pID),
    FOREIGN KEY (cName) REFERENCES College(cName)
  );

/* note that "left" and "right" are reserved words in SQL */

Question: What is average enrollment of colleges in the state FL?

assistant: SELECT avg(enr) FROM College WHERE state = 'FL'
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 current (
  ballotpedia_id text,
  bioguide_id text PRIMARY KEY,
  birthday_bio date,
  cspan_id real PRIMARY KEY,
  fec_id text,
  first_name text,
  gender_bio text,
  google_entity_id_id text,
  govtrack_id integer,
  house_history_id real,
  icpsr_id real,
  last_name text,
  lis_id text,
  maplight_id real,
  middle_name text,
  nickname_name text,
  official_full_name text,
  opensecrets_id text,
  religion_bio text,
  suffix_name text,
  thomas_id integer,
  votesmart_id real,
  wikidata_id text,
  wikipedia_id text
);
CREATE TABLE current-terms (
  address text,
  bioguide text PRIMARY KEY,
  caucus text,
  chamber text,
  class real,
  contact_form text,
  district real,
  end text PRIMARY KEY,
  fax text,
  last text,
  name text,
  office text,
  party text,
  party_affiliations text,
  phone text,
  relation text,
  rss_url text,
  start text,
  state text,
  state_rank text,
  title text,
  type text,
  url text
);
CREATE TABLE historical (
  ballotpedia_id text,
  bioguide_id text PRIMARY KEY,
  bioguide_previous_id text,
  birthday_bio text,
  cspan_id text,
  fec_id text,
  first_name text,
  gender_bio text,
  google_entity_id_id text,
  govtrack_id integer,
  house_history_alternate_id text,
  house_history_id real,
  icpsr_id real,
  last_name text,
  lis_id text,
  maplight_id text,
  middle_name text,
  nickname_name text,
  official_full_name text,
  opensecrets_id text,
  religion_bio text,
  suffix_name text,
  thomas_id text,
  votesmart_id text,
  wikidata_id text,
  wikipedia_id text
);
CREATE TABLE historical-terms (
  address text,
  bioguide text PRIMARY KEY,
  chamber text,
  class real,
  contact_form text,
  district real,
  end text,
  fax text,
  last text,
  middle text,
  name text,
  office text,
  party text,
  party_affiliations text,
  phone text,
  relation text,
  rss_url text,
  start text,
  state text,
  state_rank text,
  title text,
  type text,
  url text
);
CREATE TABLE social-media (
  bioguide text PRIMARY KEY,
  facebook text,
  facebook_id real,
  govtrack real,
  instagram text,
  instagram_id real,
  thomas integer,
  twitter text,
  twitter_id real,
  youtube text,
  youtube_id text
);
-- foreign keys: current-terms.bioguide -> current.bioguide_id; historical-terms.bioguide -> historical.bioguide_id; social-media.bioguide -> current.bioguide_id

Hint: start date refers to start; end date refers to end date; Pearl Peden Oldfield refers to official_full_name; official_full_name refers to first_name, middle_name, last_name

Question: Provide the start date, end date, and party of Pearl Peden Oldfield.

assistant: SELECT T2.start, T2.`end`, T2.party FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Pearl' AND T1.middle_name = 'Peden' AND T1.last_name = 'Oldfield'
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 Attributes (
  attribute_id integer PRIMARY KEY,
  attribute_name text
);
CREATE TABLE Categories (
  category_id integer PRIMARY KEY,
  category_name text
);
CREATE TABLE Compliments (
  compliment_id integer PRIMARY KEY,
  compliment_type text
);
CREATE TABLE Days (
  day_id integer PRIMARY KEY,
  day_of_week text
);
CREATE TABLE Years (
  year_id integer PRIMARY KEY,
  actual_year integer
);
CREATE TABLE Business_Attributes (
  attribute_id integer PRIMARY KEY,
  business_id integer PRIMARY KEY,
  attribute_value text
);
CREATE TABLE Business_Categories (
  business_id integer PRIMARY KEY,
  category_id integer PRIMARY KEY
);
CREATE TABLE Business_Hours (
  business_id integer PRIMARY KEY,
  day_id integer PRIMARY KEY,
  opening_time text,
  closing_time text
);
CREATE TABLE Checkins (
  business_id integer PRIMARY KEY,
  day_id integer PRIMARY KEY,
  label_time_0 text,
  label_time_1 text,
  label_time_2 text,
  label_time_3 text,
  label_time_4 text,
  label_time_5 text,
  label_time_6 text,
  label_time_7 text,
  label_time_8 text,
  label_time_9 text,
  label_time_10 text,
  label_time_11 text,
  label_time_12 text,
  label_time_13 text,
  label_time_14 text,
  label_time_15 text,
  label_time_16 text,
  label_time_17 text,
  label_time_18 text,
  label_time_19 text,
  label_time_20 text,
  label_time_21 text,
  label_time_22 text,
  label_time_23 text
);
CREATE TABLE Elite (
  user_id integer PRIMARY KEY,
  year_id integer PRIMARY KEY
);
CREATE TABLE Reviews (
  business_id integer PRIMARY KEY,
  user_id integer PRIMARY KEY,
  review_stars integer,
  review_votes_funny text,
  review_votes_useful text,
  review_votes_cool text,
  review_length text
);
CREATE TABLE Tips (
  business_id integer PRIMARY KEY,
  user_id integer PRIMARY KEY,
  likes integer,
  tip_length text
);
CREATE TABLE Users_Compliments (
  compliment_id integer PRIMARY KEY,
  user_id integer PRIMARY KEY,
  number_of_compliments text
);
CREATE TABLE Business (
  business_id integer PRIMARY KEY,
  active text,
  city text,
  state text,
  stars real,
  review_count text
);
CREATE TABLE Users (
  user_id integer PRIMARY KEY,
  user_yelping_since_year integer,
  user_average_stars text,
  user_votes_funny text,
  user_votes_useful text,
  user_votes_cool text,
  user_review_count text,
  user_fans text
);

Hint: actively running refers to active = 'TRUE'; Tolleson refers to city = 'Tolleson';

Question: State the number of actively running Yelp businesses in "Tolleson".

assistant: SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Tolleson' AND active LIKE 'TRUE'
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 employee (
  employee_id integer PRIMARY KEY,
  first_name text,
  last_name text,
  address text,
  city text,
  state text,
  zip integer,
  phone text,
  title text,
  salary integer,
  supervisor integer
);
CREATE TABLE establishment (
  license_no integer PRIMARY KEY,
  dba_name text,
  aka_name text,
  facility_type text,
  risk_level integer,
  address text,
  city text,
  state text,
  zip integer,
  latitude real,
  longitude real,
  ward integer
);
CREATE TABLE inspection (
  inspection_id integer PRIMARY KEY,
  inspection_date date,
  inspection_type text,
  results text,
  employee_id integer,
  license_no integer,
  followup_to integer
);
CREATE TABLE inspection_point (
  point_id integer PRIMARY KEY,
  Description text,
  category text,
  code text,
  fine integer,
  point_level text
);
CREATE TABLE violation (
  inspection_id integer PRIMARY KEY,
  point_id integer PRIMARY KEY,
  fine integer,
  inspector_comment text
);
-- foreign keys: employee.supervisor -> employee.employee_id; inspection.followup_to -> inspection.inspection_id; inspection.license_no -> establishment.license_no; inspection.employee_id -> employee.employee_id; violation.point_id -> inspection_point.point_id; violation.inspection_id -> inspection.inspection_id

Hint: risk level 3 refers to risk_level = '3'; tavern refers to facility_type = 'TAVERN'; average number = divide(count(inspection_id), sum(license_no)) where risk_level = '3' and facility_type = 'TAVERN'

Question: What is the average number of inspections did risk level 3 taverns have?

assistant: SELECT CAST(COUNT(T2.inspection_id) AS REAL) / COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = 3 AND T1.facility_type = 'TAVERN'
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 "member" (
"Member_ID" int,
"Card_Number" text,
"Name" text,
"Hometown" text,
"Level" int,
PRIMARY KEY ("Member_ID")
);

Question: What is the total number of purchases for members with level 6?

assistant: SELECT count(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6
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 "storm" (
"Storm_ID" int,
"Name" text,
"Dates_active" text,
"Max_speed" int,
"Damage_millions_USD" real,
"Number_Deaths" int,
PRIMARY KEY ("Storm_ID")
);

Question: What are the names of regions with two or more storms?

assistant: SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING count(*) >= 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 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 Faculty (
       FacID 	       INTEGER PRIMARY KEY,
       Lname		VARCHAR(15),
       Fname		VARCHAR(15),
       Rank		VARCHAR(15),
       Sex		VARCHAR(1),
       Phone		INTEGER,
       Room		VARCHAR(5),
       Building		VARCHAR(13)
);

create table Department (
       DNO   		INTEGER PRIMARY KEY,
       Division		VARCHAR(2),
       DName		VARCHAR(25),
       Room		VARCHAR(5),
       Building		VARCHAR(13),
       DPhone		INTEGER
);

create table Member_of (
       FacID 	       INTEGER,
       DNO	       INTEGER,
       Appt_Type       VARCHAR(15),
       FOREIGN KEY(FacID) REFERENCES Faculty(FacID),
       FOREIGN KEY(DNO) REFERENCES Department(DNO)
);

create table Course (
       CID   	    	VARCHAR(7) PRIMARY KEY,
       CName		VARCHAR(40),
       Credits		INTEGER,
       Instructor	INTEGER,
       Days		VARCHAR(5),
       Hours		VARCHAR(11),
       DNO		INTEGER,
       FOREIGN KEY(Instructor) REFERENCES Faculty(FacID),
       FOREIGN KEY(DNO) REFERENCES Department(DNO)
);

create table Minor_in (
       StuID 	      INTEGER,
       DNO		INTEGER,
       FOREIGN KEY(StuID) REFERENCES Student(StuID),
       FOREIGN KEY(DNO) REFERENCES Department(DNO)
);

create table Enrolled_in (
       StuID 		 INTEGER,
       CID		VARCHAR(7),
       Grade		VARCHAR(2),
       FOREIGN KEY(StuID) REFERENCES Student(StuID),
       FOREIGN KEY(CID) REFERENCES Course(CID),
       FOREIGN KEY(Grade) REFERENCES Gradeconversion(lettergrade)
);

create table Gradeconversion (
       lettergrade	     VARCHAR(2) PRIMARY KEY,
       gradepoint	     FLOAT
);

Question: What are the first names for students who have an "a" in their first name?

assistant: SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'