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 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

Question: What is the party and state of the legislator that has an open secrets ID of N00003689 and thomas ID of 186?

assistant: SELECT T2.party, T2.state FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.opensecrets_id = 'N00003689' AND T1.thomas_id = 186 GROUP BY T2.party, T2.state
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: display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary.

assistant: SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC
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 "mission" (
"Mission_ID" int,
"Ship_ID" int,
"Code" text,
"Launched_Year" int,
"Location" text,
"Speed_knots" int,
"Fate" text,
PRIMARY KEY ("Mission_ID"),
FOREIGN KEY ("Ship_ID") REFERENCES `ship`("Ship_ID")
);

CREATE TABLE "ship" (
"Ship_ID" int,
"Name" text,
"Type" text,
"Nationality" text,
"Tonnage" int,
PRIMARY KEY ("Ship_ID")
);

Question: Please show the most common type of ships.

assistant: SELECT TYPE FROM ship GROUP BY TYPE 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:
CREATE TABLE "list" ( 
	"LastName" TEXT, 
	"FirstName" TEXT, 
	"Grade" INTEGER, 
	"Classroom" INTEGER,
	PRIMARY KEY(LastName, FirstName)
);
CREATE TABLE "teachers" ( 
	"LastName" TEXT, 
	"FirstName" TEXT, 
	"Classroom" INTEGER,
	PRIMARY KEY(LastName, FirstName)
);

Question: Report the first name and last name of all the students.

assistant: SELECT DISTINCT firstname , lastname FROM list
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 Air Carriers (
  Code integer PRIMARY KEY,
  Description text
);
CREATE TABLE Airports (
  Code text PRIMARY KEY,
  Description text
);
CREATE TABLE Airlines (
  FL_DATE text,
  OP_CARRIER_AIRLINE_ID integer,
  TAIL_NUM text,
  OP_CARRIER_FL_NUM integer,
  ORIGIN_AIRPORT_ID integer,
  ORIGIN_AIRPORT_SEQ_ID integer,
  ORIGIN_CITY_MARKET_ID integer,
  ORIGIN text,
  DEST_AIRPORT_ID integer,
  DEST_AIRPORT_SEQ_ID integer,
  DEST_CITY_MARKET_ID integer,
  DEST text,
  CRS_DEP_TIME integer,
  DEP_TIME integer,
  DEP_DELAY integer,
  DEP_DELAY_NEW integer,
  ARR_TIME integer,
  ARR_DELAY integer,
  ARR_DELAY_NEW integer,
  CANCELLED integer,
  CANCELLATION_CODE text,
  CRS_ELAPSED_TIME integer,
  ACTUAL_ELAPSED_TIME integer,
  CARRIER_DELAY integer,
  WEATHER_DELAY integer,
  NAS_DELAY integer,
  SECURITY_DELAY integer,
  LATE_AIRCRAFT_DELAY integer
);
-- foreign keys: Airlines.OP_CARRIER_AIRLINE_ID -> Air Carriers.Code; Airlines.DEST -> Airports.Code; Airlines.ORIGIN -> Airports.Code

Hint: date of flight refers to FL_DATE; tail number of flight refers to TAIL_NUM; Ross Aviation Inc.: GWE refers to Description = 'Ross Aviation Inc.: GWE';

Question: Provide the date and tail number of flight with air carrier "Ross Aviation Inc.: GWE".

assistant: SELECT T1.FL_DATE, T1.TAIL_NUM FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T2.Description = 'Ross Aviation Inc.: GWE'
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 lists (
  user_id integer,
  list_id integer PRIMARY KEY,
  list_title text,
  list_movie_number integer,
  list_update_timestamp_utc text,
  list_creation_timestamp_utc text,
  list_followers integer,
  list_url text,
  list_comments integer,
  list_description text,
  list_cover_image_url text,
  list_first_image_url text,
  list_second_image_url text,
  list_third_image_url text
);
CREATE TABLE movies (
  movie_id integer PRIMARY KEY,
  movie_title text,
  movie_release_year integer,
  movie_url text,
  movie_title_language text,
  movie_popularity integer,
  movie_image_url text,
  director_id text,
  director_name text,
  director_url text
);
CREATE TABLE ratings_users (
  user_id integer,
  rating_date_utc text,
  user_trialist integer,
  user_subscriber integer,
  user_avatar_image_url text,
  user_cover_image_url text,
  user_eligible_for_trial integer,
  user_has_payment_method integer
);
CREATE TABLE lists_users (
  user_id integer PRIMARY KEY,
  list_id integer PRIMARY KEY,
  list_update_date_utc text,
  list_creation_date_utc text,
  user_trialist integer,
  user_subscriber integer,
  user_avatar_image_url text,
  user_cover_image_url text,
  user_eligible_for_trial text,
  user_has_payment_method text
);
CREATE TABLE ratings (
  movie_id integer,
  rating_id integer,
  rating_url text,
  rating_score integer,
  rating_timestamp_utc text,
  critic text,
  critic_likes integer,
  critic_comments integer,
  user_id integer,
  user_trialist integer,
  user_subscriber integer,
  user_eligible_for_trial integer,
  user_has_payment_method integer
);
-- foreign keys: lists.user_id -> lists_users.user_id; ratings_users.user_id -> lists_users.user_id; lists_users.user_id -> lists.user_id; lists_users.list_id -> lists.list_id; ratings.user_id -> ratings_users.user_id; ratings.user_id -> lists_users.user_id; ratings.movie_id -> movies.movie_id

