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:
-- 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 */

Question: What are the names of all the different reviewers who rates Gone with the Wind?

assistant: SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.title = 'Gone with the Wind'
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 app_all (
  app_id integer PRIMARY KEY
);
CREATE TABLE app_events (
  event_id integer PRIMARY KEY,
  app_id integer PRIMARY KEY,
  is_installed integer,
  is_active integer
);
CREATE TABLE app_events_relevant (
  event_id integer PRIMARY KEY,
  app_id integer PRIMARY KEY,
  is_installed integer,
  is_active integer
);
CREATE TABLE app_labels (
  app_id integer,
  label_id integer
);
CREATE TABLE events (
  event_id integer PRIMARY KEY,
  device_id integer,
  timestamp datetime,
  longitude real,
  latitude real
);
CREATE TABLE events_relevant (
  event_id integer PRIMARY KEY,
  device_id integer,
  timestamp datetime,
  longitude real,
  latitude real
);
CREATE TABLE gender_age (
  device_id integer PRIMARY KEY,
  gender text,
  age integer,
  group text
);
CREATE TABLE gender_age_test (
  device_id integer PRIMARY KEY
);
CREATE TABLE gender_age_train (
  device_id integer PRIMARY KEY,
  gender text,
  age integer,
  group text
);
CREATE TABLE label_categories (
  label_id integer PRIMARY KEY,
  category text
);
CREATE TABLE phone_brand_device_model2 (
  device_id integer PRIMARY KEY,
  phone_brand text PRIMARY KEY,
  device_model text PRIMARY KEY
);
CREATE TABLE sample_submission (
  device_id integer PRIMARY KEY,
  F23- real,
  F24-26 real,
  F27-28 real,
  F29-32 real,
  F33-42 real,
  F43+ real,
  M22- real,
  M23-26 real,
  M27-28 real,
  M29-31 real,
  M32-38 real,
  M39+ real
);
-- foreign keys: app_events.event_id -> events.event_id; app_events_relevant.app_id -> app_all.app_id; app_events_relevant.event_id -> events_relevant.event_id; app_labels.app_id -> app_all.app_id; app_labels.label_id -> label_categories.label_id; events_relevant.device_id -> gender_age.device_id; gender_age.device_id -> phone_brand_device_model2.device_id

Question: Describe the device user gender and age of the event ID of 15251.

assistant: SELECT T1.gender, T1.age FROM gender_age AS T1 INNER JOIN events AS T2 ON T2.device_id = T1.device_id WHERE T2.event_id = 15251
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: Show member names without any registered branch.

assistant: SELECT name FROM member WHERE member_id NOT IN (SELECT member_id FROM membership_register_branch)
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 country (
  id integer PRIMARY KEY,
  country_name text
);
CREATE TABLE ranking_system (
  id integer PRIMARY KEY,
  system_name text
);
CREATE TABLE ranking_criteria (
  id integer PRIMARY KEY,
  ranking_system_id integer,
  criteria_name text
);
CREATE TABLE university (
  id integer PRIMARY KEY,
  country_id integer,
  university_name text
);
CREATE TABLE university_ranking_year (
  university_id integer,
  ranking_criteria_id integer,
  year integer,
  score integer
);
CREATE TABLE university_year (
  university_id integer,
  year integer,
  num_students integer,
  student_staff_ratio real,
  pct_international_students integer,
  pct_female_students integer
);
-- foreign keys: ranking_criteria.ranking_system_id -> ranking_system.id; university.country_id -> country.id; university_ranking_year.university_id -> university.id; university_ranking_year.ranking_criteria_id -> ranking_criteria.id; university_year.university_id -> university.id

Hint: lowest number of students refers to MIN(num_students); in 2015 refers to year = 2015; name of university refers to university_name;

Question: Show the name of the university with the lowest number of students in 2015.

assistant: SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 ORDER BY T1.num_students ASC 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:
CREATE TABLE ATT_CLASSES (
  ATT_CLASS_ID integer PRIMARY KEY,
  ATT_CLASS text
);
CREATE TABLE OBJ_CLASSES (
  OBJ_CLASS_ID integer PRIMARY KEY,
  OBJ_CLASS text
);
CREATE TABLE IMG_OBJ (
  IMG_ID integer PRIMARY KEY,
  OBJ_SAMPLE_ID integer PRIMARY KEY,
  OBJ_CLASS_ID integer,
  X integer,
  Y integer,
  W integer,
  H integer
);
CREATE TABLE IMG_OBJ_ATT (
  IMG_ID integer PRIMARY KEY,
  ATT_CLASS_ID integer PRIMARY KEY,
  OBJ_SAMPLE_ID integer PRIMARY KEY
);
CREATE TABLE PRED_CLASSES (
  PRED_CLASS_ID integer PRIMARY KEY,
  PRED_CLASS text
);
CREATE TABLE IMG_REL (
  IMG_ID integer PRIMARY KEY,
  PRED_CLASS_ID integer PRIMARY KEY,
  OBJ1_SAMPLE_ID integer PRIMARY KEY,
  OBJ2_SAMPLE_ID integer PRIMARY KEY
);
-- foreign keys: IMG_OBJ.OBJ_CLASS_ID -> OBJ_CLASSES.OBJ_CLASS_ID; IMG_OBJ_ATT.IMG_ID -> IMG_OBJ.IMG_ID; IMG_OBJ_ATT.OBJ_SAMPLE_ID -> IMG_OBJ.OBJ_SAMPLE_ID; IMG_OBJ_ATT.ATT_CLASS_ID -> ATT_CLASSES.ATT_CLASS_ID; IMG_REL.IMG_ID -> IMG_OBJ.IMG_ID; IMG_REL.OBJ2_SAMPLE_ID -> IMG_OBJ.OBJ_SAMPLE_ID; IMG_REL.IMG_ID -> IMG_OBJ.IMG_ID; IMG_REL.OBJ1_SAMPLE_ID -> IMG_OBJ.OBJ_SAMPLE_ID; IMG_REL.PRED_CLASS_ID -> PRED_CLASSES.PRED_CLASS_ID

