Database schema:

CREATE TABLE "ATT_CLASSES" (
	"ATT_CLASS_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['0', '1'],
	"ATT_CLASS" TEXT NOT NULL -- example: ['indoors', 'building s'],
	PRIMARY KEY ("ATT_CLASS_ID")
)


CREATE TABLE "IMG_OBJ" (
	"IMG_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['2', '1'],
	"OBJ_SAMPLE_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['2', '1'],
	"OBJ_CLASS_ID" INTEGER -- example: ['246', '298'],
	"X" INTEGER -- example: ['0', '78'],
	"Y" INTEGER -- example: ['0', '308'],
	"W" INTEGER -- example: ['722', '799'],
	"H" INTEGER -- example: ['557', '290'],
	PRIMARY KEY ("IMG_ID", "OBJ_SAMPLE_ID"), 
	CONSTRAINT fk_img_obj_obj_classes FOREIGN KEY("OBJ_CLASS_ID") REFERENCES "OBJ_CLASSES" ("OBJ_CLASS_ID")
)


CREATE TABLE "IMG_OBJ_ATT" (
	"IMG_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['2', '1'],
	"ATT_CLASS_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['0', '1'],
	"OBJ_SAMPLE_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['22', '21'],
	PRIMARY KEY ("IMG_ID", "ATT_CLASS_ID", "OBJ_SAMPLE_ID"), 
	CONSTRAINT fk_img_obj_att_att_classes FOREIGN KEY("ATT_CLASS_ID") REFERENCES "ATT_CLASSES" ("ATT_CLASS_ID"),
	CONSTRAINT fk_img_obj_att_img_obj FOREIGN KEY("IMG_ID", "OBJ_SAMPLE_ID") REFERENCES "IMG_OBJ" ("IMG_ID", "OBJ_SAMPLE_ID")
)


CREATE TABLE "IMG_REL" (
	"IMG_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['2', '1'],
	"PRED_CLASS_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['0', '1'],
	"OBJ1_SAMPLE_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['13', '12'],
	"OBJ2_SAMPLE_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['1', '34'],
	PRIMARY KEY ("IMG_ID", "PRED_CLASS_ID", "OBJ1_SAMPLE_ID", "OBJ2_SAMPLE_ID"), 
	CONSTRAINT fk_img_rel_pred_classes FOREIGN KEY("PRED_CLASS_ID") REFERENCES "PRED_CLASSES" ("PRED_CLASS_ID"),
	CONSTRAINT fk_img_rel_img_obj FOREIGN KEY("IMG_ID", "OBJ1_SAMPLE_ID") REFERENCES "IMG_OBJ" ("IMG_ID", "OBJ_SAMPLE_ID"),
	CONSTRAINT fk_img_rel_img_obj FOREIGN KEY("IMG_ID", "OBJ2_SAMPLE_ID") REFERENCES "IMG_OBJ" ("IMG_ID", "OBJ_SAMPLE_ID")
)


CREATE TABLE "OBJ_CLASSES" (
	"OBJ_CLASS_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['0', '1'],
	"OBJ_CLASS" TEXT NOT NULL -- example: ['goggles', 'awning'],
	PRIMARY KEY ("OBJ_CLASS_ID")
)


CREATE TABLE "PRED_CLASSES" (
	"PRED_CLASS_ID" INTEGER DEFAULT 0 NOT NULL -- example: ['0', '1'],
	"PRED_CLASS" TEXT NOT NULL -- example: ['looking a', 'playing on'],
	PRIMARY KEY ("PRED_CLASS_ID")
)

Question: Give the number of samples in image no.2377985 whose attribute is electrical.
Evidence: number of samples refers to OBJ_SAMPLE_ID; image no.2377985 refers to IMG_ID = 2377985; attribute is electrical refers to ATT_CLASS = 'electrical'

SQL:
SELECT SUM(CASE WHEN T2.ATT_CLASS = 'white' THEN 1 ELSE 0 END) FROM IMG_OBJ_ATT AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 2347915