Hint: most popular movies refers to MAX(movie_popularity); rating score of 5 refers to rating_score = 5; movies of the 21st century refers to movie_release_year> = 2000

Question: What are the top 5 most popular movies of the 21st century? Indicate how many users gave it a rating score of 5.

assistant: SELECT DISTINCT T2.movie_id, SUM(T1.rating_score = 5) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T2.movie_popularity DESC LIMIT 5
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: scored 40 refers to score = 40; in teaching refers to criteria_name = 'Teaching'

Question: How many universities scored 40 in teaching criteria?

assistant: SELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T2.score = 40 AND T1.criteria_name = 'Teaching' AND T2.score = 40
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 "Songs" ( 
	"SongId" INTEGER PRIMARY KEY, 
	"Title" TEXT 
);
CREATE TABLE "Albums" ( 
	"AId" INTEGER PRIMARY KEY, 
	"Title" TEXT, 
	"Year" INTEGER, 
	"Label" TEXT, 
	"Type" TEXT );
CREATE TABLE "Band" ( 
	"Id" INTEGER PRIMARY KEY, 
	"Firstname" TEXT, 
	"Lastname" TEXT );
CREATE TABLE "Instruments" ( 
	"SongId" INTEGER, 
	"BandmateId" INTEGER, 
	"Instrument" TEXT ,
	PRIMARY KEY(SongId, BandmateId, Instrument),
	FOREIGN KEY (SongId) REFERENCES Songs(SongId),
	FOREIGN KEY (BandmateId) REFERENCES Band(Id)
);
CREATE TABLE "Performance" ( 
	"SongId" INTEGER, 
	"Bandmate" INTEGER, 
	"StagePosition" TEXT,
	PRIMARY KEY(SongId, Bandmate),
	FOREIGN KEY (SongId) REFERENCES Songs(SongId),
	FOREIGN KEY (Bandmate) REFERENCES Band(Id)
);
CREATE TABLE "Tracklists" ( 
	"AlbumId" INTEGER, 
	"Position" INTEGER, 
	"SongId" INTEGER ,
	PRIMARY KEY(AlbumId, Position),
	FOREIGN KEY (SongId) REFERENCES Songs(SongId),
	FOREIGN KEY (AlbumId) REFERENCES Albums(AId)
);
CREATE TABLE "Vocals" ( 
	"SongId" INTEGER, 
	"Bandmate" INTEGER, 
	"Type" TEXT,
	PRIMARY KEY(SongId, Bandmate),
	FOREIGN KEY (SongId) REFERENCES Songs(SongId),
	FOREIGN KEY (Bandmate) REFERENCES Band(Id)
);

Question: What is the type of vocables that appears most frequently?

assistant: SELECT TYPE FROM vocals GROUP BY TYPE 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 "race" (
"Race_ID" int,
"Name" text,
"Class" text,
"Date" text,
"Track_ID" text,
PRIMARY KEY ("Race_ID"),
FOREIGN KEY ("Track_ID") REFERENCES "track"("Track_ID")
);

CREATE TABLE "track" (
"Track_ID" int,
"Name" text,
"Location" text,
"Seating" real,
"Year_Opened" real,
PRIMARY KEY ("Track_ID")
);

Question: What are the names and locations of tracks that have had exactly 1 race?

assistant: SELECT T2.name , T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id HAVING count(*) = 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 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: is medium refers to user_fans = 'Medium'; high compliments refers to number_of_compliments = 'High'

