### Database Schema:
CREATE TABLE SeriesPost (
	year	INTEGER	NULL,
	round	TEXT	NULL,
	series	TEXT	NULL,
	tmIDWinner	TEXT	NULL,
	lgIDWinner	TEXT	NULL,
	tmIDLoser	TEXT	NULL,
	lgIDLoser	TEXT	NULL,
	W	INTEGER	NULL,
	L	INTEGER	NULL,
	T	INTEGER	NULL,
	GoalsWinner	INTEGER	NULL,
	GoalsLoser	INTEGER	NULL,
	note	TEXT	NULL,
	foreign key (year) references Teams (year),
	foreign key (tmIDLoser) references Teams (tmID),
	foreign key (tmIDWinner) references Teams (tmID)
);

CREATE TABLE TeamsSC (
	year	INTEGER	NOT NULL	PRIMARY KEY,
	lgID	TEXT	NULL,
	tmID	TEXT	NOT NULL	PRIMARY KEY,
	G	INTEGER	NULL,
	W	INTEGER	NULL,
	L	INTEGER	NULL,
	T	INTEGER	NULL,
	GF	INTEGER	NULL,
	GA	INTEGER	NULL,
	PIM	TEXT	NULL,
	foreign key (year) references Teams (year),
	foreign key (tmID) references Teams (tmID)
);

CREATE TABLE Teams (
	year	INTEGER	NOT NULL	PRIMARY KEY,
	lgID	TEXT	NULL,
	tmID	TEXT	NOT NULL	PRIMARY KEY,
	franchID	TEXT	NULL,
	confID	TEXT	NULL,
	divID	TEXT	NULL,
	rank	INTEGER	NULL,
	playoff	TEXT	NULL,
	G	INTEGER	NULL,
	W	INTEGER	NULL,
	L	INTEGER	NULL,
	T	INTEGER	NULL,
	OTL	TEXT	NULL,
	Pts	INTEGER	NULL,
	SoW	TEXT	NULL,
	SoL	TEXT	NULL,
	GF	INTEGER	NULL,
	GA	INTEGER	NULL,
	name	TEXT	NULL,
	PIM	TEXT	NULL,
	BenchMinor	TEXT	NULL,
	PPG	TEXT	NULL,
	PPC	TEXT	NULL,
	SHA	TEXT	NULL,
	PKG	TEXT	NULL,
	PKC	TEXT	NULL,
	SHF	TEXT	NULL
);

CREATE TABLE TeamSplits (
	year	INTEGER	NOT NULL	PRIMARY KEY,
	lgID	TEXT	NULL,
	tmID	TEXT	NOT NULL	PRIMARY KEY,
	hW	INTEGER	NULL,
	hL	INTEGER	NULL,
	hT	INTEGER	NULL,
	hOTL	TEXT	NULL,
	rW	INTEGER	NULL,
	rL	INTEGER	NULL,
	rT	INTEGER	NULL,
	rOTL	TEXT	NULL,
	SepW	TEXT	NULL,
	SepL	TEXT	NULL,
	SepT	TEXT	NULL,
	SepOL	TEXT	NULL,
	OctW	TEXT	NULL,
	OctL	TEXT	NULL,
	OctT	TEXT	NULL,
	OctOL	TEXT	NULL,
	NovW	TEXT	NULL,
	NovL	TEXT	NULL,
	NovT	TEXT	NULL,
	NovOL	TEXT	NULL,
	DecW	TEXT	NULL,
	DecL	TEXT	NULL,
	DecT	TEXT	NULL,
	DecOL	TEXT	NULL,
	JanW	INTEGER	NULL,
	JanL	INTEGER	NULL,
	JanT	INTEGER	NULL,
	JanOL	TEXT	NULL,
	FebW	INTEGER	NULL,
	FebL	INTEGER	NULL,
	FebT	INTEGER	NULL,
	FebOL	TEXT	NULL,
	MarW	TEXT	NULL,
	MarL	TEXT	NULL,
	MarT	TEXT	NULL,
	MarOL	TEXT	NULL,
	AprW	TEXT	NULL,
	AprL	TEXT	NULL,
	AprT	TEXT	NULL,
	AprOL	TEXT	NULL,
	foreign key (year) references Teams (year),
	foreign key (tmID) references Teams (tmID)
);

