You are on page 1of 8

Integrated

Master in Mechanical Engineering – 3rd year


Information Systems – 2014/2015
Exam – Normal Season – June 25th, 2015
Duration: 2 hours + 30 min. tolerance

Name: __________________________________________________________________________

Read carefully each question and answer in the blank areas. When answering each item, do only repeat
the classes that are necessary.

P2 (7 points)

Problem 1

The Platform ONG.PT is a private philanthropic association that represents the majority of the Portuguese
NGOs (Non-governmental organizations). The association’s main goal is to empower the NGOs at political
and legislative levels, and to promote their actions and projects. The Platform ONG.PT intends to develop an
information system for managing the activities of their related NGOs.

Design the conceptual class model for each set of requirements defined in the following items:

1. “The Platform ONG.PT keeps an up-to-date registry of its NGOs. An NGO is characterized by its name,
acronym, headquarter address and e-mail. For each NGO it is also needed to store its members. A member is
characterized by name, address, e-mail, and its function inside the NGO (e.g. President, Secretariat, etc.). A
member can only belong to one NGO. Since the member of an NGO can be either an individual or a collective
entity, it is essential to store the type of an entity (e.g. Association, Organization, etc.). Finally, it is also
needed to store the registry number and the name of the individual responsible for an entity.”
Integrated Master in Mechanical Engineering – 3rd year
Information Systems – 2014/2015
Exam – Normal Season – June 25th, 2015
Duration: 2 hours + 30 min. tolerance

2. The Platform ONG.PT also needs to know the action area of each NGO. For example, some NGOs act on
humanitarian subjects and other subjects related to human rights. Other NGOs act on environmental subjects,
such as biodiversity. For each action area, a NGO should provide the estimated budget that will be required.

Each NGO is responsible for a number of projects. A project is characterized by a name, budget and action
area. Partners, such as companies, foundations or even states, can support the projects. For each partner, it
is important to know the name, type and financial aid that is given for each project.
Integrated Master in Mechanical Engineering – 3rd year
Information Systems – 2014/2015
Exam – Normal Season – June 25th, 2015
Duration: 2 hours + 30 min. tolerance

3. For each project, a NGO carries some actions for informing and bring awareness to citizens on the action
areas for which it is responsible. For each action it is important to know the name and the places where it can
be done. Normally, each action carried by a NGO has different forms of expression (petitions, debates, think
tanks, parades etc.). Such actions can be carried in many places around the world, in distinct moments.
However, it important to ensure that actions of the same type do not repeat in a same location.
Integrated Master in Mechanical Engineering – 3rd year
Information Systems – 2014/2015
Exam – Normal Season – June 25th, 2015
Duration: 2 hours + 30 min. tolerance

Problem 2

The following diagrams represent two alternatives for the conceptual modeling of a database for storing the
employees of a set of companies and the trainings that they do.
Establish a comparison between the two models, pointing the advantages and disadvantages of each one.
To sustain your conclusions, convert each conceptual model to the relational model.
Integrated Master in Mechanical Engineering – 3rd year
Information Systems – 2014/2015
Exam – Normal Season – June 25th, 2015
Duration: 2 hours + 30 min. tolerance

Answer the questions on this sheet.


Mark the letter corresponding to the answer that you consider to be the most correct.

P3 (5 points)

The table below stores information about articles published in Portuguese newspapers:

#Newsp Name_Newsp #Article Author Date Title_Article #Theme Theme
1 Record 1 António Magalhães 23-05-2014 Bem fica 1 Sports
2 A Bola 3 Miguel S. Tavares 17-05-2014 Onze anos e seis dias 1 Sports
2 A Bola 12 Vítor Serpa 19-05-2014 Desilusão 1 Sports
3 Expresso 2 Henrique Monteiro 18-05-2014 Conhecer as contas 2 Economy
4 Diário de Notícias 9 Raul Vaz 23-05-2014 O Estado e a educação sexual 3 People
6 Jornal de Notícias 9 Raul Vaz 24-05-2014 O Estado e a educação sexual 3 People
5 Público 17 João Bénard da Costa 20-05-2014 Os meus sete papas (II) 3 People
4 Diário de Notícias 21 Jorge Fiel 17-06-2014 Aumentando a sabedoria dos taxistas 3 People
6 Jornal de Notícias 21 Jorge Fiel 10-06-2014 Aumentando a sabedoria dos taxistas 3 People
3 Expresso 6 João Bénard da Costa 08-06-2013 Regresso às primeiras imagens 4 Culture
5 Público 4 Miguel S. Tavares 20-05-2014 O silêncio de Seguro 5 Politics
5 Público 8 José Manuel Fernandes 18-05-2014 Desilusão 5 Politics
3 Expresso 10 Fernando Madrinha 09-05-2014 Os cuidados de Passos Coelho 5 Politics

i) In which Normal Form (NF) is table above?


a) 2 NF
b) 1 NF
c) 3 NF
d) None of the above

ii) Which is the primary key for the table above?
a) #Article
b) #Newsp, #Article, Author
c) #Newsp, #Article
d) #Article, Date

iii) How many tables are needed to represent the same information in the 2NF?
a) 4
b) 3
c) 2
d) None of the above
Integrated Master in Mechanical Engineering – 3rd year
Information Systems – 2014/2015
Exam – Normal Season – June 25th, 2015
Duration: 2 hours + 30 min. tolerance