Hint: number of images refers to IMG_ID; object sample of "suit" refers to OBJ_CLASS = 'suit'

Question: Give the number of images containing the object sample of "suit".

assistant: SELECT COUNT(T.IMG_ID) FROM ( SELECT T2.IMG_ID FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.OBJ_CLASS = 'suit' GROUP BY T2.IMG_ID ) T
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 "people" (
"People_ID" int,
"District" text,
"Name" text,
"Party" text,
"Age" int,
PRIMARY KEY ("People_ID")
);

CREATE TABLE "debate" (
"Debate_ID" int,
"Date" text,
"Venue" text,
"Num_of_Audience" int,
PRIMARY KEY ("Debate_ID")
);

Question: Show the names of people that are on affirmative side of debates with number of audience bigger than 200.

assistant: SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID WHERE T2.Num_of_Audience > 200
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 state (
  StateCode text PRIMARY KEY,
  State text,
  Region text
);
CREATE TABLE callcenterlogs (
  Date received date,
  Complaint ID text PRIMARY KEY,
  rand client text,
  phonefinal text,
  vru+line text,
  call_id integer,
  priority integer,
  type text,
  outcome text,
  server text,
  ser_start text,
  ser_exit text,
  ser_time text
);
CREATE TABLE client (
  client_id text PRIMARY KEY,
  sex text,
  day integer,
  month integer,
  year integer,
  age integer,
  social text,
  first text,
  middle text,
  last text,
  phone text,
  email text,
  address_1 text,
  address_2 text,
  city text,
  state text,
  zipcode integer,
  district_id integer
);
CREATE TABLE district (
  district_id integer PRIMARY KEY,
  city text,
  state_abbrev text,
  division text
);
CREATE TABLE events (
  Date received date,
  Product text,
  Sub-product text,
  Issue text,
  Sub-issue text,
  Consumer complaint narrative text,
  Tags text,
  Consumer consent provided? text,
  Submitted via text,
  Date sent to company text,
  Company response to consumer text,
  Timely response? text,
  Consumer disputed? text,
  Complaint ID text PRIMARY KEY,
  Client_ID text PRIMARY KEY
);
CREATE TABLE reviews (
  Date date PRIMARY KEY,
  Stars integer,
  Reviews text,
  Product text,
  district_id integer
);
-- foreign keys: callcenterlogs.rand client -> client.client_id; client.district_id -> district.district_id; district.state_abbrev -> state.StateCode; events.Client_ID -> client.client_id; events.Complaint ID -> callcenterlogs.Complaint ID; reviews.district_id -> district.district_id

Hint: the Northeast refers to Region = 'Northeast'; Microsoft email refers to email like '%@outlook.com'

Question: How many customers in the Northeast use Microsoft email?

assistant: SELECT COUNT(T1.email) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Northeast' AND T1.email LIKE '%@outlook.com'
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 id of the department with the fewest staff assignments.

assistant: SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY count(*) 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:
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 Club (
       ClubID           INTEGER PRIMARY KEY,
       ClubName         VARCHAR(40),
       ClubDesc         VARCHAR(1024),
       ClubLocation VARCHAR(40)
);

create table Member_of_club (
       StuID            INTEGER,
       ClubID           INTEGER,
       Position     VARCHAR(40),
       FOREIGN KEY(StuID) REFERENCES Student(StuID),
       FOREIGN KEY(ClubID) REFERENCES Club(ClubID)
);

Question: Count the number of clubs for which the student named "Eric Tai" is a member.

