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. Attributes and must have identical values
B. Each value of determines one value of
C. Each value of determines one value of
D. Attribute must always be a primary key

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 determines every key in the database
C. It depends on part of the composite key
D. It depends on the entire composite key

3 Which set of dependencies demonstrates a transitive dependency?

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

4 What is the main purpose of database normalization?

Concept of normalization Easy
A. To reduce data redundancy
B. To remove every foreign key
C. To combine all tables into one
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. Candidate keys
B. Atomic values
C. Partial dependencies
D. Foreign keys

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

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

8 What is a database transaction?

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

9 What does a read operation do in a transaction?

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

10 What does a write operation do in a transaction?

Read and write operations on transactions Easy
A. Stores or changes a data value
B. Retrieves a data value only
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. Terminated
D. Failed

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

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

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

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

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

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

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

Introduction to PL/SQL block structure Easy
A. BEGIN section
B. END label
C. DECLARE section
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. The section that creates and normalizes all database tables before execution
D. EXCEPTION section

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. DECLARE, which repeatedly checks every condition until the block is committed
B. IF
C. LOOP
D. EXIT

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

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

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

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

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 transitively dependent on StudentID
D. Grade is fully dependent on the composite key

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

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

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

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

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 domain mismatch
B. A transaction deadlock
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. Sort the skill names before storing the value
B. Increase the maximum size of the Skills column
C. Store each student-skill pair as a separate row
D. Create separate columns for three possible skills

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. OrderLine(OrderID, ProductID, OrderDate, Quantity), Product(ProductID, ProductName)
B. Order(OrderID, ProductName), Product(ProductID, OrderDate), OrderLine(OrderID, ProductID, Quantity)
C. Order(OrderID, OrderDate), Product(ProductID, ProductName), OrderLine(OrderID, ProductID, Quantity)
D. OrderLine(OrderID, ProductID, ProductName, Quantity), Order(OrderID, OrderDate)

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, DeptID) and Department(DeptID, DeptName)
B. Employee(EmpID, DeptName) and Department(EmpID, DeptID)
C. Employee(EmpID, DeptID, DeptName) without any decomposition
D. Employee(EmpID, DeptID) and Department(EmpID, DeptName)

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

Introduction to transactions Medium
A. Commit the debit before beginning the credit update
B. Place both updates in one transaction and commit afterward
C. Save the credit first and ignore debit failures
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 120, and the update by T1 is lost
B. X becomes 130, and both updates are preserved
C. X becomes 110, and the update by T2 is lost
D. X remains 100, and both writes are rejected

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. Partially committed
B. Fully committed
C. Active
D. Aborted

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. Consistency
B. Durability
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. Consistency
B. Durability
C. Isolation
D. Atomicity

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 block silently assigns a null value
B. The exception handler prints Missing
C. The database automatically inserts a row
D. The declaration section runs a second time

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

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

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. 'C'
C. 'A'
D. 'B'

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. 6
B. 10
C. 3
D. 4

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. adjust_salary(101, 500, v_salary); where v_salary is a variable
B. v_salary := adjust_salary(101, 500); using function syntax
C. adjust_salary(101, 500, 6000); where 6000 is a literal
D. SELECT adjust_salary(101, 500) INTO v_salary FROM dual;

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. 12000
C. 60000
D. 5000

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 multivalued dependency on
B. A trivial dependency through
C. A partial dependency on
D. A transitive dependency through

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. Sort the list and retain one text-valued column
C. Create an order-line row for each product occurrence
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. 1NF but not 2NF
B. 2NF but not 3NF
C. 3NF but not BCNF
D. BCNF

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 prime determinant
B. is an alternate candidate key
C. is a trivial dependency
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. A cycle between and
B. Only an edge from to
C. Only an edge from to
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. Lost update, with final
B. Dirty read, with final
C. Lost update, with final
D. Nonrepeatable read, 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, failed, aborted
D. Active, partially committed, committed, 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. Durability follows because committed changes can be redone
C. Atomicity follows because dirty pages cannot reach disk
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 0
B. 10 followed by 0
C. No output because the block terminates
D. 0 followed by 10

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. C, because both conditions are unknown
B. B, because the second condition is true
C. A, because NULL equals 3
D. Nothing, because comparison with NULL raises an error

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. 12
B. 5
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. 10, because copy-out does not occur
B. 11, because assignment occurs before raising
C. NULL, because the actual parameter is invalidated
D. No value, because the outer block also fails

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 and commits with the calling query
B. The query fails because a query-invoked function performs DML
C. The update succeeds but is rolled back after the query
D. The function returns zero without executing the update

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. Recoverable, but neither cascadeless nor strict
C. Strict and cascadeless, but not recoverable
D. Cascadeless, but neither recoverable 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 raises ORA-06503 at runtime
B. It always fails compilation with a syntax error
C. It implicitly returns numeric zero
D. It implicitly returns SQL NULL