1. The EXISTS keyword will be true if:
- Any row in the subquery meets the condition only
- All rows in the subquery fail the condition only
- Both of these two conditions are met
- 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?
- One
- Two
- Three
- 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?
- SELECT dept_id, MIN (salary), MAX (salary) FROM employees WHERE MIN(salary) < 5000 AND MAX (salary) > 15000;
- SELECT dept_id, MIN (salary), MAX (salary) FROM employees WHERE MIN (salary) < 5000 AND MAX (salary) 15000 GROUP BY dept_id;
- SELECT dept_id, MIN(salary), MAX(salary) FROM employees HAVING MIN (salary) < 5000 AND MAX (salary)
- SELECT dept_id, MIN (salary), MAX (salary) FROM employees GROUP BY dept_id HAVING MIN(salary) < 5000 AND MAX (salary) > 15000
- 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?
- SELECT TO_DATE (SYSDATE, ‘FMDAY, DD Month, YYYY’) FROM dual;
- SELECT TO_CHAR (SYSDATE, ‘FMDD, DY Month, YYYY’) FROM dual;
- SELECT TO_CHAR (SYSDATE, ‘FMDay, DD Month, YYYY’) FROM dual;
- SELECT TO_CHAR (SYSDATE, ‘FMDY, DDD Month, YYYY’) FROM dual;
- SELECT TO_DATE (SYSDATE, ‘FMDY, DDD Month, YYYY’) FROM dual;
- What is true about joining tables through an Equijoin?
- You can join a maximum of two tables through an Equijoin.
- You can join a maximum of two columns through an Equijoin.
- You specify an Equijoin condition in the SELECT or FROM clauses of a SELECT statement.
- To join two tables through an Equijoin, the columns in the join condition must be primary key and foreign key columns.
- 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?
- It produces an error.
- It executes but returns no rows.
- It generates output for NULL as well as the other values produced by the subquery.
- 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)
- In an E-R diagram double lines indicate
- Total participation.
- Multiple participation.
- Cardinality N.
- None of the above.
Ans: (A)
- In SQL the statement select * from R, S is equivalent to
- Select * from R natural join S.
- Select * from R cross join S.
- Select * from R union join S.
- Select * from R inner join S.
Ans: (B)
- Which of the following is not a consequence of concurrent operations?
- Lost update problem.
- Update anomaly.
- Unrepeatable read.
- Dirty read.
Ans: (B)
- Which normal form is considered adequate for normal relational database design?
- 2NF
- 5NF
- 4NF
- 3NF
Ans: (D)
- 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
- M:N
- M:1
- 1:1
- 1:M
Ans: (C)
- Which of the following is not a consequence of non-normalized database?
- Update Anomaly
- Insertion Anomaly
- Redundancy
- Lost update problem
Ans: (D)
- Which of the following is illegal?
- A.SELECT SYSDATE – SYSDATE FROM DUAL;
- B.SELECT SYSDATE – (SYSDATE – 2) FROM DUAL;
- C.SELECT SYSDATE – (SYSDATE + 2) FROM DUAL;
- D.None of these
Answer: Option D
- 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
- 10
- 9
- 5
- 0
Option B
- 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
- 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) - The SELECT statement SELECT ‘Hi’ FROM DUAL WHERE NULL = NULL; Outputs
- Hi
- FLASE
- TRUE
- Nothing
Answer: D