
CREATE TABLE enzyme (
	id INTEGER, 
	name TEXT, 
	"Location" TEXT, 
	"Product" TEXT, 
	"Chromosome" TEXT, 
	"OMIM" INTEGER, 
	"Porphyria" TEXT, 
	PRIMARY KEY (id)
)


CREATE TABLE medicine (
	id INTEGER, 
	name TEXT, 
	"Trade_Name" TEXT, 
	"FDA_approved" TEXT, 
	PRIMARY KEY (id)
)


CREATE TABLE medicine_enzyme_interaction (
	enzyme_id INTEGER, 
	medicine_id INTEGER, 
	interaction_type TEXT, 
	PRIMARY KEY (enzyme_id, medicine_id), 
	FOREIGN KEY(medicine_id) REFERENCES medicine (id), 
	FOREIGN KEY(enzyme_id) REFERENCES enzyme (id)
)

CREATE TABLE enzyme (
	id INTEGER, 
	name TEXT, 
	"Location" TEXT, 
	"Product" TEXT, 
	"Chromosome" TEXT, 
	"OMIM" INTEGER, 
	"Porphyria" TEXT, 
	PRIMARY KEY (id)
)

/*
2 rows from enzyme table:
id	name	Location	Product	Chromosome	OMIM	Porphyria
1	ALA synthase	Mitochondrion	δ-Aminolevulinic acid	3p21.1	125290	none
2	ALA dehydratase	Cytosol	Porphobilinogen	9q34	125270	ALA-Dehydratase deficiency
*/


CREATE TABLE medicine (
	id INTEGER, 
	name TEXT, 
	"Trade_Name" TEXT, 
	"FDA_approved" TEXT, 
	PRIMARY KEY (id)
)

/*
2 rows from medicine table:
id	name	Trade_Name	FDA_approved
1	Amisulpride	Solian	No
2	Aripiprazole	Abilify	Yes
*/


CREATE TABLE medicine_enzyme_interaction (
	enzyme_id INTEGER, 
	medicine_id INTEGER, 
	interaction_type TEXT, 
	PRIMARY KEY (enzyme_id, medicine_id), 
	FOREIGN KEY(medicine_id) REFERENCES medicine (id), 
	FOREIGN KEY(enzyme_id) REFERENCES enzyme (id)
)

/*
2 rows from medicine_enzyme_interaction table:
enzyme_id	medicine_id	interaction_type
1	1	inhibitor
1	2	inhibitor
*/
What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with.
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
[{'id': 3, 'name': 'Asenapine', 'FDA_approved': 'Yes'}, {'id': 2, 'name': 'Aripiprazole', 'FDA_approved': 'Yes'}, {'id': 20, 'name': 'Ziprasidone', 'FDA_approved': 'Yes'}, {'id': 8, 'name': 'Iloperidone', 'FDA_approved': 'Yes'}, {'id': 19, 'name': 'Sulpiride', 'FDA_approved': 'No'}, {'id': 13, 'name': 'Paliperidone', 'FDA_approved': 'Yes'}, {'id': 10, 'name': 'Melperone', 'FDA_approved': 'No'}, {'id': 9, 'name': 'Lurasidone', 'FDA_approved': 'Yes'}, {'id': 7, 'name': 'Clozapine', 'FDA_approved': 'Yes'}, {'id': 6, 'name': 'Clocapramine', 'FDA_approved': 'No'}, {'id': 5, 'name': 'Carpipramine', 'FDA_approved': 'No'}, {'id': 4, 'name': 'Blonanserin', 'FDA_approved': 'No'}, {'id': 1, 'name': 'Amisulpride', 'FDA_approved': 'No'}]