0% found this document useful (0 votes)
17 views177 pages

Technology 04

The document contains a series of questions and answers related to database concepts, SQL queries, and relational models. It covers topics such as data ordering checks, attributes in relational models, ER diagram translations, SQL statement clauses, and transaction support in databases. Each question is followed by the correct answer, indicating the knowledge required for understanding database management systems.

Uploaded by

K5555
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views177 pages

Technology 04

The document contains a series of questions and answers related to database concepts, SQL queries, and relational models. It covers topics such as data ordering checks, attributes in relational models, ER diagram translations, SQL statement clauses, and transaction support in databases. Each question is followed by the correct answer, indicating the knowledge required for understanding database management systems.

Uploaded by

K5555
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 177

Q23.

When ordering data is entered in the format shown below, which of the following is
appropriate to check whether the order date is on a business day that is the same as or prior
to the entering date?

Ordering data
Form number Order date Product code Quantity Customer code
(Characters) (Characters) (Characters) (Number) (Characters)

a) Duplication check b) Format check


c) Logical check d) Sequence check

Ans: (c) 2022 April


Q24. Which of the following is the appropriate explanation of attributes in the relational
model?

a) It is possible to define attributes that have no name.


b) The domains of definition for attributes within a relation must not overlap.
c) The same name can be given to two (2) or more attributes in a relation.
d) There is no meaning in the order of attributes within a relation, and the relation is the
same even if the order is changed.

Ans: (d) 2022 April


Q25. When an ER diagram is translated into a set of tables in a relational database, which of
the following is an appropriate method to translate a many-to-many relationship between
two entities?

a) Combine two entities and create a single table.


b) Create a table for each entity and import the primary key from a table of smaller size to a
table of larger size.
c) Create a table for each entity and import the primary key from one table to another table,
and vice versa.
d) Create a table for each entity and then create a new table and import the primary keys
from both entities to the new table.

Ans: (d) 2022 April


Q26. Which of the following is a clause that is inserted into blank A of the SQL statement that
calculates the average scores for each class and each subject from the “MidtermTest” table,
and displays them in ascending order of class and subject?

MidtermTest (Class, Subject, StudentNumber, Name, Score)

[SQL statement]
SELECT Class, Subject, AVG(Score) AS AverageScore
FROM MidtermTest
A

a) GROUP BY Class, Subject ORDER BY Class, AVG(Score)


b) GROUP BY Class, Subject ORDER BY Class, Subject
c) GROUP BY Class, Subject, StudentNumber
ORDER BY Class, Subject, AverageScore
d) GROUP BY Class, AverageScore
ORDER BY Class, Subject, AverageScore

Ans: (b) 2022 April


Q27. The tables “Flight” and “City” are created as shown below. Which of the following is
the SQL to output the flight code, its origin city name, and its destination city name from
those tables?

Flight: (FlightCode, OriginCityID, DestinationCityID)


City: (CityID, CityName)

a) SELECT FlightCode, City.CityName, City.CityName


FROM Flight, City
WHERE Flight.OriginCityID = City.CityID AND
Flight. DestinationCityID = City.CityID
b) SELECT FlightCode, OriginCityID, DestinationCityID
FROM Flight, City
WHERE Flight.OriginCityID = City.CityID AND
Flight.DestinationCityID = City.CityID
c) SELECT FlightCode, c1.CityName, c2.CityName
FROM Flight, City c1, City c2
WHERE Flight.OriginCityID = c1.CityID AND
Flight.DestinationCityID = c2.CityID
d) SELECT f1.FlightCode, c1.CityName, c2.CityName
FROM Flight f1, Flight f2, City c1, City c2
WHERE f1.OriginCityID = c1.CityID AND
f2.DestinationCityID = c2.CityID

Ans: (c) 2022 April


Q28. For the description of the lock granularity of an RDBMS below, which of the following
is an appropriate combination of A and B?

Each pair of transactions that are processed in parallel updates multiple rows in a single table.
When a row-level lock and a table-level lock are compared, lock contention is more likely to
occur when an A -level lock is used. More RDBMS memory area is required when
a B -level lock is used in order to manage the lock while transactions are being
processed.

A
aa)) ro row
b)
b) ro table
cc)) tabl row
d) tabl table

Ans: (c) 2022 April


Q25. When the relationships between continent and country, and between country and city are
shown in the class diagram below, which of the following is an appropriate combination of
multiplicities that are to be inserted into blank A through blank D? Here, there are no cross
continental countries. Each continent has at least one country, and each country has at least
one city.

A B C D
a) 1..1 1..* 1..* 1..1
b) 1..1 1..* 1..1 1..*
c) 1..1 0..* 0..* 1..1
d) 1..1 0..* 1..1 0..*

Ans: (b) 2021 October


Q26. Tables Course and Section were created to record the course and section information of
a university, respectively, as shown below; the primary keys are underlined.

Course (cid, title, credits)


Section (cid, secid, semester, year)

The current status of those tables are shown below.

Course Section
cid title credits cid secid semester year
CSE101 Discrete Mathematics 3 CSE101 1 Spring 2018
CSE102 Computer Prog. I 3 CSE101 1 Spring 2019
CSE103 Computer Prog. II 3 CSE101 2 Fall 2019
EEE101 Electrical Circuits I 4 CSE102 1 Fall 2018
EEE102 Electrical Circuits II 4 CSE102 2 Fall 2018
CSE103 1 Spring 2019
CSE103 2 Fall 2019
EEE101 1 Spring 2019
EEE102 1 Spring 2019
EEE102 1 Fall 2019

When the SQL shown below is executed, which of the following tables is obtained as the
output?

SELECT C.title
FROM Course C
WHERE 1 = (SELECT COUNT(cid)
FROM Section S
WHERE C.cid = S.cid AND S.year = 2019);

a) b) c) d)
Title title title title
Computer Prog. II Discrete Mathematics
Null Electrical Circuits I
Electrical Circuits I Computer Prog. I
Electrical Circuits II Electrical Circuits I
Electrical Circuits II

Ans: (d) 2021 October


Q27. Which of the following is an appropriate explanation of an E-R diagram?

a) A relationship is expressed by describing the related entity name in the entity type.
b) The relationship between entity types is expressed by an arrow from the referencing side
in the direction of the referenced side.
c) There are no attributes in the entity type, but the relationship type has attributes.
d) There are several kinds of relationships between entity types such as one-to-many or
many-to-many.

Ans: (d) 2021 October


Q28. Which of the following is the main purpose of transaction support in a database
management system?

a) To ensure that either all the updates corresponding to a given transaction are made or
none of them are made
b) To ensure that only authorized users can access the database
c) To help users update data by providing a graphical user interface
d) To provide an accessible catalog in which descriptions of data items are stored

Ans: (a) 2021 October


Q29. Which of the following is an appropriate description of distributed databases?

a) Access to a database server is shared among a globally distributed userbase so that


everyone can access the database.
b) It is a database that is distributed to all interested researchers and other users worldwide
so that everyone can benefit.
c) It is a NoSQL database instead of a Relational Database Management System
(RDBMS).
d) It stores different parts of a database in different locations, and its processing is
distributed across those parts.

Ans: (d) 2021 October


Q25. Which of the following is an appropriate explanation of a relational database?

a) Data is represented as a table, and the tables are linked to one another using the column
values of these tables.
b) Each attribute is represented as a pair of the attribute value and the storage location of
the record having that value and used as an index.
c) The relationship among records is represented by a data structure using links that can
represent both tree and network structures.
d) The relationship among records is represented by a data structure using pointers that are
limited to representing a tree structure.

Ans: (a) 2021 April


Q26. Which of the following is performed periodically to prevent a decline in the access
efficiency of a database?

a) Backup b) Database dump


c) Reorganization d) Rollback

Ans: (c) 2021 April


Q27. A student’s ID, name, and class ID are recorded in the Student table. Which of the
following SQL returns records of all students whose names start with A?

a) SELECT * FROM Student WHERE name LIKE ’%A’;


b) SELECT * FROM Student WHERE name LIKE ‘%A_’;
c) SELECT * FROM Student WHERE name LIKE ‘A_’;
d) SELECT * FROM Student WHERE name LIKE ‘A%’;

Ans: (d) 2021 April


Q28. Among the search processes for the “Sales” table, which of the following is appropriate to
set a hash index rather than a B+ tree index? Here, the column in which the index is set is
shown inside <>.

Sales (form number, sales date, product name, user ID, store number, sales amount)

a) Searching for sales with a sales amount of 100 dollars or more. <sales amount>
b) Searching for sales with the product name beginning with ‘DB’. <product name>
c) Searching for sales with the sales date as the current month. <sales date>
d) Searching for sales with the user ID as ‘1001’. <user ID>

Ans: (d) 2021 April


Q29. Which of the following is the appropriate explanation of the key value store that is used in
the processing of big data?

a) It is represented by a two-dimensional table with rows and columns based on the set
theory.
b) It represents the relationship among nodes with the three (3) elements, i.e., “node,”
“relationship,” and “property.”
c) It saves the desired data together with a value that enables this data to be uniquely
identified as a pair.
d) The data for one (1) case is called a “document,” and the data structure of each
document is unrestricted and can be changed whenever data is added.

Ans: (c) 2021 April


Q25. Which of the following is the key of the relation schema, R (A, B, C, P, Q, T), when R has
the functional dependencies shown below?

A→B
A→C
CP→Q
CP→T

a) A b) A, B c) A, P d) C, P

Ans: (c) 2020 October


Q27. In the data model of the figure represented by UML, which of the following is a
multiplicity that should be inserted in blanks I and II?

[Conditions]
(1) One or more employees belong to a department.
(2) An employee belongs to any one department.
(3) The history of the departments to which an employee has belonged is recorded as
the assignment history.

I II
a) 0..* 0..*
b) 0..* 1..*
c) 1..* 0..*
d) 1..* 1..*

Ans: (d) 2020 October


Q28. When a failure occurs in a storage unit that stores a database, which of the following is
an operation that can recover the database by using backup files and a log?

a) Archive b) Checkpoint dump


c) Commit d) Rollforward

Ans: (d) 2020 October


Q29. Which of the following is an appropriate explanation of the granularity of locks?

a) When a large number of transactions update the same data, and the granularity is set as
large, the number of transactions that can be simultaneously executed increases.
b) When all data in a table are referenced, and the granularity is set as large, data
referenced from other transactions can be undisturbed.
c) When data are updated, and the granularity is set as large, the waiting times of other
transactions increase, and the total throughput declines.
d) When the granularity is set as large, the number of included data increases, and the
number of locks that one transaction makes increases.

Ans: (c) 2020 October


Q31. Which of the following is a device that connects multiple LANs by relaying data through
the protocol information of the data link layer of the OSI basic reference model?

a) Bridge b) Gateway c) Repeater d) Router

Ans: (a) 2020 October


Q26. From the figure below, which of the following is an appropriate set of attributes for the
“CatalogProduct” class table?

Catalog CatalogProduct ProductItem


CatalogID Price ProductID
Season 1 0..* SpecialPrice 0..* 1 Vendor
Year Gender
Description Description
EffectiveDate
EndDate

a) CatalogID, Price, SpecialPrice


b) CatalogID, PoductID, Price, SpecialPrice
c) Price, SpecialPrice
d) ProductID, Price, SpecialPrice

Ans: (b) 2020 April


