aherntech/sparc huggingface dataset:
Database: company_office
Question sequence:
List the names of the buildings that have a status on-hold.
Also, list their height and number of stories.
Actually just show the names and number of stories for each!
Can you just show the names sorted by number of stories FROM least to greatest?
SQL query sequence:
SELECT name FROM buildings WHERE Status  =  "on-hold"
SELECT name, height, stories FROM buildings WHERE Status  =  "on-hold"
SELECT name, stories FROM buildings WHERE Status  =  "on-hold"
SELECT name FROM buildings WHERE Status  =  "on-hold" ORDER BY Stories ASC
Final question: Please show the names of the buildings whose status is "on-hold", in ascending order of stories.
Final SQL: SELECT name FROM buildings WHERE Status  =  "on-hold" ORDER BY Stories ASC
Database: company_office
Question sequence:
Show each company id and its industry.
Show how many companies are in each industry.
Sort industries by the number of companies in a descending order!
Actually, can you just show the industries!
SQL query sequence:
SELECT id, industry FROM companies
SELECT Industry, count(*) FROM Companies GROUP BY Industry
SELECT Industry, count(*) FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC
Final question: Please show the industries of companies in descending order of the number of companies.
Final SQL: SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC
Database: company_office
Question sequence:
How many different company industries are there?
What are they?
Which one has the least number of companies?
How about the most?
SQL query sequence:
SELECT count(distinct industry) FROM companies
SELECT distinct Industry FROM Companies
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) ASC LIMIT 1
SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1
Final question: List the industry shared by the most companies.
Final SQL: SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1
Database: company_office
Question sequence:
How many buildings are there?
How many have a company office?
What are their building names?
What are the names of the buildings other than those?
SQL query sequence:
SELECT count(*) FROM buildings
SELECT count(distinct building_id) FROM Office_locations
SELECT T2.name FROM Office_locations as T1 join buildings as T2 on T1.building_id = T2.id group by T2.id
SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations)
Final question: List the names of buildings that have no company office.
Final SQL: SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations)
Database: company_office
Question sequence:
How many different industries have companies have headquarters in USA?
headquarters in China?
how about both?
Which ones?
SQL query sequence:
SELECT count(distinct Industry) FROM companies where Headquarters  =  "USA"
SELECT count(distinct Industry) FROM companies where Headquarters  =  "China"
SELECT count(*) FROM (SELECT Industry FROM Companies WHERE Headquarters  =  "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters  =  "China")
SELECT Industry FROM Companies WHERE Headquarters  =  "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters  =  "China"
Final question: Show the industries shared by companies whose headquarters are "USA" and companies whose headquarters are "China".
Final SQL: SELECT Industry FROM Companies WHERE Headquarters  =  "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters  =  "China"
Database: company_office
Question sequence:
What industry is each company in?
How many companies are in Banking industry?
How about in the industry Conglomerate?
How many in total are in either one?
SQL query sequence:
SELECT id, industry FROM companies
SELECT count(*) FROM Companies WHERE Industry  =  "Banking"
SELECT count(*) FROM Companies WHERE Industry  =  "Conglomerate"
SELECT count(*) FROM Companies WHERE Industry  =  "Banking" OR Industry  =  "Conglomerate"
Final question: Find the number of companies whose industry is "Banking" or "Conglomerate",
Final SQL: SELECT count(*) FROM Companies WHERE Industry  =  "Banking" OR Industry  =  "Conglomerate"
Database: theme_gallery
Question sequence:
Show all info about artists.
How many are there?
SQL query sequence:
SELECT * FROM artist
SELECT count(*) FROM artist
Final question: How many artists do we have?
Final SQL: SELECT count(*) FROM artist
Database: theme_gallery
Question sequence:
Show all info about artists
Can you just give me their name and age?
Ohh also add their country.
Sort them by the year they joined.
SQL query sequence:
SELECT * FROM artist
SELECT name ,  age  FROM artist
SELECT name ,  age ,  country FROM artist
SELECT name ,  age ,  country FROM artist ORDER BY Year_Join
Final question: Show all artist name, age, and country ordered by the year they joined.
Final SQL: SELECT name ,  age ,  country FROM artist ORDER BY Year_Join
Database: theme_gallery
Question sequence:
Show all artists.
What are their countries?
Just give me distinct ones.
SQL query sequence:
SELECT * FROM artist
SELECT country FROM artist
SELECT DISTINCT country FROM artist
Final question: What are all distinct country for artists?
Final SQL: SELECT DISTINCT country FROM artist
Database: theme_gallery
Question sequence:
Show all artists.
What are their names and year they joined?
Oh please just consider those who are not from United States.
SQL query sequence:
SELECT * FROM artist
SELECT name ,  year_join FROM artist
SELECT name ,  year_join FROM artist WHERE country != 'United States'
Final question: Show all artist names and the year joined who are not from United States.
Final SQL: SELECT name ,  year_join FROM artist WHERE country != 'United States'
Database: theme_gallery
Question sequence:
Which artists have an age above 46?
Which artists have an age above 46 and joined after 1990?
How many are there?
SQL query sequence:
SELECT * FROM artist WHERE age  >  46
SELECT * FROM artist WHERE age  >  46 AND year_join  >  1990
SELECT count(*) FROM artist WHERE age  >  46 AND year_join  >  1990
Final question: How many artists are above age 46 and joined after 1990?
Final SQL: SELECT count(*) FROM artist WHERE age  >  46 AND year_join  >  1990
Database: theme_gallery
Question sequence:
Show all artists.
Just show those from United States.
What is their average age?
Also show their minimum age.
SQL query sequence:
SELECT * FROM artist
SELECT * FROM artist WHERE country  =  'United States'
SELECT avg(age)  FROM artist WHERE country  =  'United States'
SELECT avg(age) ,  min(age) FROM artist WHERE country  =  'United States'
Final question: What is the average and minimum age of all artists from United States.
Final SQL: SELECT avg(age) ,  min(age) FROM artist WHERE country  =  'United States'
Database: theme_gallery
Question sequence:
What is the year each artist joined?
Can you order artists by the year they joined?
What is the name of the artist who joined latest?
SQL query sequence:
SELECT year_join FROM artist
SELECT * FROM artist ORDER BY year_join
SELECT name FROM artist ORDER BY year_join DESC LIMIT 1
Final question: What is the name of the artist who joined latest?
Final SQL: SELECT name FROM artist ORDER BY year_join DESC LIMIT 1
Database: theme_gallery
Question sequence:
Show all info about exhibition.
Hmm just show those that took place after year 2005.
How many are there?
SQL query sequence:
SELECT * FROM exhibition
SELECT * FROM exhibition WHERE YEAR  >=  2005
SELECT count(*) FROM exhibition WHERE YEAR  >=  2005
Final question: How many exhibition are there in year 2005 or after?
Final SQL: SELECT count(*) FROM exhibition WHERE YEAR  >=  2005
Database: theme_gallery
Question sequence:
Show all info about exhibition.
What are their themes and years?
Which themes and years had ticket prices lower than 15?
SQL query sequence:
SELECT * FROM exhibition
SELECT theme ,  YEAR FROM exhibition
SELECT theme ,  YEAR FROM exhibition WHERE ticket_price  <  15
Final question: Show theme and year for all exhibitions with ticket prices lower than 15.
Final SQL: SELECT theme ,  YEAR FROM exhibition WHERE ticket_price  <  15
Database: theme_gallery
Question sequence:
Show all artist names.
Show all exhibitions.
Count exhibitions for each artist.
Show all artist names and the number of exhibitions for each artist.
SQL query sequence:
SELECT name from artist
SELECT * FROM exhibition
SELECT count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id
SELECT T2.name ,  count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id
Final question: Show all artist names and the number of exhibitions for each artist.
Final SQL: SELECT T2.name ,  count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id
Database: theme_gallery
Question sequence:
Count exhibitions for each artist.
Which artist has the most exhibitions?
Give me his or her name and country.
SQL query sequence:
SELECT count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id
SELECT * FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id ORDER BY count(*) DESC LIMIT 1
SELECT T2.name , T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id ORDER BY count(*) DESC LIMIT 1
Final question: What is the name and country for the artist with most number of exhibitions?
Final SQL: SELECT T2.name , T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id ORDER BY count(*) DESC LIMIT 1
Database: theme_gallery
Question sequence:
Show all artist ids involved in an exhibition.
Which artists did not have any exhibition?
What are their names?
SQL query sequence:
SELECT artist_id FROM exhibition
SELECT * FROM artist WHERE artist_id NOT IN (SELECT artist_id FROM exhibition)
SELECT name FROM artist WHERE artist_id NOT IN (SELECT artist_id FROM exhibition)
Final question: Show names for artists without any exhibition.
Final SQL: SELECT name FROM artist WHERE artist_id NOT IN (SELECT artist_id FROM exhibition)
Database: theme_gallery
Question sequence:
Show all exhibitions.
What is the average ticket price?
Which exhibitions have a ticket price higher than the average?
What are the themes and artist names for the exhibitions with a ticket price higher than the average?
SQL query sequence:
SELECT * FROM exhibition
SELECT avg(ticket_price) FROM exhibition
SELECT * FROM exhibition WHERE ticket_price  >  (SELECT avg(ticket_price) FROM exhibition)
SELECT T1.theme ,  T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id WHERE T1.ticket_price  >  (SELECT avg(ticket_price) FROM exhibition)
Final question: What is the theme and artist name for the exhibition with a ticket price higher than the average?
Final SQL: SELECT T1.theme ,  T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id WHERE T1.ticket_price  >  (SELECT avg(ticket_price) FROM exhibition)
Database: theme_gallery
Question sequence:
Show all info about exhibitions.
Which exhibitions were before year 2009?
What are their average ticket prices?
Can you also show their minimum, and maximum ticket prices?
SQL query sequence:
SELECT * FROM exhibition
SELECT * FROM exhibition WHERE YEAR  <  2009
SELECT avg(ticket_price) FROM exhibition WHERE YEAR  <  2009
SELECT avg(ticket_price) ,  min(ticket_price) ,  max(ticket_price) FROM exhibition WHERE YEAR  <  2009
Final question: Show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009.
Final SQL: SELECT avg(ticket_price) ,  min(ticket_price) ,  max(ticket_price) FROM exhibition WHERE YEAR  <  2009
Database: theme_gallery
Question sequence:
What is the ticket price of each exhibition?
Sort exhibitions in a descending order of ticket price.
Can you show the theme and year of exhibitions?
SQL query sequence:
SELECT ticket_price FROM exhibition
SELECT * FROM exhibition ORDER BY ticket_price DESC
SELECT theme ,  YEAR FROM exhibition ORDER BY ticket_price DESC
Final question: Show theme and year for all exhibitions in a descending order of ticket price.
Final SQL: SELECT theme ,  YEAR FROM exhibition ORDER BY ticket_price DESC
Database: theme_gallery
Question sequence:
Which exhibitions were held in year 2004?
What were the themes for each?
Can you also the dates, and attendances?
SQL query sequence:
SELECT * FROM exhibition WHERE year  =  2004
SELECT theme FROM exhibition WHERE year  =  2004
SELECT T2.theme ,  T1.date ,  T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T2.year  =  2004
Final question: What is the theme, date, and attendance for the exhibition in year 2004?
Final SQL: SELECT T2.theme ,  T1.date ,  T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T2.year  =  2004
Database: theme_gallery
Question sequence:
Show all exhibitions in 2004.
Show all artists.
Show all the names of the artists who didn't have an exhibition in 2004.
SQL query sequence:
select * from exhibition where year  =  2004
SELECT name FROM artist
SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id WHERE T1.year  =  2004
Final question: Show all artist names who didn't have an exhibition in 2004.
Final SQL: SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id WHERE T1.year  =  2004
Database: theme_gallery
Question sequence:
Show the theme of each exhibition.
How about of each exhibition with an attendance below 100?
How about of each exhibition with an attendance below 100 or above 500?
SQL query sequence:
SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id
SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  <  100
SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  <  100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  500
Final question: Show the theme for exhibitions with both records of an attendance below 100 and above 500.
Final SQL: SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  <  100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  500
Database: theme_gallery
Question sequence:
Which exhibition has an attendance more than 100?
How about those with an attendance of more than 100 or a ticket price below 10?
How many are there?
SQL query sequence:
SELECT * FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  100
SELECT * FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  100 OR T2.ticket_price  <  10
SELECT count(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  100 OR T2.ticket_price  <  10
Final question: How many exhibitions have a attendance more than 100 or have a ticket price below 10?
Final SQL: SELECT count(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  100 OR T2.ticket_price  <  10
Database: county_public_safety
Question sequence:
How many counties are there?
What is the average crime rate of counties?
How about the minimum and maximum?
SQL query sequence:
SELECT COUNT(*) FROM county_public_safety
SELECT avg(Crime_rate) FROM county_public_safety
SELECT min(Crime_rate) ,  max(Crime_rate) FROM county_public_safety
Final question: What are the minimum and maximum crime rate of counties?
Final SQL: SELECT min(Crime_rate) ,  max(Crime_rate) FROM county_public_safety
Database: county_public_safety
Question sequence:
What is the average population?
What is the maximum population?
What is the name of its county?
SQL query sequence:
SELECT AVG(Population) FROM county_public_safety
SELECT Population FROM county_public_safety ORDER BY Population DESC LIMIT 1
SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1
Final question: List the name of the county with the largest population.
Final SQL: SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1
Database: county_public_safety
Question sequence:
What is the minimum white percentage of the counties?
How about the largest 5 white percentages?
List the names of their cities.
SQL query sequence:
SELECT White FROM city ORDER BY White ASC LIMIT 1
SELECT White FROM city ORDER BY White DESC LIMIT 5
SELECT Name FROM city ORDER BY White DESC LIMIT 5
Final question: List the names of the city with the top 5 white percentages.
Final SQL: SELECT Name FROM city ORDER BY White DESC LIMIT 5
Database: county_public_safety
Question sequence:
What is the average number of police officers of all counties?
Which county has largest number of police officers? Show its county_ID.
Which cities are located in this county?
SQL query sequence:
SELECT AVG(Police_officers) FROM county_public_safety
SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1
SELECT name FROM city WHERE county_ID  =  (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1)
Final question: Show the name of cities in the county that has the largest number of police officers.
Final SQL: SELECT name FROM city WHERE county_ID  =  (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1)
Database: county_public_safety
Question sequence:
What is the average population of all counties?
How many counties have a population more than 20000?
How many cities are located in these counties?
SQL query sequence:
SELECT AVG(population) FROM county_public_safety
SELECT COUNT(*) FROM county_public_safety WHERE population  >  20000
SELECT count(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population  >  20000)
Final question: Show the number of cities in counties that have a population more than 20000.
Final SQL: SELECT count(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population  >  20000)
Database: county_public_safety
Question sequence:
What is the laargest white percentage among all cities?
How many cities have a white percentage of more than 90?
What is the id of the county this city is located in?
What is this county's crime rate?
SQL query sequence:
SELECT max(White) FROM city
SELECT COUNT(*) FROM city WHERE White  >  90
SELECT County_ID FROM city WHERE White  >  90
SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID  =  T2.County_ID WHERE T1.White  >  90
Final question: Show the crime rate of counties with a city having white percentage more than 90.
Final SQL: SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID  =  T2.County_ID WHERE T1.White  >  90
Database: county_public_safety
Question sequence:
How many different locations are there?
What is the location shared by the fewest counties?
How about the one shared by most counties?
SQL query sequence:
SELECT COUNT(DISTINCT LOCATION) FROM county_public_safety
SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) ASC LIMIT 1
SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
Final question: What is the location shared by most counties?
Final SQL: SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
Database: county_public_safety
Question sequence:
How many cities does each county have?
Could you order the results by the number of cities?
Which counties do not have any cities? List their names.
SQL query sequence:
SELECT County_ID, COUNT(*) FROM city GROUP BY County_ID
SELECT County_ID, COUNT(*) FROM city GROUP BY County_ID ORDER BY COUNT(*) DESC
SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city)
Final question: List the names of counties that do not have any cities.
Final SQL: SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city)
Database: county_public_safety
Question sequence:
How many counties with location on the east?
How about the number of counties with location on the west?
Please show the police forces in counties with location on the east.
How about the police forces shared by counties with location on the east and west?
SQL query sequence:
SELECT COUNT(*) FROM county_public_safety WHERE LOCATION  =  "East"
SELECT COUNT(*) FROM county_public_safety WHERE LOCATION  =  "West"
SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "East"
SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "West"
Final question: Show the police force shared by counties with location on the east and west.
Final SQL: SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "West"
Database: medicine_enzyme_interaction
Question sequence:
What is the id of the medicine 'Amisulpride'?
What are the enzyme ids that interact as inhibitor with medicine 'Amisulpride'?
What is the name of this enzyme?
SQL query sequence:
SELECT id from medicine WHERE name = 'Amisulpride'
SELECT T2.enzyme_id from medicine as T1 JOIN medicine_enzyme_interaction as T2 ON T1.id = T2.medicine_id WHERE T1.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor'
SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id  =  T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id  =  T3.id WHERE T3.name  =  'Amisulpride' AND T2.interaction_type  =  'inhibitor'
Final question: What are the names of enzymes in the medicine named 'Amisulpride' that can serve as an 'inhibitor'?
Final SQL: SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id  =  T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id  =  T3.id WHERE T3.name  =  'Amisulpride' AND T2.interaction_type  =  'inhibitor'
Database: medicine_enzyme_interaction
Question sequence:
What are the ids of medicines that interact with at least one enzyme?
Give their names, too.
Only show that information for medicines with at least two interactions.
SQL query sequence:
SELECT DISTINCT medicine_id from medicine_enzyme_interaction
SELECT T1.id ,  T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id
SELECT T1.id ,  T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
Final question: What are the ids and names of the medicine that can interact with two or more enzymes?
Final SQL: SELECT T1.id ,  T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
Database: medicine_enzyme_interaction
Question sequence:
Show the id, name, and FDA approval for medicines.
Only ones that have some interaction with an enzyme.
Order that by descending order of number of enzymes the medicine interacts with.
SQL query sequence:
SELECT id, name, FDA_approved from medicine
SELECT id, name, FDA_approved from medicine WHERE id in (SELECT medicine_id from medicine_enzyme_interaction)
SELECT T1.id ,  T1.Name ,  T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id ORDER BY count(*) DESC
Final question: What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with.
Final SQL: SELECT T1.id ,  T1.Name ,  T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id ORDER BY count(*) DESC