Database Design Exercises: Miguel Rebollo Introduction To Computer Science 2010-2011
Database Design Exercises: Miguel Rebollo Introduction To Computer Science 2010-2011
Exercises
Miguel Rebollo
We want to know what actions are realised in each city, storing its
name, country and n of inhabitants. We also need an identifier to
differentiate them. Also there is wished the investment of the project
that corresponds to the city and a small description of the action.
For each species, we want to know its common name and its scientific
name, as well as a general description and a photo. Every species can
live in different natural habitats defined by his name, climate and
predominant vegetation. Every species has associated an index of
vulnerability inside every habitat, which measures the risk of extinction
of the species in the above mentioned habitat.
To organize the visits, and according to the habitats that visitors wants
to cover, the park offers them a series of trips for the habitats, which
are identified by their code and are characterised by their duration,
length and maximum number of authorised visitors. A habitat only can
be part of one itinerary.
A health centre need a DB with the case history of all its patients.
The health centre is divided into several units, each one having an
identifier, a name and the floor in which it is located. The unit has a
doctor in charge, characterised by his/her name, code and speciality.
When patients arrive, they are admitted in a unit and are registered
with their SS number, age and date of admission. While they are still in
hospital, all interventions realised by doctors are written down, setting
the date, the observed symptom and the prescribed treatment.
A health centre need a DB with the case history of all its patients.
The health centre is divided into several units, each one having an
identifier, a name and the floor in which it is located. The unit has a
doctor in charge, characterised by his/her name, code and speciality.
When patients arrive, they are admitted in a unit and they are
registered with their SS number, age and date of admission. While they
are still in hospital, all interventions realised by doctors are written
down, setting the date, the observed symptom and the prescribed
treatment.
A route is identified by a code. The total length (in km.), the source
and the destination of each route is stored. Besides, each bus has a
license number, a model, its capacity (number of passengers) and
the name of its driver. We assume that a bus can only be covering
one route.
Routes cover several cities. Well store the name of the city, the
address and the telephone number of the bus station. To keep the
stops organised, each bus stop has a order number. This number
can be different depending on the route the city belongs to (one city
can belong to several routes).
The photos are characterised by their URL (it's unique) and they have
a filename, data type, size, resolution and a field that sets if the
photo is public or private.
Users add as many tags as they need to each one of their photos to
classify them. Each tag keeps the total number of pictures that use
the tag. Besides, the system can suggest additional tags, so we need
to indicate who has added the tag: the user or the system.
Create the conceptual and the logical schemes of the database that
fulfills the requirements expounded.
For each web page, you will store its URL (web address), its name, a
short description and a global valuation.
Draw the conceptual and the logical schemes of the database that
fulfills the requirements expounded.
Orders are identified by its number and they contains the date, the
total amount and a list with the flowers included in the order and
their quantity. Flowers are identified by a code, their name and the
retail price. Flowers belong to an species. Species have a name,
flowering period, planting season, appropriate soil and
recommended sun exposure.
Create the conceptual and logical model that corresponds with these
requirements
Draw the conceptual and the logical schemes of the database that
fulfill the requirements expounded.
Lenders that lend they money are registered with an id, their name
and their available amount of money for the financial operations.
Borrowers are identified by their id and the company registers their
name and a risk value depending on their personal situation.
When borrowers apply for a loan, a new loan code, the total amount,
the refund deadline, the interest rate and its purpose are stored in
the database. Lenders choose the amount that they want to invest in
each loan. A lender can contribute with different partial amounts to
several loans.
Create the conceptual and logical model that corresponds with these
requirements.
Users have a nick (unique), a password, their real name and a valid
email account. Users can write comments, which are composed by a
text and the publication date. Furthermore, users can appear in
photos. A Photo has a filename and an optional description. To tag
users in the photos, a frame is used. The coordinates of these
frames are stored in the photo too in order to know which users
appear in each photo.