Question: Among the users whose fan is medium, how many users received high compliments from other users.

assistant: SELECT COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Users_Compliments AS T2 ON T1.user_id = T2.user_id WHERE T2.number_of_compliments = 'High' AND T1.user_fans = 'Medium'
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: word id refers to wid; repeated no more than 10 times refers to occurrences < = 10

Question: What is the word id of the catalan language that was repeated no more than 10 times in the said language?

assistant: SELECT wid FROM langs_words WHERE occurrences <= 10
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 runs (
  run_at text,
  max_rowid integer,
  reviews_added integer
);
CREATE TABLE podcasts (
  podcast_id text PRIMARY KEY,
  itunes_id integer,
  slug text,
  itunes_url text,
  title text
);
CREATE TABLE reviews (
  podcast_id text,
  title text,
  content text,
  rating integer,
  author_id text,
  created_at text
);
CREATE TABLE categories (
  podcast_id text PRIMARY KEY,
  category text PRIMARY KEY
);

Hint: podcast 'More Stupider: A 90-Day Fiance Podcast'  refers to title = 'More Stupider: A 90-Day Fiance Podcast'; rating of 1 refers to rating = 1

Question: Write all the review titles and the contents belonging to the podcast 'More Stupider: A 90-Day Fiance Podcast' with a review rating of 1.

assistant: SELECT title, content FROM reviews WHERE podcast_id = ( SELECT podcast_id FROM podcasts WHERE title = 'More Stupider: A 90-Day Fiance Podcast' ) AND rating = 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=OFF;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "Web_client_accelerator" (
"id" int,
"name" text,
"Operating_system" text,
"Client" text,
"Connection" text,
primary key("id")
);

Question: What is the maximum, minimum and average market share of the listed browsers?

assistant: SELECT max(market_share) , min(market_share) , avg(market_share) FROM browser
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: Twelfth Night refers to Title = 'Twelfth Night'

Question: What is the description of Act 1, Scene 2 in Twelfth Night?

assistant: SELECT T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Twelfth Night' AND T2.Act = 1 AND T2.Scene = 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 City (
  ID integer PRIMARY KEY,
  Name text,
  CountryCode text,
  District text,
  Population integer
);
CREATE TABLE Country (
  Code text PRIMARY KEY,
  Name text,
  Continent text,
  Region text,
  SurfaceArea real,
  IndepYear integer,
  Population integer,
  LifeExpectancy real,
  GNP real,
  GNPOld real,
  LocalName text,
  GovernmentForm text,
  HeadOfState text,
  Capital integer,
  Code2 text
);
CREATE TABLE CountryLanguage (
  CountryCode text PRIMARY KEY,
  Language text PRIMARY KEY,
  IsOfficial text,
  Percentage real
);
-- foreign keys: City.CountryCode -> Country.Code; CountryLanguage.CountryCode -> Country.Code

Question: Give the population of the country where Queimados city belongs.

assistant: SELECT T2.Population FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Queimados'
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 actor (
  ActorID integer PRIMARY KEY,
  Name text,
  Date of Birth date,
  Birth City text,
  Birth Country text,
  Height (Inches) integer,
  Biography text,
  Gender text,
  Ethnicity text,
  NetWorth text
);
CREATE TABLE movie (
  MovieID integer PRIMARY KEY,
  Title text,
  MPAA Rating text,
  Budget integer,
  Gross integer,
  Release Date text,
  Genre text,
  Runtime integer,
  Rating real,
  Rating Count integer,
  Summary text
);
CREATE TABLE characters (
  MovieID integer PRIMARY KEY,
  ActorID integer PRIMARY KEY,
  Character Name text,
  creditOrder integer,
  pay text,
  screentime text
);
-- foreign keys: characters.MovieID -> movie.MovieID; characters.ActorID -> actor.ActorID

Hint: drama genre refers to Genre = 'Drama'; net worth greater than $400,000,000.00 refers to NetWorth > '$400,000,000.00'; percentage = divide(count(ActorID where NetWorth > '$400,000,000.00'), COUNT(ActorID))*100%

Question: Among the movies with drama genre, what is the percentage of the actors with net worth greater than $400,000,000.00?

assistant: SELECT SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 400000000 THEN 1 ELSE 0 END) - SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) < 400000000 THEN 1 ELSE 0 END) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Genre = 'Drama'
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: What are the names and ids of products costing between 600 and 700?

assistant: SELECT product_name , product_id FROM products WHERE product_price BETWEEN 600 AND 700