Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Induction_Training_2

Total questions: 71

Worksheet time: 43mins

Name
Class
Date
1.

Given table has 100 tuples and write a query to find out only 50 tuples from given table (only first half records).

a)

SELECT TOP FIRSTHALF * FROM Bikes;

b)

ELECT TOP 1/2 * 

FROM Bikes;  

c)

SSELECT TOP 

HALF  * FROM Bikes;  

d)

SELECT TOP 50 PERCENT * FROM Bikes; 

2.

Write a query and find out number of unique salaries and return unique salary from EMP table.

a)

SELECT COUNT (UNIQUE Emp_Salary) AS Unique_Salary FROM Employee ; 

b)

SELECT COUNT (DISTINCT Emp_Salary) ,Salary FROM Employee ; 

c)

SELECT AS Unique_Salary , COUNT (DISTINCT Emp_Salary)  FROM Employee ; 

d)

SELECT COUNT (DISTINCT Emp_Salary) AS Unique_Salary FROM Employee ; 

3.

Which query will “find out two employees who came from Delhi”?

a)

SELECT TOP 2 * FROM Employee WHERE Emp_City = Delhi ;  

b)

SELECT  2 * FROM Employee WHERE Emp_City = Delhi ; 

c)

SELECT  * FROM Employee WHERE Emp_City = Delhi  AND Emp_City<2;  

d)

SELECT TOP 2 *  Employee WHERE Emp_City = Delhi ;  

4.

Which query will help us to select a random record from table?

a)

SELECT column  FROM table  ORDER BY NEWID()  

b)

SELECT RANDOM column FROM table  ORDER BY NEWID()  

c)

SELECT TOP 1 column FROM table  ORDER BY NEWID()  

d)

SELECT TOP 1 column FROM table  AS NEWID()  

5.

Write a query to find out total sales but total sales greater then 300 from department table?

a)

SELECT department, SUM (sales) AS "Total Sales"  

FROM order_details  

GROUP BY department WHERE SUM (sales)>300;

b)

SELECT department, SUM (sales) AS "Total Sales"  

FROM order_details  

GROUP BY department HAVING SUM (sales)>300;

c)

SELECT department, SUM (sales) AS "Total Sales"  

FROM order_details  

GROUP BY sales HAVING SUM (sales)>300;

d)

SELECT * SUM (sales) AS "Total Sales"  

FROM order_details  GROUP BY department HAVING SUM (sales)>300;

6.

Write a query and return all records from Table A and Table B.

a)

SELECT Distinct *

FROM table_A  

FULL OUTER JOIN table_B  

ON table_A.A = table_B.A;  

b)

SELECT (Distinct *)  

FROM table_A  

FULL OUTER JOIN table_B  

ON table_A.A = table_B.A;  

c)

SELECT *  

FROM table_A  

JOIN table_B  

ON table_A.A = table_B.A;  

d)

SELECT *  

FROM table_A  

FULL OUTER JOIN table_B  

ON table_A.A = table_B.A;  

7.

We have two tables, Table-1 and Table-2. Column id is common attribute in both tables. Also, only 5 ID are matches in both tables. So, here is the question.

Table-1 has 6 tuples and table-2 has 7 tuples. If we will perform cross join on these tables then, how many tuples will return?

a)

30

b)

5

c)

42

d)

13

8.

If a set is a collection of values given by the select clause, The ______ connective tests for set membership.

a)

within

b)

Include

c)

Under

d)

IN

9.

Which of the below is an invalid query?

a)

SELECT Unique(name) FROM DataFlair;

b)

SELECT * FROM DataFlair Where experience!=0;

c)

Select name FROM DataFlair;

10.

Find out which query gives an error.

a)

select * from Grades where  not Grade = '1' ;

b)

select * from Grades where not Grade =1 ;

c)

select * from Grades where Grade not like '1' ;

d)

select * grades where grade = 1 and grade = 11;

11.

Find out which query will give second highest salary (Multiple choose Questions).

a)

SELECT   First_name, Max(salary)  AS   salary  FROM   employee  WHERE   salary in (select salary from employee minus select max(salary) from employee);

b)

SELECT   First_name, Max(salary)  AS   salary  FROM   employee  WHERE   salary != ( select max(salary) from employee);

c)

SELECT First_name, salary AS salary FROM employee WHERE 1 > ( select Count( DISTINCT salary) FROM employee);

12.

Find out which query will give an error from options?

a)

SELECT * FROM Employee WHERE Salary BETWEEN '50000' AND '100000';

b)

SELECT * FROM Employee WHERE Salary BETWEEN '50000' OR '100000';

c)

SELECT * FROM Employee WHERE Salary in ( '50000')  AND salary in ( '100000');

d)

SELECT * FROM Employee WHERE Salary = '50000' AND Salary = '100000';

13.

Write a query to find the employees name whose name start with ‘S’.