assistant: SELECT count(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Eric" AND t3.lname = "Tai"
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 country (
  origin integer PRIMARY KEY,
  country text
);
CREATE TABLE price (
  ID integer PRIMARY KEY,
  price real
);
CREATE TABLE data (
  ID integer PRIMARY KEY,
  mpg real,
  cylinders integer,
  displacement real,
  horsepower integer,
  weight integer,
  acceleration real,
  model integer,
  car_name text
);
CREATE TABLE production (
  ID integer PRIMARY KEY,
  model_year integer PRIMARY KEY,
  country integer
);
-- foreign keys: data.ID -> price.ID; production.ID -> price.ID; production.ID -> data.ID; production.country -> country.origin

Hint: car's name refers to car_name; the most fuel efficient refers to max(mpg); in 1975 refers to model_year = 1975

Question: Which is the most fuel efficient car in 1975?

assistant: SELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = '1975' ORDER BY T1.mpg 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:
CREATE TABLE Ingredient (
  ingredient_id integer PRIMARY KEY,
  category text,
  name text,
  plural text
);
CREATE TABLE Recipe (
  recipe_id integer PRIMARY KEY,
  title text,
  subtitle text,
  servings integer,
  yield_unit text,
  prep_min integer,
  cook_min integer,
  stnd_min integer,
  source text,
  intro text,
  directions text
);
CREATE TABLE Nutrition (
  recipe_id integer PRIMARY KEY,
  protein real,
  carbo real,
  alcohol real,
  total_fat real,
  sat_fat real,
  cholestrl real,
  sodium real,
  iron real,
  vitamin_c real,
  vitamin_a real,
  fiber real,
  pcnt_cal_carb real,
  pcnt_cal_fat real,
  pcnt_cal_prot real,
  calories real
);
CREATE TABLE Quantity (
  quantity_id integer PRIMARY KEY,
  recipe_id integer,
  ingredient_id integer,
  max_qty real,
  min_qty real,
  unit text,
  preparation text,
  optional text
);
-- foreign keys: Nutrition.recipe_id -> Recipe.recipe_id; Quantity.recipe_id -> Nutrition.recipe_id; Quantity.ingredient_id -> Ingredient.ingredient_id; Quantity.recipe_id -> Recipe.recipe_id

Hint: best in helping your body's natural defence against illness and infection refers to MAX(vitamin_a);

Question: How many ingredients are there in the recipe that is best in helping your body's natural defence against illness and infection?

assistant: SELECT COUNT(*) FROM Nutrition AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.vitamin_a > 0
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: have no attribute refers to attribute_value in( 'none', 'no', 'false')

Question: Mention the number of businesses that have no any attribute.

assistant: SELECT COUNT(business_id) FROM Business_Attributes WHERE attribute_value IN ('none', 'no', 'false')
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 "building" (
"building_id" text,
"Name" text,
"Street_address" text,
"Years_as_tallest" text,
"Height_feet" int,
"Floors" int,
PRIMARY KEY("building_id")
);

CREATE TABLE "Institution" (
"Institution_id"  text,
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" int,
"Team" text,
"Primary_Conference" text,
"building_id" text,
PRIMARY KEY("Institution_id"),
FOREIGN  KEY ("building_id") REFERENCES "building"("building_id")
);

CREATE TABLE "protein" (
"common_name" text,
"protein_name" text,
"divergence_from_human_lineage" real,
"accession_number" text,
"sequence_length" real,
"sequence_identity_to_human_protein" text,
"Institution_id" text,
PRIMARY KEY("common_name"),
FOREIGN KEY("Institution_id") REFERENCES "Institution"("Institution_id")
);

Question: For each building, show the name of the building and the number of institutions in it.

assistant: SELECT T1.name , count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_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:
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: organization refers to organ

Question: Does disable students join organization. If yes, please indicate the organization joined by the students.

assistant: SELECT DISTINCT T2.organ FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name`
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=OFF;
BEGIN TRANSACTION;
CREATE TABLE station (
    id INTEGER PRIMARY KEY,
    name TEXT,
    lat NUMERIC,
    long NUMERIC,
    dock_count INTEGER,
    city TEXT,
    installation_date TEXT);

Question: For each zip code, return the average mean temperature of August there.

assistant: SELECT zip_code , avg(mean_temperature_f) FROM weather WHERE date LIKE "8/%" GROUP BY zip_code
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 country (
  id integer PRIMARY KEY,
  country_name text
);
CREATE TABLE ranking_system (
  id integer PRIMARY KEY,
  system_name text
);
CREATE TABLE ranking_criteria (
  id integer PRIMARY KEY,
  ranking_system_id integer,
  criteria_name text
);
CREATE TABLE university (
  id integer PRIMARY KEY,
  country_id integer,
  university_name text
);
CREATE TABLE university_ranking_year (
  university_id integer,
  ranking_criteria_id integer,
  year integer,
  score integer
);
CREATE TABLE university_year (
  university_id integer,
  year integer,
  num_students integer,
  student_staff_ratio real,
  pct_international_students integer,
  pct_female_students integer
);
-- foreign keys: ranking_criteria.ranking_system_id -> ranking_system.id; university.country_id -> country.id; university_ranking_year.university_id -> university.id; university_ranking_year.ranking_criteria_id -> ranking_criteria.id; university_year.university_id -> university.id

Hint: in 2011 refers to year 2011; got the lowest score refers to MIN(score), teaching criteria refers to criteria_name = 'Teaching'

Question: In 2011, which university got the lowest score in teaching criteria?

assistant: SELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Teaching' AND T2.year = 2011 ORDER BY T2.score ASC 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:
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: How many different scientists are assigned to any project?

assistant: SELECT count(DISTINCT scientist) FROM assignedto