Q27. Which of the following is the database function that is automatically executed when a
specific action such as update, delete, or insert occurs within a database?

a) Cursor b) Stored procedure c) Trigger d) Update query

Ans: (c) 2020 April


Q28. A sequence of two relational algebra expressions is shown below.

← ( )
← − ( × )−

Here, “ ”, “×”, and “ −” represent projection, direct product, and difference, respectively.
When the relational states of R and S are as follows, which of the following can be obtained
as T?

R S
X Y X
1 A 1
2 A 2
2 B

a) T b) T
Y Y
NULL A

c) T d) T
Y Y
B A
B

Ans: (b) 2020 April


Q29. There are three tables, EMPLOYEE, PROJECT, and WORK_PROJ for recording
employees, projects, and working information of employees on projects respectively. When
the SQL statement shown below is executed for these tables, which of the following is
generated as the output?

EMPLOYEE PROJECT WORK_PROJ


EID ENAME PID PNAME EID PID HOURS
1 Rahbar 1 Construction 1 1 20
2 Karthik 2 Land Purchase 1 2 10
3 Abir 2 1 40
3 1 20
3 2 10
[SQL Statement]
SELECT ENAME FROM EMPLOYEE
WHERE NOT EXISTS
((SELECT PID FROM PROJECT)
EXCEPT
(SELECT PID FROM WORK_PROJ
WHERE WORK_PROJ.EID = EMPLOYEE.EID))

a) ENAME b) ENAME
NULL Rahbar
Karthik

c) ENAME d) ENAME
Karthik Rahbar
Abir Abir

Ans: (d) 2020 April


Q30. In a database system, which of the following is the action to undo changes done by
transactions executed after the last commit?

a) Commit b) Roll back c) Roll forward d) View

Ans: (b) 2020 April


Q25. When an order data shown below is entered, which of the following is the data validation
that is performed to determine whether the order date is on or before the business day on
which the data is entered?

Order data
Slip No. Order date Product code Quantity Customer code
(characters) (characters) (characters) (number) (characters)

a) Duplicate check b) Format check


c) Logical check d) Sequence check

Ans: (c) 2019 October


Q27. Of the functions provided by a DBMS, which of the following is a means for achieving
protection for data confidentiality?

a) Checking referential constraints when the data is updated


b) Managing a transaction that combines a series of processes as a logical unit
c) Managing the data access rights of users
d) Placing an exclusive lock on the data before it is updated

Ans: (c) 2019 October


Q28. In a relational database, which of the following is the appropriate purpose for defining a
foreign key?

a) To prevent fragmentation in the record storage area due to the repeated deletion and
insertion of records
b) To provide a constraint to maintain referential consistency between the records of related
tables
c) To restore as many records as possible when they are damaged by failure, based on the
mutual relationship between tables
d) To speed up the searching and updating of related tables by storing them closer together

Ans: (b) 2019 October


Q29. Which of the following is an SQL statement that gives the same result as the SQL statement
that is described below for the “Product” table and the “Inventory” table? Here, the
underlined part indicates the primary key.

SELECT ProductNumber FROM Product


WHERE ProductNumber NOT IN (SELECT ProductNumber FROM Inventory)

Product
ProductNumber ProductName UnitPrice

Inventory
WarehouseNumber ProductNumber InventoryQuantity

a) SELECT ProductNumber FROM Product


WHERE EXISTS (SELECT ProductNumber FROM Product)

b) SELECT ProductNumber FROM Inventory


WHERE NOT EXISTS (SELECT ProductNumber FROM Product)

c) SELECT ProductNumber FROM Product


WHERE EXISTS (SELECT ProductNumber FROM Inventory
WHERE Product.ProductNumber = Inventory.ProductNumber)

d) SELECT ProductNumber FROM Product


WHERE NOT EXISTS (SELECT ProductNumber FROM Inventory
WHERE Product.ProductNumber = Inventory.ProductNumber)

Ans: (d) 2019 October


Q30. Which of the following is a file where values before and after an update of the database
are written and saved as the update history of the database?

a) Backup file b) Checkpoint file


c) Dump file d) Log file

Ans: (d) 2019 October


Q31. Which of the following is an appropriate description of the lock operation that is used for
the concurrency control of a transaction?

a) For a resource on which a shared lock is acquired, the acquisition of a new shared lock
by another transaction is permitted.
b) For a resource on which a shared lock is acquired, the acquisition of a new exclusive
lock by another transaction is permitted.
c) For a resource on which an exclusive lock is acquired, the acquisition of a new shared
lock by another transaction is permitted.
d) For a resource on which an exclusive lock is acquired, the acquisition of a new exclusive
lock by another transaction is permitted.

Ans: (a) 2019 October


Q26. An employee works for a department, which can be located in multiple regions. Three tables
EMP, DEPT, and DEPT_LOCS are created as shown below for recording the employee,
department, and department location data, respectively.

EMP DEPT DEPT_LOCS

EID Ename DNO Salary DNO Dname Manager DNO Region


11 John Bate 1 20000 ID 1 L1
12 Mohammed Karim 2 40000 1 Admin 11 1 L3
13 Sadat Hossain 1 50000 2 Accounts 13 2 L2
14 Katherine Li 3 20000 3 Research 15 3 L3
15 Shuvashish Bose 3 40000 3 L2

What is the output of the SQL shown below?

SELECT EName, Salary


FROM EMP
WHERE DNO IN (( SELECT DNO
FROM DEPT)
MINUS
(SELECT DNO
FROM DEPT_LOCS
WHERE Region=’L2’)
))

a) b) Ename Salary
Ename Salary John Bate 20000
NULL NULL Sadat Hossain 50000

c) Ename Salary d) Ename Salary


John Bate 20000 John Bate 20000
Sadat Hossain 50000 Mohammed Karim 40000
Katherine Li 20000 Sadat Hossain 50000
Shuvashish Bose 40000 Katherine Li 20000
Shuvashish Bose 40000

Ans: (b) 2019 April


Q27. In an SQL statement, which of the following is a constraint that is specified with
FOREIGN KEY and REFERENCES?

a) Assertion b) Check constraint


c) Key constraint d) Referential constraint

Ans: (d) 2019 April


Q28. In a client/server system, which of the following is the mechanism that reduces the
network load between the client and server by placing the frequently used commands on the
DBMS on the server in advance?

a) Group commitment b) Multithreading of server processes


c) Stored procedure d) Two-phase commitment

Ans: (c) 2019 April


Q29. Which of the following is a characteristic to guarantee that the result of an update
transaction is either performed completely or canceled as if nothing happened?

a) Atomicity b) Consistency
c) Durability d) Isolation

Ans: (a) 2019 April


Q30. Which of the following is the process that is executed periodically to prevent reducing
the access efficiency of the database?

a) Backup b) Database dump


c) Reorganization d) Roll back

Ans: (c) 2019 April


Q27. “a → b” represents the fact that when the value of attribute a is determined, the value of
attribute b is determined uniquely. For example, “Employee number → Employee name”
represents that when the employee number is determined, the employee name is
determined uniquely. Based on this notation, when the relations between attributes a
through j are established as shown in the figure below, which of the following is an
appropriate combination of three (3) tables that defines the relations in a relational
database?

a b f
c g
d h
e i
j

a) Table 1 (a) b) Table 1 (a, b, c, d, e)


Table 2 (b, c, d, e) Table 2 (b, f, g, h)
Table 3 (f, g, h, i, j) Table 3 (e, i, j)

c) Table 1 (a, b, f, g, h) d) Table 1 (a, c, d)


Table 2 (c, d) Table 2 (b, f, g, h)
Table 3 (e, i, j) Table 3 (e, i, j)

Ans: (b) 2018 October


Q28. The data model in the diagram below is implemented with three (3) tables. Which of the
following is an appropriate combination of A and B in table “Transfer” that contains the
record that indicates “500 dollars sales to Company X are posted to the cash account on
April 4, 2017”? Here, the data model is described in UML.

Account AccountingTransaction
2.. * *
AccountCode TransactionNumber
AccountTitle DateOfPosting
Transfer
Description
Amount
Constraint:
The total “Debit” amount of
one (1) accounting
Debit Credit transaction must match the
total “Credit” amount.

Account Transfer
Account Account Transaction
Code AccountTitle Code Debit/Credit Amount Number
208 Sales A B 500 0122
510 Cash 208 Credit 500 0122
511 Deposits 510 Credit 500 0124
812 Travel expenses 812 Debit 500 0124

AccountingTransaction
TransactionNumber DateOfPosting Description
0122 2017-04-04 Company X
0124 2017-04-04 Company X

A B
a) 208 Credit
b) 208 Debit
c) 510 Credit
d) 510 Debit

Ans: (d) 2018 October


Q29. After relations X and Y are joined, which of the following is (are) the relational algebra
operation(s) to obtain relation Z?

X
StudentNumber Name FacultyCode
1 Amy White A
2 Bob Green B
3 Cathy Black A
4 David Grey B
5 Edward Brown A
6 Frank Blue A

Y
FacultyCode FacultyName
A Engineering
B Information
C Literature

Z
FacultyName StudentNumber Name
Information 2 Bob Green
Information 4 David Grey

a) Projection and selection b) Projection and union


c) Selection d) Selection and union

Ans: (a) 2018 October


Q30. In a DBMS, when multiple transaction programs update the same database
simultaneously, which of the following is a technology that is used to prevent logical
contradictions?

a) Exclusive control b) Integrity constraint


c) Normalization d) Reorganization

Ans: (a) 2018 October


Q31. As an example of the use of big data, which of the following is a process that uses
statistical or other methods to obtain new knowledge (such as trends and patterns) from a
large amount of data?

a) Data dictionary b) Data mining


c) Data warehouse d) Metadata

Ans: (b) 2018 October


Q24. When ordering data in the format below is entered, which of the following is an
appropriate check to examine whether the value of the Order date field is on a business day
equal to or prior to the entering date?

Ordering data
Form number Order date Product code Quantity Customer code
(Characters) (Characters) (Characters) (Numbers) (Characters)

a) Sequence check b) Duplication check


c) Format check d) Logical check

Ans: (d) 2018 April


Q26. Which of the following properties of database transactions refers to the ability of the
system to recover a committed transaction when either the system or the storage media
fails?

a) Atomicity b) Consistency
c) Durability d) Isolation

Ans: (c) 2018 April


Q27. There is a “Delivery” table that has six (6) records. Which of the following is the
functional dependency that is satisfied by this table? Here, “X → Y” indicates that X
functionally determines Y.

Delivery
Delivery_ Department_ Department_ Delivery_ Component_ Quantity
date ID name destination ID
2016-08-21 300 Production Chicago 1342 300
department 2 office
2016-08-21 300 Production Chicago 1342 300
department 2 office
2016-08-25 400 Production Boston 2346 300
department 1 factory
2016-08-25 400 Production Boston 2346 1,000
department 1 factory
2016-08-30 500 Research and Boston 2346 30
development factory
department
2016-08-30 500 Research and New York 1342 30
development office
department

a) Delivery_date → Component_ID
b) Delivery_destination → Component_ID
c) Department_ID → Component_ID
d) Department_name → Delivery_destination

Ans: (b) 2018 April


Q28. Which of the following methods to join two (2) tables in an RDBMS is a description of
the sort-merge join method?

