
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 medicine and trade names that can interact as an inhibitor and activitor with enzymes?
SELECT T1.name ,  T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id WHERE interaction_type  =  'inhibitor' INTERSECT SELECT T1.name ,  T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id WHERE interaction_type  =  'activitor'
[{'name': 'Asenapine', 'Trade_Name': 'Saphris'}, {'name': 'Iloperidone', 'Trade_Name': 'Fanapt'}]