In this lab session we will use data about mountains and hikers.
Please make sure that you all have an instance of the mountains
relation in your database. You can follow the proposed
solution to last weeks exercise to generate one. Furthermore,
load data into relation hikers which is defined as
before. The file hikers.load contains a list of hikers
in the following format: hid|hname|age|skill.
Now generate a simplified relation climbs as follows:
CREATE TABLE climbs (
hid int NOT NULL,
mid int NOT NULL,
FOREIGN KEY (hid) REFERENCES hikers(hid),
FOREIGN KEY (mid) REFERENCES mountains(mid),
PRIMARY KEY (hid, mid)
Data for relation climbs is given in climbs.load. The
format of the file is hid|mid.
Create a view munros that list all the Munros in mountains. The
view should have the same attributes as mountains except for attribute type.