Databases

Databases

77 questions · Fundamental Engineering · 51–77

Practice

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

cidtitlecredits
CSE101Discrete Mathematics3
CSE102Computer Prog. I3
CSE103Computer Prog. II3
EEE101Electrical Circuits I4
EEE102Electrical Circuits II4

Section

cidsecidsemesteryear
CSE1011Spring2018
CSE1011Spring2019
CSE1012Fall2019
CSE1021Fall2018
CSE1022Fall2018
CSE1031Spring2019
CSE1032Fall2019
EEE1011Spring2019
EEE1021Spring2019
EEE1021Fall2019

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);

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

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

In the event of a disk failure, which of the following is a method for recovering a database by restoring a full backup data onto a disk from a tape, and then reflecting, from logs, post-update copies after the full backup was taken?

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 sequence of two relational algebra expressions is shown below.

T1 ← πY(R)

T ← T1 − πY((S × T1) − R)

Here, “πY”, “×”, 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

XY
1A
2A
2B

S

X
1
2

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

EIDENAME
1Rahbar
2Karthik
3Abir

PROJECT

PIDPNAME
1Construction
2Land Purchase

WORK_PROJ

EIDPIDHOURS
1120
1210
2140
3120
3210
[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))

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

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

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

Employees

Emp_IDEmp_nameSalaryManager_IDDID
10Amit50000183
11Vikrom75000162
12Nishi40000183
13Niloy60000171
14Pritom80000183
15Mohitlal45000183
16Rahman90000null1
17Roxy55000162
18Santosh65000171

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_IDAverage Salary
1665000
1762500
1853750
OptionEF

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?

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

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

ProductNumberProductNameUnitPrice

Inventory

Warehouse​NumberProduct​NumberInventory​Quantity

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

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

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?

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?

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

“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?

bcdefghija

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.

AccountAccountCodeAccountTitle2.. **TransferAmountDebitCreditAccountingTransactionTransactionNumberDateOfPostingDescriptionConstraint:The total “Debit” amount ofone (1) accountingtransaction must match thetotal “Credit” amount.

Account

AccountCodeAccountTitle
208Sales
510Cash
511Deposits
812Travel expenses

Transfer

AccountCodeDebit/CreditAmountTransactionNumber
AB5000122
208Credit5000122
510Credit5000124
812Debit5000124

AccountingTransaction

TransactionNumberDateOfPostingDescription
01222017-04-04Company X
01242017-04-04Company X
OptionAB

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

X

StudentNumberNameFacultyCode
1Amy WhiteA
2Bob GreenB
3Cathy BlackA
4David GreyB
5Edward BrownA
6Frank BlueA

Y

FacultyCodeFacultyName
AEngineering
BInformation
CLiterature

Z

FacultyNameStudentNumberName
Information2Bob Green
Information4David Grey

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?

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?

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_dateDepartment_IDDepartment_nameDelivery_destinationComponent_IDQuantity
2016-08-21300Production department 2Chicago office1342300
2016-08-21300Production department 2Chicago office1342300
2016-08-25400Production department 1Boston factory2346300
2016-08-25400Production department 1Boston factory23461,000
2016-08-30500Research and development departmentBoston factory234630
2016-08-30500Research and development departmentNew York office134230

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

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

Employee_numberDepartment
11001Administration
11002Accounting
11003Sales
11004Sales
11005Information systems
11006Sales
11007Planning
12001Sales
12002Information systems

Department

Department_nameFloor
Planning1
Administration1
Information systems2
Sales3
Accounting2
Legal affairs2
Procurement2

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?