a) All rows in the tables are re-ordered according to the values in the column to be joined,
and they are joined in order from the top.
b) If a column to be joined in one of the tables is included in the index, the column to be
joined in the other table and the index value are used to join the tables.
c) The values in a column to be joined in one of the tables are extracted in order, and they
are joined with the column to be joined from the other table.
d) The values in a column to be joined in one of the tables are used to create a hash table,
and this is joined with the column to be joined from the other table.

Ans: (a) 2018 April


Q29. When the SQL statement shown below is executed on the “Employee” table and the
“Department” table, which of the following is the result?

SELECT COUNT(*) FROM Employee, Department


WHERE Employee.Department = Department.Department_name AND
Department.Floor = 2

Employee Department
Employee_number Department Department_name Floor
11001 Administration Planning 1
11002 Accounting Administration 1
11003 Sales Information systems 2
11004 Sales Sales 3
11005 Information systems Accounting 2
11006 Sales Legal affairs 2
11007 Planning Procurement 2
12001 Sales
12002 Information systems

a) 1 b) 2 c) 3 d) 4

Ans: (c) 2018 April


Q30. In a distributed database system, which of the following is a method for the finalization
of update processing when an inquiry is made to multiple sites that perform a series of
transaction processes as to whether finalization is possible or not and whether finalization
is possible at all sites?

a) Exclusive control b) Roll back


c) Roll forward d) Two-phase commitment

Ans: (d) 2018 April


Q25. In a DBMS, which of the following functions decides the schema?

a) Definition function b) Maintenance function


c) Recovery function d) Security function

Ans: (a) 2017 October


Q26. The attributes of the relation “OrderRecord” have the functional dependency (1) to (6)
below. Normalization is performed with these functional dependencies up to the third normal
form, and the decomposition into the relations “Product,” “Customer,” “Order,” and
“OrderDetails” are performed. Which of the following is appropriate for the relation
“OrderDetails”? Here, {X, Y} represents a combination of the attributes X and Y, and X → Y
represents that X functionally determines Y. The solid underline represents a primary key.

OrderRecord (OrderNumber, OrderDate, CustomerNumber, CustomerName,


ProductNumber, ProductName, Quantity, UnitSalesPrice)

[Functional dependency]
(1) OrderNumber, → OrderDate
(2) OrderNumber, → CustomerNumber
(3) CustomerNumber → CustomerName
(4) {OrderNumber, ProductNumber} → Quantity
(5) {OrderNumber, ProductNumber} → UnitSalesPrice
(6) ProductNumber → ProductName

a) OrderDetails (OrderNumber, Quantity, UnitSalesPrice)


b) OrderDetails (OrderNumber, CustomerNumber, Quantity, UnitSalesPrice)
c) OrderDetails (OrderNumber, CustomerNumber, ProductNumber, CustomerName,
Quantity, UnitSalesPrice)
d) OrderDetails (OrderNumber, ProductNumber, Quantity, UnitSalesPrice)

Ans: (d) 2017 October


Q27. Which of the following is an appropriate description of the mapping between the relational
model and relational database as its implementation?

a) A domain is mapped to a character type or a character string type.


b) A relation is mapped to a table.
c) Attributes and columns are ordered from left to right.
d) Neither tuples nor rows have duplicates.

Ans: (b) 2017 October


Q29. Which of the following can change the deadlock state of the transaction back to the normal
state?

a) Commit b) Drop c) Rollback d) Roll Forward

Ans: (c) 2017 October


Q21. ABC company applies a three-generation backup policy. The ABC company’s system
automatically performs full back up on the 10th, 17th, and 25th of each month. If the latest
back up was performed on 17th September, what is the date that the oldest information was
backed up?

a) 17th August b) 25th August c) 10th September d) 17th September

Ans: (b) 2017 April


Q27. Which of the following is a database design that consists of multiple tables, with rows and
columns that are linked together through matching data stored in each table?

a) Hierarchical database b) Network database


c) Object-oriented database d) Relational database

Ans: (d) 2017 April


Q28. Which of the following is an appropriate explanation of schema in RDBMS?

a) It is a collective term for database operations, such as insert, update, deletion, and
selection of data.
b) It is a collective term for various constraints for maintaining consistency of the database.
c) It is a set of data definitions, such as the nature of data, the format of data, and the
relation with other data.
d) It is not a real table, but a virtual table from the users’ viewpoint.

Ans: (c) 2017 April


Q29. Which of the following is an appropriate normalization form (NF) used in a relational
database in which every non-prime attribute must be dependent only on the primary key, and
no non-prime attribute is dependent on another non-prime attribute?

a) 1NF b) 2NF c) 3NF d) BCNF

Ans: (c) 2017 April


Q30. Among the phases of database design, which of the following phases involves the
creation of an ER diagram?

a) Conceptual design of databases phase


b) Distributed design of databases phase
c) Logical design of databases phase
d) Physical design of databases phase

Ans: (a) 2017 April


Q31. Which of the following SQL statements for the table “ShipmentRecord” obtains the
largest value?
ShipmentRecord
ProductNumber Date Quantity

NP200 2015-10-10 3
FP233 2015-10-10 2
NP200 2015-10-11 1
FP233 2015-10-11 2

a) SELECT AVG(Quantity) FROM ShipmentRecord WHERE ProductNumber = 'NP200'


b) SELECT COUNT(*) FROM ShipmentRecord
c) SELECT MAX(Quantity) FROM ShipmentRecord
d) SELECT SUM(Quantity) FROM ShipmentRecord WHERE Date = '2015-10-11'

Ans: (b) 2017 April


Q26. When new naming conventions for data items are provided, which of the following
problems cannot be avoided only by the naming conventions described below?

[Naming conventions]
(1) Always add a classification word such as the “name”, “code”, “number”, “amount”, or
“date” at the end of the data item name, and set the data type determined for each
classification word.
(2) Create a dictionary in which data item names and their meanings are registered, and
ensure that synonyms and homonyms do not occur.

a) Both the date type and the character string exist together as the data type of the data
item “ReceiptDate”.
b) It cannot be determined whether the data item “Customer” is the “CustomerCode” or
“CustomerName”.
c) The scope of the possible values of the data item “OrderAmount” varies according to
the table.
d) There is a data item called “AwardAmount” that has the same meaning as the data item
“BonusAmount”.

Ans: (c) 2016 October


Q27. The data model shown in the figure below is implemented as three (3) tables. At this
time, which of the following is an appropriate combination of A and B in the “Transfer”
table in which the transaction of “the sales of 500 dollars to Company C are booked in the
cash account on April 4, 2015” is recorded? Here, the data model is described in UML.

Account AccountingTransaction
2..* *
AccountCode TransactionNumber
AccountTitle DateOfPosting
Description
Transfer
Amount
Constraint:
The total “Debit” amount of
one (1) accounting transaction
must match the total “Credit”
Debit Credit amount.

Account Transfer Accounting transaction


Account Account Account Debit/ Transaction Transaction DateOf
Amount Description
Code Title Code Credit Number Number Posting

Company
208 Sales A B 500 0122 0122 2015-04-04
A

Company
510 Cash 208 Credit 500 0122 0124 2015-04-04
A

511 Deposits 510 Credit 500 0124

Travel
812 812 Debit 500 0124
expenses

A B
a) 208 Credit
b) 208 Debit
c) 510 Credit
d) 510 Debit

Ans: (d) 2016 October


Q28. In the process of table implementation, which of the following is an appropriate SQL
statement that removes a column in an existing table?

a) ALTER TABLE table_name b) ALTER TABLE table_name


DELETE COLUMN column_name DROP COLUMN column_name

c) UPDATE TABLE table_name d) UPDATE TABLE table_name


DELETE COLUMN column_name DROP COLUMN column_name

Ans: (b) 2016 October


Q29. When a manager is analyzing the sales of products in a supermarket, he makes a query
to list all products with their sales amount, including the products that have no sales amount.
Which of the following is an appropriate combination of statements to be filled in the boxes
in the query? Here, the columns of Product and Sales are shown below.

Product: (ProductID, PName, Price, Cost)


Sales: (SalesID, ProductID, SalesDate, Unit, Amount)

SELECT Product.PName, SUM(Amount)

FROM Product A Sales

on Product.ProductID = Sales.ProductID

GROUP BY B ;

(A) (B)
a) INNER JOIN Amount
b) INNER JOIN Product.PName
c) LEFT JOIN Amount
d) LEFT JOIN Product.PName

Ans: (d) 2016 October


Q30. Which of the following is an appropriate description of locks?

a) For a resource on which transaction T1 has acquired an exclusive lock, transaction T2


can acquire an exclusive, but not a shared, lock.
b) For a resource on which transaction T1 has acquired an exclusive lock, transaction T2
can acquire either an exclusive or a shared lock.
c) For a resource on which transaction T1 has acquired a shared lock, transaction T2 can
acquire a shared, but not an exclusive, lock.
d) For a resource on which transaction T1 has acquired a shared lock, transaction T2 can
acquire either a shared or an exclusive lock.

Ans: (c) 2016 October


Q20. A company performs a full backup every Sunday night and differential backups every
night other than Sunday night. If the failure occurs on Wednesday morning, which of the
following backups is least needed to restore the system?

a) The latest differential backups from Tuesday.


b) The latest full and the latest differential backups from both Monday and Tuesday.
c) The latest full and the latest differential backups from Tuesday.
d) The latest full backups from Sunday.

Ans: (c) 2016 April


Q29. Which of the following is an appropriate purpose for adopting a three-layer schema
architecture for DBMS?

a) To avoid making any impact on an application program even if the physical storage
structure of data is changed
b) To derive a new table from a source table through a relational operation as if the new
table actually existed
c) To restrict programming languages such that the application program and DBMS are
linked closely
d) To use an interactively used SQL statement from an application program as well

Ans: (b) 2016 April


Q30. Which is the most suitable multiplicity of the “Register” relationship between
“Customer” entity and “Car” entity that matches the following diagram? Here, “A..B” and
“C..D” respectively indicate the minimum and maximum possible participations to the
relationship.

Customer Register Car

Mr. A
1456
Ms. B
4568
Ms. C
3246
Mr. D

A..B C..D
Customer Car

A B C D
a) 0 1 0 1
b) 1 1 0 1
c) 0 1 0 *
d) 1 1 0 *

Ans: (b) 2016 April


Q31. Which of the following is an appropriate method used to remove data redundancy in
relational database systems?

a) Entity-relationship b) Functional dependency


c) Hierarchical d) Normalization

Ans: (d) 2016 April


Q32. In a relation schema R = (A, B, C, D, E), the following functional dependencies are held:

A→ BC
CD→ E
B → D
E → A
Which of the following is a combination of two candidate keys for R?

a) A and E b) B and C c) B and D d) C and D

Ans: (a) 2016 April


Q33. Which of the following is the main purpose of transaction support in a database
management system?

a) To ensure that either all the updates corresponding to a given transaction are made or
none of them is made
b) To ensure that only authorized users can access the database
c) To help users update data by providing a graphical user interface
d) To provide an accessible catalog in which descriptions of data items are stored

Ans: (a) 2016 April


Q26. Among the descriptions concerning database models, which of the following is an
appropriate explanation of the network model?

a) It consists of two or more data files located at different sites on a computer network.
b) It presents information in two-dimensional tables with rows and columns.
c) Its records are organized into a tree structure.
d) Its records can have multiple parent records and multiple child records.

Ans: (d) 2015 October


