wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQLTest 01

Total questions: 56

Worksheet time: 29mins

Name
Class
Date
1.

In SQL, a view is a ......... table based on the result-set of an SQL statement.

a)

REAL

b)

SELF

c)

VIRTUAL

2.

The conceptual model is...

a)

Dependant on hardware

b)

Dependant on software

c)

Dependant on both hardware and software

d)

Independant on hardware and software

3.

A collection of tables to represent both data and the relationships among is known as,.........

a)

Entity relationship model

b)

Relational Model

c)

Object base data model

d)

Semi structured data model

4.

DBMS is a general purpose software system that facilitate the process of

a)

Defining a database

b)

Constructing a database

c)

Manipulating database

5.

Which is database language ?

a)

C

b)

C++

c)

SQL

d)

None

6.

......... is the structure of the database.

a)

Table

b)

Relation

c)

Schema

d)

None

7.

Schema is defined by

a)

DML

b)

DDL

c)

DCL

d)

DQL

8.

DBMS is bridge between operating system and .............

a)

User

b)

Database administrator

c)

Application program

d)

None

9.

An entity has set of ............ that describe it.

a)

Attributes

b)

Entity set

c)

Relationships

d)

None

10.

.......... is the information about data.

a)

Data

b)

Metadata

c)

Entity

d)

Relations

11.

Which level of abstraction describes what data are stored in the database ?

a)

Physical level

b)

View level

c)

Abstraction level

d)

Logical level

12.

Which of the following is not disadvantage of DBMS ?

a)

High Cost

b)

Adequate backup

c)

No redundancy

d)

Complexity

13.

Which of the following is structure of database ?

a)

Table

b)

Schema

c)

Relation

d)

None

14.

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

a)

COUNT()

b)

NUMBER()

c)

SUM()

d)

COUNT(*)

15.

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

a)

DELETE

b)

REMOVE

c)

DROP

d)

CLEAR

16.

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

17.

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%’

18.

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

19.

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

20.

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’

21.

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

22.

SQL query to find the temperature in increasing order of all cities.

a)

SELECT city FROM weather ORDER BY temperature

b)

SELECT city, temperature FROM weather

c)

SELECT city, temperature FROM weather ORDER BY temperature

d)

SELECT city, temperature FROM weather ORDER BY city

23.

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

24.

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

25.

Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.

a)

SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)

b)

SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’)

c)

SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’)

d)

SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’);

26.

What will be the output of the query :

Select Substring('mysql application',3,3)

a)

app

b)

mysql

c)

application

d)

sql

27.

What will be the output of the following query:

Select round(59999.99,-2);

a)

59999

b)

59900

c)

60000

d)

59990

28.

Which function will be used to remove only the trailing spaces from a string?

a)

ltrim()

b)

rtrim()

c)

trim()

d)

all

29.

Fill in the blank:

___________________ this clause is used to apply condition on all the rows of table.

a)

Where

b)

Having

c)

Order By

d)

Sort By

30.

Difference between ALTER Table command and UPDATE command :

a)

ALTER is DDL command and is used for modifying the schema of table

b)

UPDATE is DML command and is

used for modifying the existing data of table

c)

Using Alter command any value inside the table can be modified.

d)

Using Update command columns of a table can be renamed.

31.

Which clause is used when we want to use aggregate functions in conditions?

a)

Where

b)

Group By

c)

Having

d)

Both 2 and 3

32.

Which statement allows us to add a record to a table?

a)

Add To

b)

Update To

c)

Add Into

d)

Insert Into

33.

Normalisation is:

a)

Removing all necessary data from a database

b)

Organising a database to remove repeated entries and increase the accuracy of the data

c)

Putting fields from different tables into one big database

34.

An advantage of normalisation is:

a)

The storage space needed for a normalised database is likely to be smaller

b)

The process of normalising a database is very easy and doesn’t require any skill

c)

