Dludora/Bird-minidev-sqlserver-oracle huggingface dataset:
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 (SQLite): 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
SQL (SQL Server): SELECT T.label FROM ( SELECT T2.label, COUNT(T2.molecule_id) AS _agg1 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 OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY ) t
SQL (Oracle): SELECT T.label FROM ( SELECT T2.label, COUNT(T2.molecule_id) FROM atom T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'h' GROUP BY T2.label ORDER BY COUNT(T2.molecule_id) DESC NULLS LAST FETCH FIRST 1 ROWS ONLY ) t

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 (SQLite): 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
SQL (SQL Server): SELECT T.element FROM (SELECT T1.element, COUNT(DISTINCT T1.molecule_id) AS _agg1 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 OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY) t
SQL (Oracle): SELECT T.element FROM (SELECT T1.element, COUNT(DISTINCT T1.molecule_id) FROM atom T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '-' GROUP BY T1.element ORDER BY COUNT(DISTINCT T1.molecule_id) ASC NULLS FIRST FETCH FIRST 1 ROWS ONLY) t

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 (SQLite): 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'
SQL (SQL Server): 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'
SQL (Oracle): SELECT T1.bond_type FROM bond T1 INNER JOIN connected 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: 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 (SQLite): 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 = '-'
SQL (SQL Server): 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 = '-'
SQL (Oracle): SELECT COUNT(DISTINCT CASE WHEN T1.element = 'i' THEN T1.atom_id ELSE NULL END) iodine_nums, COUNT(DISTINCT CASE WHEN T1.element = 's' THEN T1.atom_id ELSE NULL END) sulfur_nums FROM atom T1 INNER JOIN connected T2 ON T1.atom_id = T2.atom_id INNER JOIN bond T3 ON T2.bond_id = T3.bond_id WHERE T3.bond_type = '-'

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 (SQLite): 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 = '+'
SQL (SQL Server): SELECT TRY_CAST(COUNT(DISTINCT CASE WHEN T1.element <> 'f' THEN T2.molecule_id ELSE NULL END) AS FLOAT) * 100 / COUNT(DISTINCT T2.molecule_id) AS _agg1 FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+'
SQL (Oracle): SELECT CAST(COUNT(DISTINCT CASE WHEN T1.element <> 'f' THEN T2.molecule_id ELSE NULL END) AS BINARY_DOUBLE) * 100 / COUNT(DISTINCT T2.molecule_id) FROM atom T1 INNER JOIN molecule 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 (SQLite): 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 = '#'
SQL (SQL Server): SELECT TRY_CAST(COUNT(DISTINCT CASE WHEN T2.label = '+' THEN T2.molecule_id ELSE NULL END) AS FLOAT) * 100 / COUNT(DISTINCT T2.molecule_id) AS _agg1 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 = '#'
SQL (Oracle): SELECT CAST(COUNT(DISTINCT CASE WHEN T2.label = '+' THEN T2.molecule_id ELSE NULL END) AS BINARY_DOUBLE) * 100 / COUNT(DISTINCT T2.molecule_id) FROM atom T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id INNER JOIN bond T3 ON T2.molecule_id = T3.molecule_id WHERE T3.bond_type = '#'

Question: Please list top three elements of the toxicology of the molecule TR000 in alphabetical order.
Evidence: TR000 is the molecule id;
SQL (SQLite): SELECT DISTINCT T.element FROM atom AS T WHERE T.molecule_id = 'TR000' ORDER BY T.element LIMIT 3
SQL (SQL Server): SELECT DISTINCT T.element FROM atom AS T WHERE T.molecule_id = 'TR000' ORDER BY T.element OFFSET 0 ROWS FETCH NEXT 3 ROWS ONLY
SQL (Oracle): SELECT DISTINCT T.element FROM atom T WHERE T.molecule_id = 'TR000' ORDER BY T.element NULLS FIRST FETCH FIRST 3 ROWS ONLY

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 (SQLite): 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'
SQL (SQL Server): SELECT ROUND(TRY_CAST(COUNT(CASE WHEN T.bond_type = '=' THEN T.bond_id ELSE NULL END) AS FLOAT) * 100 / COUNT(T.bond_id),5) FROM bond AS T WHERE T.molecule_id = 'TR008'
SQL (Oracle): SELECT ROUND(CAST(COUNT(CASE WHEN T.bond_type = '=' THEN T.bond_id ELSE NULL END) AS BINARY_DOUBLE) * 100 / COUNT(T.bond_id),5) FROM bond 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 (SQLite): 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
SQL (SQL Server): SELECT ROUND(TRY_CAST(COUNT(CASE WHEN T.label = '+' THEN T.molecule_id ELSE NULL END) AS FLOAT) * 100 / COUNT(T.molecule_id),3) FROM molecule t
SQL (Oracle): SELECT ROUND(CAST(COUNT(CASE WHEN T.label = '+' THEN T.molecule_id ELSE NULL END) AS BINARY_DOUBLE) * 100 / COUNT(T.molecule_id),3) FROM molecule t

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 (SQLite): 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'
SQL (SQL Server): SELECT ROUND(TRY_CAST(COUNT(CASE WHEN T.element = 'h' THEN T.atom_id ELSE NULL END) AS FLOAT) * 100 / COUNT(T.atom_id),4) FROM atom AS T WHERE T.molecule_id = 'TR206'
SQL (Oracle): SELECT ROUND(CAST(COUNT(CASE WHEN T.element = 'h' THEN T.atom_id ELSE NULL END) AS BINARY_DOUBLE) * 100 / COUNT(T.atom_id),4) FROM atom T WHERE T.molecule_id = 'TR206'

Question: What are the elements of the toxicology and label of molecule TR060?
Evidence: TR060 is the molecule id; 
SQL (SQLite): 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'
SQL (SQL Server): 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'
SQL (Oracle): SELECT DISTINCT T1.element, T2.label FROM atom T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id WHERE T2.molecule_id = 'TR060'

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 (SQLite): 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
SQL (SQL Server): SELECT T.bond_type FROM ( SELECT T1.bond_type, COUNT(T1.molecule_id) AS _agg1 FROM bond AS T1  WHERE T1.molecule_id = 'TR010' GROUP BY T1.bond_type ORDER BY COUNT(T1.molecule_id) DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY ) AS T
SQL (Oracle): SELECT T.bond_type FROM ( SELECT T1.bond_type, COUNT(T1.molecule_id) FROM bond T1  WHERE T1.molecule_id = 'TR010' GROUP BY T1.bond_type ORDER BY COUNT(T1.molecule_id) DESC NULLS LAST FETCH FIRST 1 ROWS ONLY ) 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 (SQLite): 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
SQL (SQL Server): 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 OFFSET 0 ROWS FETCH NEXT 3 ROWS ONLY
SQL (Oracle): SELECT DISTINCT T2.molecule_id FROM bond T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id WHERE T1.bond_type = '-' AND T2.label = '-' ORDER BY T2.molecule_id NULLS FIRST FETCH FIRST 3 ROWS ONLY

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 (SQLite): 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' OR T2.atom_id2 = T1.molecule_id || '_2'
SQL (SQL Server): SELECT COUNT(T2.bond_id) AS _agg1 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' OR T2.atom_id2 = T1.molecule_id  +  '_2'
SQL (Oracle): SELECT COUNT(T2.bond_id) FROM bond T1 INNER JOIN connected T2 ON T1.bond_id = T2.bond_id WHERE T1.molecule_id = 'TR009' AND T2.atom_id = T1.molecule_id || '_1' OR T2.atom_id2 = T1.molecule_id || '_2'

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 (SQLite): 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'
SQL (SQL Server): 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'
SQL (Oracle): SELECT T1.bond_type, T2.atom_id, T2.atom_id2 FROM bond T1 INNER JOIN connected T2 ON T1.bond_id = T2.bond_id WHERE T2.bond_id = 'TR001_6_9'

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 (SQLite): SELECT COUNT(T.bond_id) FROM connected AS T WHERE SUBSTR(T.atom_id, -2) = '19'
SQL (SQL Server): SELECT COUNT(T.bond_id) AS _agg1 FROM connected AS T WHERE RIGHT(T.atom_id, 2) = '19'
SQL (Oracle): SELECT COUNT(T.bond_id) FROM connected 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 (SQLite): SELECT DISTINCT T.element FROM atom AS T WHERE T.molecule_id = 'TR004'
SQL (SQL Server): SELECT DISTINCT T.element FROM atom AS T WHERE T.molecule_id = 'TR004'
SQL (Oracle): SELECT DISTINCT T.element FROM atom T WHERE T.molecule_id = 'TR004'