Q27. When the relationships between continent and country and between country and city are
shown in the class diagram below, which of the following is an appropriate combination of
multiplicities that are to be inserted into blank A through blank D? Here, there is no cross
continental country. Each continent has at least one country, and each country has at least
one city.

A B C D
a) 1..1 1..* 1..* 1..1
b) 1..1 1..* 1..1 1..*
c) 1..1 0..* 0..* 1..1
d) 1..1 0..* 1..1 0..*

Ans: (b) 2015 October


Q28. “a → b” represents the fact that when the value of item a is determined, the value of item
b is determined uniquely. For example, “Employee number → Employee name”
represents that when the employee number is determined, the employee name is
determined uniquely. Based on this notation, when the relations between items a
through j are established as shown in the figure below, which of the following is the
appropriate combination of three tables that defines the relations in the relational
database?

a b f
c g
d h
e i
j

a) Table 1 (a) b) Table 1 (a, b, c, d, e)


Table 2 (b, c, d, e) Table 2 (b, f, g, h)
Table 3 (f, g, h, i, j) Table 3 (e, i, j)

c) Table 1 (a, b, f, g, h) d) Table 1 (a, c, d)


Table 2 (c, d) Table 2 (b, f, g, h)
Table 3 (e, i, j) Table 3 (e, i, j)

Ans: (b) 2015 October


Q29. In the operation of a relational database, which of the following is an appropriate
explanation of projection?

a) From two or more sets of tables, the sets that match conditions are combined together to
create a new table.
b) Only specific columns are extracted from a table.
c) The query result of a table and the query result of another table are combined together
and set in one table.
d) The rows that match specific conditions are extracted from a table.

Ans: (b) 2015 October


Q30. Which of the following is an SQL statement that gives the same result as the SQL
statement that is described below for the “Product” table and the “Inventory” table?
Here, the underlined part indicates the primary key.

SELECT ProductNumber FROM Product


WHERE ProductNumber NOT IN (SELECT ProductNumber FROM Inventory)

Product
ProductNumber ProductName UnitPrice

Inventory
WarehouseNumber ProductNumber InventortQuantity

a) SELECT ProductNumber FROM Product


WHERE EXISTS (SELECT ProductNumber FROM Product)

b) SELECT ProductNumber FROM Inventory


WHERE NOT EXISTS (SELECT ProductNumber FROM Product)

c) SELECT ProductNumber FROM Product


WHERE EXISTS (SELECT ProductNumber FROM Inventory
WHERE Product.ProductNumber = Inventory.ProductNumber)

d) SELECT ProductNumber FROM Product


WHERE NOT EXISTS (SELECT ProductNumber FROM Inventory
WHERE Product.ProductNumber = Inventory.ProductNumber)

Ans: (d) 2015 October


Q28. In a relational database table, which of the following is a column or a combination of
columns whose values are defined by the primary key of another table in order to
maintain referential integrity in the database?

a) Candidate key b) Foreign key


c) Super key d) Surrogate key

Ans: (b) 2015 April


Q29. There is a record that consists of eight attributes a through h as shown below. The
primary key of the record is the combination of attributes a and b. Attributes h, c, and f
can be determined by attributes a, b, and e respectively. Which of the following is the
third normal form of this record?

a b c d e f g h

a) a h b c a b c d e f g

b) a h b c a b d e f g

c) a h b c e f a b d e g

d) a b c d e f g h

Ans: (c) 2015 April


Q30. Which of the following is an appropriate description of the ACID (Atomicity,
Consistency, Isolation, and Durability) properties that are considered to be the key
transaction processing features of a database management system (DBMS)?

a) Atomicity refers to the ability of the application to make operations in a transaction


appear isolated from all other operations.
b) Consistency refers to the ability of the DBMS to guarantee that either all of the tasks
of a transaction are performed or none of them are.
c) Durability refers to the guarantee that once the user has been notified of success, the
transaction persists, and is not undone.
d) Isolation refers to the database being in a legal state when the transaction begins and
when it ends.

Ans: (c) 2015 April


Q31. When there are two relational database tables A and B as shown below, which of the
following is the appropriate table that shows the result of the relational operation A ÷ B ?

A B
Employee_ID Project_ID Project_ID
S1 P1 P2
S1 P2 P4
S1 P3
S1 P4
S2 P1
S2 P2
S3 P2
S4 P2
S4 P4

a) Employee_ID b) Employee_ID
S1 S1
S2 S4

c) Employee_ID d) Employee_ID
S1 S3
S2 S4
S3
S4

Ans: (b) 2015 April


Q32. For the “Product” table shown below, a transaction that executes the SQL statement
below terminates abnormally because of the occurrence of a deadlock. Which of the
following is the “Product” table after the abnormal termination? Here, other
transactions use the “Product” table as reference but do not update it.

Product
Product_code Product_name Unit_price
A010 AAA 2,500
B020 BBB 1,000
C030 CCC 4,500

[SQL statement]
DELETE FROM Product WHERE Product_code = 'B020'

a) Product_code Product_name Unit_price


A010 AAA 2,500
B020 NULL 1,000
C030 CCC 4,500

b) Product_code Product_name Unit_price


A010 AAA 2,500
B020 BBB 1,000
C030 CCC 4,500

c) Product_code Product_name Unit_price


A010 AAA 2,500
C030 CCC 4,500

d) Product_code Product_name Unit_price


B020 BBB 1,000

Ans: (b) 2015 April


Q15. The response speed of a database server is slowed down, even though no application is
changed. As shown in the table below, the possible causes and the investigation items
are considered to identify the cause. Which of the following is an appropriate
investigation item that should be inserted in blank C?

Possible cause Investigation item


• An increase in load because of the coexistence of
another system on the same machine
• An increase in the amount of communication A
because of an increase in the number of connected
clients
• The generation of SQL statements that require a
B
large processing time because of atypical searches
• An increase in disk I/O because of fragmentation C

• A lack of buffer capacity in the database D

a) Confirmation of changes in external factors


b) Identification of slow processes
c) Investigation of the hit ratio of cache memory
d) Verification of the status of data storage

Ans: (d) 2014 October


Q26. Which of the following is an appropriate explanation concerning the data structure in a
relational database?

a) Data and methods are unified (i.e., encapsulated) and stored.


b) Data is represented with one or more two-dimensional tables.
c) Parent records and child records are linked with a pointer.
d) Tags are used to represent data structure and meaning.

Ans: (b) 2014 October


Q27. In a relational database, there are two conditions that must be met as a primary key
constraint. One condition is that there are no duplicate key values. Which of the
following is another condition?

a) The primary key must be composed of only one column.


b) The primary key must be defined as the first column of a table.
c) The primary key value must match the candidate key of another table.
d) The primary key value must not be null.

Ans: (d) 2014 October


Q28. In order to find all rows from the “Books” table that include “UNIX” in the title, the SQL
statement is used as shown below. Which of the following is an appropriate character
string that is specified in blank A? Here, the title is stored in the “Title” column of the
“Books” table.

SELECT * FROM Books WHERE Title LIKE ' A '

a) %UNIX b) %UNIX% c) UNIX d) UNIX%

Ans: (b) 2014 October


Q29. Which of the following is the relational operation that corresponds to the manipulation of
the SQL statement for Table R shown below?

R
A1 A2 A3 A4 A5

[SQL statement]
SELECT A1, A3, A5 FROM R

a) Difference b) Join
c) Projection d) Selection

Ans: (c) 2014 October


Q30. When the SQL statement below is executed under the given conditions, what is the
maximum number of rows that are created?

SELECT P.ProductID, P.ProductName, S.SalesAmount


FROM Product P LEFT JOIN Sales S
ON S.ProductID = P.ProductID

[Conditions]
1. There are two relational database tables “Product” and “Sales” as shown below.

Product: ProductID, ProductName, UnitPrice


Sales: ProductID, SalesQuantity, SalesAmount

The relationship between “Product” and “Sales” is illustrated by using a


UML class diagram as shown below.

1..1 0..*
Product Sales

2. There are 2,000 rows in the “Product” table and 100,000 rows in the “Sales” table.

a) 2,000 b) 100,000 c) 101,999 d) 200,000,000

Ans: (c) 2014 October


Q18. In a client/server system using a database server, the generation of a large number of SQL
statements causes a problem with a rapidly increasing network load between client and
server. Which of the following is an appropriate solution to this problem?

a) Reorganization of database b) Revision of index


c) Use of dynamic SQL d) Use of stored procedure

Ans: (d) 2014 April


Q32. Which of the following is the appropriate sequence of steps used for normalizing a
relational database table?

Step A: Attributes dependent on non-key attributes are separated as another table.


Step B: Attributes dependent on only part of key are separated as another table.
Step C: Repetitive data is separated as another table.

a) B  A  C b) B  C  A
c) C  A  B d) C  B  A

Ans: (d) 2014 April


Q33. In a relational database, which of the following is an appropriate definition of a
composite key?

a) A minimal set of attributes that uniquely identifies a tuple within a relation


b) A primary or foreign key that consists of two or more attributes of a relation
c) A set of attributes from which the primary key of a relation is chosen
d) An attribute in a child table that matches the primary key values in the parent table

Ans: (b) 2014 April


Q34. When the SQL statements shown below are executed for the “SMARK” table, which of
the following is the appropriate table that can be obtained as a result?
CREATE VIEW Result
AS SELECT * FROM SMARKS AS S
WHERE S.Marks > 52 AND S.ID <= 0100
SELECT r.ID FROM Result AS r
WHERE r.Status LIKE 'Pass' AND r.Mark <= 90

SMARK
ID Name Marks Status
0014 Jack Smith 80 Pass
0016 Mary White 75 Pass
0057 Tom Scott 90 Pass
0058 Jimmy Brown 52 Fail
0076 Susan Jackson 59 Fail
0100 Bob Miller 92 Pass

a) ID b) ID
0014 0014
0016 0016
0057 0057
0076
0100

c) ID d) ID
0014 0058
0016 0076
0057
0100

Ans: (a) 2014 April


Q35. In an SQL statement, which of the following is an appropriate explanation of the percent
symbol (%) that is used with the LIKE operator in a WHERE clause?

a) It is a wildcard character that matches any single alphabetic character.


b) It is a wildcard character that matches any single character within the list.
c) It is a wildcard character that matches any single numeric character.
d) It is a wildcard character that matches any string of zero or more characters.

Ans: (d) 2014 April


Q36. As shown below, there are three relational database tables Table_1, Table_2, and Table_3.
Table_1 contains the students who have knowledge of Java language, and Table_2
contains the students who have knowledge of C++. Table_3 contains the students who
know C++ but do not know Java. Which of the following is the appropriate operation in
relational algebra that can be used to create Table_3?

Table_1 Table_2
Student_ID Student_Name Class Student_ID Student_Name Class

S0005 Susan Boyle C1 S0015 George Miller C3

S0010 Billy Robinson C2 S0020 Mary Porter C1

S0015 George Miller C3 S0010 Billy Robinson C2

S0001 Adam Smith C2

Table_3
Student_ID Student_Name Class

S0020 Mary Porter C1

S0001 Adam Smith C2

a) Difference b) Intersection c) Natural join d) Union

Ans: (a) 2014 April


Q32. Which of the following is the form of normalization into which the relational database
table below is classified?

Employee Employee Year of Position


Position
number name employment allowance
12345 John Smith 1981 Manager 900
12346 Tom Stewart 1995 Assistant manager 500
12347 Paul Douglas 1997 Assistant manager 500