It is possible to see previous details that have been changed, such as a customer’s address, as we can look back at an older entry

35.

An entity is represented by what in a database?

a)

Table

b)

Row

c)

Column

d)

Cell

36.

An attribute is represented by what in a database?

a)

Table

b)

Row

c)

Column

d)

Cell

37.

What is a foreign key?

a)

A unique identifier in a database

b)

A primary key of one table that appears in another table

c)

A field that should not be in a table and needs removing

38.

What is a functional dependency?

a)

when an non-key attribute is determined by a whole part of a COMPOSITE primary key.

b)

When a key field is changed and it conflicts with another key

c)

When a database function is dependant of the operation of another function to work correctly

d)

When data is a database is repeated for different entities

39.

What is a composite primary key?

a)

A primary key that can be duplicated in the same table

b)

An attribute that is a primary key in another table

c)

A foreign key that is a primary key in more than one other table

d)

A primary key made up from two or more attributes

40.

A relation is in 1NF if it doesn't contain any ____________?

a)

Determinants

b)

Repeating columns

c)

Null values in primary key fields

d)

Functional dependencies

41.

After being in 1NF, a table is in 2NF if it has...

a)

only one primary key field

b)

all of its fields are Whole Key Dependant

c)

non-key fields that are functionally dependant

d)

at least one repeating group

42.

Which of the following statements fully describes data in 2NF:

a)

When any repeating fields have been removed and the table is given a primary key

b)

When all repeating entries of data are removed and the fields in each table are directly related to the primary key and no fields are present that are not related to each other

c)

When all the fields in each table are directly related to the primary key

43.

What is an atomic field?

a)

A field that contains multiple items of data

b)

A field that is repeated

c)

A field that contains only one item of data

44.

Problems in Relational Data Model are :

a)

Anomalies

b)

Information Redundancy

c)

None of the above

45.

3 types of anomalies are :

a)

insert

b)

delete

c)

modification

d)

None of the above

46.

Information Redundancy is Duplication of data due to storing the same data multiple times.

a)

True

b)

False

47.

A process for assigning attributes into a table and reduces data redundancy and helps eliminate the data anomalies that associated with poor database design is called as :

a)

Normalization

b)

Information Redundancy

c)

Anomalies

48.

The purposes of normalization are :

a)

To ensure that the anomalies doesn’t occur

b)

To reduce data or storage redundancy

c)

To ensure easy for record searching/finding

d)

All the above

49.

Steps in Normalization are :

a)

UNF- 1NF-2NF-3NF-BCNF

b)

1NF-2NF-3NF-BCNF

c)

2NF-3NF-BCNF

d)

None of the above

50.

"Constraint between two attributes or two sets of attributes."


The above statement is referring to :

a)

Functional Dependecies

b)

Transitive Dependencies

51.

Choose three types of Functional Dependency

a)

Full Functional Dependency

b)

Partial Functional Dependency

c)

Transitive Functional Dependency

d)

None of the above

52.

"Occurs when an attribute is functionally dependent on another non-key attribute."


The above statement is referring to :

a)

Full Functional Dependency

b)

Partial Functional Dependency

c)

Transitive Dependencies

53.

A disadvantage of normalisation is:

a)

The data loses its integrity as some of it is removed in the normalisation process

b)

The process of searching the database may be slower due to a higher demand on the central processing unit (CPU)

c)

Removing redundant data means that links cannot be created between tables

54.

A relation is in 1NF if it doesn't contain any ____________?

a)

Determinants

b)

Repeating groups

c)

Null values in primary key fields

d)

Functional dependencies

55.

When designing a database you should ____.

a)

make sure entities are in normal form before table structures are created

b)

create table structures then normalize the database

c)

only normalize the database when performance problems occur

d)

consider more important issues such as performance before normalizing

56.

A table in ____ contains no transitive dependencies.

a)

1NF

b)

2NF

c)

3NF

d)

none of the above