You are on page 1of 4

TAREA 2

Exercise 2.2

A Formula One fan club wants to set up a database to keep track of the results of all the seasons
since the first Formula One World championship in 1950.

A season is held on a year, between a starting date and an ending date, has a number of races, and
is described by a summary and a set of regulations. A race has a round number (stating the
ordering of the race in a season), an official name (e.g., 2013 Formula One Shell Belgian Grand
Prix), a race date, a race time (expressed in both local and UTC time), a description of the weather
when the race took place, the pole position (consisting of driver name and time realized), and the
fastest lap (consisting of driver name, time, and lap number).

Each race of a season belongs to a Grand Prix (e.g., Belgian Grand Prix), for which the following
information is kept: active years (e.g., 1950–1956, 1958, etc. for the Belgian Grand Prix), total
number of races (58 races as of 2013 for the Belgian Grand Prix), and a short historical description.
The race of a season is held on a circuit, described by its name (e.g., Circuit de Spa-
Francorchamps), location (e.g., Spa, Belgium), type (such as race, road, street), number of laps,
circuit length, race distance (the latter two expressed in kilometers), and lap record (consisting of
time, driver, and year). Notice that over the years, the course of the circuits may be modified
several times. For example, the Spa-Francorchamps circuit was shortened from 14 to 7 km in 1979.
Further, a Grand Prix may use several circuits over the years. For example, the Belgian Grand Prix
has been held alternatively in the SpaFrancorchamps, Zolder, and Nivelles circuits.

A team has a name (e.g., Scuderia Ferrari), one or two bases (e.g., Maranello, Italy), and one or
two current principals (e.g., Stefano Domenicali). In addition, a team keeps track of its debut (the
first Grand Prix entered), the number of races competed, the number of world championships won
by constructor and by driver, the highest race finish (consisting of place and number of times), the
number of race victories, the number of pole positions, and the number of fastest laps.

A team competing in a season has a full name, which typically includes its current sponsor (e.g.,
Scuderia Ferrari Marlboro from 1997 to 2011), a chassis (e.g., F138), an engine (e.g., Ferrari 056),
and a tyre brand (e.g., Bridgestone). For each driver, the following information is kept: name,
nationality, birth date and birth place, number of races entered, number championships won,
number of wins, number of podiums, total points in the career, number of pole positions, number
of fastest laps, highest race finish (consisting of place and number of times), and highest grid
position (consisting of place and number of times). Drivers are hired by teams competing in a
season as either main drivers or test drivers. Each team has two main drivers and usually two test
drivers, but the number of test drivers may vary from none to six. In addition, although a main
driver is usually associated with a team for the whole season, it may only participate in some of
the races of the season. A team participating in a season is assigned two consecutive numbers for
its main drivers, where the number 1 is assigned to the team that won the constructor’s world title
the previous season. Further, the number 13 is usually not given to a car, it only appeared once in
the Mexican Grand Prix in 1963.
A driver participating in a Grand Prix must participate in a qualifying session, which determines the
starting order for the race. The results kept for a driver participating in the qualifying session are
the position and the time realized for the three parts (called Q1, Q2, and Q3). Finally, the results
kept for a driver participating in a race are the following: position (may be optional), number of
laps, time, the reason why the driver retired or was disqualified (both may be optional), and the
number of points (scored only for the top eight finishers).

(a) Design an ER schema for this application. In particular, state the identifiers and the derived
attributes. Note any unspecified requirements and integrity constraints, and make
appropriate assumptions to make the specification complete. If you need additional
information, you may look at the various existing Formula One web sites.

(b) Translate the ER schema above into the relational model. Indicate the keys of each relation,
the referential integrity constraints, and the non-null constraints.

(a) ER schema
Circuits

CircuitID
Name
(1,n)
HeldOn Location
(1,1)
Type
CircuitLength
/RaceDintance
Races LapRecord
NumberLaps
Time
RaceID DriverName
RoundNumber Year
Seasons
Name
RaceDate (1,1)
SeasonID
Year RaceTime (1,1) (1,n) (1,n)
StartingDate (1,n)
Local Belong GrandPrix Use
(1,1)
EndingDate Have UTC
/NumberRaces Weather GrandPrixID
PolePosition ActiveYears Year
Summary
Regulations DriverID /NumberRaces
(1,n) DriverName Description
Time
(1,n)
FastestLap
DriverID Qualify
Participate DriverName (1,n)
Time Run
LapNumber Position
Consecutives TimeQ1
Number1 TimeQ2
Position (0,1)
Number2 TimeQ3
NumberLaps
(1,n) Time
WhyRetir (0,1) (1,n)
Teams WhyDesc (0,1) (1,n)
Sponsors NrPoints (0,1) Drivers
TeamID
SponsorID (1,n) Sponsors (1,n) Name
DriverID
Name Teams Base (1,2)
Name
Principal (1,2)
Nationality
Year Debut
BirthDate
Chassis GrandPrixName (1,n) (1,n)
Hire BirthPlace
Date
/NumberRaces
ChassisID (1,n) (1,n) /NumberRaces
ChassisTeams /NrChampionships
Name /NrChampionships Season /NumberWins
/HighestRaceFinish DriverType /NumberPodiums
Year /Place
/TotalPoints
Engines /NumberTimes
/NrPolePositions
/NrRaceVictories
/NrFastestLaps
EngineID (1,n) (1,n) /NrPolePositions
EngineTeams HighestRaceFinish
Name /NrFastestLaps
Place
NumberTimes
Year HighestGridPos
TyreBrands Place
(1,n) (1,n) NumberTimes
TyreBrandID
TyreTeams
Name

Year

(b) Relational model


Circuits

Races CircuitID
Name
RaceID Location
RoundNumber Type
Name CircuitLength
RaceDate LapRecord
RaceTime Time
Seasons Local DriverName
UTC Year
GrandPrix
SeasonID Weather
Year PolePosition GrandPrixID Use
StartingDate DriverID ActiveYears
EndingDate DriverName /NumberRaces GrandPrixID
/NumberRaces Time Description CircuitID
Summary FastestLap
Regulations DriverID Year
DriverName
Time
LapNumber Run Qualify
Participate
SeasonID
RaceID GrandPrixID
SeasonID CircuitID
DriverID DriverID
TeamID /RaceDintance
Position (0,1) Position
Consecutives NumberLaps
NumberLaps TimeQ1
Number1 GrandPrixID
Time TimeQ2
Number2 TimeQ3
WhyRetir (0,1)
WhyDesc (0,1)
NrPoints (0,1)
SponsorsTeams Teams
Sponsors Drivers
SponsorID TeamID
SponsorID TeamID Name
DriverID
Name Name Base (1,2)
Name
Year Principal (1,2)
Nationality
Debut
BirthDate
GrandPrixName Hire BirthPlace
ChassisTeams Date
/NumberRaces
/NumberRaces TeamID
Chassis /NrChampionships
/NrChampionships DriverID
ChassisID /NumberWins
/HighestRaceFinish Season
ChassisID TeamID /NumberPodiums
/Place DriverType
Name Name /TotalPoints
/NumberTimes
Year /NrPolePositions
/NrRaceVictories
/NrFastestLaps
/NrPolePositions
HighestRaceFinish
/NrFastestLaps
EngineTeams Place
Engines NumberTimes
EngineID HighestGridPos
TyreTeams Place
EngineID TeamID
TyreBrands NumberTimes
Name Name TyreID
Year TeamID TyreBrandID
Name Name
Year

You might also like