Ein Tanzverein bietet zurzeit 4 verschiedene Trainingsstunden im

advertisement
Business Information Systems. Exam Database Management Systems
WS11
NAME______________________________ MATRIKEL___________
1
a).
Describe in few words (in Stichworten) the 3 layers (Sichten, Schemata) of the
ANSI-SPARC database architecture model and their function (under which point of view
they describe a database). (6 points)
1b.
To which of the above layers belongs an input form, where a user can edit
customer data and can see as well the orders of the customer? (2)
To which layer belongs a base table in 3rd normal form which is used for the
customer data? (2)
Exam Database Management Systems WS2011 2
2.
Explain in few words the following terms and their mutual connection (how one of
them relates to the others - ihren Zusammenhang untereinander). (12)
a)
Attribute
b)
Key (not foreign key)
c)
Data type
d)
Foreign key
Exam Database Management Systems WS2011 3
3.orderitem
Order
ID
OrderDate
Customer
ID
Postal Code Product
ID
Product Name
10248 04-Jul-1996 VINET
51100
11 Queso Cabrales
10248 04-Jul-1996 VINET
51100
10248 04-Jul-1996 VINET
Supplier Quant
ID
ity
5
12
42 Singaporean Hokkien Fried Mee
20
10
51100
72 Mozzarella di Giovanni
14
5
10249 05-Jul-1996 TOMSP
44087
14 Tofu
6
9
10249 05-Jul-1996 TOMSP
44087
51 Manjimup Dried Apples
24
40
10250 08-Jul-1996 HANAR
05454-876
41 Jack's New England Clam Chowder
19
10
10250 08-Jul-1996 HANAR
05454-876
51 Manjimup Dried Apples
24
35
10250 08-Jul-1996 HANAR
05454-876
65 Louisiana Fiery Hot Pepper Sauce
2
15
10251 08-Jul-1996 VICTE
69004
22 Gustaf's Knäckebröd
9
6
10251 08-Jul-1996 VICTE
69004
57 Ravioli Angelo
26
15
10251 08-Jul-1996 VICTE
69004
65 Louisiana Fiery Hot Pepper Sauce
2
20
The above table shows items of customer orders
(1) Orders are identified by OrderID, products are identified by ProductID, Customers
by CustomerID and Suppliers by SupplierID
(2) In an order the same product cannot appear more than once
(3) For every order there is exactly one customer
(4) For every product there is exactly one supplier
(5) For the customer the PostalCode is displayed
(6) For each orderitem there is a quantity, which means how many peaces of the
product are actually ordered
a)
Please explain in a few words that the key of this relation is {Order_ID, Product_ID}
(2)
b)
Does the table respect the normal forms 1, 2, 3? Please explain seperately for
every normal form. Normalize the database schema to 3rd normal form. Specifiy
only the relation names and the attributes. Don’t write down the tuples of the new
relations. Underline the primary key attributes.
Please write your answer on the back side of the page before (left from this sheet).
(15)
Exam Database Management Systems WS2011 4
4. Take the table from task 3 and write down the SQL command for the following tasks.
Write down only the command, not the resulting table.
Here is the schema once again:
orderitem
Order
ID
OrderDate
Customer
ID
Postal Code Product
ID
Product Name
Supplier Quant
ID
ity
a) (3) Display a list of the orders with Order_ID and Order_Date. The list shall be
ordered by Order_ID and contain every order only once.
b) (3) Display the Order_ID and Order_Date only of the orders of the customers
'TOMSP' and 'VICTE'.
c) (4)
Display for every order how many items it has.
d) (4)
Which orders have more than 2 items (SQL-command)?
Exam Database Management Systems WS2011 5
Exam Database Management Systems WS2011 6
e) The following table contains all customers. Use it together with the table orderitem of
task 3
customer
CustomerID
CompanyName
HANAR
Hanari Carnes
TOMSP
Toms Spezialitäten
VICTE
Victuailles en stock
VINET
Vins et alcools Chevalier
Display for all customers the attributes: customerID, CompanyName, orderID, OrderDate
(5)
f) Explain the difference between a natural join and a condition join. (5)
Exam Database Management Systems WS2011 7
5.
The following tables are given
product
ProductID
ProductName
UnitPrice SupplierID
1 Chai
18,00
1
2 Chang
19,00
1
3 Aniseed Syrup
10,00
1
4 Chef Anton's Cajun Seasoning
22,00
2
5 Chef Anton's Gumbo Mix
21,35
2
supplier
SupplierID
CompanyName
1 Exotic Liquids
2 New Orleans Cajun Delights
Write down the CREATE TABLE command for the table product. The price must be
greater than 0. Use the data types INTEGER, DECIMAL(places, places_after_comma)
und VARCHAR(length). Implement all integrity constraints. (12)
Exam Database Management Systems WS2011 8
6a.
Describe in a few words what the term „Isolation“ means for transactions (ACID
principle). What do the other letters in 'ACID' denote?(8)
6b. (5) Describe in short what the term 'lost update' means, when user A and user B work
in the same table at the same time.
Exam Database Management Systems WS2011 9
7. You see a part of the conceptual data model for a housekeeping company
(Hausverwaltung).
<pi> = "primary identifier". Primary key attributes are underlined.
a) (4)
Describe the relationships completely in words.
b) (8) Insert into the above diagram an entity type house where a house has one to
many appartments and belongs to one or more persons. An appartment belongs to exactly
one house and a person can own zero or more houses.
Download