### 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 objects can you spot in image no. 72? What objects may be identified on the same image and within the bounding box represented as (341, 27, 42, 51)?

### Extra Knowledge:
How many objects refers to OBJ_CLASS_ID; image no. 72 refers to IMG_ID = 72; What objects refers to OBJ_CLASS; bounding box represented as (341, 27, 42, 51) refers to X = 341 and Y = 27 and W = 42 and H = 51
SELECT SUM(IIF(T1.IMG_ID = 1, 1, 0)), SUM(IIF(T1.X = 341 AND T1.Y = 27 AND T1.W = 42 AND T1.H = 51, 1, 0)) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID