human
Schema:
medicine (id, name, Trade_Name, FDA_approved)
enzyme (id, name, Location, Product, Chromosome, OMIM, Porphyria)
medicine_enzyme_interaction (enzyme_id, medicine_id, interaction_type)
Please answer with SQL.
assistant
Sure, I understand.
human
How many kinds of enzymes are there?
assistant
SELECT count(*) FROM enzyme
human
What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction?
assistant
SELECT DISTINCT T1.name , T1.location , T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'
human
List the name of enzymes in descending lexicographical order.
assistant
SELECT name FROM enzyme ORDER BY name DESC
human
What are the names of enzymes who does not produce 'Heme'?
assistant
SELECT name FROM enzyme WHERE product != 'Heme'
human
What is the interaction type of the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'?
assistant
SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole'
human
Which enzyme names have the substring 'ALA'?
assistant
SELECT name FROM enzyme WHERE name LIKE "%ALA%" ;