wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

XII Database & SQL

Total questions: 61

Worksheet time: 31mins

Name
Class
Date
1.

Which SQL function is used to count the number of rows in a SQL query?

a)

COUNT()

b)

NUMBER()

c)

SUM()

d)

COUNT(*)

2.

Which of the following SQL clauses is used to DELETE tuples from a database table?

a)

DELETE

b)

REMOVE

c)

DROP

d)

CLEAR

3.

If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default

a)

ASC

b)

DESC

c)

There is no default value

d)

None of the mentioned

4.

With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?

a)

SELECT * FROM Persons WHERE FirstName=’a’

b)

SELECT * FROM Persons WHERE FirstName LIKE ‘a%’

c)

SELECT * FROM Persons WHERE FirstName LIKE ‘%a’

d)

SELECT * FROM Persons WHERE FirstName=’%a%’

5.

What does the ALTER TABLE clause do?

a)

The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints

b)

The SQL ALTER TABLE clause is used to insert data into database table

c)

THE SQL ALTER TABLE deletes data from database table

d)

The SQL ALTER TABLE clause is used to delete a database table

6.

The UPDATE SQL clause can _____________

a)

update only one row at a time

b)

update more than one row at a time

c)

delete more than one row at a time

d)

delete only one row at a time

7.

How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?

a)

UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’

b)

MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’

c)

MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’

d)

UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’

8.

SQL query to find all the cities whose humidity is 95.

a)

SELECT city WHERE humidity = 95

b)

SELECT city FROM weather WHERE humidity = 95

c)

SELECT humidity = 89 FROM weather

d)

SELECT city FROM weather

9.

Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.

a)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70

b)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70

c)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70

d)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70

10.

The command to remove rows from a table ‘CUSTOMER’ is __________________

a)

DROP FROM CUSTOMER

b)

UPDATE FROM CUSTOMER

c)

REMOVE FROM CUSTOMER

d)

DELETE FROM CUSTOMER WHERE

11.

The number of rows in a relation

a)

degree

b)

tuple

c)

cardinality

d)

domain

12.

SQL stands for

(a)  

13.

Repetition of data is called data ..............

a)

dependance

b)

redundancy

c)

inconsistency

d)

isolation

14.

Mismatched redundant copies of data is known as data ............

a)

dependance

b)

redundancy

c)

inconsistency

d)

isolation

15.

A ............ is an organized collection of structured data.

a)

information

b)

file

c)

database

d)

DBMS

16.

A data ................ is a set of rules that define valid data.

a)

constraint

b)

data dictionary

c)

query

d)

all of these

17.

A relational database consists of a collection of ..............

a)

tables

b)

fields

c)

records

d)

keys

18.

Data redundancy may lead to data inconsistency.

a)

True

b)

False

19.

In relational data model, the total number of rows can be identified as ______________________ .

a)

Cardinality

b)

Degree

c)

Attribute

d)

Entity

20.

Identify the total number of attributes in a relational data model.

a)

Tuple

b)

Entity

c)

Degree

d)

Cardinality

21.
A row in a database.
a)
Record
b)
Field
c)
Entity
d)
Table
22.
What language does the Relational Model use?
a)
Java
b)
Python
c)
SQL
d)
C++
23.
RDBMS
a)
Relational Database Basic Management System
b)
Relational Database Management System
c)
Required Database Management Setup
d)
None of these
24.

Columns are called as Fields.

a)

True

b)

False

25.

To store fix sized text char data type is used.

a)

True

b)

False

26.

Each row of data in a table is called a tuple.

a)

True

b)

False

27.

A Foreign key is used to represent the relationship between two relations.

a)

True

b)

False

28.

Tables are organized in the form of ___________ and______________.

a)

Report

b)

Rows

c)

Query

d)

Columns

29.
A quick way to find data in a database is to use _____.
a)
queries
b)
quandries
c)
questions
d)
file folders
30.

Count() -> return the no. of records in a table .

a)

True

b)

False

31.