a)

SELECT * FROM Employee WHERE First_name Match'S%';

b)

SELECT * FROM Employee WHERE First_name = 'S%';

c)

SELECT * FROM Employee WHERE First_name in ('S%');

d)

SELECT * FROM Employee WHERE First_name LIKE 'S%';

14.

What is a Self-Join?

a)

Joining to column

b)

Joining two difference table

c)

Cross joining two

d)

Joining one table with same

15.

What is sequence of clauses used with SELECT query in SQL?

a)

WHERE clause ,ORDER BY clause,GROUP BY clause,HAVING clause

b)

WHERE clause ,GROUPBY clause,HAVING clause,ORDER BY clause      

c)

ORDER BY clause, GROUP BY clause, HAVING clause, WHERE clause 

d)

WHERE clause, GROUP BY clause,  ORDER BY clause, HAVING clause

16.

What does BLOB in SQL stand for?

a)

Binary Large Object

b)

Big long object

c)

Binary language for object

17.

What does the following statement in SQL do?

truncate table student ;

a)

delete the student table

b)

drop the student table 

c)

delete all record

d)

create a student table

18.

_____removes all rows from a table without logging the individual row deletions.

a)

  DELETE

b)

DROP

c)

TRUNCATE

d)

 REMOVE

19.

What is the purpose of the SQL AS clause?

a)

The AS SQL clause is used to change the name of a column in the result set or to assign a name to a derived column

b)

The AS clause is used with the JOIN clause only

c)

The AS clause defines a search condition

20.

Which data type can store unstructured data in a column?

a)

RAW

b)

VARCHAR

c)

NUMERIC

d)

CHAR

21.

A subquery in an SQL SELECT statement is enclosed in___.

a)

parenthesis -- (...).  

b)

brackets -- [...].

c)

CAPITAL LETTERS

d)

braces -- {...}.

22.

What is the output of the given query?

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

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

a)

10

b)

9

c)

8

d)

7

23.

SQL Views are also known as____.

a)

Simple tables 

b)

Virtual tables

c)

Complex tables

d)

Actual Tables

24.

_______ is a constraint that can be defined only at the column level?

a)

UNIQUE

b)

NOT NULL

c)

CHECK 

d)

PRIMARY KEY

25.

Which statement is true regarding routines and triggers?

a)

Both run automatically.

b)

Both are stored in the database.

c)

Both consist of procedural code.

d)

Both have to be called to operate.

26.

Choose correct option to rename database name:

a)

RENAME old_database  TO new_database;

b)

RENAME DATABASE old_database TO new_database;

27.

What id Difference between DELETE and TRUNCATE statement?

a)

Both commands delete all the rows and free the space containing by table.

b)

DELETE command deletes rows based on specified condition and free the space.

c)

TRUNCATE command  deletes all the rows and free the containing space by table.

28.

With SQL, how can you return number of records in the “Student”Table?

a)

SELECT  ALL(*)from Student;

b)

SELECT  Columns(*) from  Student;

c)

SELECT LEN(*) from Student;

d)

SELECT COUNT(*) from Student;

29.

Choose incorrect characteristic of PRIMARY KEY

a)

Primary key always has unique data.

b)

Primary key length cannot ne exceeded than 900 bytes.

c)

Primary key cannot have null value.

d)

Primary key doesn’t enforces an entity integrity of the table

30.

Choose correct answer about where clause and having statement.

a)

Both are used to filter the records from a group

b)

Where clause filter records before groupings are made and having filter

Records from a group.

c)

Both can use logical connectives like OR, AND, etc.

31.

Which SQL statement is used to return only different values?

a)

SELECT DIFFERENT

b)

SELECT DISTINCT

c)

SELECT UNIQUE

32.

How can you change “Sagar” into “Jayesh” in the “Last_name” column in Person table?

a)

UPDATE Person SET Last_name=”Sagar” into Last_name=”Jayesh”;

b)

MODIFY Person SET Last_name=” Jayesh” WHERE Last_name=” Sagar”;

c)

MODIFY Person SET Last_name=”Sagar” into Last_name=”Jayesh”;

d)

UPDATE Person SET Last_name=”Jayesh” WHERE Last_name=”Sagar”;

33.

The minimal set of super key is called______________.

a)

Primary key

b)

Secondary key

c)

Candidate key

d)

Foreign key

34.

The distinguishable parts of record are called___________.

a)

Files

b)

Data

c)

Fields

d)

Database

35.

A _____ means that one record in a particular record type can be related to Many records in another record type and vice versa.

a)

One-to- one relationship

b)

One-to- many relationship

c)

Many -to- one relationship

d)

Many -to- Many relationship

36.

Which of the following clause cannot be used in SQL sub queries?

a)

GROUP BY

b)

ORDER BY

c)

DELETE

d)

FROM

37.

Which one if these is used to put the same value in all the rows?      

