Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

UAS - PBD - INABA

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

The SQL WHERE clause:

a)

limits the column data that are returned.

b)

limits the row data that are returned.

c)

Both A and B are correct

d)

Neither A nor B is correct

2.

Arrange the order of clauses in the select statement

a)

FROM

b)

WHERE

c)

GROUP BY

d)

HAVING

e)

ORDER BY

1)
2)
3)
4)
5)
3.

Match the following

a)

Check

1.

Used to limit column values to specific values

b)

Delete

2.

Remove specific rows

c)

Unique

3.

Will not allow duplicate

d)

Having

4.

Restrict the output after grouping

e)

Distinct

5.

Eliminate duplicate values

4.

Drag the correct option into the correct box

SELECT ​ ​ (a)   ​ (b)   users ​ (c)   ​ (d)   ='user1';

Choose from the below words
password
from
where
username
5.

The command to remove rows from a table 'CUSTOMER' is:

a)

REMOVE FROM CUSTOMER ...

b)

DROP FROM CUSTOMER ...

c)

DELETE FROM CUSTOMER WHERE ...

d)

UPDATE FROM CUSTOMER ...

6.

How can you change 'Thomas' to 'Michael' in the LastName column in the user table

a)

UPDATE User SET LastName = 'Thomas' INTO LastName = 'Michel'

b)

MODIFY Users SET LastName = 'Michel' WHERE LastName = 'Thomas'

c)

MODIFY Users SET LastName = 'Thomas' INTO LastName = 'Michel'

d)

UPDATE Users SET LastName = 'Michel' WHERE LastName = 'Thomas'

7.

Complete the query by drag the correct option into the correct boxes.

To display the detail of employee having „e‟ in their name in descending order of salary

SELECT * ​ (a)   emp ​ (b)   ename LIKE "%e%" ​ (c)   ​ SAL ​ (d)   ;

Choose from the below words
FROM
WHERE
ORDER BY
DESC
8.

Match the following

a)

DDL

1.

ALTER

b)

DML

2.

UPDATE

c)

TCL

3.

ROLLBACK

d)

DCL

4.

GRANT

9.

Reorder the following

Order of keywords for SQL SELECT statements?

a)

SELECT

b)

FROM

c)

WHERE

d)

GROUP B Y

e)

ORDER BY

1)
2)
3)
4)
5)
10.

DDL Stands for ___________.

a)

Data Management Language

b)

Data Manupulation Language

c)

Data Development Language

d)

Data Definition Language

11.

The language used application programs to request data from the DBMS is referred to as __________

a)

DDL

b)

DML

c)

Query Language

d)

All of the mentioned

12.

Match SQL language with SQL commands

1)DDL i)Revok, Grant

2)DML ii)rename a table

3)TCL iii)insert, update

4)DCL iv)rollback , commit

a)

1-iii,2-i,3-ii,4-iv

b)

1-iii,2-ii,3-iv,4-i

c)

1-ii,2-iii,3-iv,4-i

d)

1-i,2-iii,3-ii,4-iv

13.

Which of the following is not a type of SQL statement?

a)

Data Manipulation Language (DML)

b)

Data Definition Language (DDL)

c)

Data Control Language (DCL)

d)

Data Communication Language (DCL)

14.

In existing table, ALTER TABLE statement is used to

a)

Add columns

b)

Add constraints

c)

Delete columns

d)

Delete constrains

e)

All the above

15.

SQL Query to delete all rows in a table without deleting the table (structure, attributes, and indexes)

a)

DELETE FROM table_name;

b)

DELETE TABLE table_name;

c)

DROP TABLE table_name;

d)

None

16.

Correct syntax query syntax to drop a column from a table is

a)

DELETE COLUMN column_name;

b)

DROP COLUMN column_name;

c)

ALTER TABLE table_name DROP COLUMN column_name;

d)

None is correct.

17.

SQL has how many main commands for DDL:

a)

1

b)

2

c)

3

d)

4

18.

Which command is used for removing a table and all its data from the database:

a)

Create command

b)

Drop table command

c)

Alter table command

d)

All of the mentioned

19.

Which of the following language is used to specify database Schema ?

a)

DDL

b)

DML

c)

DCL

d)

None

20.

What is a ‘tuple’?

a)

A row or record in a database table

b)

Another name for the key linking different tables in a database.

c)

An attribute attached to a record.

d)

Another name for a table in an RDBMS.

21.

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

a)

REMOVE FROM CUSTOMER …

b)

DROP FROM CUSTOMER …

c)

DELETE FROM CUSTOMER WHERE …

d)

UPDATE FROM CUSTOMER …

22.

The command to eliminate a table from a database is:

a)

REMOVE TABLE CUSTOMER;

b)

DROP TABLE CUSTOMER;

c)

DELETE TABLE CUSTOMER;

d)

UPDATE TABLE CUSTOMER;

23.

To remove duplicate rows from the results of an SQL SELECT statement, the ________ qualifier specified must be included

a)

ONLY

b)

UNIQUE

c)

DISTINCT

d)

SINGLE

24.