CREATE TABLE TeamsPost (
	year	INTEGER	NOT NULL	PRIMARY KEY,
	lgID	TEXT	NULL,
	tmID	TEXT	NOT NULL	PRIMARY KEY,
	G	INTEGER	NULL,
	W	INTEGER	NULL,
	L	INTEGER	NULL,
	T	INTEGER	NULL,
	GF	INTEGER	NULL,
	GA	INTEGER	NULL,
	PIM	TEXT	NULL,
	BenchMinor	TEXT	NULL,
	PPG	TEXT	NULL,
	PPC	TEXT	NULL,
	SHA	TEXT	NULL,
	PKG	TEXT	NULL,
	PKC	TEXT	NULL,
	SHF	TEXT	NULL,
	foreign key (year) references Teams (year),
	foreign key (tmID) references Teams (tmID)
);

CREATE TABLE GoaliesShootout (
	playerID	TEXT	NULL,
	year	INTEGER	NULL,
	stint	INTEGER	NULL,
	tmID	TEXT	NULL,
	W	INTEGER	NULL,
	L	INTEGER	NULL,
	SA	INTEGER	NULL,
	GA	INTEGER	NULL,
	foreign key (playerID) references Master (playerID),
	foreign key (tmID) references Teams (tmID),
	foreign key (year) references Teams (year)
);

CREATE TABLE GoaliesSC (
	playerID	TEXT	NOT NULL	PRIMARY KEY,
	year	INTEGER	NOT NULL	PRIMARY KEY,
	tmID	TEXT	NULL,
	lgID	TEXT	NULL,
	GP	INTEGER	NULL,
	Min	INTEGER	NULL,
	W	INTEGER	NULL,
	L	INTEGER	NULL,
	T	INTEGER	NULL,
	SHO	INTEGER	NULL,
	GA	INTEGER	NULL,
	foreign key (playerID) references Master (playerID),
	foreign key (tmID) references Teams (tmID),
	foreign key (year) references Teams (year)
);

CREATE TABLE Master (
	playerID	TEXT	NULL,
	coachID	TEXT	NULL,
	hofID	TEXT	NULL,
	firstName	TEXT	NULL,
	lastName	TEXT	NOT NULL,
	nameNote	TEXT	NULL,
	nameGiven	TEXT	NULL,
	nameNick	TEXT	NULL,
	height	TEXT	NULL,
	weight	TEXT	NULL,
	shootCatch	TEXT	NULL,
	legendsID	TEXT	NULL,
	ihdbID	TEXT	NULL,
	hrefID	TEXT	NULL,
	firstNHL	TEXT	NULL,
	lastNHL	TEXT	NULL,
	firstWHA	TEXT	NULL,
	lastWHA	TEXT	NULL,
	pos	TEXT	NULL,
	birthYear	TEXT	NULL,
	birthMon	TEXT	NULL,
	birthDay	TEXT	NULL,
	birthCountry	TEXT	NULL,
	birthState	TEXT	NULL,
	birthCity	TEXT	NULL,
	deathYear	TEXT	NULL,
	deathMon	TEXT	NULL,
	deathDay	TEXT	NULL,
	deathCountry	TEXT	NULL,
	deathState	TEXT	NULL,
	deathCity	TEXT	NULL,
	foreign key (coachID) references Coaches (coachID)
);

