Unit 6: Database Design - Practice Quiz

INT322 — Computing System And Technologies 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What does the functional dependency mean?

Functional dependency Easy
A. Each value of determines one value of
B. Attribute must always be a primary key
C. Attributes and must have identical values
D. Each value of determines one value of

2 When is an attribute fully functionally dependent on a composite key?

Fully functional dependency Easy
A. It is independent of the composite key
B. It depends on the entire composite key
C. It depends on part of the composite key
D. It determines every key in the database

3 Which set of dependencies demonstrates a transitive dependency?

Transitive dependency Easy
A. , , and are all composite candidate keys in the same relation
B. and
C. and
D. and

4 What is the main purpose of database normalization?

Concept of normalization Easy
A. To remove every foreign key
B. To combine all tables into one
C. To reduce data redundancy
D. To increase duplicate records

5 Which requirement must a table satisfy to be in First Normal Form (1NF)?

First normal form Easy
A. Each table contains a composite key
B. Each column contains duplicate groups
C. Each field contains an atomic value
D. Each non-key field depends on another non-key field

6 A table is in Second Normal Form (2NF) when it is in 1NF and has no:

Second normal form Easy
A. Atomic values
B. Foreign keys
C. Partial dependencies
D. Candidate keys

7 A table is in Third Normal Form (3NF) when it is in 2NF and has no:

Third normal form Easy
A. Atomic attributes
B. Functional dependencies involving any attributes in the relation
C. Primary keys
D. Transitive dependencies

8 What is a database transaction?

Introduction to transactions Easy
A. A logical unit of database work
B. A permanent copy of a database
C. A program used only to design forms
D. A collection of unrelated tables

9 What does a read operation do in a transaction?

Read and write operations on transactions Easy
A. Permanently saves every transaction currently active on the server
B. Retrieves a data value
C. Deletes a database schema
D. Changes a data value

10 What does a write operation do in a transaction?

Read and write operations on transactions Easy
A. Retrieves a data value only
B. Stores or changes a data value
C. Displays the complete structure of every table
D. Creates a database user only

11 Which state indicates that a transaction is currently executing its operations?

States and stages of a transaction Easy
A. Committed
B. Active
C. Failed
D. Terminated

12 Which transaction state indicates that all changes have been saved successfully?

States and stages of a transaction Easy
A. Aborted
B. Failed
C. Committed
D. Active

13 Which ACID property ensures that all transaction operations occur or none occur?

ACID properties of a transaction Easy
A. Durability
B. Consistency
C. Isolation
D. Atomicity

14 Which ACID property ensures that committed changes survive a system failure?

ACID properties of a transaction Easy
A. Durability
B. Consistency with all temporary values automatically copied into separate backup databases
C. Isolation
D. Atomicity

15 Which section of a PL/SQL block contains executable statements?

Introduction to PL/SQL block structure Easy
A. DECLARE section
B. BEGIN section
C. END label
D. EXCEPTION section

16 Which section of a PL/SQL block is used to handle runtime errors?

Introduction to PL/SQL block structure Easy
A. BEGIN section
B. DECLARE section
C. EXCEPTION section
D. The section that creates and normalizes all database tables before execution

17 Which PL/SQL operator is used to assign a value to a variable?

Implementation of operators in PL/SQL Easy
A. ==
B. =>
C. =
D. :=

18 Which PL/SQL statement selects between actions based on a condition?

Implementation of control statements in PL/SQL Easy
A. LOOP
B. DECLARE, which repeatedly checks every condition until the block is committed
C. IF
D. EXIT

19 Which keywords begin the definition of a stored PL/SQL procedure?

Implementation of procedures in PL/SQL Easy
A. CREATE PROCEDURE
B. CREATE FUNCTION
C. BEGIN PROCEDURE
D. DECLARE PROCEDURE

20 What must a PL/SQL function provide to its caller?

Implementation of functions in PL/SQL Easy
A. A separately committed transaction containing at least one database write
B. A transaction lock
C. A return value
D. A new table

21 For relation , the functional dependencies are , , and . What is the closure ?

Functional dependency Medium
A.
B.
C.
D.

22 Given , which functional dependency is implied by ?

Functional dependency Medium
A.
B.
C.
D.

