header1.html

Monday, 8 April 2013

DBMS Quiz-5(SQL)


DBMS Quiz-5
1.________ key in the where clause specifies an inclusive list to search
IN
BETWEEN
LIKE
NULL


2.________ key with WHERE clause specifies an inclusive range to search
IN
BETWEEN
LIKE
NULL


3. __________are the Wildcards Used for Single Character and Multi Character pattern matching
_ and %
% and _
* and _
_ and *


4.The (*) asterisk in select statement is to specify ___________
All Columns from a table
All Rows from a table
None of above


5.The EMP table has these columns: ENAME VARCHAR2(35) SALARY NUMBER(8,2), HIRE_DATE DATE Management wants a list of names of employees who have been with the company for more than five years. Which SQL Statement displays the desired results?
SELECT ENAME FROM EMP WHERE SYSDATE – HIRE_DATE > 5
SELECT ENAME FROM EMP WHERE HIRE_DATE – SYSDATE > 5
SELECT ENAME FROM EMP WHERE (SYSDATE – HIRE_DATE) /365 > 5;
SELECT ENAME FROM EMP WHERE (SYSDATE * HIRE_DATE) * 365 > 5;


6.Add a PHONE_NUMBER column of NUMBER data type to an existing EMPLOYEES table. The EMPLOYEES table already contains records of 100 employees. Which of the following command do you use to add phone numbers to all the 100 records
INSERT
UPDATE
ADD
ENTER


7.Evaluate the following SQL Statement: SELECT e.employee_id, (0.15 *salary) + (0.5 * e.commission_pct) + (s.sales_amount) * (.35 * e.bonus)) CALC_VALUE FROM employees e, sales s Where e.employee_id = s.emp_id; What happens if parentheses is removed from the formula (choose the correct option)
The Value displayed in the CALC_VALUE column will be lower.
The value displayed in the CALC_VALUE column will be higher
There will be no difference in the value displayed in the CALC_VALUE column
An error will be reported


8.SELECT empname ename from employee; What is the resulting column heading
empname
ename
empname ename
None of the above


9.What is the output of the following SQL Statement SELECT empname, empsal from employee ORDER BY empsal desc; SELECT empname,empsal from employee ORDER BY 2 desc;
Both will produce identical results
Second statement will give an error
Second statement will not give any result
Both will produce results, but both will be different.


10.___________ data type supports a variable length character string
varchar2
varchar
char
None of the above