______ command is used to see the structure of a table.

a)

Drop

b)

Insert

c)

Select

d)

Describe

32.

Which command eliminate the duplicate record in a table?

a)

Drop

b)

Insert

c)

Distinct

d)

Update

33.

Q4 Which command is used for filtering the record in a table?

a)

Distinct

b)

Order by

c)

Describe

d)

Where

34.

Which command is used to add/modify/remove a column from a table?

a)

Insert

b)

Update

c)

Alter

d)

Delete

35.

In RDBMS, table is known as ________

a)

Tuple

b)

Relation

c)

Attribute

d)

Domain

36.

View is a virtual table?

a)

True

b)

False

37.

In RDBMS, field is known as ________

a)

Tuple

b)

Relation

c)

Attribute

d)

Domain

38.

The Primary Key identifies the record uniquely in a table?

a)

True

b)

False

39.

What SQL clause is used to restrict the rows returned by a query ?

a)

WHEN

b)

HAVING

c)

FROM

d)

WHERE

40.

Which of the following can add a row to a table ?

a)

Add

b)

Insert

c)

Update

d)

Alter

41.

Which SQL statement is used to insert new data in database ?

a)

INSERT INTO

b)

UPDATE

c)

ADD

d)

INSERT NEW

42.

Which one will delete the table data as well as table structure?

a)

DELETE

b)

DROP

43.

What is a foreign key ?

a)

A foreign key is a key field in table , which relates the table to another table where the key is a primary key or unique key.

b)

Constraint (reference integrity)

c)

The foreign key is a column that can have NULL value

d)

The foreign key is a column that can not have NULL values

44.

GRANT & REVOKE IS THE

a)

DDL

b)

DML

c)

DCL

d)

TCL

45.

CREATE & DROP IS A ----------STATEMENT

a)

DDL

b)

DCL

c)

DML

d)

TCL

46.

SELECT & INSERT

a)

DDL

b)

DML

c)

DCL

d)

TCL

47.

Which of the following is an application of DBMS?

a)

Banking

b)

Airlines

c)

university

d)

All of them

48.

Database is a collection of

a)

Data

b)

Related data

c)

Correct data

d)

fields

49.

Pool of values from where a column draws the value is called .............

a)

table

b)

attribute

c)

dataset

d)

domain

50.

The column which has unique values in all the rows but is not a primary key is called ............. key.

a)

candidate

b)

alternate

c)

composite

d)

foreign

51.

This symbol is placed immediately after the SELECT command to display all the fields.

a)

$

b)

%

c)

=

d)

*

52.

What is the meaning of DDL?

a)

Data Definition Language

b)

Database definition Language

c)

Data Definition Link

d)

Data Division Langauge

53.

The _____ command is used to modify columns in a table

a)

DROP

b)

INSERT

c)

ALTER

d)

CREATE

54.

delete * from employee;

a)

Deletes all tuples.

b)

updates the table emp with null.

c)

Destroys the table.

d)

select all the record

55.

select all DML commands are:-

a)

INSERT

b)

UPDATE

c)

DELETE

d)

GRANT

56.

select all DDL commands are:-

a)

UPDATE

b)

ALTER

c)

DROP

d)

DELETE

57.

Which of the following is the correct order of keywords for SQL SELECT statements?

a)

SELECT, FROM, WHERE

b)

FROM, WHERE, SELECT

c)

WHERE, FROM,SELECT

d)

SELECT,WHERE,FROM

58.
Which of the following is not a type of database?
a)
Decentralised
b)
Hierarchical
c)
Network
d)
Relational
59.

A ___________ is a specific type of field in a relational database that can identify each unique record independently

a)

Candidate Key

b)

Primary key

c)

Surrogate key

d)

Unique Key

60.

The COUNT() function also counts the NULL values.

a)

True

b)

False

61.

The average value of the given numeric column is calculated by using - - - function.

a)

GETAVG()

b)

FINDAVG()

c)

AVG()

d)

AVGVALUE()