CREATE TABLE AwardsPlayers (
	playerID	TEXT	NOT NULL	PRIMARY KEY,
	award	TEXT	NOT NULL	PRIMARY KEY,
	year	INTEGER	NOT NULL	PRIMARY KEY,
	lgID	TEXT	NULL,
	note	TEXT	NULL,
	pos	TEXT	NULL,
	foreign key (playerID) references Master (playerID)
);

CREATE TABLE Scoring (
	playerID	TEXT	NULL,
	year	INTEGER	NULL,
	stint	INTEGER	NULL,
	tmID	TEXT	NULL,
	lgID	TEXT	NULL,
	pos	TEXT	NULL,
	GP	INTEGER	NULL,
	G	INTEGER	NULL,
	A	INTEGER	NULL,
	Pts	INTEGER	NULL,
	PIM	INTEGER	NULL,
	`+/-`	TEXT	NULL,
	PPG	TEXT	NULL,
	PPA	TEXT	NULL,
	SHG	TEXT	NULL,
	SHA	TEXT	NULL,
	GWG	TEXT	NULL,
	GTG	TEXT	NULL,
	SOG	TEXT	NULL,
	PostGP	TEXT	NULL,
	PostG	TEXT	NULL,
	PostA	TEXT	NULL,
	PostPts	TEXT	NULL,
	PostPIM	TEXT	NULL,
	`Post+/-`	TEXT	NULL,
	PostPPG	TEXT	NULL,
	PostPPA	TEXT	NULL,
	PostSHG	TEXT	NULL,
	PostSHA	TEXT	NULL,
	PostGWG	TEXT	NULL,
	PostSOG	TEXT	NULL,
	foreign key (tmID) references Teams (tmID),
	foreign key (year) references Teams (year),
	foreign key (playerID) references Master (playerID)
);

CREATE TABLE CombinedShutouts (
	year	INTEGER	NULL,
	month	INTEGER	NULL,
	date	INTEGER	NULL,
	tmID	TEXT	NULL,
	oppID	TEXT	NULL,
	`R/P`	TEXT	NULL,
	IDgoalie1	TEXT	NULL,
	IDgoalie2	TEXT	NULL,
	foreign key (IDgoalie2) references Master (playerID),
	foreign key (IDgoalie1) references Master (playerID)
);

CREATE TABLE ScoringShootout (
	playerID	TEXT	NULL,
	year	INTEGER	NULL,
	stint	INTEGER	NULL,
	tmID	TEXT	NULL,
	S	INTEGER	NULL,
	G	INTEGER	NULL,
	GDG	INTEGER	NULL,
	foreign key (tmID) references Teams (tmID),
	foreign key (year) references Teams (year),
	foreign key (playerID) references Master (playerID)
);

CREATE TABLE AwardsCoaches (
	coachID	TEXT	NULL,
	award	TEXT	NULL,
	year	INTEGER	NULL,
	lgID	TEXT	NULL,
	note	TEXT	NULL,
	foreign key (coachID) references Coaches (coachID)
);

CREATE TABLE ScoringSup (
	playerID	TEXT	NULL,
	year	INTEGER	NULL,
	PPA	TEXT	NULL,
	SHA	TEXT	NULL,
	foreign key (playerID) references Master (playerID)
);

CREATE TABLE TeamVsTeam (
	year	INTEGER	NOT NULL	PRIMARY KEY,
	lgID	TEXT	NULL,
	tmID	TEXT	NOT NULL	PRIMARY KEY,
	oppID	TEXT	NOT NULL	PRIMARY KEY,
	W	INTEGER	NULL,
	L	INTEGER	NULL,
	T	INTEGER	NULL,
	OTL	TEXT	NULL,
	foreign key (year) references Teams (year),
	foreign key (oppID) references Teams (tmID),
	foreign key (tmID) references Teams (tmID)
);

