Test Bank—Chapter Nine (Database Systems)
Multiple Choice Questions
1. Which of the following accesses a database in terms of a database model?
A. Application software B. Database management system C. Actual database
ANSWER: A
2. Which of the following describes only the portion of a database available to a particular user?
A. Database model B. Schema C. Subschema D. DBMS
ANSWER: C
3. Which of the following relational operations combine data from more than one relation?
A. SELECT B. PROJECT C. JOIN
ANSWER: C
4. Which of the following relational operations extracts entire columns from a relation?
A. SELECT B. PROJECT C. JOIN
ANSWER: B
5. Which of the following relational operations extracts entire rows from a relation?
A. SELECT B. PROJECT C. JOIN
ANSWER: A
6. Which of the following relational operations is performed by the SQL statement below?
select A, B, C
from X
A. SELECT B. PROJECT C. JOIN
ANSWER: B
7. Given the relation X below
X: A B C
2 5 7
3 3 3
4 3 2
5 2 8
what value will be extracted by the following query?
TEMP SELECT from X where B > C
RESULT PROJECT A from TEMP
A. 2 B. 3 C. 4 D. 5
ANSWER: C
8. Given the relation X below
X: A B C
2 5 7
3 3 3
4 4 2
5 2 8
what value will be retrieved by the following query?
TEMP SELECT from X where B = C
RESULT PROJECT B from TEMP
A. 2 B. 3 C. 4 D. 5
ANSWER: B
9. Given the relation below
X: A B C
2 5 7
3 3 6
4 4 2
5 2 2
what values will be retrieved by the following SQL statement?
select A, B
from X
where X.B = X.C
A. 2, 5 B. 3, 6 C. 2, 2 D. 5, 2
ANSWER: D
10. Given the two relations X and Y below
X: A B Y: C D
7 s t 3
2 z r 2
what value would be retrieved by executing the following SQL statement?
select Y.C
from X, Y
where X.A < Y.D
A. s B. z C. t D. r
ANSWER: C
11. Which of the following is not a potential problem caused by multiple transactions manipulating a
database at the same time?
A. Lost update problem B. Clustering C. Deadlock D. Incorrect summary problem
ANSWER: B
12. Which of the following features within a DBMS is not provided to maintain database integrity?
A. Concurrent transaction processing B. Log
C. Locking protocol D. Commit points
ANSWER: A
13. Which of the following data mining techniques would be applied when trying to identify traits that
characterize the citizens of a democracy who fail to vote?
A. Class description B. Class discrimination
C. Cluster analysis D. Association analysis
ANSWER: A
Fill-in-the-blank/Short-answer Questions
1. In a relational database, information is presented as though it were stored in tables called
_________________ , each of which has columns called _________________ and rows
called _________________ .
ANSWER: Relations, attributes, tuples
2. Identify two database models.
____________________
____________________
ANSWER: Possible answers include: relational and object-oriented
3. Suppose a relation X had the attributes PartID (part identification number), StockGoal (quantity
held when fully stocked), and CurrentQuantity (quantity actually in stock). Complete the following
statement to obtain information about those parts that are not fully stocked.
Result SELECT from X where _________________________________________
ANSWER: StockGoal CurrentQuantity
4. Suppose a relation X had the attributes Name, EmployeeID, and Address. Complete the following
statement to obtain a list of the names and addresses of all employees.
Result ___________________________________ from X
ANSWER: PROJECT Name, Address
5. Given the two relations X and Y below
X: A B Y: C D
2 s t 1
5 z r 3
w 2
what values would be in the tuple produced by the following statement?
Result JOIN X and Y where X.A < Y.D
______________________
ANSWER: 2, s, r, 3
6. Given the two relations X and Y below
X: A B Y: C D
2 s t 1
5 z r 3
w 2
what values would be in the tuple produced by the following statements?
Temp JOIN X and Y where X.A = Y.D
Result PROJECT X.B, Y.C from Temp
____________________
ANSWER: s, w
7. Given the two relations X and Y below
X: A B Y: C D
7 s t 1
3 z r 2
1 u
what values would be retrieved by executing the following statement?
select X.A, X.B, Y.C
from X, Y
where X.A < Y.D
_________________
ANSWER: 1, u, t
8. Given the three relations X, Y, and Z below
X: A B Y: C D Z: E F
7 s t 4 2 w
3 z r 2 3 q
1 u
what values would be retrieved by executing the following statement?
select X.B, Y.C, Z.F
from X, Y, Z
where X.A > Y.D and X.A = Z.E
_________________
ANSWER: z, r, q
9. Which of the operations SELECT, PROJECT, and JOIN are actually used when executing the
following SQL instruction?
select A, B
from X
where C = D
________________________________
ANSWER: SELECT, PROJECT
10. Given the relation Employees containing the attributes Name, Address, and BirthDate, what
question is answered by the following sequence of operations?
Temp SELECT from Employees where BirthDate < “January 4, 1975”
Result PROJECT Name from Temp
________________________________
ANSWER: Which employees were born before January 4, 1975?
11. Given the relation Employees containing the attributes Name, Address, and CurrentJobID and
the relation Jobs containing the attributes JobID, SkillRating, Department, what question is
answered by the following sequence of operations?
Temp1 JOIN Employees and Jobs
where Employees.CurrentJobID = Jobs.JobID
Temp2 SELECT from Temp1 where Department = “Personnel”
Result PROJECT Name from Temp2
________________________________
ANSWER: Which employees work in the personnel department?
12. Given the relation Employees containing the attributes Name, Address, and CurrentJobID and
the relation Jobs containing the attributes JobID, SkillRating, Department, what question is
answered by the following SQL statement?
select SkillRating
from Employees, Jobs
where Employees.Name = “Joe Smith”
and Employees.CurrentJobID = Jobs.JobID
________________________________
ANSWER: What is the skill rating of Joe Smith’s job?
General Format Questions
1. What information is available from a relational database containing one relation with the attributes
Name, Employee identification number, and Address that is not available from a database containing two
relations, one with attributes Name and Address and the other with attributes Address and Employee
identification number? Explain your answer.
ANSWER: The connection between an employee’s name and identification number may not be available
in the second database because two employees may have the same address.
2. Given the two relations X and Y below
X: A B Y: C D
2 s t 1
5 z r 3
w 2
draw the relation Result that would be produced by the following statements?
Temp JOIN X and Y where X.A > Y.D
Result PROJECT X.B, Y.C from Temp
ANSWER: X.B Y.C
s t
z t
z r
z w
3. Translate the following query into a single SQL statement.
Temp SELECT from X where A = B
Result PROJECT A, C from Temp
ANSWER: select A, C from X where A = B
4. Given a relation called People whose attributes are Name, Father, and Mother (containing each
person’s name as well as the name of that person’s parents), write an SQL statement to obtain a list of all
the children of Nathan.
ANSWER: select Name
from People
where Father = “Nathan”
5. Given the relation Parts containing the attributes PartName, PartNumber, and SupplierID as
well as the relation Suppliers containing the attributes SupplierID, Address, FaxNumber, write
an SQL statement to obtain the supplier identifications and fax numbers for all the suppliers that supply
the part whose part number is X4J26.
ANSWER: select Suppliers.SupplierID, Suppliers.FaxNumber
from Parts, Suppliers
where Parts.PartNumber = “X4J26”
and Parts.SupplierID = Suppliers.SupplierID
6. Imagine that you own a restaurant and want to create a computer system to handle the menu. Think
about which entities are part the ‘system’ and draw the ER-diagram. You are free to imagine the whole
process from raw materials over preparation to presentation and pricing for the customers in the
restaurant etc.etc. There is no absolute right or wrong answer as long as you explain the purpose of the
system you model.