23 In Enrollment(StudentID, CourseID, Grade), the key is (StudentID, CourseID). If neither StudentID nor CourseID alone determines Grade, which statement is correct?

Fully functional dependency Medium
A. Grade is partially dependent on the composite key
B. Grade is independent of the composite key
C. Grade is fully dependent on the composite key
D. Grade is transitively dependent on StudentID

24 Relation has composite key and dependencies and . What does this show about ?

Fully functional dependency Medium
A. It is transitive because is part of
B. It is not fully functional because determines
C. It is trivial because is outside
D. It is fully functional because is a key

25 In Employee(EmpID, DeptID, DeptName), suppose EmpID determines DeptID and DeptID determines DeptName. Which dependency is transitive?

Transitive dependency Medium
A. DeptID determines EmpID
B. DeptName determines EmpID
C. DeptName determines DeptID
D. EmpID determines DeptName

26 A department name is repeated in every employee row. Changing the department name requires modifying many rows. Which database design problem is illustrated?

Concept of normalization Medium
A. A transaction deadlock
B. A domain mismatch
C. An update anomaly
D. A deletion anomaly

27 A Student table stores the value Java, Python, SQL in one Skills column. Which change best brings the design into First Normal Form?

First normal form Medium
A. Create separate columns for three possible skills
B. Increase the maximum size of the Skills column
C. Sort the skill names before storing the value
D. Store each student-skill pair as a separate row

28 OrderLine(OrderID, ProductID, OrderDate, ProductName, Quantity) has key (OrderID, ProductID). Also, OrderID determines OrderDate, and ProductID determines ProductName. Which decomposition reaches Second Normal Form?

Second normal form Medium
A. Order(OrderID, ProductName), Product(ProductID, OrderDate), OrderLine(OrderID, ProductID, Quantity)
B. OrderLine(OrderID, ProductID, ProductName, Quantity), Order(OrderID, OrderDate)
C. Order(OrderID, OrderDate), Product(ProductID, ProductName), OrderLine(OrderID, ProductID, Quantity)
D. OrderLine(OrderID, ProductID, OrderDate, Quantity), Product(ProductID, ProductName)

29 Employee(EmpID, DeptID, DeptName) has key EmpID, with EmpID determining DeptID and DeptID determining DeptName. Which decomposition removes the Third Normal Form violation?

Third normal form Medium
A. Employee(EmpID, DeptName) and Department(EmpID, DeptID)
B. Employee(EmpID, DeptID) and Department(EmpID, DeptName)
C. Employee(EmpID, DeptID, DeptName) without any decomposition
D. Employee(EmpID, DeptID) and Department(DeptID, DeptName)

30 A bank transfer debits one account and credits another. How should these operations be organized?

Introduction to transactions Medium
A. Place both updates in one transaction and commit afterward
B. Save the credit first and ignore debit failures
C. Commit the debit before beginning the credit update
D. Run each update as an unrelated database transaction

31 Two transactions execute this schedule on X, initially 100: T1: read(X), T2: read(X), T1: write(X=110), T2: write(X=120). What is the result?

Read and write operations on transactions Medium
A. X becomes 110, and the update by T2 is lost
B. X remains 100, and both writes are rejected
C. X becomes 120, and the update by T1 is lost
D. X becomes 130, and both updates are preserved

32 A transaction has executed its final statement, but the database has not yet guaranteed that its changes are permanently stored. What is its state?

States and stages of a transaction Medium
A. Active
B. Partially committed
C. Aborted
D. Fully committed

33 A system crashes after debiting an account but before crediting the destination account. Which ACID property requires the debit to be rolled back?

ACID properties of a transaction Medium
A. Durability
B. Consistency
C. Isolation
D. Atomicity

34 Transaction T1 updates a salary but has not committed. Transaction T2 must not see that temporary value. Which ACID property enforces this behavior?

ACID properties of a transaction Medium
A. Isolation
B. Atomicity
C. Consistency
D. Durability

35 Consider a PL/SQL block whose SELECT INTO statement returns no rows and whose exception section contains WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE('Missing');. What occurs?

Introduction to PL/SQL block structure Medium
A. The exception handler prints Missing
B. The block silently assigns a null value
C. The declaration section runs a second time
D. The database automatically inserts a row