a) Second normal form b) Third normal form


c) Fourth normal form d) Unnormalized form

Ans: (a) 2013 October


Q33. In a relational database, which of the following is an appropriate purpose of defining a
foreign key?

a) To prevent fragmentation of the record storage area because of the repeated deletion
and addition of records
b) To provide a constraint to maintain referential consistency between the records of
related tables
c) To restore as many records as possible that are damaged by a failure, based on the
mutual relationship between tables
d) To speed up the searching and updating of related tables by storing them closer
together

Ans: (b) 2013 October


Q34. The sales record for salespersons in a certain financial year at a company is shown in the
table below. Which of the following is an appropriate SQL statement that retrieves the
name of the salesperson with average sales of $400,000 or higher for the year from the
1st quarter (1Q) through the 4th quarter (4Q) and $300,000 or higher in sales for each
individual quarter? Here, the unit for the amounts in this table is 1,000 dollars.

Sales_record
Number Name 1Q 2Q 3Q 4Q

123 Ichiro Yamada 296 319 366 415


594 Taro Suzuki 435 453 304 464
612 Hanako Sato 496 394 423 511


a) SELECT Name FROM Sales_record
WHERE (1Q+ 2Q+ 3Q+ 4Q)/4 >= 400 OR
1Q >= 300 OR 2Q >= 300 OR
3Q >= 300 OR 4Q >= 300
b) SELECT Name FROM Sales_record
WHERE (1Q+ 2Q+ 3Q+ 4Q) >= 400 AND
1Q >= 300 AND 2Q >= 300 AND
3Q >= 300 AND 4Q >= 300
c) SELECT Name FROM Sales_record
WHERE 1Q > 400 OR 2Q > 400 OR
3Q >= 400 OR 4Q >= 400 AND
1Q >= 300 OR 2Q >= 300 OR
3Q >= 300 OR 4Q >= 300
d) SELECT Name FROM Sales_record
WHERE (1Q+ 2Q+ 3Q+ 4Q) >= 1600 AND
1Q >= 300 AND 2Q >= 300 AND
3Q >= 300 AND 4Q >= 300

Ans: (d) 2013 October


Q35. Which of the following is the unit of atomicity that a DBMS must guarantee for the
update of a database?

a) From a checkpoint to the next checkpoint


b) From the acquisition of backup data to the occurrence of a media failure
c) From the start of a transaction to its commit or rollback operation
d) From the start-up to the shutdown of the database system

Ans: (c) 2013 October


Q36. Which of the following is an appropriate explanation of data warehouse?

a) A logically interrelated collection of shared data that is physically distributed over a


computer network
b) A subject-oriented, integrated, time-variant, and non-volatile collection of data in
support of management’s decision-making process
c) The dynamic synthesis, analysis, and consolidation of large volumes of
multi-dimensional data
d) The process of finding correlations or patterns among dozens of fields in large
existing databases by using statistical methods

Ans: (b) 2013 October


Q31. As shown in the class diagram below, there is a many-to-many association between the
two classes Product and Warehouse. When there is a need to know how many of each
product are stored in each warehouse, the association class StockHolding can be added
between the two classes Product and Warehouse so as not to hide the original
many-to-many relationship.

Product Warehouse
0..* 0..*
- product_name - storage_name
- product_number - storage_location
- unit_price

StockHolding
- quantity

If the class diagram shown below is depicted using a full class instead of the
association class, which of the following is the appropriate combination of cardinalities
that are inserted into blanks A through D?

A B C D
a) 0..*
. 1 0..* 1
b) 0..*
. 1 1 0..*

c) 1 0..* 0..*
. 1
d) 1 0.. 1 0..*

Ans: (c) 2013 April


Q32. As shown below, when the SQL statement is executed on the relational database table
“Staff”, which of the following tables is created?

SELECT StaffID, BranchID FROM Staff WHERE BranchID = 'B03'


UNION
SELECT StaffID, BranchID FROM Staff WHERE Salary > 5000;

Staff
StaffID Salary BranchID
S01 2000 B01
S02 4000 B01
S03 3000 B03
S04 8000 B03
S05 3000 B03
S06 4000 B07
S07 6000 B08

a) StaffID BranchID b) StaffID BranchID


S04 B03 S03 B03
S04 B03
S05 B03
S07 B08

c) StaffID BranchID d) StaffID BranchID


S03 B03 S03 B03
S04 B03 S04 B03
S05 B03 S05 B03
S04 B03 S03 B08
S07 B08 S04 B08
S05 B08
S07 B03
S07 B08

Ans: (b) 2013 April


Q33. Which of the following is the appropriate flow of execution of SQL statements?

a) Code generation  Optimization  Decomposition  Execution


b) Decomposition  Code generation  Optimization  Execution
c) Decomposition  Optimization  Code generation  Execution
d) Optimization  Decomposition  Code generation  Execution

Ans: (c) 2013 April


Q34. In a relational database system, which of the following is an appropriate purpose of
recording changes in a database file as a journal file?

a) To determine whether to commit or roll back the database updates


b) To enable recovery to be undertaken effectively in the event of a failure
c) To move transaction log records to the database backup files
d) To support concurrency control of the simultaneous execution of transactions

Ans: (b) 2013 April


Q35. Which of the following is the most appropriate description concerning the exclusive
control of a DBMS?

a) Exclusive control is necessary for data that might be updated simultaneously by


several people.
b) Exclusive control is necessary for improving the processing speed of data that is
frequently accessed.
c) Exclusive control is necessary for preventing the occurrence of a deadlock when
data is accessed.
d) In order to improve the processing speed, the range of the data on which exclusive
control is performed must be made as wide as possible.

Ans: (a) 2013 April


Q31. When the order data shown below is entered into the order entry system, which of the
following is a check that is performed to see if the order date is on or before the
business day on which the data is entered?

Order data
Slip number Order date Product code Quantity Customer code
(characters) (characters) (characters) (numeric value) (characters)

a) Duplication check b) Format check


c) Logical check d) Sequence check

Ans: (c) 2012 October


Q33. A university offers many disciplines. Many students graduate in these disciplines after
clearing various courses assigned to each discipline. A student can graduate in only
one discipline. Some courses are common to certain disciplines. The university
maintains the details of courses, disciplines, and students in a relational database.
Which of the following describes an appropriate relationship between discipline, course,
and student on the database?

a) The relationship between course and discipline is one-to-many.


b) The relationship between course and student is many-to-many.
c) The relationship between course and student is one-to-many.
d) The relationship between discipline and student is one-to-one.

Ans: (b) 2012 October


Q34. When data in the “Product” table is as shown below, which of the following is an
update process that reduces the number of rows in the “Profitable_product” view
created using “View definition” below?

Product
Produ
Product_code _name Model Sales_price Purchase_price
S001 T T2003 150,000
150,000 100,000
S003 S S2003 200 170,000
S005 R R2003 140,000
14 80,000

[View definition]
CREATE VIEW Profitable_product
AS SELECT * FROM Product
WHERE Sales_price - Purchase_price >= 40000

a) Changing the Purchase_price of the product with a Product_code of S003 to 90,000


b) Changing the Purchase_price of the product with a Product_code of S005 to 90,000
c) Changing the Sales_price of the product with a Product_code of S001 to 130,000
d) Changing the Sales_price of the product with a Product_code of S005 to 130,000

Ans: (c) 2012 October


Q35. Each time a student is absent from school, the date is recorded in the relational
database table A as shown below. Which of the following is an appropriate SQL
statement that can be used to create table B containing all of the students who have
been absent from school for two consecutive days? Here, the DateDiff function
calculates time periods between two dates. For example,
DateDiff ('2012-04-11','2012-04-10') returns “1”.

A B
StudentID AbsenceDate StudentID
… … …
S01 2012-04-10 S10
S10 2012-04-10 S12
S11 2012-04-10 …
S10 2012-04-11
S12 2012-04-11
S12 2012-04-12
… …

a) SELECT DISTINCT A.StudentID


FROM A
WHERE DateDiff(A.AbsenceDate,A.AbsenceDate)=1

b) SELECT DISTINCT A.StudentID


FROM A, A AS A1
WHERE DateDiff(A.AbsenceDate,A1.AbsenceDate)=1

c) SELECT DISTINCT A.StudentID


FROM A, A AS A1
WHERE A.StudentID = A1.StudentID AND
DateDiff(A.AbsenceDate,A1.AbsenceDate)=1

d) SELECT DISTINCT A.StudentID


FROM A, A AS A1
WHERE A.StudentID = A1.StudentID OR
DateDiff(A.AbsenceDate,A1.AbsenceDate)=1

Ans: (c) 2012 October


Q36. Which of the following is an appropriate purpose of using a locking mechanism in a
relational database system?

a) To commit or roll back the database updates automatically


b) To move transaction log records to the database journal files
c) To support concurrency control of the simultaneous execution of transactions
d) To write the data periodically from the checkpoint file into the database

Ans: (c) 2012 October


Q37. Which of the following is an appropriate explanation of data mining?

a) A technique for accessing and searching a large amount of data in parallel at very high
speed
b) A technique for accumulating and storing a large amount of time-series data such as
sales performance and manufacturing performance
c) A technique for analyzing a large amount of data statistically and mathematically to
discover patterns or rules
d) A technique for creating separate databases for each department in accordance with
the intended use

Ans: (c) 2012 October


Q32. A publishing company produces textbooks for high school. Each book is written by
an author who specializes in a subject. An editor is assigned to work with an author
for a book. An editor can review several books while an author can write several
books on the same subject. There are several authors on the same subject and several
editors to choose from. The E-R diagram below shows the relationships between
subject, author, book, and editor, but the relations between author and book and
between author and editor are incomplete. Which of the following is the appropriate
combination of relations that are applied to complete the E-R diagram? Here, 1 *
indicates a one-to-many relation, * * is a many-to-many relation.

1 *
Subject Book

1 *

* 1

Author Editor

a)

b)

c)

d)

Ans: (d) 2012 April


Q33. When the database design is divided into three phases (i.e., conceptual design, logical
design, and physical design), which of the following is a part of the physical design?

a) Building a model of the data by using the information in user requirements


specifications
b) Checking relational database tables for data redundancy by using normalization
procedures
c) Constructing a model of the data used in an enterprise based on a specific data
model (e.g., relational)
d) Describing base relations, file organizations, and indexes used to improve query
performance

Ans: (d) 2012 April


Q34. When the table below is used to design a relational database for managing a
video-rental shop, which of the following can be a potential candidate key? Here, (X,
Y) represents a tuple of attributes X and Y.

CID CName SID SName VID RDate MID MName


C01 John S03 Susan V01 2012-03-20 M01 Harry Potter
C02 Jim S01 Sara V03 2012-03-20 M02 Star Wars
C03 Peter S02 Kim V03 2012-03-20 M02 Star Wars
C02 Jim S01 Sara V02 2012-03-20 M01 Harry Potter
C03 Peter S02 Kim V02 2012-03-21 M01 Harry Potter
C02 Jim S02 Kim V01 2012-03-20 M01 Harry Potter
C04 Tim S02 Kim V02 2012-03-24 M01 Harry Potter
Note: Acronyms and abbreviations are used as shown below.
CID : Customer ID SID : Staff ID
CName : Customer Name SName : Staff Name
VID : Video ID MID : Movie ID
RDate : Rental Date MName : Movie Name

