### Database Schema:
CREATE TABLE event (
	id	INTEGER	NOT NULL	PRIMARY KEY,
	sport_id	INTEGER	NULL	DEFAULT NULL,
	event_name	TEXT	NULL	DEFAULT NULL,
	foreign key (sport_id) references sport (id)
);

CREATE TABLE noc_region (
	id	INTEGER	NOT NULL	PRIMARY KEY,
	noc	TEXT	NULL	DEFAULT NULL,
	region_name	TEXT	NULL	DEFAULT NULL
);

CREATE TABLE sport (
	id	INTEGER	NOT NULL	PRIMARY KEY,
	sport_name	TEXT	NULL	DEFAULT NULL
);

CREATE TABLE games (
	id	INTEGER	NOT NULL	PRIMARY KEY,
	games_year	INTEGER	NULL	DEFAULT NULL,
	games_name	TEXT	NULL	DEFAULT NULL,
	season	TEXT	NULL	DEFAULT NULL
);

CREATE TABLE games_competitor (
	id	INTEGER	NOT NULL	PRIMARY KEY,
	games_id	INTEGER	NULL	DEFAULT NULL,
	person_id	INTEGER	NULL	DEFAULT NULL,
	age	INTEGER	NULL	DEFAULT NULL,
	foreign key (games_id) references games (id),
	foreign key (person_id) references person (id)
);

CREATE TABLE city (
	id	INTEGER	NOT NULL	PRIMARY KEY,
	city_name	TEXT	NULL	DEFAULT NULL
);

CREATE TABLE competitor_event (
	event_id	INTEGER	NULL	DEFAULT NULL,
	competitor_id	INTEGER	NULL	DEFAULT NULL,
	medal_id	INTEGER	NULL	DEFAULT NULL,
	foreign key (medal_id) references medal (id),
	foreign key (event_id) references event (id),
	foreign key (competitor_id) references games_competitor (id)
);

CREATE TABLE medal (
	id	INTEGER	NOT NULL	PRIMARY KEY,
	medal_name	TEXT	NULL	DEFAULT NULL
);

CREATE TABLE games_city (
	games_id	INTEGER	NULL	DEFAULT NULL,
	city_id	INTEGER	NULL	DEFAULT NULL,
	foreign key (games_id) references games (id),
	foreign key (city_id) references city (id)
);

CREATE TABLE person (
	id	INTEGER	NOT NULL	PRIMARY KEY,
	full_name	TEXT	NULL	DEFAULT NULL,
	gender	TEXT	NULL	DEFAULT NULL,
	height	INTEGER	NULL	DEFAULT NULL,
	weight	INTEGER	NULL	DEFAULT NULL
);

CREATE TABLE person_region (
	person_id	INTEGER	NULL	DEFAULT NULL,
	region_id	INTEGER	NULL	DEFAULT NULL,
	foreign key (person_id) references person (id),
	foreign key (region_id) references noc_region (id)
);

### User's Query:
Calculate the bmi of the competitor id 147420.

### Extra Knowledge:
DIVIDE(weight), MULTIPLY(height, height) where id = 147420;
SELECT CAST(T1.weight AS REAL) / (T1.height * T1.height) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T2.id = 147420