Professional Documents
Culture Documents
The database management system must protect a database against the storing of tuples
with duplicate values of ... keys.
Please select a correct key name:
1: Primary
2: Candidate
3: Foreign
Suppose we are going to load into a data base some thousands of tuples which are
represented by records of an independent data file. In this case we should use . . .
Please select a correct sentence.
1: a "self-contained" language.
2: a host language + DML.
Suppose we need to retrieve certain data from a data base. And we are not going to
repeat this query in the future. In this case we should use ...
Please select a correct sentence.
1: a "self-contained" language.
2: a host language + DML.
Normalization
Please select a correct sentence.
1: Database Administrator has to describe the set of functional dependencies in a
database schema.
2: A set of functional dependencies is a property of an area being
modelled. The functional dependencies cannot be changed during data
base updating.
3: A set of functional dependencies may be dynamically changed when a new tuple
is stored or deleted.
Relational Algebra
1.
2.
3.
No
No
Relational Calculus
Let X and Y be the names of tuple variables both of which range over the tuples of the
relation Product.
Consider the query:
X == Product; Y == Product;
(X.Pname, Y.Price) : (X.P# = Y.P# & X.Price > 1100)
Please select a query which is equivalent to this one.
1: (X.Pname, Y.Price) : (X.Price > 1100)
2: (X.Pname, Y.Price) : (X.P#=Y.P# Or X.Price > 1100)
3: (X.Pname, X.Price) : (X.Price > 1100)
Query: "Get names of such customers who bought the product CPU".
C == Customer, T == Transaction, P == Product
(C.Cname): T P (T.P#=P.P# And P.Pname=CPU ??? )
Please select the omitted comparison (???)
1: Or X.C# = Y.C#
2: And C.C# = T.C#
3: And C.C# = P.C#
Query: "Get names of such customers which live in the same city as the customer Codd".
C1 == Customer, C2 == Customer
(C1.Cname): ???(C1.Ccity = C2.Ccity And C2.Cname = "Codd")
Please select the omitted quantifier (???)
1. C2
2: C2
3: C1
Query: "Get names of such products which were bought by ALL customers".
P == Product, T == Transaction, C == Customer
(P.Pname): ??? (P.P# = T.P# And T.C# = C.C#)
Please select the omitted quantifiers (???)
1. C T
2: T C
3: C T
Query: "Get the customer names and product prices for all transactions of the product
VDU".
Range Customer C; Range Transaction T Some; ???
Get (C.Cname, P.Price):(C.C#=T.C# & T.P#=P.P# & P.Pname=VDU)
Please select the omitted Range statement (???)
1. Range Product P;
2: Range Product P SOME;
3: Range Product P ALL;
Query: "Find a total number of customers who bought the product VDU".
Please select a correct definition of the query
1. Range Customer C; Range Transaction T Some; Range Product P Some;
Get A(Count(C.C#)):(C.C#=T.C# & T.P#=P.P# & P.Pname=VDU);
2. Range Transaction T; Range Product P SOME;
Get A(Count(T.C#)):(T.P#=P.P# & P.Pname=VDU);
3. Range Customer C; Range Transaction T Some; Range Product P Some;
Get A(Count(T.P#)):(C.C#=T.C# & T.P#=P.P# & P.Pname=VDU);
Query: "Get names of such customers who bought the product CPU".
Range Customer C; Range Product P Some; ???
Get B(C.Cname):(C.C#=T.C# & T.P#=P.P# & P.Pname=CPU)
Please select the omitted Range statement (???)
1. Range Transaction T;
2: Range Transaction T SOME;
3: Range Transaction T ALL;
Query: "Get names of such customers who bought the product CPU, in ascending order of
dates of transactions".
Range Customer C; Range Product P Some; ???
Get B(C.Cname, T.Date):(C.C#=T.C# & T.P#=P.P# & T.Pname=CPU) UP T.Date;
Please select the omitted Range statement (???)
1. Range Transaction T;
2: Range Transaction T SOME;
3: Range Transaction T ALL;
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))
Query: "Get names of all customers who bought the product CPU".
Select Cname From Customer Where C# ???
(Select C# From Transaction Where P# ???
(Select P# From Product Where Pname=CPU))
Please select omitted comparisons(???...???)
1. In . . . In
2: In . . . Not In
3: Not In . . . In
Query: "Get names of all customers who did not buy the product CPU".
Select Cname From Customer Where C# ???
(Select C# From Transaction Where P# ???
(Select P# From Product Where Pname=CPU))
Please select omitted comparisons(???...???)
1. In . . . In
2: In . . . Not In
3: Not In . . . In
Query: "Get names of all customers who bought the product CPU, but did not buy the
producr VDU".
Select Cname From Customer Where C# In
(Select C# From Transaction Where P# In
(Select P# From Product Where Pname=CPU))
And C# ???
(Select C# From Transaction Where P# ???
(Select P# From Product Where Pname=VDU))
Please select omitted comparisons(???...???)
1. In . . . In
2: In . . . Not In
3: Not In . . . In
Query: "Get names of customers who bought the product number 1".
Please select all correct definitions of the query
1. Select Cname From Customer Where C# In
(Select C# From Transaction Where P#=1)
2. Select Cname From Customer X, Transaction Y
Where X.C#=Y.C# And Y.P#=1
3. Select Cname From Customer Where
Customer.C#=Transaction.C# And Transaction.P#=1
Query: "Get names of customers and dates of such transactions which dealt with the
product number 1".
Please select a correct definition of the query
1. Select Cname, Date From Customer Where C# In
(Select C# From Transaction Where P#=1)
2. Select Cname, Date From Customer, Transaction
Where Customer.C#=Transaction.C# And Transaction.P#=1
3. Select Cname, Date From Customer, Transaction
Where Transaction.P#=1
Query: "Get names of customers, dates and total price of such transactions which dealt
with the product number 1".
Please select a correct definition of the query
1. Select Cname, Date, Qnt*Price From Customer, Product
Where C# In (Select C# From Transaction Where P#=1)
And Transaction.P# = Product.P#
2. Select Cname, Date, Qnt*Price
From Customer, Product, Transaction Where
Customer.C# = Transaction.C# And Transaction.P#=Product.P#
And Product.P#=1
3. Select Cname, Date, Qnt*Price
From Customer, Product, Transaction Where
Customer.C# = Transaction.C# And Transaction.P#=1
Query: "Find the number of product units that were bought by the customer number 1.".
Please select a correct definition of the query
1.Select COUNT(*) From Customer Where C# In
(Select P# From Transaction Where C#=1)
2.Select COUNT(*) From Transaction Where C#=1
3.Select SUM (Qnt) From Transaction Where C#=1
Query: "Find a number of such customers who bought the product number 1".
Please select all correct definitions of the query
1.Select COUNT(*) From Customer Where C# In
(Select C# From Transaction Where P#=1)
2.Select COUNT(X.C#) From Customer X, Transaction Y
Where X.C#=Y.C# AND Y.P#=1
3.Select COUNT(*) From Customer X, Transaction Y
Where X.C#=Y.C# AND Y.P#=1
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
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(*) From Transaction
Where P#=1 Or P#=2 Group By P#
3.Select P#, COUNT(C#) From Transaction
Where P#=1 Or P#=2
Query: "Get the names of such customers who bought more than 45 units of the
company's products".
Select Cname From Customer Where C# In
(Select C# From Transaction ??? )
Please select the omitted statement (???)
1. Group By P# Having SUM(Qnt)>45
2. Group By C# Having SUM(Qnt)>45
3. Group By C# Having COUNT( * )>45
Query: "Get the names of such customers who bought all types of the company's
products".
Select Cname From Customer Where C# IN
(Select C# From Transaction Where P# ???
(Select P# From Product))
Please select the omitted comparison (???)
1. IN
2. NOT IN
3. = ALL
Query: "Get names of all customers who bought the product number 1".
Please select the omitted example element(?)
1.X
2.A
3.ALL
Query: "Get names of products having a price between 1100 and 2000".
Please select the omitted example element(?)
1. Y
2. P.Y
3. X
Query: "Get numbers for such products which were bought by all customers".
Please select the omitted example element(?)
1.X
2.P.X
3.ALL.X