a) (CID, MID)
b) (CID, VID, RDate)
c) (VID, RDate)
d) (VID, SID)

Ans: (b) 2012 April


Q35. In the term “ACID”, which is the basic foundation that database transactions are built
upon, what does the third character “I ” stand for?

a) Independence b) Integrity
c) Interactivity d) Isolation

Ans: (d) 2012 April


Q36. Which of the following is the UPDATE statement that can correctly update the data of
the “Product” table? Here, the “Product” table is defined by the CREATE statement
shown below.

CREATE TABLE Product


(Product_number CHAR(4), Product_name CHAR(20), Supplier_number CHAR(6),
Unit_price INT, PRIMARY KEY(Product_number))

Product
Product_number Product_name Supplier_number Unit_price
S001 A XX0001 180
S002 A YY0002 200
S003 B YY0002 350
S004 C ZZ0003 400
S005 C XX0001 380

a) UPDATE Product SET Product_number = 'S001'


WHERE Product_number = 'S002'
b) UPDATE Product SET Product_number = 'S006'
WHERE Product_name = 'C'
c) UPDATE Product SET Product_number = NULL
WHERE Product_number = 'S002'
d) UPDATE Product SET Product_name = 'D'
WHERE Product_number = 'S003'

Ans: (d) 2012 April


Q16. In a client/server system, which of the following is the most appropriate advantage of
using “stored procedures” that are available to all clients and do not need to be
replicated in each client?

a) Data traffic between client and server can be reduced.


b) Distributed processing can be easily implemented.
c) Memory usage of both client and server can be reduced.
d) The number of access to the database can be reduced.

Ans: (a) 2011 October


Q30. Which of the following is a concept that is included in both E-R and Enhanced E-R
diagrams?

a) Cardinality b) Generalization c) Specilization d) Superclass

Ans: (a) 2011 October


Q31. When the SELECT statement is executed to join two tables T1 and T2 as shown below,
which of the following tables is created?

SELECT * FROM T1 INNER JOIN T2 ON T1.V < T2.X

T1 T2
U V X Y Z
aa 1 3 4 7
bb 2 2 5 8
cc 3 1 6 b

a) U V X Y Z
aa 1 3 4 7

b) U V X Y Z
aa 1 3 4 7
bb 2 3 4 7

c) U V X Y Z
aa 1 3 4 7
bb 2 2 5 8
cc 3 1 6 b

d) U V X Y Z
aa 1 3 4 7
aa 1 2 5 8
bb 2 3 4 7

Ans: (d) 2011 October


Q32. Which of the following is the appropriate SQL command that can be used to undo any
changes made to the database since the last commit?

a) Close b) Drop c) Revoke d) Rollback

Ans: (d) 2011 October


Q33. Which of the following is the primary purpose of locking a resource in database
management systems?

a) To improve overall performance b) To maintain data integrity


c) To prevent risk of deadlocks d) To prevent unauthorized access

Ans: (b) 2011 October


Q34. There is a database that manages user information (user database). From a viewpoint
of security management, which of the following is the appropriate access privilege
granted to an application program that searches the user database and displays the
results? Here, the functions of privileges are described below.

[Functions of privileges]
- Read privilege:Records on the user database can be read.
- Update privilege:Records on the user database can be registered, updated, and
deleted.
- Administrator privilege: Tables on the user database can be read, registered,
updated, and deleted.

a) Administrator privilege b) Read and update privileges


c) Read privilege d) Update privilege

Ans: (c) 2011 October


Q35. Which of the following is an appropriate set of characteristics of a data warehouse in
comparison with traditional databases?

a) Integrated, non-subject-oriented, volatile, and time-variant


b) Integrated, subject-oriented, non-volatile, and time-variant
c) Integrated, subject-oriented, volatile, and time-invariant
d) Non-integrated, subject-oriented, volatile, and time-variant

Ans: (b) 2011 October


Q30. Which of the following is the data model that is organized as a tree-like structure using
a parent-child or one-to-many relationship?

a) Hierarchical data model b) Network data model


c) Object data model d) Relational data model

Ans: (a) 2011 April


Q31. Which of the following is the appropriate description concerning the third normal form
(3NF) in a relational database?

a) A set of relations or tables is in 3NF if all the key attributes are defined and it
contains no repeating groups.
b) A set of relations or tables is in 3NF if and only if it contains no repeating groups
and every non-key attribute is fully functionally dependent on the entire primary
key.
c) A set of relations or tables is in 3NF if and only if it is in 2NF and every non-key
attribute is mutually independent and directly dependent on the entire primary key.
d) A set of relations or tables is in 3NF if and only if it is in Boyce-Codd normal form
and contains no more than one multi-valued dependency.

Ans: (c) 2011 April


Q32. Which of the following is the main purpose of using indexes in relational database
tables?

a) To enhance data security


b) To ensure data integrity
c) To improve query performance
d) To prevent risk of deadlocks

Ans: (c) 2011 April


Q33. Which of the following is the appropriate table that can be retrieved by performing the
projection operation in order to choose the column “Product name” from the Cartesian
(or direct) product of two tables T1 and T2?

T1 T2
Order Product Product
Customer name Product name
number number number
00
001 Brian Williams A-01 A-
A-01 Radio
002
00 Jake Forester A-02 A-02
A- TV set
00
003 Sylvia Fox A-02 A-
A-03 CD player

a) b)
Product name Product name
Radio Radio
TV set TV set
CD player

c) d)
Product name Product name
Radio Radio
TV set TV set
TV set TV set
CD player

Ans: (b) 2011 April


Q34. When a transaction to the relational database is successfully completed, which of the
following SQL commands can be used for making changes permanent?

a) Checkpoint b) Commit c) Rollback d) Savepoint

Ans: (b) 2011 April


Q35. Which of the following is the most appropriate description concerning the primary role
of an SQL query optimizer?

a) It determines the most efficient way to execute a query.


b) It minimizes the number of rows in a result set.
c) It parses a query and improves it for efficient network transmission.
d) It stores the results of frequently used queries in a cache.

Ans: (a) 2011 April


Q25. There are some methods of getting backup files for the purpose of recovering files and
managing generations. Which of the following is an appropriate description
concerning those methods or procedures?

a) A differential backup contains all files changed after the last full backup, while an
incremental backup saves all files changed after the last full, differential, or
incremental backup.
b) A differential backup may take longer to restore files than an incremental backup,
because the most recent versions of files are spread across a larger number of
backup sets.
c) A multiplexed backup is used as a mixed combination of a full backup, a differential
backup, and an incremental backup.
d) An incremental backup tends to take longer to get backup files than a differential
backup, because more files are copied during each backup.

Ans: (a) 2010 October


Q30. Which of the following is the data model that was originally introduced for the purpose
of conceptual modeling and is often used for logical modeling and physical modeling
as well as conceptual modeling?

a) E-R model b) Hierarchical model


c) Network model d) Relational model

Ans: (a) 2010 October


Q31. The figure below shows the relationships among data items used in a certain parts
management system. When the system is implemented as a relational database,
which of the following is the most appropriate and effective table structure of the
relational database?

Part_name

Color Cost Supplier_name

Supplier_ address Supplier_ phone

a) Parts table
Part_name Color Cost Supplier_name Supplier_address Supplier_phone

b) Parts table
Part_name Color Cost

Supplier table
Supplier_name Supplier_address Supplier_phone

c) Parts table
Part_name Color Cost Supplier_name

Supplier table
Supplier_name Supplier_address Supplier_phone

d) Parts table
Part_name Color Cost

Supplier table
Part_name Supplier_name Supplier_address Supplier_phone

Ans: (c) 2010 October


Q32. As shown below, there are two relational database tables Movie and Actor. Which of
the following SQL statements should be used for retrieving a list of movie titles,
released years, and directors, from all the movies that include “Action” or “Comedy”
as a genre and “Cooper” as an actor’s name? Here, there is no movie remade with
different actors, so “Title” and “Movie_title” are both primary keys in each table.

Movie (Released_year, Title, Director, Genre, Description)


Actor (Name, Movie_title, Role)

a) SELECT Movie_title, Released_year, Director FROM Movie, Actor


WHERE Name = 'Cooper '
AND (Genre = 'Action ' OR Genre = 'Comedy ')
AND Title = Movie_title
b) SELECT Movie_title, Released_year, Director FROM Movie, Actor
WHERE Name = 'Cooper '
AND Genre = 'Action ' AND Genre = 'Comedy '
AND Title = Movie_title
c) SELECT Title, Released_year, Director FROM Movie, Actor
WHERE Name = 'Cooper '
AND (Genre = 'Action ' OR Genre = 'Comedy ')
d) SELECT Title, Released_year, Director FROM Movie, Actor
WHERE Name = 'Cooper '
AND Genre = 'Action ' AND Genre = 'Comedy '

Ans: (a) 2010 October


Q33. As shown below, there are four relational database tables Product, Supplier, Sale, and
Employee that are used for a database system in a retail store. Here, the solid and
dotted lines indicate the primary and foreign keys, respectively.

Product (ProdNo, ProdName, Cost, Price, SupplierNo)


Supplier (SupplierNo, SuppName, SuppAddress)
Sale (ProdNo, EmpNo, DateTime, Quantity)
Employee (EmpNo, EmpName, EmpAddress)

The number of records for each table is as follows:


Number of
Table name Remarks
records
Product 200 Each of the groups of 10 records has the same supplier.
Supplier 30
Each of the groups of 100 records is from the same
Sale 10,000
product.

Employee 10

How many records are returned after execution of the SQL statement below?

SELECT * FROM Product A, Supplier B, Sale C


WHERE A.ProdNo = C.ProdNo AND A.SupplierNo = B.SupplierNo

a) 200 b) 10,000 c) 10,230 d) 60,000,000

Ans: (b) 2010 October


Q34. As shown in the table below, there are five transactions T1 through T5 that are
performed simultaneously in parallel, in any order. Which of the following is the
combination of transactions that has the possibility of a deadlock? Here, only one
transaction can have an exclusive lock at a time. Shared locks can be used with
multiple transactions.

T1 T2 T3 T4 T5
X(A) X(A) X(B) S(B) X(C)
R(A) R(A) R(B) S(A) X(A)
W(A) W(A) W(B) R(A) R(A)
Commit X(B) S(C) R(B) R(C)
R(B) R(C) Commit W(C)
W(B) W(C) W(A)
Commit Commit Commit

The notation used in the above table is shown below.

Symbol Operation
X(#) Exclusive lock
S(#) Shared lock
R(#) Read
W(#) Write
Commit End transaction
# Resource name

a) T1, T2, and T4 b) T1, T2, and T5


c) T2, T3, and T4 d) T2, T3, and T5

Ans: (d) 2010 October


Q35. Which of the following explains the database rollback process?

a) The “redo journal” is used to restore the data to the status immediately before the
failure after the start of the transaction.
b) The “redo journal” is used to restore the data to the status immediately before the
start of the transaction.
c) The “undo journal” is used to restore the data to the status immediately before the
failure after the start of the transaction.
d) The “undo journal” is used to restore the data to the status immediately before the
start of the transaction.

Ans: (d) 2010 October


Q34. Which of the following SQL statements corresponds to the “projection” operation of
the relational algebra that can extract only the column “Continent” from the table
“Country” and eliminate duplicates from the records returned?