36 What value is assigned by the PL/SQL statement v_result := 10 + NULL;?

Implementation of operators in PL/SQL Medium
A. 0
B. 10
C. NULL
D. A runtime exception

37 Given v_score := 75, what is assigned to v_grade by IF v_score >= 80 THEN v_grade := 'A'; ELSIF v_score >= 60 THEN v_grade := 'B'; ELSE v_grade := 'C'; END IF;?

Implementation of control statements in PL/SQL Medium
A. NULL
B. 'B'
C. 'C'
D. 'A'

38 A PL/SQL loop sets v_sum := 0 and runs FOR i IN 1..4 LOOP CONTINUE WHEN MOD(i, 2) = 0; v_sum := v_sum + i; END LOOP;. What is the final value of v_sum?

Implementation of control statements in PL/SQL Medium
A. 3
B. 6
C. 4
D. 10

39 A procedure is declared as adjust_salary(p_id IN NUMBER, p_raise IN NUMBER, p_new_salary OUT NUMBER). Which call correctly supplies the OUT argument?

Implementation of procedures in PL/SQL Medium
A. v_salary := adjust_salary(101, 500); using function syntax
B. adjust_salary(101, 500, v_salary); where v_salary is a variable
C. SELECT adjust_salary(101, 500) INTO v_salary FROM dual;
D. adjust_salary(101, 500, 6000); where 6000 is a literal

40 A function is defined as FUNCTION annual_salary(p_monthly NUMBER) RETURN NUMBER IS BEGIN RETURN p_monthly * 12; END;. What does annual_salary(5000) return?

Implementation of functions in PL/SQL Medium
A. NULL
B. 60000
C. 5000
D. 12000

41 For relation , let . Which set contains all and only the candidate keys of ?

Functional dependency Hard
A.
B.
C.
D.

42 A relation has candidate key and exactly these relevant dependencies: , , and . Which dependency is fully functional on the composite key?

Fully functional dependency Hard
A.
B.
C.
D.

43 In , suppose and , with . How should the implied dependency be classified for normalization purposes?

Transitive dependency Hard
A. A trivial dependency through
B. A transitive dependency through
C. A multivalued dependency on
D. A partial dependency on

44 Let have . Consider the decomposition , , and . Which assessment is correct?

Concept of normalization Hard
A. It is lossless and dependency-preserving
B. It is lossy and not dependency-preserving
C. It is lossy but dependency-preserving
D. It is lossless but not dependency-preserving

45 An ORDER_DATA table stores ProductIDs as a comma-separated list in each order row. Which redesign establishes 1NF without imposing an arbitrary maximum number of products?

First normal form Hard
A. Store the list as one validated JSON array
B. Create an order-line row for each product occurrence
C. Sort the list and retain one text-valued column
D. Replace the list with five nullable product columns

46 For , let . The candidate keys are and . Assuming atomic attributes, what is the highest normal form satisfied?

Second normal form Hard
A. BCNF
B. 1NF but not 2NF
C. 3NF but not BCNF
D. 2NF but not 3NF

47 In with , the candidate keys are and . Why does satisfy the formal 3NF condition even though is not a superkey?

Third normal form Hard
A. is a trivial dependency
B. is an alternate candidate key
C. is a prime determinant
D. is a prime attribute

48 Consider the schedule r1(X), w1(X), r2(Y), w2(Y), r1(Y), w1(Y), r2(X), w2(X). What does its precedence graph show?

Introduction to transactions Hard
A. Only an edge from to
B. Only an edge from to
C. A cycle between and
D. No edge between and

49 Initially, . Both transactions read before either writes. Then writes its computed value , and writes its computed value . What anomaly and final value result?

Read and write operations on transactions Hard
A. Dirty read, with final
B. Lost update, with final
C. Nonrepeatable read, with final
D. Lost update, with final

50 A transaction executes its final statement, but a failure occurs before its commit record becomes durable. Recovery then completes its rollback. Which state sequence best describes this path?

States and stages of a transaction Hard
A. Active, failed, partially committed, aborted
B. Active, committed, failed, terminated
C. Active, partially committed, committed, aborted
D. Active, partially committed, failed, aborted

51 A write-ahead logging system forces all required log records, including the commit record, to stable storage before acknowledging a commit, but writes modified data pages later. Which conclusion is correct?