Question: Among all the atoms from 21 to 25, list all the molecules that are carcinogenic.
Evidence: atoms from 21 to 25 refers to SUBSTR(atom_id, 7, 2) between '21' and '25'; label = '+' mean molecules are carcinogenic
SQL (SQLite): SELECT DISTINCT T2.molecule_id FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE SUBSTR(T1.atom_id, -2) BETWEEN '21' AND '25' AND T2.label = '+'
SQL (SQL Server): SELECT DISTINCT T2.molecule_id FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE RIGHT(T1.atom_id, 2) BETWEEN '21' AND '25' AND T2.label = '+'
SQL (Oracle): SELECT DISTINCT T2.molecule_id FROM atom T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id WHERE SUBSTR(T1.atom_id, -2) BETWEEN '21' AND '25' AND T2.label = '+'

Question: What are the bonds that have phosphorus and nitrogen as their atom elements?
Evidence: have phosphorus as atom elements refers to element = 'p'; have nitrogen as atom elements refers to element = 'n'
SQL (SQLite): SELECT T2.bond_id FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T2.bond_id IN ( SELECT T3.bond_id FROM connected AS T3 INNER JOIN atom AS T4 ON T3.atom_id = T4.atom_id WHERE T4.element = 'p' ) AND T1.element = 'n'
SQL (SQL Server): SELECT T2.bond_id FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T2.bond_id IN ( SELECT T3.bond_id FROM connected AS T3 INNER JOIN atom AS T4 ON T3.atom_id = T4.atom_id WHERE T4.element = 'p' ) AND T1.element = 'n'
SQL (Oracle): SELECT T2.bond_id FROM atom T1 INNER JOIN connected T2 ON T1.atom_id = T2.atom_id WHERE T2.bond_id IN ( SELECT T3.bond_id FROM connected T3 INNER JOIN atom T4 ON T3.atom_id = T4.atom_id WHERE T4.element = 'p' ) AND T1.element = 'n'

Question: Is the molecule with the most double bonds carcinogenic?
Evidence: double bond refers to bond_type = ' = '; label = '+' mean molecules are carcinogenic
SQL (SQLite): SELECT T1.label FROM molecule AS T1 INNER JOIN ( SELECT T.molecule_id, COUNT(T.bond_type) FROM bond AS T WHERE T.bond_type = '=' GROUP BY T.molecule_id ORDER BY COUNT(T.bond_type) DESC LIMIT 1 ) AS T2 ON T1.molecule_id = T2.molecule_id
SQL (SQL Server): SELECT T1.label FROM molecule AS T1 INNER JOIN ( SELECT T.molecule_id, COUNT(T.bond_type) AS _agg1 FROM bond AS T WHERE T.bond_type = '=' GROUP BY T.molecule_id ORDER BY COUNT(T.bond_type) DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY ) AS T2 ON T1.molecule_id = T2.molecule_id
SQL (Oracle): SELECT T1.label FROM molecule T1 INNER JOIN ( SELECT T.molecule_id, COUNT(T.bond_type) FROM bond T WHERE T.bond_type = '=' GROUP BY T.molecule_id ORDER BY COUNT(T.bond_type) DESC NULLS LAST FETCH FIRST 1 ROWS ONLY ) T2 ON T1.molecule_id = T2.molecule_id
Database: toxicology

Question: What is the average number of bonds the atoms with the element iodine have?
Evidence: atoms with the element iodine refers to element = 'i'; average = DIVIDE(COUND(bond_id), COUNT(atom_id)) where element = 'i'
SQL (SQLite): SELECT CAST(COUNT(T2.bond_id) AS REAL) / COUNT(T1.atom_id) FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T1.element = 'i'
SQL (SQL Server): SELECT TRY_CAST(COUNT(T2.bond_id) AS FLOAT) / COUNT(T1.atom_id) AS _agg1 FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T1.element = 'i'
SQL (Oracle): SELECT CAST(COUNT(T2.bond_id) AS BINARY_DOUBLE) / COUNT(T1.atom_id) FROM atom T1 INNER JOIN connected T2 ON T1.atom_id = T2.atom_id WHERE T1.element = 'i'