Country
Name Continent
Canada North America
Malaysia Asia
Malawi Africa
Brazil South America
Germany Europe
China Asia

a) SELECT * FROM Country


b) SELECT * FROM Country GROUP BY Continent
c) SELECT Continent FROM Country
d) SELECT DISTINCT Continent FROM Country

Ans: (d) 2010 April


Q35. Among the ACID (Atomicity, Consistency, Isolation, Durability) properties of
transactions, which of the following is the appropriate description concerning
“atomicity”?

a) A transaction is a basic unit of processing; it must be performed in its entirety, or


else it must be cancelled.
b) Every transaction must preserve the integrity constraints of the database. There is
no contradiction at all in the database.
c) Multiple simultaneous transactions cannot interfere with one another. Intermediate
results within a transaction are not visible to other transactions.
d) Once a transaction changes the database and the changes are committed, these
changes must never be lost because of subsequent failures.

Ans: (a) 2010 April


Q36. When a database on a client/server system is accessed, which of the following is the
function that can reduce the network load by preparing the instruction groups
beforehand that are frequently used on the server?

a) Group commitment function


b) Multithread function of a server process
c) Stored procedure function
d) Two-phase commitment function

Ans: (c) 2010 April


Q37. Which of the following is the appropriate description concerning exclusive control in a
database?

a) When a shared lock is applied to a resource by a transaction, an exclusive lock can be


applied to it by another transaction.
b) When a shared lock is applied to a resource by a transaction, another shared lock can
be applied to it by another transaction.
c) When an exclusive lock is applied to a resource by a transaction, a shared lock can be
applied to it by another transaction.
d) When an exclusive lock is applied to a resource by a transaction, another exclusive
lock can be applied to it by another transaction.

Ans: (b) 2010 April


Q38. Which of the following appropriately describes a characteristic of distributed database
systems in comparison to centralized database systems?

a) A failure at a single site makes the whole system unavailable to all users.
b) Acquisition and maintenance costs of the entire system are lower because of
distributed nature.
c) Expansion of the system, such as adding more data, increasing database sizes, and
adding more processors, is much more difficult.
d) Local queries and transactions accessing data at a single site have better
performance because of the smaller local databases.

Ans: (d) 2010 April


Q65. Which of the following is the purpose of periodically reorganizing a database in
operation?

a) Additions, updates, and deletions performed repeatedly on a database generate


storage areas that cannot be reused, and therefore the database volume increases and
the processing speed decreases. For this reason, such areas are reorganized to
prevent performance degradation.
b) It may become necessary to change a part of the database definitions, such as
addition of data items, in the process of the database operations. In such a case, the
database is reorganized so that it can be changed and reused.
c) New records are created each time the records in the database are updated; thus, the
database volume increases and the processing speed decreases. For this reason,
multiple updated records are combined into one record to improve the processing
speed.
d) Once a record is deleted after it is registered as a key, it cannot be registered again.
Since it is inconvenient, the keys are reorganized so that the deleted keys can be
used again.

Ans: (a) 2010 April


Q60. Which of the following is an appropriate explanation of the schema in a relational
database management system?

a) It is a set of data definitions, such as the data attributes, data formats, and
relationships with other data.
b) It is not an actual table, but instead a virtual table from the viewpoint of the user.
c) It is the umbrella term for database operations, such as the insert, update, delete, and
search operations for data.
d) It is the umbrella term for various constraints that maintain database consistency.

Ans: (a) 2009 October


Q61. indicates that the value of attribute y is determined uniquely by the value of
attribute x. Which of the following appropriately defines the relationships shown in the
figure as a set of tables of the third normal form? Here, multiple attributes contained in
a box x show that the value of attribute y is determined uniquely by the values of all
those multiple attributes.

a b f

c g

h
d

a) Table 1{ a } b) Table 1{ a, b, c, d, e }
Table 2{ b, c, d, e } Table 2{ a, c }
Table 3{ f, g, h } Table 3{ b, e, f, g, h }

b) Table 1{ a, b, c, d, e } d) Table 1{ a, b, c, d, e }
Table 2{ b, c, f, g, h } Table 2{ b, f, g }
Table 3{ b, c, h } Table 3{ b, c, h }

Ans: (d) 2009 October


Q62. Which of the following is a non-updatable view?

a) A view for a view


b) A view including a “GROUP BY” clause in the view definition
c) A view including a “WHERE” clause in the view definition
d) A view not including the primary key of the original table

Ans: (b) 2009 October


Q63. There are two tables X and Y as shown below. Which of the following SELECT
statements returns the maximum number of rows by using these two tables?

X Y
VAL VAL
1 1
2 2
3 3

a) SELECT * FROM X, Y
b) SELECT * FROM X, Y WHERE X.VAL > Y.VAL
c) SELECT * FROM X
UNION
SELECT * FROM Y
d) SELECT * FROM X X1, X X2 WHERE X1.VAL = X2.VAL

Ans: (a) 2009 October


Q64. When a new record is inserted in the relational database table “Payment” shown below,
which of the following SQL statements causes a unique constraint violation? Here,
“Contract_number” and “Contract_date” are primary keys.

Payment
Contract number Contract date Amount
1001 2009-01-10 1,000
1003 2009-01-15 890
1003 2009-02-10 80

a) INSERT INTO Payment VALUES (1001, ‘2009-01-15’, 80)


b) INSERT INTO Payment VALUES (1002, ‘2009-01-10’, 970)
c) INSERT INTO Payment VALUES (1003, ‘2009-01-10’, 890)
d) INSERT INTO Payment VALUES (1003, ‘2009-01-15’, 1000)

Ans: (d) 2009 October


Q65. Which of the following files is used for writing the values before and after a database
update, and storing them as a database update record?

a) Backup file b) Checkpoint file


c) Dump file d) Journal file

Ans: (d) 2009 October


Q60. As shown below, there are three tables Student, Instructor, and Result. Which of the
following relational algebra operations can be used for deriving the table “Result” from
the tables “Student” and “Instructor”?

Student Instructor Result


First Name Last Name First Name Last Name First Name Last Name
Jack Smith Susan White Susan White
Tom Brown Paul Miller Paul Miller
Nancy Anderson Jack Smith Betty Wilson
David Moore Betty Wilson
Robert Taylor Tom Brown
Jennifer Jones
Barbara Jackson

a) Instructor ÷ Student
b) Instructor  Student
c) Instructor – Student
d) Instructor  Student

Ans: (c) 2009 April


Q61. There are three tables T1, T2, and T3 as shown below. Which of the following tables is
created as the result of executing the SQL statement specified below?

SELECT T3.D, SUM(T1.B)


FROM T1 NATURAL JOIN T2 NATURAL JOIN T3
GROUP BY T3.D

Table T1 Table T2 Table T3


A B C C D D E F
1 10 1 1 1 1 9 1
2 20 1 2 2 2 8 2
3 30 2 4 1 5 7 3
4 40 4 5 2 6 6 4

a) D SUM(B) b) D SUM(B)
1 70 1 30
2 30 2 30
4 40

c) D SUM(B) d) D SUM(B)
1 10 1 10
2 20 1 20
5 0 2 30
6 0 4 40

Ans: (a) 2009 April


Q62. When a program accesses relational database tables by means of embedded SQL
statements, which of the following SQL statements is used to define the derived table?

a) CLOSE b) DECLARE CURSOR


c) FETCH d) OPEN

Ans: (b) 2009 April


Q63. Which of the following is an appropriate description concerning the recovery process of
databases?

a) At the restart known as “cold start,” the checkpoint log and update information log
are used for recovering the database.
b) At the restart known as “warm start,” control goes back to the checkpoint, and the
update information log is used for recovering the database.
c) “Roll back” refers to the operation of reflecting the transactions that completed
normally after the checkpoint, by checking the update information log.
d) “Roll forward” refers to the operation of returning incomplete transactions at the
occurrence of a failure to the status before update.

Ans: (b) 2009 April


Q64. Which of the following is an appropriate description concerning the duties of database
administrators?

a) To allocate available development staff and resources in an optimal way for the
system development using databases, and then manage them so that the system can
be developed in an efficient way
b) To conduct user interviews and create applications based on the external schema of
the provided database
c) To design and maintain databases, monitor their operations, and recover from
failures
d) To perform acceptance inspections to determine whether or not applications satisfy
the functions, performance, operability, and other specifications required by users

Ans: (c) 2009 April


Q65. For the purpose of finding out the number of times a Web page is accessed, an access
counter is being designed. As shown in the figure, when two browsers gain access to
the Web page simultaneously, Processes 1 through 4 are executed in this order on the
server. When the access counter value is 100 before the two browsers access the Web
page, what is the counter value at the completion of Process 4?

[Processes] Server
Browser 1 1. Read the access counter and
add 1.
3.. rite the result of Process 1
into the access counter.
Internet
[Processes] Access
counter
2. Read the access counter and
add 1.
Browser 2 4.. rite the result of Process 2
into the access counter.

a) 100
00 b) 101
01 c) 102
02 d) 104

Ans: (b) 2009 April


Q36. Which of the following is the term that refers to collecting a large volume of data
through a variety of corporate activities, organizing, integrating, and saving the data
for specific purposes, and using it for decision-making support, for example?

a) Data administration b) Data dictionary


c) Data mapping d) Data warehouse

Ans: (d) 2008 October


Q60. Which of the following data models represents data relationships in a tree structure?

a) E-R model b) Hierarchical model


c) Relational model d) Network model

Ans: (b) 2008 October


Q61. Which of the following is an appropriate explanation of a relational database?

a) A parent record and child records are connected by means of pointers.


b) Data and methods are encapsulated.
c) Data is represented by two-dimensional tables.
d) Tags are used to define data structures and meanings.

Ans: (c) 2008 October


Q62. Which of the following is an appropriate explanation of “projection” in relational
operations?

a) Only specified attributes are extracted from tables, and a new table is created.
b) The tuples in two tables that meet the relevant conditions are combined, and a new
table is created.
c) Tuples that commonly exist in two tables are extracted, and a new table is created.
d) Tuples that meet given conditions are selected from tables, and a new table is created.

Ans: (a) 2008 October


Q63. There are two tables “movie” and “movietype” as shown below. Which of the
following tables is created as the result of executing the SQL statement specified
below?

SELECT mName, mTypeCode, mCompany


FROM movie M, movietype MT
WHERE M.mTypeID = MT.mTypeID AND MT.mTypeName = 'Action'

movie
mID mName mTypeID mDirector mCompany
M01 Beowulf 01 Robert Zemeckis Paramount Pictures
M02 Enchanted 02 Kevin Lima Walt Disney Pictures
M03 This Christmas 03 Preston A. Whitmore II Sony Pictures
M04 Hitman 01 Xavier Gens 20th Century Fox

movietype
mTypeID mTypeCode mTypeName
01 AC Action
02 AD Adventure
03 CO Comedy

a) mName mTypeID mCompany


Beowulf 01 Robert Zemeckis
Hitman 01 Xavier Gens

b) mName mTypeCode mCompany


Beowulf AC Paramount Pictures
Hitman AC 20th Century Fox

c) mName mTypeName mCompany


Beowulf Action Paramount Pictures
Hitman Action 20th Century Fox

d) mName mTypeCode mCompany


Beowulf AC Paramount Pictures
Enchanted AD Walt Disney Pictures
This Christmas CO Sony Pictures
Hitman AC 20th Century Fox