With SQL, how do you select all the columns from a table named "Persons"?

a)

SELECT [all] FROM Persons

b)

SELECT Persons

c)

SELECT * FROM Persons

d)

SELECT *.Persons

25.

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

a)

SELECT * FROM Persons WHERE FirstName='a'

b)

SELECT * FROM Persons WHERE FirstName LIKE 'a%'

c)

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

d)

SELECT * FROM Persons WHERE FirstName LIKE '%a'

26.

With SQL, how can you insert a new record into the "Persons" table?

a)

INSERT ('Jimmy', 'Jackson') INTO Persons

b)

INSERT VALUES ('Jimmy', 'Jackson') INTO Persons

c)

INSERT INTO Persons VALUES ('Jimmy', 'Jackson')

27.

With SQL, how can you return the number of records in the "Persons" table?

Next ❯

a)

SELECT NO(*) FROM Persons

b)

SELECT COLUMNS(*) FROM Persons

c)

SELECT COUNT(*) FROM Persons

d)

SELECT LEN(*) FROM Persons

28.

The NOT NULL constraint enforces a column to not accept empty values.


Next ❯

a)

TRUE

b)

FALSE

29.

Which operator is used to search for a specified pattern in a column?

a)

GET

b)

FROM

c)

LIKE

30.

SELECT * FROM employee WHERE salary>10000 AND dept_id=101;

Which of the following fields are displayed as output?

a)

Salary, dept_id

b)

Employee

c)

Salary

d)

All the field of employee relation

31.

In the given query which of the keyword has to be inserted?

INSERT INTO employee _____ (1002,Joey,2000);

a)

Table

b)

Values

c)

Relation

d)

Field

32.

CREATE TABLE employee (id INTEGER,name VARCHAR(20),salary NOT NULL);

INSERT INTO employee VALUES (1005,Rach,0);

INSERT INTO employee VALUES (1007,Ross, );

INSERT INTO employee VALUES (1002,Joey,335);


Some of these insert statements will produce an error. Identify the statement.

a)

Insert into employee values (1005,Rach,0);

b)

Insert into employee values (1002,Joey,335);

c)

Insert into employee values (1007,Ross, );

d)

None of the mentioned

33.

Which command is used for removing a table and all its data from the database:

a)

Create command

b)

Drop table command

c)

Alter table command

d)

All of the mentioned

34.

Which constraint(s) can be used to make sure that the column is not left empty?

a)

NOT NULL

b)

UNIQUE

c)

PRIMARY KEY

d)

ALL THE ABOVE

35.
Which of the following is NOT a type of SQL constraint?
a)
Primary Key
b)
Foreign Key
c)
Alternate Key
d)
Unique
e)
NOT NULL
36.

______________ constraint prevents NULL values

a)

UNIQUE

b)

NOT NULL

c)

NULL

d)

FOREIGN KEY

37.

5. ___________ constraint ensures that no two rows have the same value in the specified columns.

a)

Primary Key

b)

Unique

c)

Default

d)

Check

38.

6. ___________ which helps to uniquely identify a record.

a)

Primary key Constraint

b)

Unique Constraint

c)

Default constraint

d)

Check constraint

39.

A primary key can be NULL in the table? TRUE or FALSE

a)

TRUE

b)

FALSE

40.

SELECT * FROM cars WHERE Doors > 3

would return how many records?

a)

1

b)

2

c)

3

d)

4

41.

SELECT * FROM Students WHERE Gender="Female" AND Class=2.2

would return how many records?

a)

1

b)

2

c)

3

d)

4

42.

In the given query which of the keyword has to be inserted?

INSERT INTO employee _____ (1002,Joey,2000);

a)

Table

b)

Values

c)

Relation

d)

Field

43.

CREATE TABLE employee (id INTEGER,name VARCHAR(20),salary NOT NULL);

INSERT INTO employee VALUES (1005,Rach,0);

INSERT INTO employee VALUES (1007,Ross, );

INSERT INTO employee VALUES (1002,Joey,335);


Some of these insert statements will produce an error. Identify the statement.

a)

Insert into employee values (1005,Rach,0);

b)

Insert into employee values (1002,Joey,335);

c)

Insert into employee values (1007,Ross, );

d)

None of the mentioned

44.

Which statement is used to extract data from a database?

a)

Extract

b)

Get

c)

Open

d)

Select

45.

If you were wanting to filter data, which clause would you use?

a)

Where

b)

Order by

c)

From

d)

Select

46.

Using which word allows you to specify that more than one condition must be met in a query?

a)

Also

b)

And

c)

Or

d)

Where

47.

Using which word allows you to specify that only one of a series of conditions needs to be met in a query filter?

a)

And

b)

Maybe

c)

If

d)

Or

48.

In order to amend data in a database we would use which SQL statement?

a)

Update

b)

Amend

c)

Alter

d)

Modify

49.

To remove a record from a table which SQL statement would you use?

a)

Remove

b)

Cancel

c)

Delete

d)

Eradicate

50.

Less than or equal to?

a)

>=

b)

=>

c)

=<

d)

<=