wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SQL_RDBMS

Total questions: 12

Worksheet time: 4mins

Name
Class
Date
1.

RDMBs has been designed to handle what kind of data?

a)

semi-structured data

b)

Structured Data

c)

Unstructured Data

d)

All of them

2.

It is not possible to join 2 Tables if they don't have any common fields (Columns)

a)

True

b)

False

3.

What will be the output? select count(*) from sample_table

a)

4

b)

5

c)

2

d)

3

4.

Which join will you use if we need all records from both the tables with no duplicates?

a)

LEFT OUTER JOIN

b)

FULL OUTER JOIN

c)

INNER JOIN

d)

CROSS JOIN

5.

"create" command falls under which category?

a)

DDL

b)

DML

c)

DCL

d)

TCL

6.

What is the difference b/w DROP and DELETE commands?

a)

Drop -> Can't recover the deleted data. Delete -> Can recover deleted data

b)

Both Drop and Delete drops the schema as well as entire data

c)

Both Drop and Delete just deletes records based on condition

d)

Drop -> deletes entire data & schema. Delete -> deletes records based on condition

7.

Which of the following is NOT correct wrt RDBMS?

a)

Consistency may not be maintained at times

b)

There is a solid structure attached to each table

c)

Data is in the form of Rows and Columns

d)

While storing Sequence of records is insignificant

8.

How many records will this query output? select * from emp where 1=2

a)

2 Records

b)

All Records

c)

1 Record

d)

0 Records

9.

What will be the output? select count(id) from sample_table

a)

5

b)

3

c)

2

d)

0

10.

Which query will get the second highest salary from emp table?

a)

select second(salary) from emp where salary

b)

select TOP 2 Salary from emp order by salary

c)

select max(salary) from emp where salary<>(select max(salary) from emp)

d)

select max(e.salary) from emp e where e.salary = second_highest()

11.

Which of the following is NOT a window function?

a)

SUBSTRING

b)

ROW_NUMBER()

c)

RANK()

d)

COUNT()

12.

Which is the correct query to fetch the fields "dept_id", "dept_name", "Salary" dept wise highest salary information? I want all dept_id records at any cost.

a)

select d.dept_id, d.dept_name, max(e.salary) from emp e RIGHT JOIN dept d on e.dept_id=d.id

b)

select d.dept_id, d.dept_name, max(e.salary) from emp e, dept d

c)

select d.dept_id, d.dept_name, max(e.salary) from emp e RIGHT JOIN dept d on e.dept_id=d.id

group by d.dept_id, d.dept_name

d)

select d.dept_id, d.dept_name, max(e.salary) from emp e FULL OUTER JOIN dept d on e.dept_id=d.id