DBMS MCQ Questions and Answer Set-11

1.  The EXISTS keyword will be true if:

  1. Any row in the subquery meets the condition only
  2. All rows in the subquery fail the condition only
  3. Both of these two conditions are met
  4. Neither of these two conditions is met

Explanation: EXISTS keyword checks for existance of a condition.

2. How many tables may be included with a join?

  1. One
  2. Two
  3. Three
  4. All the above

  • Examine the description of the EMPLOYEES table:

EMP_ID NUMBER (4)                      NOT NULL

LAST_NAME                                       VARCHAR2 (30) NOT NULL

FIRST_NAME                                      VARCHAR2 (30)

DEPT_ID                                               NUMBER (2)

JOB_CAT                                              VARCHAR (30)

SALARY                                                 NUMBER (8, 2)

Which statement shows the department ID, minimum salary, and maximum salary paid in that department, only if the minimum salary is less than 5000 and maximum salary is more than 15000?

  1. SELECT dept_id, MIN (salary), MAX (salary) FROM employees WHERE MIN(salary) < 5000 AND MAX (salary) > 15000;
  2. SELECT dept_id, MIN (salary), MAX (salary) FROM employees WHERE MIN (salary) < 5000 AND MAX (salary) 15000 GROUP BY dept_id;
  3. SELECT dept_id, MIN(salary), MAX(salary) FROM employees HAVING MIN (salary) < 5000 AND MAX (salary)
  4. SELECT dept_id, MIN (salary), MAX (salary) FROM employees GROUP BY dept_id HAVING MIN(salary) < 5000 AND MAX (salary) > 15000
  5. SELECT dept_id, MIN (salary), MAX (salary) FROM employees GROUP BY dept_id, salary HAVING MIN (salary) < 5000 AND MAX (salary) > 15000;

  •   You would like to display the system date in the format “Monday, 01 June, 2001”. Which SELECT statement should you use?
  1. SELECT TO_DATE (SYSDATE, ‘FMDAY, DD Month, YYYY’) FROM dual;
  2. SELECT TO_CHAR (SYSDATE, ‘FMDD, DY Month, YYYY’) FROM dual;
  3. SELECT TO_CHAR (SYSDATE, ‘FMDay, DD Month, YYYY’) FROM dual;
  4. SELECT TO_CHAR (SYSDATE, ‘FMDY, DDD Month, YYYY’) FROM dual;
  5. SELECT TO_DATE (SYSDATE, ‘FMDY, DDD Month, YYYY’) FROM dual;

  •   What is true about joining tables through an Equijoin?
  1. You can join a maximum of two tables through an Equijoin.
  2. You can join a maximum of two columns through an Equijoin.
  3. You specify an Equijoin condition in the SELECT or FROM clauses of a SELECT statement.
  4. To join two tables through an Equijoin, the columns in the join condition must be primary key and foreign key columns.
  5. You can join n tables (all having single column primary keys) in a SQL statement by specifying a minimum of n-1 join conditions.

  • Evaluate the following SQL statement:

SQL> SELECT cust_id, cust_last_name

FROM customers WHERE cust_credit_limit IN (select cust_credit_limit FROM customers WHERE cust_city =’Singapore’);

Which statement is true regarding the above query if one of the values generated by the subquery is NULL?

  1. It produces an error.
  2. It executes but returns no rows.
  3. It generates output for NULL as well as the other values produced by the subquery.
  4. It ignores the NULL value and generates output for the other values produced by the subquery.

  • Which of the following is not a property of transactions?
  • Atomicity
  • Concurrency
  • Isolation
  • Durability

  • Checkpoints are a part of
  • Recovery measures.
  • Security measures.
  • (C ) Concurrency measures.
  • Authorization measures.

Ans: (A)

  • Precedence graphs help to find a
  • Serializable schedule.
  • Recoverable schedule.
  • Deadlock free schedule.
  • Cascadeless schedule.

Ans: (A)

  1. In an E-R diagram double lines indicate
  2. Total participation.
  3.  Multiple participation.
  4.  Cardinality N.
  5.  None of the above.

Ans: (A)

  1. In SQL the statement select * from R, S is equivalent to
  2. Select * from R natural join S.
  3. Select * from R cross join S.
  4. Select * from R union join S.
  5. Select * from R inner join S.

Ans: (B)

  1. Which of the following is not a consequence of concurrent operations?
  2. Lost update problem.
  3. Update anomaly.
  4. Unrepeatable read.
  5. Dirty read.

Ans: (B)

  1. Which normal form is considered adequate for normal relational database design?
  2.  2NF
  3.  5NF
  4.  4NF
  5.  3NF

Ans: (D)

  1. If both the functional dependencies : X®Y and Y®X hold for two attributes X and Y then the relationship between X and Y is
  2.  M:N
  3.  M:1
  4.  1:1
  5.  1:M

Ans: (C)

  1. Which of the following is not a consequence of non-normalized database?
  2. Update Anomaly
  3. Insertion Anomaly
  4. Redundancy
  5. Lost update problem

Ans: (D)

  1. Which of the following is illegal?
  1. A.SELECT SYSDATE – SYSDATE FROM DUAL;
  2. B.SELECT SYSDATE – (SYSDATE – 2) FROM DUAL;
  3. C.SELECT SYSDATE – (SYSDATE + 2) FROM DUAL;
  4. D.None of these

Answer: Option D

  1. Table Employee has 10 records. It has a non-NULL SALARY column which is also UNIQUE.

The SQL statement

SELECT COUNT(*) FROM Employee WHERE SALARY > ANY (SELECT SALARY FROM EMPLOYEE);

prints

  1. 10
  2. 9
  3. 5
  4. 0

Option B

  1. Let the statement : SELECT column1 FROM myTable; return 10 rows.
    The statement : SELECT ALL column1 FROM myTable; will return
    a) less than 10 rows
    b) more than 10 rows
    c) exactly 10 rows
    d) none of the Mentioned

Option c

  1.  Consider the relation scheme R = {E, F, G, H, I, J, K, L, M, M} and the set of functional dependencies {{E, F} -> {G}, {F} -> {I, J}, {E, H} -> {K, L}, K -> {M}, L -> {N} on R. What is the key for R?
    (A) {E, F}
    (B) {E, F, H}
    (C) {E, F, H, K, L}
    (D) {E}


    Answer: (B)

  2. The SELECT statement SELECT ‘Hi’ FROM DUAL WHERE NULL = NULL; Outputs
  3. Hi
  4. FLASE
  5. TRUE
  6. Nothing

Answer: D

Leave a Comment