• Non ci sono risultati.

Design - Part A

N/A
N/A
Protected

Academic year: 2021

Condividi "Design - Part A"

Copied!
2
0
0

Testo completo

(1)

Design - Part A

1. The following relations are given (primary keys are underlined):

BABY PARKING ACTIVITY (ACode, AName, TypeOfActivity, MinAge, MaxAge, Period) EDUCATOR(SSN, EName, Specialization)

EDUCATOR FOR ACTIVITY(ACode, SSN, Total#EstimatedHours) ACTIVITY REGISTER(ACode, SSN, Date, #Hours)

Write the following queries:

(a) Mandatory exercise in algebra (4 points):

Show the name and the specialization of educators who have taught only activities for children aged 2 to 4 years in the first period.

(b) Mandatory exercise in SQL (5 points):

Show the name and the type of the activities for children aged between 1 and 3 years to which at least 3 educators were assigned and that have a total number of estimated hours less than 30 hours.

(c) Optional exercise in SQL (5 points):

For each activity for which the total number of hours has been greater than the total number of estimated hours, show the name of the activity and for every educator the name and the total number of worked hours.

1

(2)

Design - Part B

2. A real estate agency wishes to design a database to manage its website.

• The real estate agency has several offices in the main cities. For each office, identified by a numerical code and the name of the city in which it is located, the address, the phone number, and an email address are known.

• The real estate agency publishes ads about homes. Each home is characterized by a code, the neighbourhood, the surface, the number of bedrooms, and the number of bathrooms. In addition, the database stores for each home a list of filenames of pictures, to be displayed on the website. Each ad, identified by a code that is unique within all ads referring to the same home, is characterized by the publication date and a short description. Ads are divided into rental ads and sale ads. For rental ads, the minimum duration of the contract and the monthly fee are known. For sale ads, the database stores the price of the home and the information whether the home is immediately available or not.

• Customers of the real estate agency website are identified by their nickname and char- acterized by name, surname, date of birth, email address, and possibly a phone number.

Customers may create lists to keep track of their ads of interest. For each customer, the database stores a list of each ad selected by the customer, together with the date on which the ad was added to the list by the customer.

• Different real estate agents work for the agency. Each agent, identified by his/her SSN, is characterized by his/her name, email, phone number and the office where the agent is currently working.

• Customers can request visits to homes they are interested in, accompanied by an estate agent. For each visit, the home, the real estate agent accompanying the visit, the customer requesting the visit, the date and the time of the visit are recorded. Note that the same customer may request one or more visits, to the same home or to different homes. In addition, the same agent may accompany one or more visits. However, no more than one visit may be scheduled simultaneously in the same home.

• To provide financial aid to its customers, the real estate agency offers a financial counselling service in its offices. The database keeps track of each day of the week on which the financial counselling service is available in each office, together with the opening and closing times.

Assume that, on a given day of the week and in a given office, the service is provided in at most a single time frame.

(a) Mandatory exercise (9 points): Describe the conceptual schema of a database for the above application by means of an ER diagram.

(b) Mandatory exercise (4 points): Derive a normalized relational logical schema for the same database.

(c) Optional exercise (1 point): Define referential integrity constraints for 3 relations of your choice among those defined in the conceptual schema.

2

Riferimenti

Documenti correlati

Please describe your experience in Graduates Tracking, Labour markets, European project management and external evaluation. Other relevant knowledge of/experience

Based on these results we did not expect to find relevant relationships between astrology (Sun Signs, Elements and astrological gender) and individual differences in

Olmi S, Magnone S, Bertolini A, Croce E (2005) Laparoscopic versus open appendect- omy in acute appendicitis: a randomized prospective study. Sauerland S, Lefering R, Neugebauer

 A solution based on SQL like queries executed on a temporary table associated with the input data..

Bayesian nonparametrics, Central limit theorem, Conditional iden- tity in distribution, Indian buffet process, Random measure, Random reinforcement, Stable

results of the Garey and Johnson approach, we establish under what conditions the results of these two approaches can be.. compared, eventually exhibiting some examples which show

Jones (1990) suggested that there was a certain amount of homogeneity in the measurements of islandica Razorbills in Britain, Ireland and Iceland and that there was a possible

L.240/2010 Ingegneria dell'Impresa "Mario Lucertini" e conseguito in data 10/04/2018, le mie principali attività scientifiche hanno incluso la fluidodinamica (CFD,