header1.html

Showing posts with label SQL Quiz. Show all posts
Showing posts with label SQL Quiz. Show all posts

Monday, 5 August 2013

SQL Joins mcqs Quiz


After Simple Quiz and MCQs on Stored Procedures.Try for this simpel Quiz.

SQL JOINS
1.___________can be specified in the FROM clause only.
Inner joins
Outer joins
Cross joins
None of above


2.The_______________returns a number of rows equal to the product of all rows in all the tables being joined.
Outer join
Inner join
Cartesian product
Self Join


3._________return rows only when there is at least one row from both tables that matches the join condition.
Inner joins
Outer joins
Self Join
Left outer join


4.___________return all rows from at least one of the tables or views mentioned in the FROM clause, as long as those rows meet any WHERE or HAVING search conditions.
Cartesian Product
Inner Join
Self Join
Outer joins


5.To retain the nonmatching information by including nonmatching rows in the results of a join, use a _________.
full outer join
left outer join
right outer join
Any of above


6.________ is simple sql join condition which uses the equal sign as the comparison operator.
SQL Equi Join
SQL Non equi join
Cross Join
None of above


7._________is a sql join condition which makes use of some comparison operator other than the equal sign like >, <, >=, <= .
Cross Join
SQL Equi Join
SQL Non equi join
None of above.


8.A ___________that does not have a WHERE clause produces the Cartesian product of the tables involved in the join.
self join
cross join
outer join
inner join


9.In self join ______ helps the query processor determine whether columns should present data from the right or left version of the table.
where clause
from clause
table alias
All of above


10.Which of the following Joins won’t work in SQL Server but only supports in Oracle.
Cross Join
Equi Join
Self join
Natural joins
http://www.highrankdirectory.com/blogs_diaries/garden_and_home/

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