a)

Group by unique column

b)

Group by single column

c)

Group by one column

d)

Group by same value

38.

Select the syntax of Single Line Comment.

a)

.

b)

!

c)

--

d)

---#

39.

If multiple columns are used as Primary Key, it is known as_____________.

a)

Unique

b)

Composite

c)

Foreign

40.

SELECT COUNT (____ ID) FROM teaches WHERE semester = ’Spring’ AND YEAR = 2010;

If we do want to eliminate duplicates, we use the keyword ______in the aggregate expression.

a)

Distinct

b)

Count

c)

Avg

d)

Primary key

41.

You attempt to query the database with this command:

select nvl (100 / quantity, none) from inventory;

Why does this statement cause an error when QUANTITY values are null?

a)

The expression attempts to divide by a null value

b)

The character string none should be enclosed in single quotes (' ')

c)

A null value used in an expression cannot be converted to an actual value

d)

he data types in the conversion function are incompatible

42.

How many sizes of headers are available in HTML by default?

a)

5

b)

1

c)

3

d)

6

43.

What is the smallest header in HTML by default?

a)

h1

b)

h2

c)

h6

d)

h4

44.

What are the types of lists available in HTML?      

a)

Ordered, Unordered Lists.

b)

Bulleted, Numbered Lists.

c)

Named, Unnamed Lists.

45.

How to create an ordered list in HTML?

a)

<ul>

b)

<ol>

c)

<href>

d)

<b>

46.

HTML files are saved by default with the extension?

a)

.html

b)

.h

c)

.ht

47.

We enclose HTML tags within?

a)

{}

b)

<>

c)

!!

48.

What is the effect of the <b> tag?     

a)

It converts the text within it to bold font.

b)

It is used to write black-colored font.

c)

It is used to change the font size.

49.

What is meant by an empty tag in HTML?

a)

There is no such concept of an empty tag in HTML

b)

An empty tag does not require a closing tag

c)

An empty tag cannot have any content within it

50.

What are the attributes used to change the size of an image?

a)

Width and height

b)

Big and Small

c)

Top and bottom

51.

Which attribute is used to provide a unique name to an HTML element?

a)

id

b)

class

c)

type

52.

Which of the following properties is used to change the font of text?

a)

font-family

b)

font-size

c)

text-align

53.

What tag is used to render an image on a webpage?

a)

img

b)

src

c)

image

54.

Apart from <i> tag, which of the following tag is used to render a text in italics?

a)

<em>

b)

<strong>

c)

<b>

55.

Colors are defined in HTML using?

a)

RGB Values

b)

HEX Values

c)

RGBA values

d)

All of the above

56.

Which property is used to set colors in HTML?

a)

color

b)

background-color

c)

font-color

d)

text-color

57.

Which property is used to set border colors in HTML?

a)

border-color

b)

border

c)

Both A and B

58.

Which of the following things are necessary to create an HTML page?

a)

A text editor

b)

Web Browser

c)

Both A and B

59.

Which of the following tags is used to indicate the page’s start and endpoints?

a)

<body>

b)

<html>

c)

<head>

d)

<doctype>

60.

Which HTML tag is called the root element of an HTML document?

a)

<html>

b)

<body>

c)

<title>

d)

<head>

61.

How is black color represented in terms of RGB values?

a)

RGB(0, 0, 0)

b)

RGB(100, 100, 100)

c)

RGB(100, 100, 0)

d)

RGB(100, 0, 0)

62.

How to set a font for a whole page?

a)

<targetfont>

b)

<defaultfont>

c)

<font>

63.

Which of the following colors contain equal amounts of RBG?

a)

White

b)

Gray

c)

Black

d)

All of the above

64.

Which of the following tags is used to add a row to a table in HTML?

a)

<tr>

b)

<td>

c)

<th>

65.

Which property allows an image link to show a text label?

a)

alt

b)

str

c)

alternative

66.

Which HTML tag is used to set up a Javascript-like client-side scripting language?

a)

<script>

b)

<select>

c)

<anchar>

67.

Which of the following is correct about HTML?

a)

HTML uses User Defined Tags.

b)

HTML uses tags defined within the language.

c)

Both A and B

68.

The correct sequence of HTML tags for starting a webpage is -

a)

Head, Title, HTML, body

b)

HTML, Body, Title, Head

c)

HTML, Head, Title, Body

d)

HTML, Head, Title, Body

69.

Which of the following tag is used to insert a line-break in HTML?

a)

<br>

b)

<a>

c)

<pre>

d)

<b>

70.

_____ tag defines the description list.

a)

<dl>

b)

<dt>

c)

<td>

71.

. A subquery in an SQL SELECT statement is enclosed in:

                                

a)

parenthesis -- (...).  

b)

brackets -- [...].

c)

CAPITAL LETTERS

d)

braces -- {...}.