Question: List all the elements of atoms that can not bond with any other atoms.
Evidence:  atoms cannot bond with other atoms means atom_id NOT in connected table;
SQL (SQLite): SELECT DISTINCT T.element FROM atom AS T WHERE T.element NOT IN ( SELECT DISTINCT T1.element FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id )
SQL (SQL Server): SELECT DISTINCT T.element FROM atom AS T WHERE T.element NOT IN ( SELECT DISTINCT T1.element FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id )
SQL (Oracle): SELECT DISTINCT T.element FROM atom T WHERE T.element NOT IN ( SELECT DISTINCT T1.element FROM atom T1 INNER JOIN connected T2 ON T1.atom_id = T2.atom_id )

Question: What are the atoms of the triple bond with the molecule "TR041"?
Evidence: TR041 is the molecule id; triple bond refers to bond_type = '#';
SQL (SQLite): SELECT T2.atom_id, T2.atom_id2 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 = '#' AND T3.molecule_id = 'TR041'
SQL (SQL Server): SELECT T2.atom_id, T2.atom_id2 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 = '#' AND T3.molecule_id = 'TR041'
SQL (Oracle): SELECT T2.atom_id, T2.atom_id2 FROM atom T1 INNER JOIN connected T2 ON T1.atom_id = T2.atom_id INNER JOIN bond T3 ON T2.bond_id = T3.bond_id WHERE T3.bond_type = '#' AND T3.molecule_id = 'TR041'

Question: What are the elements of the atoms of TR144_8_19?
Evidence: TR144_8_19 is the bond id; 
SQL (SQLite): SELECT T2.element FROM connected AS T1 INNER JOIN atom AS T2 ON T1.atom_id = T2.atom_id WHERE T1.bond_id = 'TR144_8_19'
SQL (SQL Server): SELECT T2.element FROM connected AS T1 INNER JOIN atom AS T2 ON T1.atom_id = T2.atom_id WHERE T1.bond_id = 'TR144_8_19'
SQL (Oracle): SELECT T2.element FROM connected T1 INNER JOIN atom T2 ON T1.atom_id = T2.atom_id WHERE T1.bond_id = 'TR144_8_19'
Database: toxicology

Question: List the elements of all the triple bonds.
Evidence: triple bond refers to bond_type = '#';
SQL (SQLite): SELECT DISTINCT T3.element 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 T1.bond_type = '#'
SQL (SQL Server): SELECT DISTINCT T3.element 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 T1.bond_type = '#'
SQL (Oracle): SELECT DISTINCT T3.element FROM bond T1 INNER JOIN connected T2 ON T1.bond_id = T2.bond_id INNER JOIN atom T3 ON T2.atom_id = T3.atom_id WHERE T1.bond_type = '#'

Question: What proportion of single bonds are carcinogenic? Please provide your answer as a percentage with five decimal places.
Evidence: single bond refers to bond_type = '-'; label = '+' mean molecules are carcinogenic; proportion = DIVIDE(SUM(label = '+') * 100, COUNT(bond_id)) where bond_type = '-'
SQL (SQLite): SELECT ROUND(CAST(COUNT(CASE WHEN T2.label = '+' THEN T1.bond_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.bond_id),5) FROM bond AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.bond_type = '-'
SQL (SQL Server): SELECT ROUND(TRY_CAST(COUNT(CASE WHEN T2.label = '+' THEN T1.bond_id ELSE NULL END) AS FLOAT) * 100 / COUNT(T1.bond_id),5) FROM bond AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.bond_type = '-'
SQL (Oracle): SELECT ROUND(CAST(COUNT(CASE WHEN T2.label = '+' THEN T1.bond_id ELSE NULL END) AS BINARY_DOUBLE) * 100 / COUNT(T1.bond_id),5) FROM bond T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id WHERE T1.bond_type = '-'

Question: Calculate the total atoms with triple-bond molecules containing the element phosphorus or bromine.
Evidence: triple bond refers to bond_type = '#'; phosphorus refers to element = 'p'; bromine refers to element = 'br'
SQL (SQLite): SELECT COUNT(T1.atom_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 = '#' AND T1.element IN ('p', 'br')
SQL (SQL Server): SELECT COUNT(T1.atom_id) AS _agg1 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 = '#' AND T1.element IN ('p', 'br')
SQL (Oracle): SELECT COUNT(T1.atom_id) FROM atom T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id INNER JOIN bond T3 ON T2.molecule_id = T3.molecule_id WHERE T3.bond_type = '#' AND T1.element IN ('p', 'br')