1sf/bird-sql-dev-xresults huggingface dataset:
Database: california_schools
Question: What is the lowest grade for the District Special Education Consortia School with National Center for Educational Statistics school district identification number of 0613360?
Evidence: District Special Education Consortia School refers to EdOpsCode = 'SPECON'.
SQL: SELECT MIN(T1.`Low Grade`) FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.NCESDist = '0613360' AND T2.EdOpsCode = 'SPECON'
Database: california_schools
Question: What is the city location of the high school level school with Lunch Provision 2 whose lowest grade is 9 and the highest grade is 12 in the county of Merced?
Evidence: High school can be represented as EILCode = 'HS'
SQL: SELECT T2.City FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`NSLP Provision Status` = 'Lunch Provision 2' AND T2.County = 'Merced' AND T1.`Low Grade` = 9 AND T1.`High Grade` = 12 AND T2.EILCode = 'HS'
Database: california_schools
Question: Which schools served a grade span of Kindergarten to 9th grade in the county of Los Angeles and what is its Percent (%) Eligible FRPM (Ages 5-17)?
Evidence: Percent (%) Eligible FRPM (Ages 5-17) can be acquired by `FRPM Count (Ages 5-17)` / `Enrollment (Ages 5-17)` * 100
SQL: SELECT T2.School, T1.`FRPM Count (Ages 5-17)` * 100 / T1.`Enrollment (Ages 5-17)` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'Los Angeles' AND T2.GSserved = 'K-9'
Database: california_schools
Question: Between San Diego and Santa Barbara, which county offers the most number of schools that does not offer physical building? Indicate the amount.
Evidence: 'Does not offer physical building' means Virtual = F in the database.
SQL: SELECT County, COUNT(Virtual) FROM schools WHERE (County = 'San Diego' OR County = 'Santa Barbara') AND Virtual = 'F' GROUP BY County ORDER BY COUNT(Virtual) DESC LIMIT 1
Database: california_schools
Question: In which city can you find the school in the state of California with the lowest latitude coordinates and what is its lowest grade? Indicate the school name.
Evidence: State of California refers to state = 'CA'
SQL: SELECT T2.City, T1.`Low Grade`, T1.`School Name` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.State = 'CA' ORDER BY T2.Latitude ASC LIMIT 1
Database: california_schools
Question: What is the grade span offered in the school with the highest longitude?
Evidence: the highest longitude refers to the school with the maximum absolute longitude value.
SQL: SELECT GSoffered FROM schools ORDER BY ABS(longitude) DESC LIMIT 1
Database: california_schools
Question: Of the schools that offers a magnet program serving a grade span of Kindergarten to 8th grade, how many offers Multiple Provision Types? List the number of cities that offers a Kindergarten to 8th grade span and indicate how many schools are there serving such grade span for each city.
Evidence: Kindergarten to 8th grade refers to K-8; 'Offers a magnet program' means Magnet = 1; Multiple Provision Types refers to `NSLP Provision Status` = 'Multiple Provision Types'
SQL: SELECT T2.City, COUNT(T2.CDSCode) FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.Magnet = 1 AND T2.GSoffered = 'K-8' AND T1.`NSLP Provision Status` = 'Multiple Provision Types' GROUP BY T2.City
Database: california_schools
Question: What is the Percent (%) Eligible Free (K-12) in the school administered by an administrator whose first name is Alusine. List the district code of the school.
Evidence: Percent (%) Eligible Free (K-12) = `Free Meal Count (K-12)` / `Enrollment (K-12)` * 100%
SQL: SELECT T1.`Free Meal Count (K-12)` * 100 / T1.`Enrollment (K-12)`, T1.`District Code` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.AdmFName1 = 'Alusine'
Database: california_schools
Question: What is the administrator's last name that oversees the school with Charter number 40? Indicate the district, the county where the school is situated, and the name of the school.
SQL: SELECT AdmLName1, District, County, School FROM schools WHERE CharterNum = '0040'
Database: california_schools
Question: What are the valid e-mail addresses of the administrator of the school located in the San Bernardino county, City of San Bernardino City Unified that opened between 1/1/2009 to 12/31/2010 whose school types are public Intermediate/Middle Schools and Unified Schools?
Evidence: Intermediate/Middle Schools refers to SOC = 62; Unified School refers to DOC = 54; years between 2009 and 2010 can refer to 'between 1/1/2009 to 12/31/2010'
SQL: SELECT T2.AdmEmail1, T2.AdmEmail2 FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'San Bernardino' AND T2.City = 'San Bernardino' AND T2.DOC = 54 AND strftime('%Y', T2.OpenDate) BETWEEN '2009' AND '2010' AND T2.SOC = 62
Database: financial
Question: How many accounts who choose issuance after transaction are staying in East Bohemia region?
Evidence: A3 contains the data of region; 'POPLATEK PO OBRATU' represents for 'issuance after transaction'.
SQL: SELECT COUNT(T2.account_id) FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id WHERE T1.A3 = 'east Bohemia' AND T2.frequency = 'POPLATEK PO OBRATU'
Database: financial
Question: How many accounts who have region in Prague are eligible for loans?
Evidence: A3 contains the data of region
SQL: SELECT COUNT(T1.account_id) FROM account AS T1 INNER JOIN loan AS T2 ON T1.account_id = T2.account_id INNER JOIN district AS T3 ON T1.district_id = T3.district_id WHERE T3.A3 = 'Prague'
Database: financial
Question: The average unemployment ratio of 1995 and 1996, which one has higher percentage?
Evidence: A12 refers to unemploymant rate 1995; A13 refers to unemploymant rate 1996
SQL: SELECT DISTINCT IIF(AVG(A13) > AVG(A12), '1996', '1995') FROM district
Database: financial
Question: List out the no. of districts that have female average salary is more than 6000 but less than 10000?
Evidence: A11 refers to average salary; Female mapps to gender = 'F'
SQL: SELECT COUNT(DISTINCT T2.district_id)  FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'F' AND T2.A11 BETWEEN 6000 AND 10000
Database: financial
Question: How many male customers who are living in North Bohemia have average salary greater than 8000?
Evidence: Male means that gender = 'M'; A3 refers to region; A11 pertains to average salary.
SQL: SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'M' AND T2.A3 = 'north Bohemia' AND T2.A11 > 8000
Database: financial
Question: List out the account numbers of female clients who are oldest and has lowest average salary, calculate the gap between this lowest average salary with the highest average salary?
Evidence: Female means gender = 'F'; A11 refers to average salary; Gap = highest average salary - lowest average salary; If the person A's birthdate > B's birthdate, it means that person B is order than person A.
SQL: SELECT T1.account_id , ( SELECT MAX(A11) - MIN(A11) FROM district ) FROM account AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN disp AS T3 ON T1.account_id = T3.account_id INNER JOIN client AS T4 ON T3.client_id = T4.client_id WHERE T2.district_id = ( SELECT district_id FROM client WHERE gender = 'F' ORDER BY birth_date ASC LIMIT 1 ) ORDER BY T2.A11 DESC LIMIT 1
Database: financial
Question: List out the account numbers of clients who are youngest and have highest average salary?
Evidence: If the person A's birthdate < B's birthdate, it means that person B is younger than person A; A11 refers to average salary
SQL: SELECT T1.account_id  FROM account AS T1 INNER JOIN disp AS T2 ON T1.account_id = T2.account_id INNER JOIN client AS T3 ON T2.client_id = T3.client_id INNER JOIN district AS T4 on T4.district_id = T1.district_id WHERE T2.client_id = ( SELECT client_id FROM client ORDER BY birth_date DESC LIMIT 1) GROUP BY T4.A11, T1.account_id
Database: financial
Question: How many customers who choose statement of weekly issuance are Owner?
Evidence: 'POPLATEK TYDNE' stands for weekly issuance
SQL: SELECT COUNT(T1.account_id) FROM account AS T1 INNER JOIN disp AS T2 ON T1.account_id = T2.account_id WHERE T2.type = 'OWNER' AND T1.frequency = 'POPLATEK TYDNE'
Database: financial
Question: List out the id number of client who choose statement of issuance after transaction are Disponent?
Evidence: 'POPLATEK PO OBRATU' stands for issuance after transaction
SQL: SELECT T2.client_id FROM account AS T1 INNER JOIN disp AS T2 ON T1.account_id = T2.account_id WHERE T1.frequency = 'POPLATEK PO OBRATU' AND T2.type = 'DISPONENT'
Database: financial
Question: Among the accounts who have approved loan date in 1997, list out the accounts that have the lowest approved amount and choose weekly issuance statement.
Evidence: 'POPLATEK TYDNE' stands for weekly issuance
SQL: SELECT T2.account_id FROM loan AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id WHERE STRFTIME('%Y', T1.date) = '1997' AND T2.frequency = 'POPLATEK TYDNE' ORDER BY T1.amount LIMIT 1
Database: financial
Question: Among the accounts who have loan validity more than 12 months, list out the accounts that have the highest approved amount and have account opening date in 1993.
Evidence: Loan validity more than 12 months refers to duration > 12
SQL: SELECT T1.account_id FROM loan AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id WHERE STRFTIME('%Y', T2.date) = '1993' AND T1.duration > 12 ORDER BY T1.amount DESC LIMIT 1
Database: toxicology
Question: Find the triple-bonded molecules which are carcinogenic.
Evidence: triple-bonded molecules refers to bond_type = '#'; carcinogenic refers to label = '+'
SQL: SELECT DISTINCT T2.molecule_id FROM bond AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.bond_type = '#' AND T2.label = '+'
Database: toxicology
Question: What is the percentage of carbon in double-bond molecules?
Evidence: carbon refers to element = 'c'; double-bond molecules refers to bond_type = '='; percentage = DIVIDE(SUM(element = 'c'), COUNT(atom_id))
SQL: SELECT CAST(COUNT(DISTINCT CASE WHEN T1.element = 'c' THEN T1.atom_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T1.atom_id) FROM atom AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.bond_type = '='
Database: toxicology
Question: How many triple type bonds are there?
Evidence: triple type bonds refers to bond_type = '#'
SQL: SELECT COUNT(T.bond_id) FROM bond AS T WHERE T.bond_type = '#'
Database: toxicology
Question: In how many atoms is there no bromine?
Evidence: atoms with no bromine refers to element ! = 'br'
SQL: SELECT COUNT(DISTINCT T.atom_id) FROM atom AS T WHERE T.element <> 'br'
Database: toxicology
Question: Of the first 100 molecules in number order, how many are carcinogenic?
Evidence: first 100 molecules in number order refers to molecule_id between 'TR000' and 'TR099'; label = '+' means molecules are carcinogenic
SQL: SELECT COUNT(T.molecule_id) FROM molecule AS T WHERE molecule_id BETWEEN 'TR000' AND 'TR099' AND T.label = '+'
Database: toxicology
Question: Identify by their ID the molecules in which there is carbon.
Evidence: carbon refers to element = 'c';
SQL: SELECT T.molecule_id FROM atom AS T WHERE T.element = 'c'
Database: toxicology
Question: What elements are in the TR004_8_9 bond atoms?
Evidence: TR004_8_9 bond atoms refers to bond_id = 'TR004_8_9';
SQL: SELECT DISTINCT T1.element FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T2.bond_id = 'TR004_8_9'
Database: toxicology
Question: What elements are in a double type bond?
Evidence: double type bond refers to bond_type = '=';
SQL: SELECT DISTINCT T1.element FROM atom AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN connected AS T3 ON T1.atom_id = T3.atom_id WHERE T2.bond_type = '='
Database: toxicology
Question: Which type of label is the most numerous in atoms with hydrogen?
Evidence: with hydrogen refers to element = 'h'; label most numerous in atoms refers to MAX(COUNT(label)); 
SQL: SELECT T.label FROM ( SELECT T2.label, COUNT(T2.molecule_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'h' GROUP BY T2.label ORDER BY COUNT(T2.molecule_id) DESC LIMIT 1 ) t
Database: toxicology
Question: Chlorine is in what type of bond?
Evidence: type of bond refers to bond_type; chlorine refers to element = 'cl'
SQL: SELECT DISTINCT T1.bond_type FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id INNER JOIN atom AS T3 ON T2.atom_id = T3.atom_id WHERE T3.element = 'cl'
Database: toxicology
Question: What atoms are connected in single type bonds?
Evidence: single type bond refers to bond_type = '-';
SQL: SELECT T2.atom_id, T2.atom_id2 FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id WHERE T1.bond_type = '-'
Database: toxicology
Question: Indicate which atoms are connected in non-carcinogenic type molecules.
Evidence: label = '-' means molecules are non-carcinogenic
SQL: SELECT DISTINCT T1.atom_id FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN connected AS T3 ON T1.atom_id = T3.atom_id WHERE T2.label = '-'
Database: toxicology
Question: Which element is the least numerous in non-carcinogenic molecules?
Evidence: label = '-' means molecules are non-carcinogenic; least numerous refers to MIN(COUNT(element));
SQL: SELECT T.element FROM (SELECT T1.element, COUNT(DISTINCT T1.molecule_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '-' GROUP BY T1.element ORDER BY COUNT(DISTINCT T1.molecule_id) ASC LIMIT 1) t
Database: toxicology
Question: What type of bond is there between the atoms TR004_8 and TR004_20?
Evidence: type of bond refers to bond_type; between the atoms TR004_8 and TR004_20 refers to atom_id = 'TR004_8' AND atom_id2 = 'TR004_20' OR another way around
SQL: SELECT T1.bond_type FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id WHERE T2.atom_id = 'TR004_8' AND T2.atom_id2 = 'TR004_20' OR T2.atom_id2 = 'TR004_8' AND T2.atom_id = 'TR004_20'
Database: toxicology
Question: What type of label is not on molecules with atoms with tin?
Evidence: tin refers to element ! = 'sn'; label = '+' mean molecules are carcinogenic; label = '-' means molecules are non-carcinogenic
SQL: SELECT DISTINCT T2.label FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element != 'sn'
Database: toxicology
Question: How many atoms with iodine and with sulfur type elements are there in single bond molecules?
Evidence: with iodine element refer to element = 'i'; with sulfur element refers to element = 's'; single type bond refers to bond_type = '-'; Should consider the distinct atoms when counting;
SQL: SELECT COUNT(DISTINCT CASE WHEN T1.element = 'i' THEN T1.atom_id ELSE NULL END) AS iodine_nums , COUNT(DISTINCT CASE WHEN T1.element = 's' THEN T1.atom_id ELSE NULL END) AS sulfur_nums FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id INNER JOIN bond AS T3 ON T2.bond_id = T3.bond_id WHERE T3.bond_type = '-'
Database: toxicology
Question: Identify all connected atoms with a triple bond.
Evidence: triple bond refers to bond_type = '#';
SQL: SELECT T2.atom_id, T2.atom_id2 FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id WHERE T1.bond_type = '#'
Database: toxicology
Question: Identify all the atoms that are connected to the atoms of the TR181 molecule.
Evidence: TR181 molecule refers to molecule_id = 'TR181'
SQL: SELECT T2.atom_id, T2.atom_id2 FROM atom AS T1 INNER JOIN connected AS T2 ON T2.atom_id = T1.atom_id WHERE T1.molecule_id = 'TR181'
Database: toxicology
Question: What percentage of carcinogenic-type molecules does not contain fluorine?
Evidence: label = '+' mean molecules are carcinogenic; contain fluorine refers to element = 'f'; percentage = DIVIDE(SUM(element = 'f') * 100, COUNT(molecule_id)) where label = '+'; Should consider the distinct atoms when counting;
SQL: SELECT CAST(COUNT(DISTINCT CASE WHEN T1.element <> 'f' THEN T2.molecule_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.molecule_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+'
Database: toxicology
Question: What is the percentage of carcinogenic molecules in triple type bonds?
Evidence: label = '+' mean molecules are carcinogenic; triple bond refers to bond_type = '#'; percentage = DIVIDE(SUM(bond_type = '#') * 100, COUNT(bond_id)) as percent where label = '+'
SQL: SELECT CAST(COUNT(DISTINCT CASE WHEN T2.label = '+' THEN T2.molecule_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.molecule_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN bond AS T3 ON T2.molecule_id = T3.molecule_id WHERE T3.bond_type = '#'
Database: toxicology
Question: Please list top three elements of the toxicology of the molecule TR000 in alphabetical order.
Evidence: TR000 is the molecule id;
SQL: SELECT DISTINCT T.element FROM atom AS T WHERE T.molecule_id = 'TR000' ORDER BY T.element LIMIT 3
Database: toxicology
Question: What are the atoms that are bonded in the molecule TR001 with the bond ID of TR001_2_6?
Evidence: TR001 is the molecule id; TR001_2_6 is the bond id
SQL: SELECT SUBSTR(T.bond_id, 1, 7) AS atom_id1 , T.molecule_id || SUBSTR(T.bond_id, 8, 2) AS atom_id2 FROM bond AS T WHERE T.molecule_id = 'TR001' AND T.bond_id = 'TR001_2_6'
Database: toxicology
Question: What is the difference between the number of molecules that are carcinogenic and those that are not?
Evidence: label = '+' means molecules are carcinogenic; label = '-' means molecules are non-carcinogenic; difference = SUBTRACT(SUM(label = '+'), SUM(label = '-'))
SQL: SELECT COUNT(CASE WHEN T.label = '+' THEN T.molecule_id ELSE NULL END) - COUNT(CASE WHEN T.label = '-' THEN T.molecule_id ELSE NULL END) AS diff_car_notcar FROM molecule t
Database: toxicology
Question: What are the atom IDs of the bond TR000_2_5?
Evidence: TR000_2_5 is the bond id
SQL: SELECT T.atom_id FROM connected AS T WHERE T.bond_id = 'TR000_2_5'
Database: toxicology
Question: What are the bond IDs that have the same atom ID 2 of TR000_2?
Evidence: TR000_2 is the atom id; atom ID 2 refers to atom_id2
SQL: SELECT T.bond_id FROM connected AS T WHERE T.atom_id2 = 'TR000_2'
Database: toxicology
Question: Please list top five molecules that have double bonds in alphabetical order.
Evidence: double bond refers to bond_type = ' = ';
SQL: SELECT DISTINCT T.molecule_id FROM bond AS T WHERE T.bond_type = '=' ORDER BY T.molecule_id LIMIT 5
Database: toxicology
Question: What is the percentage of double bonds in the molecule TR008? Please provide your answer as a percentage with five decimal places.
Evidence: double bond refers to bond_type = '='; TR008 is the molecule id; percentage = DIVIDE(SUM(bond_type = '='), COUNT(bond_id)) as percent where molecule_id = 'TR008'
SQL: SELECT ROUND(CAST(COUNT(CASE WHEN T.bond_type = '=' THEN T.bond_id ELSE NULL END) AS REAL) * 100 / COUNT(T.bond_id),5) FROM bond AS T WHERE T.molecule_id = 'TR008'
Database: toxicology
Question: What is the percentage of molecules that are carcinogenic? Please provide your answer as a percentage with three decimal places.
Evidence: label = '+' mean molecules are carcinogenic; percentage = DIVIDE(SUM(label = '+'), COUNT(molecule_id)) as percent
SQL: SELECT ROUND(CAST(COUNT(CASE WHEN T.label = '+' THEN T.molecule_id ELSE NULL END) AS REAL) * 100 / COUNT(T.molecule_id),3) FROM molecule t
Database: toxicology
Question: How much of the hydrogen in molecule TR206 is accounted for? Please provide your answer as a percentage with four decimal places.
Evidence: hydrogen refers to element = 'h'; TR206 is the molecule id; percentage = DIVIDE(SUM(element = 'h'), COUNT(atom_id)) as percent where molecule_id = 'TR206'
SQL: SELECT ROUND(CAST(COUNT(CASE WHEN T.element = 'h' THEN T.atom_id ELSE NULL END) AS REAL) * 100 / COUNT(T.atom_id),4) FROM atom AS T WHERE T.molecule_id = 'TR206'
Database: toxicology
Question: What is the type of bond that molecule TR000 has when involved in any bonds?
Evidence: type of bond refers to bond_type; TR000 is the molecule id
SQL: SELECT DISTINCT T.bond_type FROM bond AS T WHERE T.molecule_id = 'TR000'
Database: toxicology
Question: What are the elements of the toxicology and label of molecule TR060?
Evidence: TR060 is the molecule id; 
SQL: SELECT DISTINCT T1.element, T2.label FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.molecule_id = 'TR060'
Database: toxicology
Question: Which bond type accounted for the majority of the bonds found in molecule TR010 and state whether or not this molecule is carcinogenic?
Evidence: TR010 is the molecule id; majority of the bond found refers to MAX(COUNT(bond_type)); 
SQL: SELECT T.bond_type FROM ( SELECT T1.bond_type, COUNT(T1.molecule_id) FROM bond AS T1  WHERE T1.molecule_id = 'TR010' GROUP BY T1.bond_type ORDER BY COUNT(T1.molecule_id) DESC LIMIT 1 ) AS T
Database: toxicology
Question: Please list top three molecules that have single bonds between two atoms and are not carcinogenic in alphabetical order.
Evidence: label = '-' means molecules are not carcinogenic; single type bond refers to bond_type = '-'; list top three molecules refers to return molecule_id and order by molecule_id;
SQL: SELECT DISTINCT T2.molecule_id FROM bond AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.bond_type = '-' AND T2.label = '-' ORDER BY T2.molecule_id LIMIT 3
Database: toxicology
Question: Please list top two bonds that happened with the molecule TR006 in alphabetical order.
Evidence: TR006 is the molecule id
SQL: SELECT DISTINCT T2.bond_id FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T1.molecule_id = 'TR006' ORDER BY T2.bond_id LIMIT 2
Database: toxicology
Question: How many bonds which involved atom 12 does molecule TR009 have?
Evidence: TR009 is the molecule id;  involved atom 12 refers to atom_id = 'TR009_12' or atom_id2 = 'TR009_12'
SQL: SELECT COUNT(T2.bond_id) FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id WHERE T1.molecule_id = 'TR009' AND T2.atom_id = T1.molecule_id || '_1' AND T2.atom_id2 = T1.molecule_id || '_2'
Database: toxicology
Question: How many molecules are carcinogenic and have the bromine element?
Evidence: label = '+' mean molecules are carcinogenic; have bromine element refers to element = 'br'
SQL: SELECT COUNT(DISTINCT T2.molecule_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+' AND T1.element = 'br'
Database: toxicology
Question: What are the bond type and the atoms of the bond ID of TR001_6_9?
Evidence: atoms refer to atom_id or atom_id2
SQL: SELECT T1.bond_type, T2.atom_id, T2.atom_id2 FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id WHERE T2.bond_id = 'TR001_6_9'
Database: toxicology
Question: Which molecule does the atom TR001_10 belong to? Please state whether this molecule is carcinogenic or not.
Evidence: TR001_10 is the atom id; label = '+' mean molecules are carcinogenic
SQL: SELECT T2.molecule_id , IIF(T2.label = '+', 'YES', 'NO') AS flag_carcinogenic FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.atom_id = 'TR001_10'
Database: toxicology
Question: How many molecules have a triple bond type?
Evidence: triple bond refers to bond_type = '#';
SQL: SELECT COUNT(DISTINCT T.molecule_id) FROM bond AS T WHERE T.bond_type = '#'
Database: toxicology
Question: How many connections does the atom 19 have?
Evidence: connections refers to bond_id; atom 19 refers to atom_id like 'TR%_19';
SQL: SELECT COUNT(T.bond_id) FROM connected AS T WHERE SUBSTR(T.atom_id, -2) = '19'
Database: toxicology
Question: List all the elements of the toxicology of the molecule "TR004".
Evidence: TR004 is the molecule id;
SQL: SELECT DISTINCT T.element FROM atom AS T WHERE T.molecule_id = 'TR004'
Database: toxicology
Question: How many of the molecules are not carcinogenic?
Evidence: label = '-' means molecules are non-carcinogenic
SQL: SELECT COUNT(T.molecule_id) FROM molecule AS T WHERE T.label = '-'