ACID properties of a transaction Hard
A. Consistency follows because logging validates constraints
B. Atomicity follows because dirty pages cannot reach disk
C. Durability follows because committed changes can be redone
D. Isolation follows because log records serialize all reads

52 Assuming SERVEROUTPUT is enabled, what does this PL/SQL block print?

SQL
DECLARE
  v NUMBER := 10;
BEGIN
  DECLARE
    v NUMBER := 0;
  BEGIN
    DBMS_OUTPUT.PUT_LINE(10 / v);
  EXCEPTION
    WHEN ZERO_DIVIDE THEN
      DBMS_OUTPUT.PUT_LINE(v);
  END;
  DBMS_OUTPUT.PUT_LINE(v);
END;

Introduction to PL/SQL block structure Hard
A. 0 followed by 10
B. 10 followed by 0
C. No output because the block terminates
D. 0 followed by 0

53 What is printed by this PL/SQL fragment?

SQL
DECLARE
  a NUMBER := 5;
  b NUMBER := NULL;
BEGIN
  IF a <> 5 OR b = 3 THEN
    DBMS_OUTPUT.PUT_LINE('A');
  ELSIF b IS NULL AND a BETWEEN 1 AND 5 THEN
    DBMS_OUTPUT.PUT_LINE('B');
  ELSE
    DBMS_OUTPUT.PUT_LINE('C');
  END IF;
END;

Implementation of operators in PL/SQL Hard
A. Nothing, because comparison with NULL raises an error
B. B, because the second condition is true
C. C, because both conditions are unknown
D. A, because NULL equals 3

54 What value is printed by this PL/SQL block?

SQL
DECLARE
  i NUMBER := 1;
  s NUMBER := 0;
BEGIN
  LOOP
    i := i + 1;
    CONTINUE WHEN MOD(i, 2) = 0;
    s := s + i;
    EXIT WHEN i >= 5;
  END LOOP;
  DBMS_OUTPUT.PUT_LINE(s);
END;

Implementation of control statements in PL/SQL Hard
A. 5
B. 12
C. 9
D. 8

55 Without NOCOPY, what does this block print?

SQL
DECLARE
  v NUMBER := 10;
  PROCEDURE bump(p IN OUT NUMBER) IS
  BEGIN
    p := p + 1;
    RAISE_APPLICATION_ERROR(-20001, 'stop');
  END;
BEGIN
  BEGIN
    bump(v);
  EXCEPTION
    WHEN OTHERS THEN NULL;
  END;
  DBMS_OUTPUT.PUT_LINE(v);
END;

Implementation of procedures in PL/SQL Hard
A. NULL, because the actual parameter is invalidated
B. No value, because the outer block also fails
C. 11, because assignment occurs before raising
D. 10, because copy-out does not occur

56 A stored function invoked as SELECT adjust_salary(10) FROM dual executes an UPDATE statement and is neither autonomous nor otherwise exempted. What is the expected result?

Implementation of functions in PL/SQL Hard
A. The update succeeds but is rolled back after the query
B. The query fails because a query-invoked function performs DML
C. The function returns zero without executing the update
D. The update succeeds and commits with the calling query

57 Given , which is a minimal equivalent cover?

Functional dependency Hard
A.
B.
C.
D.

58 Using the minimal cover for , which relation set is produced by the standard dependency-preserving 3NF synthesis algorithm before optional removal of subsumed relations?

Concept of normalization Hard
A.
B.
C.
D.

59 Classify the schedule w1(X), r2(X), c1, c2, where r2(X) reads the value written by .

Introduction to transactions Hard
A. Recoverable, cascadeless, and strict
B. Strict and cascadeless, but not recoverable
C. Cascadeless, but neither recoverable nor strict
D. Recoverable, but neither cascadeless nor strict

60 What occurs when f(0) is called for the following PL/SQL function?

SQL
CREATE OR REPLACE FUNCTION f(p NUMBER)
RETURN NUMBER IS
BEGIN
  IF p > 0 THEN
    RETURN p;
  END IF;
END;

Implementation of functions in PL/SQL Hard
A. It implicitly returns numeric zero
B. It raises ORA-06503 at runtime
C. It implicitly returns SQL NULL
D. It always fails compilation with a syntax error