### Database Schema:
CREATE TABLE IMG_OBJ_ATT (
	IMG_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	ATT_CLASS_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	OBJ_SAMPLE_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	foreign key (OBJ_SAMPLE_ID) references IMG_OBJ (OBJ_SAMPLE_ID),
	foreign key (IMG_ID) references IMG_OBJ (IMG_ID),
	foreign key (ATT_CLASS_ID) references ATT_CLASSES (ATT_CLASS_ID)
);

CREATE TABLE OBJ_CLASSES (
	OBJ_CLASS_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	OBJ_CLASS	TEXT	NOT NULL
);

CREATE TABLE ATT_CLASSES (
	ATT_CLASS_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	ATT_CLASS	TEXT	NOT NULL
);

CREATE TABLE PRED_CLASSES (
	PRED_CLASS_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	PRED_CLASS	TEXT	NOT NULL
);

CREATE TABLE IMG_OBJ (
	IMG_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	OBJ_SAMPLE_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	OBJ_CLASS_ID	INTEGER	NULL,
	X	INTEGER	NULL,
	Y	INTEGER	NULL,
	W	INTEGER	NULL,
	H	INTEGER	NULL,
	foreign key (OBJ_CLASS_ID) references OBJ_CLASSES (OBJ_CLASS_ID)
);

CREATE TABLE IMG_REL (
	IMG_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	PRED_CLASS_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	OBJ1_SAMPLE_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	OBJ2_SAMPLE_ID	INTEGER	NOT NULL	DEFAULT 0	PRIMARY KEY,
	foreign key (IMG_ID) references IMG_OBJ (IMG_ID),
	foreign key (OBJ2_SAMPLE_ID) references IMG_OBJ (OBJ_SAMPLE_ID),
	foreign key (PRED_CLASS_ID) references PRED_CLASSES (PRED_CLASS_ID),
	foreign key (OBJ1_SAMPLE_ID) references IMG_OBJ (OBJ_SAMPLE_ID)
);

### User's Query:
How many times is the number of images containing "broccoli" than "tomato"?

### Extra Knowledge:
images refers to IMG_ID; "broccoli" refers to OBJ_CLASS = 'broccoli'; "tomato" refers to OBJ_CLASS = 'tomato' ; How many times = divide(count(OBJ_SAMPLE_ID) when OBJ_CLASS = 'broccoli', count(OBJ_SAMPLE_ID) when OBJ_CLASS = 'tomato')
SELECT CAST(COUNT(CASE WHEN T1.OBJ_CLASS = 'broccoli' THEN T2.OBJ_SAMPLE_ID ELSE NULL END) AS REAL) / COUNT(CASE WHEN T1.OBJ_CLASS = 'tomato' THEN T2.OBJ_SAMPLE_ID ELSE NULL END) times FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID