wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL and Database Concepts Quiz

Total questions: 88

Worksheet time: 47mins

Name
Class
Date
1.

Another name for a table in a relational database?

a)

Tuple

b)

Attribute

c)

Relation

d)

Schema

2.

What is a tuple?

a)

A column

b)

A unique row in a table

c)

A table

d)

A key

3.

Purpose of defining primary keys?

a)

Improve performance

b)

Ensure data integrity and uniqueness

c)

Reduce storage

d)

Create indexes

4.

Example of one-to-many relationship?

a)

Order to Order

b)

Product to Supplier

c)

Customer to Orders

d)

Country to Capital

5.

Role of a superkey?

a)

Sorts tuples

b)

Defines table structure

c)

Ensures no two tuples are identical

d)

Creates foreign keys

6.

Not a fundamental component of an ER model?

a)

Entities

b)

Attributes

c)

Relationships

d)

Algorithms

7.

What is a foreign key in RDM conversion?

a)

A key that must be unique

b)

A key used to establish relationships between tables

c)

A primary key

d)

A composite key

8.

What is a primary key?

a)

Any attribute

b)

A foreign key

c)

A candidate key chosen to uniquely identify tuples

d)

A non-unique identifier

9.

What is normalization?

a)

Merging tables

b)

Splitting tables to eliminate redundancy

c)

Sorting data

d)

Encrypting data

10.

Role of a foreign key?

a)

Ensures uniqueness

b)

Establishes a link between two tables

c)

Creates indexes

d)

Defines primary keys

11.

What is a foreign key?

a)

A unique attribute

b)

Attribute referencing a primary key in another relation

c)

A primary key

d)

A superkey

12.

What is a superkey?

a)

A key that must be foreign

b)

Attribute(s) uniquely identifying a tuple

c)

A minimal key

d)

A composite key only

13.

What is a relationship’s degree?

a)

Number of attributes

b)

Number of entities participating

c)

Number of keys

d)

Number of tuples

14.

How are tables typically related?

a)

By indexes

b)

By triggers

c)

Through shared attributes

d)

Through stored procedures

15.

Entity that can exist independently?

a)

Weak entity

b)

Strong entity

c)

Recursive entity

d)

Composite entity

16.

Role of a foreign key in ER model?

a)

Improve performance

b)

Enforce referential integrity

c)

Create tables

d)

Define attributes

17.

Command to create a table?

a)

MAKE TABLE

b)

NEW TABLE

c)

CREATE TABLE

d)

TABLE CREATE

18.

Command to update multiple rows?

a)

MODIFY

b)

UPDATE

c)

CHANGE

d)

ALTER

19.

DDL commands do what?

a)

Manipulate data

b)

Define database structure

c)

Query data

d)

Delete rows

20.

DELETE is classified as…

a)

DDL

b)

DML

c)

TCL

d)

DCL

21.

COUNT function does what?

a)

Sums values

b)

Finds max

c)

Counts rows

d)

Groups rows

22.

ON DELETE CASCADE does what?

a)

Prevents deletion

b)

Deletes child rows when parent is deleted

c)

Updates child rows

d)

Ignores deletion

23.

Optional clause in SELECT?

a)

FROM

b)

WHERE

c)

SELECT

d)

GROUP BY

24.

Clause for sorting results?

a)

FILTER

b)

GROUP BY

c)

ORDER BY

d)

SORT

25.

CHECK constraint is used for…

a)

Creating indexes

b)

Validating data in columns

c)

Sorting data

d)

Joining tables

26.

Not a DDL command?

a)

CREATE

b)

ALTER

c)

DROP

d)

UPDATE

27.

Clause specifying condition for selecting records?

a)

ORDER BY

b)

WHERE

c)

GROUP BY

d)

HAVING

28.

GROUP BY is used with…

a)

Scalar functions

b)

Aggregate functions

c)

String functions

d)

Date functions

29.

Add a new column to a table?

a)

INSERT

b)

UPDATE

c)

ALTER TABLE

d)

MODIFY

30.