CREATE TABLE Goalies (
	playerID	TEXT	NOT NULL	PRIMARY KEY,
	year	INTEGER	NOT NULL	PRIMARY KEY,
	stint	INTEGER	NOT NULL	PRIMARY KEY,
	tmID	TEXT	NULL,
	lgID	TEXT	NULL,
	GP	TEXT	NULL,
	Min	TEXT	NULL,
	W	TEXT	NULL,
	L	TEXT	NULL,
	`T/OL`	TEXT	NULL,
	ENG	TEXT	NULL,
	SHO	TEXT	NULL,
	GA	TEXT	NULL,
	SA	TEXT	NULL,
	PostGP	TEXT	NULL,
	PostMin	TEXT	NULL,
	PostW	TEXT	NULL,
	PostL	TEXT	NULL,
	PostT	TEXT	NULL,
	PostENG	TEXT	NULL,
	PostSHO	TEXT	NULL,
	PostGA	TEXT	NULL,
	PostSA	TEXT	NULL,
	foreign key (playerID) references Master (playerID),
	foreign key (tmID) references Teams (tmID),
	foreign key (year) references Teams (year)
);

CREATE TABLE HOF (
	year	INTEGER	NULL,
	hofID	TEXT	NOT NULL	PRIMARY KEY,
	name	TEXT	NULL,
	category	TEXT	NULL
);

CREATE TABLE abbrev (
	Type	TEXT	NOT NULL	PRIMARY KEY,
	Code	TEXT	NOT NULL	PRIMARY KEY,
	Fullname	TEXT	NULL
);

CREATE TABLE TeamsHalf (
	year	INTEGER	NOT NULL	PRIMARY KEY,
	lgID	TEXT	NULL,
	tmID	TEXT	NOT NULL	PRIMARY KEY,
	half	INTEGER	NOT NULL	PRIMARY KEY,
	rank	INTEGER	NULL,
	G	INTEGER	NULL,
	W	INTEGER	NULL,
	L	INTEGER	NULL,
	T	INTEGER	NULL,
	GF	INTEGER	NULL,
	GA	INTEGER	NULL,
	foreign key (tmID) references Teams (tmID),
	foreign key (year) references Teams (year)
);

CREATE TABLE ScoringSC (
	playerID	TEXT	NULL,
	year	INTEGER	NULL,
	tmID	TEXT	NULL,
	lgID	TEXT	NULL,
	pos	TEXT	NULL,
	GP	INTEGER	NULL,
	G	INTEGER	NULL,
	A	INTEGER	NULL,
	Pts	INTEGER	NULL,
	PIM	INTEGER	NULL,
	foreign key (tmID) references Teams (tmID),
	foreign key (playerID) references Master (playerID),
	foreign key (year) references Teams (year)
);

CREATE TABLE Coaches (
	coachID	TEXT	NOT NULL	PRIMARY KEY,
	year	INTEGER	NOT NULL	PRIMARY KEY,
	tmID	TEXT	NOT NULL	PRIMARY KEY,
	lgID	TEXT	NULL,
	stint	INTEGER	NOT NULL	PRIMARY KEY,
	notes	TEXT	NULL,
	g	INTEGER	NULL,
	w	INTEGER	NULL,
	l	INTEGER	NULL,
	t	INTEGER	NULL,
	postg	TEXT	NULL,
	postw	TEXT	NULL,
	postl	TEXT	NULL,
	postt	TEXT	NULL,
	foreign key (tmID) references Teams (tmID),
	foreign key (year) references Teams (year)
);

CREATE TABLE AwardsMisc (
	name	TEXT	NOT NULL	PRIMARY KEY,
	ID	TEXT	NULL,
	award	TEXT	NULL,
	year	INTEGER	NULL,
	lgID	TEXT	NULL,
	note	TEXT	NULL
);

### User's Query:
What is the average height of player who were born in 1990 and after? Compare the average height with players who were born before 1990.

### Extra Knowledge:
average height refers to AVG(height); born in 1990 refers to birthYear = 1990

SELECT AVG(IIF(birthYear < 1990, height, NULL)) - AVG(IIF(birthYear >= 1990, height, NULL)) FROM Master