1. Registered User
Join Date
Jun 2015
Posts
1

Hi there, I am very new to this forum. I had a databases exam today in the university. I have a report of the questions and answers and answers I choose.Can you please help me check, if I choose the right answers,
Here are the questions:

Please select all correct sentences (may be just one).
1. With a single DataBase Management System (DBMS) we cannot create and maintain different databases.
2. We must define a unique Database Schema for each database.
3. We cannot store information until the Data Base Schema is defined.
Kommentare:

Frage 2 : "Basic Relational DM " [2 Punkte]
Please select all correct sentences (may be just one).
1: Each relation may have multiple primary key.
2: Each relation may have multiple candidate key.
3: Each relation has exactly one primary key.
Kommentare:

Frage 3 : "Data Updating and Normalization" [2 Punkte]
Consider the following example:
Please select all correct sentences (may be just one).

1: This relation IS NOT in Third Normal Form (3NF).
2: This relation IS in Third Normal Form (3NF).
3: We need to know functional dependencies to give an answer.
4: We need to know all rows (tuples) of the relation to give an answer.
Kommentare:

Frage 4 : "Relational Algebra (1)" [2 Punkte]

For the Join operation:
1. The schema of the resultant relation does not depend on the schemas of the source relations.
2. The schema of the resultant relation is equal to the schema of the first source relation.
3. The schema of the resultant relation is an union of all domains defined in source relations.
Kommentare:

Frage 5 : "Relational Algebra (2)" [2 Punkte]

1: A resultant relation of the Join operation does not contain null values at all.
2: A resultant relation of the Join operation does not contain null values under common column(s).
3: A resultant relation of the Join operation may contain null values under any column.

Kommentare:

Frage 6 : "Relational Calculus (1)" [2 Punkte]

Query: "Get names of such products which were sold to London".
C == Customer, T == Transaction, P == Product
(P.Pname): ???
Please select the omitted WFF ( ???)
1. T C (P.P# = T.P# And T.C# = C.C# And C.Ccity=London)
2. T P (P.P# = T.P# And T.C# = C.C# And C.Ccity=London)
3. T C (P.P# = T.P# And T.C# = C.C# And C.Ccity=London)

Frage 7 : "Relational Calculus (2)" [2 Punkte]

Query: "Get names of such customers who bought the product number 1, or bought any product which costs more than 1000".
a == Cname, b == C#, c == P#, d == Price
get (a) : b c d ???
Please select the omitted WFF( ???)
1. (Customer(a,b) And Transaction(b,c) And c=1 Or Product(c,d) & d >1000)
2. (Customer(a,b) And Transaction(b,c) And ( c=1 Or Product(c,d) & d>1000))
3. (Customer(a,b) And (Transaction(b,c) And c=1 Or Product(c,d) & d>1000))
Kommentare:

Frage 8 : "Data Sub-Language SQL (1)" [4 Punkte]

Please define an SQL Query: "Get names of products, dates and total price of such transactions which dealt with customers from London".
Select Pname, Date, Qnt*Price
From Transaction, Product
Where Transaction.C# In (Select C# From Customer Where Ccity = London)

Frage 9 : "Data Sub-Language SQL (2)" [1 Punkte]

Query: "Find a total number of such customers who bought the Product 1 and a total number of such customers who bought the Product 2".
Please select a correct definition of the query
Select P#, COUNT(*) From Transaction
Where P#=1 Or P#=2 Group By P#
1.
Select P#, COUNT(*) From Customer Where C# In
(Select C# From Transaction Where P#=1 OR P#=2)
Group By P#
2.
Select P#, COUNT(C#) From Transaction
Where P#=1 Or P#=2
3.
Kommentare:

Frage 10 : "Data Sub-Language QBE" [1 Punkte]

Query: "Get names of all customers in London or Paris".
Please select the omitted example element( ?)
1. P.Y
2. P.X
3. X
Kommentare:

Join Date
Nov 2004
Location
out on a limb
Posts
13,692
have you considered getting a QL databse and client on your own computer and running these queries yourself based ont hat data.

if you don't want to downlaod a db then there are services such as SQL fiddle that will allow you to do this.

you will learn far more by answering these questions by runnign queries than by wiriting unporvoien SQL. actually you will learn far more by debugging the SQL, refinging the query till you get the answers you expect.