SELECT * does what?

a)

Selects first row

b)

Selects all columns

c)

Selects all tables

d)

Selects all databases

31.

What is DDL?

a)

Data Delete Language

b)

Data Definition Language

c)

Data Download Language

d)

Data Deployment Language

32.

Operator checking value in a range?

a)

IN

b)

BETWEEN

c)

LIKE

d)

ANY

33.

Command to retrieve data?

a)

GET

b)

SELECT

c)

FETCH

d)

SHOW

34.

Default ORDER BY sorting?

a)

Descending

b)

Ascending

c)

Random

d)

None

35.

DML command to add data?

a)

UPDATE

b)

ALTER

c)

INSERT

d)

MERGE

36.

DEFAULT constraint does what?

a)

Prevents NULL

b)

Assigns default value if none provided

c)

Creates index

d)

Enforces uniqueness

37.

SQL command to change table structure?

a)

UPDATE

b)

INSERT

c)

ALTER

d)

MODIFY

38.

Purpose of INSERT command?

a)

Delete data

b)

Modify data

c)

Add new data

d)

Sort data

39.

What does the UNIQUE constraint do?

a)

Prevents duplicate values in a column

b)

Prevents NULL values

c)

Makes a column the primary key

d)

Sorts values automatically

40.

What does SQL stand for?

a)

Simple Query Logic

b)

Structured Query Language

c)

Sequential Query Language

d)

System Query Layer

41.

Which SQL constraint ensures that values in a primary key column are unique?

a)

UNIQUE

b)

CHECK

c)

FOREIGN KEY

d)

PRIMARY KEY

42.

Which SQL keyword eliminates duplicate rows in the result?

a)

REMOVE

b)

DISTINCT

c)

UNIQUE

d)

FILTER

43.

What does DML stand for?

a)

Data Manipulation Language

b)

Data Modeling Language

c)

Data Management Layer

d)

Database Mapping Logic

44.

What does the SELECT statement do?

a)

Delete data

b)

Retrieve data from a table

c)

Modify table structure

d)

Grant permissions

45.

Purpose of FOREIGN KEY constraint?

a)

Ensures uniqueness

b)

Links two tables together

c)

Creates indexes

d)

Sorts data

46.

Which SQL command modifies existing records?

a)

INSERT

b)

UPDATE

c)

ALTER

d)

MODIFY

47.

Which SQL constraint ensures column values must not be empty?

4 lines
48.

Which SQL command modifies existing records?

a)

INSERT

b)

UPDATE

c)

ALTER

d)

MODIFY

49.

Which SQL constraint ensures column values must not be empty?

a)

UNIQUE

b)

CHECK

c)

NOT NULL

d)

DEFAULT

50.

SQL command to remove a database?

a)

DELETE DATABASE

b)

DROP DATABASE

c)

REMOVE DB

d)

CLEAR DATABASE

51.

Which command grants user access?

a)

ALLOW

b)

GRANT

c)

PERMIT

d)

ACCESS

52.

Wildcard symbol matching any substring in LIKE?

a)

_

b)

%

53.

SQL command removing a table entirely?

a)

DELETE

b)

REMOVE

c)

DROP

d)

CLEAR

54.

How to specify constraints when creating a table?

a)

RULE

b)

LIMIT

c)

DEFINE

d)

CONSTRAINT

55.

What type of SQL statement is SELECT?

a)

DDL

b)

DML

c)

TCL

d)

DCL

56.

Command to remove all constraints from a table?

a)

DROP ALL

b)

ALTER TABLE DROP CONSTRAINT

c)

DELETE CONSTRAINTS

d)

REMOVE RULES

57.

What does ROLLBACK do?

a)

Save changes

b)

Cancel pending changes

c)

Delete the transaction

d)

Restart the database

58.

SQL statement to modify a column data type?

a)

UPDATE COLUMN

b)

ALTER TABLE

c)

MODIFY TYPE

d)

CHANGE COLUMN

59.

Which is independent of any DBMS?

a)

Physical design

b)

Internal schema

c)

Conceptual design

d)

Storage mapping

60.

Which type of attribute uniquely identifies entity instances?

a)

Composite attribute

b)

Multivalued attribute

c)

Derived attribute

d)

Identifier

61.

Total completeness implies:

a)

It may belong to no subtype

b)

It must belong to exactly one subtype

c)

It must be a member of at least one subtype

d)

It belongs to all subtypes

62.

The 'supertype' represents:

a)

A weak entity

b)

A general entity type with common attributes

c)

A relationship

d)

A multivalued attribute

63.

Attribute computed from another attribute:

a)

Composite attribute

b)

Multivalued attribute

c)

Derived attribute

d)

Key attribute

64.

Set of possible values for an attribute:

a)

Tuple

b)

Key

c)

Domain

d)

Schema

65.

Overlapping subtypes mean:

a)

Must belong to only one subtype

b)

May appear in more than one subtype

c)

Cannot belong to any subtype

d)

Must belong to all subtypes

66.

Association among entities is called:

a)

Attribute

b)

Domain

c)

Relationship

d)

Key

67.

NULL in attributes means:

a)

Zero

b)

Empty string

c)

Missing/unknown value

d)

Invalid data

68.

Conceptual design is:

a)

DBMS-specific

b)

Physical

c)

Independent of any DBMS

d)

Hardware-based

69.

Most important EER construct:

a)

Composite attributes

b)

Multivalued attributes

c)

Supertype/subtype discriminator

d)

Weak entities

70.

Conceptual design is based on info from:

a)

Implementation phase

b)

Requirements analysis phase

c)

Testing phase

d)

Deployment phase

71.

Disjoint subtypes mean:

a)

Can belong to many subtypes

b)

Must appear in only one subtype

c)

Must appear in all subtypes

d)

Appear in no subtype

72.

Nature of an attribute:

a)

A relationship

b)

A property of an entity

c)

A table

d)

A key

73.

If 'Owns' is defined for Vehicle, then:

a)

Only Car participates

b)

Only Truck participates

c)

Both Car and Truck participate

d)

Neither participates

74.

One-to-many means:

a)

Many A to many B

b)

Each A maps to many B; each B maps to one A

c)

One A to one B

d)

Many A to one B

75.

Purpose of EER model:

a)

Replace ER model

b)

Extend ER model with new constructs

c)

Remove relationships

d)

Remove attributes

76.

Completeness constraint specifies:

a)

Whether subtype has attributes

b)

Whether each supertype occurrence must belong to a subtype

c)

Whether keys exist

d)

Whether relationships are recursive

77.

'Skill' for Employee is:

a)

Relationship

b)

Attribute

c)

Domain

d)

Key

78.

Composite attribute example:

a)

Salary

b)

Name (First, Middle, Last)

c)

Age

d)

ID

79.

Relationship defined at supertype level means:

a)

Only supertype participates

b)

All subtypes participate

c)

No subtype participates

d)

Only one subtype participates

80.

Subtype represents:

a)

General entity

b)

Specialized entity inheriting from supertype

c)

Weak entity

d)

Domain

81.

Subtype of Employee:

a)

Department

b)

Salaried Employee

c)

Project

d)

Skill

82.

Chen notation is used for:

a)

Physical modeling

b)

Conceptual modeling

c)

Logical modeling

d)

Implementation

83.

NOT part of ERM:

a)

Entities

b)

Attributes

c)

Relationships

d)

User interface designs

84.

Elements of ERM include:

a)

Tables only

b)

Entities, attributes, relationships, constraints

c)

Queries

d)

Reports

85.

Partial completeness symbol:

a)

Double line

b)

Circle over single line

c)

Triangle

d)

Dashed line

86.

Attribute naming convention:

a)

Verb

b)

Noun describing characteristic

c)

Adjective

d)

Symbol

87.

Attribute on a relationship describes:

a)

Entity property

b)

Property of the connection

c)

Domain

d)

Key

88.

An entity must have:

a)

Verb name

b)

Number name

c)

Noun name

d)

Symbol name