Ans: (b) 2008 October


Q64. Which of the following appropriately describes a group function of SQL?

a) A group function returns a group of results from one row.


b) A group function returns a single result row per group for a set of queried rows.
c) A group function returns multiple result rows per group for a set of queried rows.
d) A group function returns one result from each row in the table.

Ans: (b) 2008 October


Q65. Which of the following appropriately explains the SQL statements shown below?

CREATE TABLE STAFF (


Name CHAR(256),
Birthdate DATE,
DeptID NUMBER
)
CREATE TABLE MANAGER UNDER STAFF AS (
ManagedDept NUMBER
)

a) “SELECT * FROM STAFF ” extracts all records in the table MANAGER.


b) STAFF is called subtable, and MANAGER is called supertable.
c) The table MANAGER has only one attribute.
d) The table STAFF is composed of four attributes.

Ans: (a) 2008 October


Q47. Full backup and differential backup are two methods of backing up a database.
Which of the following appropriately describes the differential backup method?

a) It requires a longer backup time than full backup.


b) Only the differential data must be restored at error recovery time, so the recovery
time is shorter than that of the full backup method.
c) This method cannot be used in alternation with full backup.
d) To recover a database, the full backup data is restored and then the differential
backup data is added.

Ans: (d) 2008 April


Q60. Which of the following is described graphically using an E-R diagram?

a) Data flows between processes


b) Data source and destination
c) Entities and relationships between entities
d) Hierarchical data structure

Ans: (c) 2008 April


Q61. You are building a new database for a company with 10 departments. Each
department contains multiple employees. In addition, each employee might work for
several departments. How should you logically model the relationship between the
department entity and the employee entity?

a) Create a mandatory one-to-many relationship between department and employee.


b) Create a new entry, create a one-to-many relationship from the employee to the new
entry, and create a one-to-many relationship from the department entry to the new
entry.
c) Create a new entry, create a one-to-many relationship from the new entry to the
employee entry, and then create a one-to-many relationship from the entry to the
department entry.
d) Create an optional one-to-many relationship between department and employee.

Ans: (b) 2008 April


Q62. Which of the following is an appropriate explanation concerning functions of
keywords in SQL?

a) “HAVING” specifies a search condition for an aggregate or a group.


b) “INDEX” is a special way to join two or more tables.
c) “LIKE” is used along with JOIN clause.
d) “VALUES” is used to sort the data in ascending or descending order.

Ans: (a) 2008 April


Q63. User A issues the command as follows:

UPDATE cust_orders
SET id = 200
WHERE id = 1

Then user B issues this command as follows:

UPDATE cust_orders
SET id = 300
WHERE id = 1

User B informs you that his/her UPDATE statement seems to be hung. Which of the
following is a possible solution that you can find?

a) Ask user A to commit the transaction.


b) Ask user B to abort the statement.
c) Ask user B to commit the transaction.
d) No action is required.

Ans: (a) 2008 April


Q64. There is a table including the data items shown below. Which of the following SQL
statements can insert a new row in the “student” table?

Name Null? Type


STUD_ID NOT NULL NUMBER(3)
NAME NOT NULL VARCHAR2(25)
ADDRESS VARCHAR2(50)
GRADUATION DATE

a) INSERT INTO student (stud_id, address, graduation)


VALUES (101, ‘Dave’, ‘100 Happy Lane’, ‘2001-06-14’);
b) INSERT INTO student (stud_id, address, name, graduation)
VALUES (101, ‘100 Happy Lane’, ‘Dave’, ‘2001-06-14’);
c) INSERT INTO student
VALUES (101, ‘100 Happy Lane’, ‘2001-06-14’, ‘Dave’);
d) INSERT INTO student
VALUES (101, ‘Dave’, ‘100 Happy Lane’, ‘2001-06-14’);

Ans: (b) 2008 April


Q65. There is a student score table shown below with basic and advanced subject codes
which begin with letters B and A respectively. Which of the following SQL
statements can be used to retrieve students, from the score table, whose basic subject
score is 70 or more and examination date is 2007-05-04?

score_ table
student_number subject_code score examination_date
1221 A01 70 2007-05-03
1201 A01 60 2007-05-03
1231 A02 90 2007-05-03
1201 B01 85 2007-05-04
1231 B01 80 2007-05-04
1231 B02 75 2007-05-03
1221 B02 60 2007-05-04

a) SELECT * FROM score_table


WHERE score >=70 AND examination_date = ‘2007-05-04’
b) SELECT student_number FROM score_table
WHERE score >=70 AND examination_date = ‘2007-05-04’
c) SELECT student_number FROM score_table
WHERE score >=70 AND examination_date = ‘2007-05-04’ AND
subject_code LIKE ‘B%’
d) SELECT * FROM score_table
WHERE score >=70 AND examination_date = ‘2007-05-04’ AND
subject_code LIKE ‘B_ _’

Ans: (c) 2008 April


Q66. In database recovery management, which of the following appropriately explains
incremental logging with deferred update?

a) Both the old and new values of the updated item are stored in the log.
b) Neither the old nor new value is stored in the log.
c) The new value of the updated item is stored in the log.
d) The old value of the updated item is stored in the log.

Ans: (c) 2008 April


Q66. Which of the following is the correct table that is created by the “natural join” operation
of two tables T1 and T2?

T1 T2
A B C B C D
a1 b1 c1 b1 c1 d1
a2 b1 c1 b1 c2 d2
a3 b2 c1 b2 c2 d3

a)
A B C D
a1 b1 c1 d1
b)
A B C D
a1 b1 c1 d1
a2 b1 c1 d1
c)
A B C B C D
a1 b1 c1 b1 c1 d1
a2 b1 c1 b1 c1 d1
d)
A B C D
a1 b1 c1 d1
a2 b1 c1 d2
a3 b2 c1 d3

Ans: (b) 2007 October


Q67. Which of the following is the appropriate description of a lock that is the exclusive
control of a database?

a) If a lock is used, deadlock cannot occur.


b) Locks come in two types: shared locks, used while reading, and exclusive locks, used
during a change.
c) The coarser the level of granularity of locked data is, the more concurrent
transactions can be executed.
d) When deadlock occurs, the lock rolls back the transaction on both sides.

Ans: (b) 2007 October


Q68. In a database system employing incremental log with immediate updates, information in
the log is used in restoring the state of the system to a previous consistent state when a
crash occurs. A log record is generated upon execution of a write operation. Each
log record consists of the transaction name Ti, the data item name, the old value of the
data item, and the new value of the data item. The log record shown below is the normal
transaction sequence after the last checkpoint. Which of the following recovery
actions should be performed after a restart of the system if a crash occurs just after <
T2 , C, 3000, 3500> and before < T2 , commit>?

[Log records]
<T1 , start>
<T1 , A, 1000, 900>
<T1 , B, 2000, 2100>
<T1 , commit>
<T2 , start>
<T2 , C, 3000, 3500>
<T2 , commit>

a) Roll back both T1 and T2 b) Roll back T1 and roll forward T2


c) Roll forward both T1 and T2 d) Roll forward T1 and roll back T2

Ans: (d) 2007 October


Q69. Which of the following is the appropriate SQL statement that is used to create Table A
from Persons Table?

Persons Table
name age gender country
Honey 23 F Korea
Jun 24 M Japan
Mark 22 M Korea
Rey 27 M Philippines
Rob 26 M Philippines
Sakura 27 F Japan

Table A
name
Honey
Rob

a) SELECT name FROM Persons WHERE country LIKE '%Korea%'


AND gender = 'F' AND age = 26
b) SELECT name FROM Persons WHERE country LIKE '%Korea%'
AND gender = 'F' OR age = 26
c) SELECT name FROM Persons WHERE country LIKE '%Korea%'
OR gender = ' F' AND age = 26
d) SELECT name FROM Persons WHERE country LIKE '%Korea%'
OR gender = 'F' OR age = 26

Ans: (b) 2007 October


Q38. Which of the following functions can reduce the network load by placing a
frequently-used instruction set on the server in advance, when accessing a database in a
client/server system?

a) Group commitment function


b) Multi-thread function of server process
c) Stored procedure function
d) Two-phase commitment function

Ans: (c) 2007 April


Q51. The entity-relationship diagrams A and B shows the relationships between three entities
in a school: teacher, class, and classroom. Which of the following is an appropriate
interpretation concerning the diagrams? Here, " 1 1 " shows a one-to-one
relationship while " 1 * " shows a one-to-many relationship.

1 1 1 1
A Teacher Class Classroom

1 * * 1
B Teacher Class Classroom

a) In A, a teacher is responsible for one class only. In B, a teacher may be responsible


for one or more classes.
b) In A, one class is always assigned to the same classroom. In B, one class may be
assigned to one or more classrooms.
c) In A, one class is always supervised by one teacher. In B, one class may be
supervised by one or more teachers.
d) In A, when a teacher or a classroom is decided, a single class will be decided. In B,
if a teacher and a classroom are decided, a single class will be decided.

Ans: (a) 2007 April


Q66. Which of the following appropriately describes a schema in a relational database
management system?

a) It is a set of data definitions such as the data properties, format, relationship with
other data, etc.
b) It is not an actual table but a virtual table from the perspective of the user.
c) It is the general term for database operations such as data insertion, updating,
deletion, search, etc.
d) It is the general term for various conditions and constraints that are used to maintain
the database in absolutely perfect condition.

Ans: (a) 2007 April


Q67. Which of the following appropriately describes a domain (defined area), a term used for
relational databases?

a) It is a relationship derived by applying the relational operations to the basic


relationship.
b) It is a set of values that attributes can hold.
c) It is a specification for copying the real world to a database.
d) It is the general term for data insertion, updating, deletion, and search in a database.

Ans: (b) 2007 April


Q68. Which of the following operations extracts specific columns from tables in a relational
database?

a) Join b) Projection c) Selection d) Union

Ans: (b) 2007 April


Q69. When a transaction fails, which of the following should be performed in order to abort it
and to rebuild the previous state of the database?

a) Archive b) Checkpoint dump


c) Commit d) Rollback

Ans: (d) 2007 April


Q26. The employee’s ID, name, salary, manager ID, and working department are recorded in
the Employees table as follows:

Employees
Emp_ID Emp_name Salary Manager_ID DID
10 Amit 50000 18 3
11 Vikrom 75000 16 2
12 Nishi 40000 18 3
13 Niloy 60000 17 1
14 Pritom 80000 18 3
15 Mohitlal 45000 18 3
16 Rahman 90000 null 1
17 Roxy 55000 16 2
18 Santosh 65000 17 1

When a query is formulated in SQL to retrieve the manager ID and the average salary of the
employees under his/her direct report, and the output is obtained as below, which of the
following is the appropriate combination to be inserted in blanks E and F in the SQL
statement?

select ___E___ as "Manager_ID",


avg(a.Salary) as "Average_Salary"
from Employees a, Employees b
where ___E___ = ___F___
group by ___E___
order by ___E___

Manager_ID Average Salary


16 65000
17 62500
18 53750

E F
a) a.DID b.DID
b) a.Emp_ID b.Emp_ID
c) a.Manager_ID b.Manager_ID
d) b.Emp_ID a.Manager_ID

Ans: (d) 2020 October


Q4. For two sets A and B of cardinalities 3 and 2, how many maps from A to B exist?

a) 1 b) 5 c) 8 d) 9

Ans: (c) 2017 April

You might also like