### Database Schema:
CREATE TABLE careplans (
	ID	TEXT	NULL,
	START	DATE	NULL,
	STOP	DATE	NULL,
	PATIENT	TEXT	NULL,
	ENCOUNTER	TEXT	NULL,
	CODE	REAL	NULL,
	DESCRIPTION	TEXT	NULL,
	REASONCODE	INTEGER	NULL,
	REASONDESCRIPTION	TEXT	NULL,
	foreign key (ENCOUNTER) references encounters (ID),
	foreign key (PATIENT) references patients (patient)
);

CREATE TABLE observations (
	DATE	DATE	NULL,
	PATIENT	TEXT	NULL,
	ENCOUNTER	TEXT	NULL,
	CODE	TEXT	NULL,
	DESCRIPTION	TEXT	NULL,
	VALUE	REAL	NULL,
	UNITS	TEXT	NULL,
	foreign key (PATIENT) references patients (patient),
	foreign key (ENCOUNTER) references encounters (ID)
);

CREATE TABLE claims (
	ID	TEXT	NULL	PRIMARY KEY,
	PATIENT	TEXT	NULL,
	BILLABLEPERIOD	DATE	NULL,
	ORGANIZATION	TEXT	NULL,
	ENCOUNTER	TEXT	NULL,
	DIAGNOSIS	TEXT	NULL,
	TOTAL	INTEGER	NULL,
	foreign key (PATIENT) references patients (patient),
	foreign key (ENCOUNTER) references encounters (ID)
);

CREATE TABLE all_prevalences (
	ITEM	TEXT	NULL	PRIMARY KEY,
	`POPULATION TYPE`	TEXT	NULL,
	OCCURRENCES	INTEGER	NULL,
	`POPULATION COUNT`	INTEGER	NULL,
	`PREVALENCE RATE`	REAL	NULL,
	`PREVALENCE PERCENTAGE`	REAL	NULL
);

CREATE TABLE procedures (
	DATE	DATE	NULL,
	PATIENT	TEXT	NULL,
	ENCOUNTER	TEXT	NULL,
	CODE	INTEGER	NULL,
	DESCRIPTION	TEXT	NULL,
	REASONCODE	INTEGER	NULL,
	REASONDESCRIPTION	TEXT	NULL,
	foreign key (ENCOUNTER) references encounters (ID),
	foreign key (PATIENT) references patients (patient)
);

CREATE TABLE encounters (
	ID	TEXT	NULL	PRIMARY KEY,
	DATE	DATE	NULL,
	PATIENT	TEXT	NULL,
	CODE	INTEGER	NULL,
	DESCRIPTION	TEXT	NULL,
	REASONCODE	INTEGER	NULL,
	REASONDESCRIPTION	TEXT	NULL,
	foreign key (PATIENT) references patients (patient)
);

CREATE TABLE allergies (
	START	TEXT	NULL,
	STOP	TEXT	NULL,
	PATIENT	TEXT	NULL	PRIMARY KEY,
	ENCOUNTER	TEXT	NULL	PRIMARY KEY,
	CODE	INTEGER	NULL	PRIMARY KEY,
	DESCRIPTION	TEXT	NULL,
	foreign key (PATIENT) references patients (patient),
	foreign key (ENCOUNTER) references encounters (ID)
);

CREATE TABLE patients (
	patient	TEXT	NULL	PRIMARY KEY,
	birthdate	DATE	NULL,
	deathdate	DATE	NULL,
	ssn	TEXT	NULL,
	drivers	TEXT	NULL,
	passport	TEXT	NULL,
	prefix	TEXT	NULL,
	first	TEXT	NULL,
	last	TEXT	NULL,
	suffix	TEXT	NULL,
	maiden	TEXT	NULL,
	marital	TEXT	NULL,
	race	TEXT	NULL,
	ethnicity	TEXT	NULL,
	gender	TEXT	NULL,
	birthplace	TEXT	NULL,
	address	TEXT	NULL
);

CREATE TABLE immunizations (
	DATE	DATE	NULL	PRIMARY KEY,
	PATIENT	TEXT	NULL	PRIMARY KEY,
	ENCOUNTER	TEXT	NULL	PRIMARY KEY,
	CODE	INTEGER	NULL	PRIMARY KEY,
	DESCRIPTION	TEXT	NULL,
	foreign key (ENCOUNTER) references encounters (ID),
	foreign key (PATIENT) references patients (patient)
);

CREATE TABLE medications (
	START	DATE	NULL	PRIMARY KEY,
	STOP	DATE	NULL,
	PATIENT	TEXT	NULL	PRIMARY KEY,
	ENCOUNTER	TEXT	NULL	PRIMARY KEY,
	CODE	INTEGER	NULL	PRIMARY KEY,
	DESCRIPTION	TEXT	NULL,
	REASONCODE	INTEGER	NULL,
	REASONDESCRIPTION	TEXT	NULL,
	foreign key (PATIENT) references patients (patient),
	foreign key (ENCOUNTER) references encounters (ID)
);

CREATE TABLE conditions (
	START	DATE	NULL,
	STOP	DATE	NULL,
	PATIENT	TEXT	NULL,
	ENCOUNTER	TEXT	NULL,
	CODE	INTEGER	NULL,
	DESCRIPTION	TEXT	NULL,
	foreign key (DESCRIPTION) references all_prevalences (ITEM),
	foreign key (PATIENT) references patients (patient),
	foreign key (ENCOUNTER) references encounters (ID)
);

### User's Query:
Identify the allergy period for Isadora Moen and what triggered it.

### Extra Knowledge:
allergy period = SUBTRACT(allergies.START, allergies.STOP); what triggered the allergy refers to allergies.DESCRIPTION;
SELECT T2.START, T2.STOP, T2.DESCRIPTION FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Isadora' AND T1.last = 'Moen'