iv) How many tables are needed to represent the same information in the 3NF?
a) 4
b) 3
c) 2
d) None of the above


v) How many foreign keys would exist in the corresponding tables in the 3NF?
a) 5
b) 2
c) 1
d) None of the above

vi) In how many attributes there can exist redundant information?
a) 3
b) 4
c) 5
d) None of the above


P4 (6 points)
The tables below store information related to dishes and their ingredients:

T_Dish T_DishType
#Dish DishName Difficulty Time #DishType #DishType NameDishType
1 Spaghetti Bolognaise 2 55 7 1 Appetizer
2 Roasted beef 1 90 4 2 Salad
3 Chicken 2 50 4 3 Main Course
4 Shrimp Risotto 3 45 3 4 Cooked
5 Greek salad 1 10 2 5 Pie
6 Patties 4 60 1 6 Stew
7 Pasta

T_Ingred T_TypeIngred T_Amount


#Ingred NameIngred Kcal #TypeIngred #TypeIngred NameTypeIngred #Ingred #Dish Quantity
1 Fruit 1 5 100
1 Lettuce 0,15 2
2 Vegetable 3 3 1000
2 Apple 0,20 1
3 Meat 7 5 125
3 Chicken 10 3
Fish 1,5 4 Fish 8 3 10
4 4
Milk 0,9 5 Dairy 9 1 150
5 5
Bread 3 6 Flour 10 1 250
6 6
7 Seasoning 10 5 100
7 Cheese 0,5 5
8 Salt 0,05 7 8 2 10
9 Spaghetti 4 6
10 Tomato 0,6 2
Integrated Master in Mechanical Engineering – 3rd year
Information Systems – 2014/2015
Exam – Normal Season – June 25th, 2015
Duration: 2 hours + 30 min. tolerance

i) Which information is returned by this query?


SELECT T_Ingred.NameIngred
FROM T_Dish, T_Ingred, T_Amount
WHERE T_Ingred.[#Ingred] = T_Amount.[#Ingred] AND T_Dish.[#Dish] = T_Amount.[#Dish]
AND T_Dish.DishName="Greek salad";

a) Dishes that share the same ingredients of Greek salad
b) Number of ingredients of Greek salad
c) Name of the ingredientes of Greek salad
d) None of the above

ii) Which information is returned by this query?
SELECT T_Dish.NameDish
FROM T_DishType,T_Dish,T_Ingred, T_Amount
WHERE T_Ingred.[#Ingred] = T_Amount.[#Ingred]
AND T_Dish.[#Dish] = T_Amount.[#Dish]
AND T_DishType.[#DishType] = T_Dish.[#DishType]
AND T_DishType.NameDishType = "Salad"
GROUP BY T_Dish.[#Dish], T_Dish.NameDish
HAVING COUNT(*) > 4;

a) Name of the dishes made of more than 4 ingredients
b) Name of the salad dishes in which the amount of each ingrediente is greather than 4
c) Name of the salad dishes made of more than 4 ingredients
d) None of the above

iii) Which information is returned by this query?
SELECT DISTINCT T_Ingred.[NameIngred]
FROM T_Dish, T_Ingred, T_Amount
WHERE T_Ingred.[#Ingred] = T_Amount.[#Ingred]
AND T_Dish.[#Dish] = T_Amount.[#Dish]
AND T_Dish.[#Dish] NOT IN
(SELECT [#Dish]
FROM T_Ingred, T_Amount
WHERE T_Ingred.[#Ingred] = T_Amount.[#Ingred]
GROUP BY [#Dish]
HAVING COUNT(*) > 4);

Integrated Master in Mechanical Engineering – 3rd year
Information Systems – 2014/2015
Exam – Normal Season – June 25th, 2015
Duration: 2 hours + 30 min. tolerance

a) Name of the ingredients that are not used in more than 4 dishes
b) Name of the ingredients that are not used in dishes with more than 4 ingredients
c) Name of the dishes that have no more than 4 ingredients
d) None of the above

iv) Indique qual o resultado da seguinte expressão:


SELECT DISTINCT [#Dish] FROM T_Amount, T_Ingred, T_TypeIngred
WHERE T_Amount.[#Ingred] = T_Ingred.[#Ingred] AND
T_Ingred.[#TypeIngred] = T_TypeIngred.[#TypeIngred] AND
NameTypeIngred <> "Flour " AND Quantity < 100

AND [#Dish] IN ( SELECT [#Dish] FROM T_Amount, T_Ingred, T_TypeIngred


WHERE T_Amount.[#Ingred] = T_Ingred.[#Ingred]
AND T_Ingred.[#TypeIngred] = T_TypeIngred.[#TypeIngred]
AND NameTypeIngred = "Fish" GROUP BY [#Dish] HAVING Sum(Quantity) < 100 );

a) Dishes with less than 100 of Fish, that do not have flour, and no ingredients have a quantity of at
least 100
b) Dishes that do not have flour and no ingredients have a quantity of at least 100
c) Dishes with less than 100 of Fish, and that do not have flour in quantities equal to 100 or more
d) None of the above



v) Write a SQL expression for selecting the name of the dishes with less than 500 Kcal, and with a dificulty
equal to 1.

You might also like