wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PQ Quiz 2

Total questions: 153

Worksheet time: 1hrs 17mins

Name
Class
Date
1.

A.... is a property of the entire relation, rather than
of the individual tuples in which each tuple is unique.

a)

Rows

b)

Key

c)

Attribute

d)

Fields

2.

What is the result of the following query?
SELECT studentdatabasename
FROM RDBMS
WHERE marks > SOME (SELECT marks
FROM student
WHERE SECTION = 'c');

a)

The query gives all the studentdatabasename for
which marks are greater than all the students in
section c

b)

The query gives all the studentdatabasename for
which the marks are greater than at least on
student in section c

c)

The query gives all the studentdatabasename for
which the marks are less than all the students in
section c

d)

The query is syntactically incorrect

3.

What is the correct answer to describe the following
query.
SELECT name
FROM instructor
WHERE salary IS NOT NULL;

a)

Tuples with null value

b)

Tuples with no null values

c)

Tuples with any salary

d)

All of the mentioned

4.

Which of the following MySQL aggregate functions is used to calculate the average?

a)

COUNT()

b)

EVERAGE()

c)

AVERAGE()

d)

AVG()

5.

From the query below, how many rows are selected?
SELECT Name
FROM instructor
WHERE salary > SOME (SELECT salary FROM
instructor WHERE dept_name = 'Comp.Sci.');

a)

The number of rows selected depends on the data
in the 'instructor' table and the comparison of
salaries.

b)

The number of rows selected is O

c)

The number of rows selected is always 10

d)

The number of rows selected is 100

6.

The query given below will not give an error. Which one of the following has to be replaced to get the desired output?
SELECT ID, name, dept name, salary * 1.1
WHERE instructor;

a)

Salary*1.1

b)

ID

c)

Where

d)

Instructor

7.

What is the purpose of the MySQL AUTO_INCREMENT attribute?

a)

The purpose of the MySQL AUTO_INCREMENT
attribute is to delete existing rows in a table.

b)

The purpose of the MySQL AUTO_INCREMENT
attribute is to update the values in a column.

c)

The purpose of the MySQL AUTO_INCREMENT
attribute is to sort the rows in a table.

d)

The purpose of the MySQL AUTO_INCREMENT
attribute is to automatically generate a unique
value for a column whenever a new row is inserted
into the table.

8.

From the script,
CREATE TABLE department
(dept_name VARCHAR (20),
building VARCHAR (15),
budget NUMBER,
PRIMARY KEY (dept_name));
CREATE TABLE course
(course_id VARCHAR (7),
title VARCHAR (50),
dept_name VARCHAR (20),
credits NUMERIC (2,0),
PRIMARY KEY (course_id),
FOREIGN KEY (dept_name)
department);
CREATE TABLE instructor
(ID VARCHAR (5),
name VARCHAR (20) NOT NULL,
dept_name VARCHAR (20),
salary NUMERIC (8,2),
FOREIGN KEY (dept_name)
CREATE TABLE SECTION
(course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
building VARCHAR (15),
department);
room_number VARCHAR (7),
time_slot id VARCHAR (4),

PRIMARY KEY (ID, course_id, sec_id, semester, YEAR),
FOREIGN KEY (course_id, sec_id, semester, YEAR)
REFERENCES SECTION,
FOREIGN KEY (ID) _____instructor);
In order to include an attribute Name to the teaches
relation which of the following command is used?

a)

Alter table teaches include Name;

b)

Alter table teaches add Name;

c)

Alter table teaches add Name varchar;

d)

Alter table teaches add Name varchar(20);

9.

Which of the following operations are associative

a)

Natural joins

b)

Theta joins

c)

Both the mentioned

d)

None of the mentioned

10.

Choose the correct option regarding the query
SELECT branch_name, COUNT (DISTINCT
customer_name)
FROM depositor, account
WHERE depositor.account_number =
account.account_number
GROUP BY branch_id
HAVING avg(balance) = 10000;

a)

The having clause allows only those tuples that
have an average balance of 10000

b)

The having clause checks whether the query result
is true or not

c)

The having clause does not check for any condition

d)

None of the mentioned

11.

A set of possible data values is called

a)

A set of possible data values is called a 'range'.

b)

A set of possible data values is called a 'variable'.

c)

A set of possible data values is called a 'domain'.

d)

A set of possible data values is called a 'coefficient'.

12.

How does the GROUP BY clause work in the context of
SQL queries?

a)

It is used to sort the result set in ascending order

b)

It is used to filter the result set based on a specified
condition

c)

It is used to group the result set based on one or
more columns

d)

It is used to perform mathematical operations on
the result set

13.

How does an attribute differ from an entity in a conceptual data model?

a)

An attribute and an entity are the same thing in a
conceptual data model.

b)

An attribute describes the properties or
characteristics of an entity, while an entity
represents a real-world object or concept.

c)

An attribute is used to represent relationships
between entities, while an entity represents the
properties of an attribute.

d)

An attribute is a type of entity, while an entity is a
type of attribute.

14.

What is the first step in database normalization?

a)

Test the database for errors

b)

Gather and analyze the requirements of the
system

c)

Implement the database system

d)

Create the physical design of the database

15.

What is the primary purpose of a foreign key in a relational database?

a)

To create a logical structure that accurately
represents real-world entities and their
relationships.

b)

To randomly group data without any logical
structure.

c)

To confuse the database administrators.

d)

To make the database more difficult to use.

16.

What is the primary purpose of a relational database system?

a)

To make the database more difficult to use

b)

To randomly group data without any logical
structure

c)

To create a logical structure that accurately
represents real-world entities and their
relationships.

d)

To confuse the database administrators

17.

The term attribute refers to a .......... of a table.

a)

Record

b)

Column

c)

Tuple

d)

Key

18.

The ____ clause is used to list the attributes desired in the result of a query

a)

select

b)

from

c)

where

d)

create

19.

Which of the following is a suitable entity?

a)

Staff

b)

StaffName

c)

Blair Drive

d)

P101

20.

The values appearing in given attributes of any tuple in the referencing relation must likewise occur in specified attributes of at least one tuple in the referenced relation, according to. .... integrity constraint.

a)

Referential

b)

Primary

c)

Referencing

d)

Specific

21.

If we specify multiple relations in the from clause and do not specify any conditions in the where clause, what will the result be?

a)

Intersection of all the relations

b)

Union of all the relations

c)

Difference of all the relations

d)

Cartesian product of all the relations

22.

What is the significance of using foreign keys in a relational database system?

a)

To ensure data integrity and enforce referential
integrity constraints

b)

To create duplicate records in the database

c)

To establish a direct connection between two
unrelated tables

d)

To complicate the database structure

23.

Which of the following is a good database management practice?

a)

Adding redundant attributes

b)

Not specifying primary keys

c)

Removing redundant attributes

d)

None of the mentioned

24.

Interpret the relationship from Fighter to Fight Schedule shown in the conceptual data model

a)

A Fighter MUST be assigned ONE or MORE Fight
Schedules

b)

A Fighter MAY be assigned ONE or MORE Fight
Schedules

c)

A Fighter MAY be assigned ONE and only ONE
Fight Schedule

d)

A Fighter MUST be assigned ONE and only ONE
Fight Schedule

25.

Which one of the following uniquely identifies the elements in the relation?

a)

Primary key

b)

Index key

c)

Foreign key

d)

Secondary key

26.

What is the primary purpose of using SQL Views in a database system?

a)

To complicate the database structure

b)

To provide a logical representation of existing
tables or views

c)

To store data separately from the main tables

d)

To confuse the database administrators

27.

What is the purpose of the following SQL command?
UPDATE table_name SET column_name = value
WHERE condition;

a)

The command is used to insert new records into
the table 'table_name' where the condition is met.

b)

The command is used to update records in the
table 'table_name' where the condition is met.

c)

The command is used to delete records from the
table 'table_name' where the condition is met.

d)

The command is used to retrieve records from the
table 'table_name' where the condition is met.

28.

The ____ clause is used to list the attributes desired in the result of a query.

a)

Where

b)

Select

c)

From

d)

Distinct

29.

What is the primary goal of using indexes in a database?

a)

To make the database more difficult to use

b)

To randomly group data without any logical
structure

c)

To speed up data retrieval and improve query
performance

d)

To confuse the database administrators

30.

What is the purpose of a foreign key in a relational database?

a)

A foreign key is used to uniquely identify a record
in a table.

b)

A foreign key is used to establish a link between
two tables.

c)

A foreign key is used to store duplicate records in a
table.

d)

A foreign key is not necessary in a relational
database.

31.

How does organizing supertypes and subtypes work
in the context of a relational database system?

a)

By creating separate tables for each subtype

b)

By using a technique called encapsulation

c)

By ignoring the concept of supertypes and
subtypes

d)

In a relational database system, organizing
supertypes and subtypes involves using a
technique called inheritance.

32.

An attribute in a relation is a foreign key if the ------ key from one relation is used as an attribute in that relation.

a)

Candidate

b)

Primary

c)

Super

d)

Sub

33.

What is the purpose of a foreign key in a relational database?

a)

To uniquely identify each record in a table

b)

To establish a link between two tables by
referencing the primary key of another table

c)

To define the structure of the database

d)

To perform complex calculations on the data

34.

Consider a Grocery Store Sales System. Is the trend in sales considered Data or Information?

a)

Graph

b)

Information

c)

Customer

d)

Data

35.

Which of the following employee_id will
be displayed for the given query?
SELECT * FROM employee WHERE
employee_id>1009;

a)

1009, 1001, 1018

b)

1009, 1018

c)

1001

d)

1018

36.

To delete a database___command is used

a)

Delete database database_name

b)

Delete database_name

c)

drop database database_name

d)

drop database_name

37.

From the script,
CREATE TABLE department
(dept_name VARCHAR (20),
building VARCHAR (15),
budget NUMBER,
PRIMARY KEY (dept_name));
CREATE TABLE course
(course_id VARCHAR (7),
title VARCHAR (50),
dept_name VARCHAR (20),
credits NUMERIC (2,0),
PRIMARY KEY (course_id),
FOREIGN KEY (dept_name)
department);
CREATE TABLE instructor
(ID VARCHAR (5),
name VARCHAR (20) NOT NULL,
dept_name VARCHAR (20),
salary NUMERIC (8,2),
FOREIGN KEY (dept_name)
CREATE TABLE SECTION
(course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
building VARCHAR (15),
department);
room_number VARCHAR (7),
time_slot id VARCHAR (4),

PRIMARY KEY (Course id sec id semster YEAR)

FOREIGN KEY (________)
CREATE TABLE teaches
(ID VARCHAR (5),
course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
PRIMARY KEY (ID, course_id, sec_id, semester, YEAR),
FOREIGN KEY (course_id, sec_id, semester, YEAR)
REFERENCES SECTION,
FOREIGN KEY (ID) ____
instructor);
In the course relation, the title field should throw an
error in case of any missing title. The command to be
added in title is

a)

Unique

b)

Not null

c)

0

d)

Null

38.

What is the main purpose of the WHERE clause in SQL?

a)

To filter rows based on specified conditions

b)

To sort the result set in ascending order

c)

To perform mathematical operations on the result
set

d)

To join multiple tables together

39.

In MySQL, which function is used to find the highest value in a column?

a)

MINO

b)

AVG()

c)

COUNT()

d)

MAX()

40.

What does the SQL statement "SELECT DISTINCT" do?

a)

The SQL statement 'SELECT DISTINCT' retrieves
values from multiple columns in a table.

b)

The SQL statement 'SELECT DISTINCT' retrieves
values that are not unique from a specified column
in a table.

c)

The SQL statement 'SELECT DISTINCT' retrieves all
values from a specified column in a table.

d)

The SQL statement 'SELECT DISTINCT' retrieves
unique values from a specified column in a table.

41.

What is the fundamental characteristic of data?

a)

Subjectivity

b)

Context-dependency

c)

Organization

d)

Rawness

42.

What is the primary purpose of a primary key in a relational database?

a)

To establish a link between two tables

b)

To uniquely identify a record in a table

c)

To store a unique identifier for a record

d)

To perform mathematical operations on data

43.

Which of the following information does an SQL DDL not specify?

a)

Indexes for the tables

b)

Actual data in the database

c)

Constraints on the data

d)

Data types for each column

44.

What is the primary purpose of denormalizing a database?

a)

To make the database more difficult to use

b)

To randomly group data without any logical
structure

c)

To create a logical structure that accurately
represents real-world entities and their
relationships.

d)

To confuse the database administrators

45.

The schema for the relationship set linking a weak entity set to its corresponding strong entity set is redundant.

a)

True

b)

False

c)

Partially true

d)

Not applicable

46.

Which is a join condition contains an equality operator

a)

GROUP BY clause

b)

ORDER BY clause

c)

Equijoins

d)

Cartesian

47.

An entity in A is associated with at most one entity in B. An entity in B, however, can be associated with any number (zero or more) of entities in A.

a)

One-to-many

b)

One-to-one

c)

Many-to-many

d)

Many-to-one

48.

An attribute is a ........... in a relation.

a)

Row

b)

Column

c)

Value

d)

Tuple

49.

A... ... ... on an attribute of a relation is a data structure
that allows the database system to find those tuples in
the relation that have a specified value for that
attribute efficiently, without scanning through all the
tuples of the relation.

a)

Index

b)

Reference

c)

Assertion

d)

Timestamp

50.

Observe the following query and choose the correct
option.
select name, ID
from student natural join department natural join
section

a)

The query is correct

b)

The query is syntactically wrong because more
than one relations are included in the natural join
operation

c)

The query is syntactically wrong because there are
more than one attributes in the select clause

d)

The query is syntactically wrong because there is
no where clause

51.

Which of the following is a suitable attribute?

a)

Staff

b)

StaffName

c)

Blair Drive

d)

P101

52.

What is the fundamental characteristic of data?

a)

Subjectivity

b)

Context-dependency

c)

Organization

d)

Meaningfulness

53.

What is the first step in conceptual database design methodology?

a)

Test the database for errors

b)

Gather and analyze the requirements of the
system

c)

Implement the database system

d)

Create the physical design of the database

54.

Why the following statement is erroneous?
SELECT dept_name, ID, avg (salary)
FROM instructor
GROUP BY dept_name;

a)

Dept ID should not be used in group by clause

b)

Group by clause is not valid in this query

c)

Avg(salary) should not be selected

d)

None

55.

Choose the correct command to delete an attribute A from a relation R

a)

DELETE FROM R WHERE A = value;

b)

ALTER TABLE R DROP COLUMN A;

c)

UPDATE R SET A = NULL;

d)

DROP A FROM R;

56.

Department (dept name, building, budget) and
Employee (employee_id, name, dept name, salary)
Here the dept_name attribute appears in both the
relations. Here using common attributes in relation
schema is one way of relating. relations.

a)

Attributes of common

b)

Tuple of common

c)

Tuple of distinct

d)

Attributes of distinct

57.

Which of the following keywords is used beside the
select clause to explicitly specify that duplicates are
not removed?

a)

ALL

b)

NOT UNIQUE

c)

NOTNULL

d)

INCLUDE

58.

What does the following query do?

UPDATE student
SET marks = marks*1.10;

a)

It decreases the marks of all the students by 90%

b)

It increases the marks of all the students by 10%

c)

It is syntactically wrong

d)

It increases the marks of all the students by 110%

59.

Which of the following information does the database
system catalog store?

a)

Number of blocks

b)

Size of a tuple of a relation

c)

Number of tuples

d)

All of the mentioned

60.

SELECT * FROM customer WHERE age>25 AND
gender='Male';
Which of the following fields are displayed as output?

a)

Age, gender

b)

Customer

c)

Age

d)

All the fields of the customer relation

61.

Which MySQL statement is used to add a new column
to an existing table?

a)

INSERT COLUMN

b)

UPDATE TABLE

c)

ALTER TABLE

d)

MODIFY TABLE

62.

How does a relationship differ from an attribute in a
conceptual data model?

a)

A relationship and an attribute are the same thing
in a conceptual data model.

b)

A relationship represents the properties or
characteristics of an entity, while an attribute
represents the associations between different
entities or tables.

c)

A relationship is used to represent the properties of
an attribute, while an attribute represents a real-
world object or concept.

d)

A relationship is a type of attribute, while an
attribute is a type of relationship.

63.

"Order By" clause is used to sort the result set of a
query based on specified columns.

a)

True

b)

False

c)

Partially True

d)

Partially False

64.

Select the incorrect statement from the following.
Normalization is necessary because it ...

a)

Reduces data redundancy

b)

Prevent data inconsistencies

c)

Increases data anomalies

d)

Increases data integrity

65.

Interpret the relationship from Fight Schedule to Fighter shown in the
conceptual data model

a)

A Fight Schedule MAY be scheduled for ONE and
only ONE Fighter

b)

A Fight Schedule MUST be scheduled for ONE and
only ONE Fighter

c)

A Fight Schedule MUST be scheduled for ONE or
MORE Fighters

d)

A Fight Schedule MAY be scheduled for ONE or
MORE Fighters

66.

To replace the relation section with some other
relation the initial step to be carried out is

a)

Delete section;

b)

Drop section;

c)

Delete from section;

d)

Replace section new_table;

67.

In the given query which of the keyword has to be
inserted?
INSERTINTO employee _____ (1002, Joey, 2000);

a)

Table

b)

Values

c)

Relation

d)

Field

68.

The where clause is a predicate involving attributes of
the relation in the ......... clause.

a)

select

b)

from

c)

with

d)

none of the mentioned

69.

create table apartment (ownerID varchar (5),
ownername varchar(25), floor numeric(4,0), primary
key (ownerID));
Choose the correct option regarding the above
statement.

a)

The statement is syntactically wrong

b)

It creates a relation with three attributes ownerID,
ownername, floor in which floor cannot be null

c)

It creates a relation with three attributes ownerID,
ownername, floor in which ownerID cannot be null

d)

It creates a relation with three attributes ownerID,
ownername, floor in which ownername must
consist of at least 25 characters

70.

Which of the following is the correct output for the
given query?
(SELECT databaseid
FROM RDBMS
WHERE SECTION = 'c')
EXCEPT
(SELECT databaseid
FROM RDBMS
WHERE id < 10);

a)

All the values of the databaseid for which section is
c and id > 10

b)

All the values of the databaseid for which section
not c and id > 10

c)

All the values of the databaseid for which section is
c and id < 10

d)

All the values of the databaseid for which section
not c and id < 10

71.

What is the primary purpose of denormalizing a database?

a)

To make the database more difficult to use

b)

To randomly group data without any logical
structure

c)

To create a logical structure that accurately
represents real-world entities and their
relationships.

d)

To confuse the database administrators

72.

If RDBMS1, RDBMS2, RDBMS3 are attributes in a
relation and S is another relation, which of the
following is an incorrect specification of an integrity
constraint?

a)

foreign key(RDBMS1, RDBMS2) references S

b)

foreign key(RDBMS1, RDBMS2)

c)

primary key(RDBMS1, RDBMS2, RDBMS3)

d)

primary key(RDBMS1)

73.

The function that an entity plays in a relationship is called that entity's..........

a)

Participation

b)

Position

c)

Role

d)

Instance

74.

_____ joins are SQL server default

a)

Outer

b)

Inner

c)

Equi

d)

None of the Mentioned

75.

If a1, a2, a3 are attributes in a relation and S is another
relation, which of the following is an incorrect
specification of an integrity constraint?

a)

primary key(a1, a2, a3)

b)

primary key(a1)

c)

foreign key(a1, a2) references S

d)

foreign key(a1, a2)

76.

select distinct dept_name from institute;
What does the above query do?

a)

It retrieves the total number of departments in the
'institute' table.

b)

It retrieves a list of unique employee names from
the 'institute' table.

c)

It retrieves a list of unique department names from
the 'institute' table.

d)

It retrieves all department names from the
'institute' table.

77.

Which command is used to create a new relation in SQL

a)

CREATE TABLE

b)

DELETE FROM

c)

UPDATE

d)

INSERT INTO

78.

Relational Algebra is a ... ... ... query language that
takes two relations as input and produces another
relation as an output of the query.

a)

Relational

b)

Structural

c)

Procedural

d)

Fundamental

79.

Phil is the database administrator for a Property
management company and creates a view named
PROPERTY_DISPLAY, which is based on the PROPERTY
table. Phil wants to make this view available for
querying to Mary. Which of the following actions
should Phil perform?

a)

No action required. Because, by default, all
database users can automatically access views.

b)

Phil must grant to Mary the SELECT privilege on
both the PROPERTY table and PROPERTY_DISPLAY
view.

c)

Phil should assign the SELECT privilege to Mary for
the PROPERTY_DISPLAY view.

d)

Phil should IT department to grant SELECT privilege
to Mary for the PROPERTY table.

80.

From the script,
CREATE TABLE department
(dept_name VARCHAR (20),
building VARCHAR (15),
budget NUMBER,
PRIMARY KEY (dept_name));
CREATE TABLE course
(course_id VARCHAR (7),
title VARCHAR (50),
dept_name VARCHAR (20),
credits NUMERIC (2,0),
PRIMARY KEY (course_id),
FOREIGN KEY (dept_name)
department);
CREATE TABLE instructor
(ID VARCHAR (5),
name VARCHAR (20) NOT NULL,
dept_name VARCHAR (20),
salary NUMERIC (8,2),
FOREIGN KEY (dept_name)
CREATE TABLE SECTION
(course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
department);
YEAR NUMERIC (4,0),
building VARCHAR (15),
room_number VARCHAR (7),
time_slot id VARCHAR (4),
PRIMARY KEY (Course id sec id semster YEAR)

FOREIGN KEY (_______) ___ course);
CREATE TABLE teaches
(ID VARCHAR (5),
course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
PRIMARY KEY (ID, course_id, sec_id, semester, YEAR),
FOREIGN KEY (course_id, sec_id, semester, YEAR)
REFERENCES SECTION,
FOREIGN KEY (ID) ________ instructor);
The department relation has an entry budget, and the
type must be replaced by

a)

Varchar (20)

b)

Varchar2 (20)

c)

Numeric (12,2)

d)

Numeric

81.

What is the fundamental characteristic of information in the context of data management?

a)

Subjectivity

b)

Context-dependency

c)

Organization

d)

Meaningfulness

82.

In a relational database system, how
would you organize the Clothing, Shirt,
and Shoe supertypes and subtypes?

a)

Combine Shirt and Shoe details in a single table
due to their similar characteristics.

b)

Create separate tables for Shirt and Shoe subtypes
due to their distinct relationships and differing
attributes.

c)

Develop one table for all Clothing, Shirt, and Shoe
details to streamline database management.

d)

Employ a single table for Clothing and individual
tables for Shirt and Shoe based on their materials.

83.

What is the fundamental characteristic of information?

a)

Subjectivity

b)

Context-dependency

c)

Organization

d)

Meaningfulness

84.

SELECT item name, color, clothes SIZE, SUM(quantity)
FROM sales
GROUP BY rollup(item name, color, clothes SIZE);
How many grouping is possible in this rollup?

a)

4

b)

10

c)

8

d)

2

85.

From the script,
CREATE TABLE department
(dept_name VARCHAR (20),
building VARCHAR (15),
budget NUMBER,
PRIMARY KEY (dept_name));
CREATE TABLE course
(course_id VARCHAR (7),
title VARCHAR (50),
dept_name VARCHAR (20),
credits NUMERIC (2,0),
PRIMARY KEY (course_id),
FOREIGN KEY (dept_name)
department);
CREATE TABLE instructor
(ID VARCHAR (5),
name VARCHAR (20) NOT NULL,
dept_name VARCHAR (20),
salary NUMERIC (8,2),
FOREIGN KEY (dept_name)
CREATE TABLE SECTION
(course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
building VARCHAR (15),
department);
room_number VARCHAR (7),
time_slot id VARCHAR (4),

PRIMARY KEY (Course id sec id semster YEAR)

FOREIGN KEY (________) _____course);
CREATE TABLE teaches
(ID VARCHAR (5),
course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
0/1 pts Score: 0X
course);
PRIMARY KEY (ID, course_id, sec_id, semester, YEAR),
FOREIGN KEY (course_id, sec_id, semester, YEAR)
REFERENCES SECTION,
FOREIGN KEY (ID) ________ instructor);
The following entry is given in to the instructor relation
(100202,Drake, Biology,30000)
Identify the output of the query given

a)

Row(s) inserted

b)

Error in ID of insert

c)

Error in Name of insert

d)

Error in Salary of the insert

86.

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

87.

An ___ is a set of entities of the same type that share the same properties, or attributes.

a)

Entity set

b)

Attribute set

c)

Relation set

d)

Entity mode

88.

Which of the following is the subset of SQL commands
used to manipulate database system structures
including tables?

a)

Data Described Language

b)

Data Retrieval Language

c)

Data Manipulation Language

d)

Data Definition Language

89.

Which keyword is used to rename a relation in a
query?

a)

RENAME

b)

CHANGE

c)

AS

d)

MODIFY

90.

Here which of the following displays the unique values
of the column?

SELECT___dept_name
FROM instructor;

a)

From

b)

Distinct

c)

Name

d)

All

91.

What is the fundamental characteristic of data?

a)

Subjectivity

b)

Context-dependency

c)

Organization

d)

Meaningfulness

92.

From the script, which is the main relation used in the
university database which is referenced by all other
relation of the university?
CREATE TABLE department
(dept_name VARCHAR (20),
building VARCHAR (15),
budget NUMBER,
PRIMARY KEY (dept_name));
CREATE TABLE course
(course_id VARCHAR (7),
title VARCHAR (50),
dept_name VARCHAR (20),
credits NUMERIC (2,0),
PRIMARY KEY (course_id),
FOREIGN KEY (dept_name)
department);
CREATE TABLE instructor
(ID VARCHAR (5),
name VARCHAR (20) NOT NULL,
dept_name VARCHAR (20),
salary NUMERIC (8,2),
FOREIGN KEY (dept_name)
CREATE TABLE SECTION
(course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
building VARCHAR (15),

room_number VARCHAR (7),
time_slot id VARCHAR (4),
PRIMARY KEY (course_id, sec_id, semester, YEAR),
FOREIGN KEY (_______)
CREATE TABLE teaches
(ID VARCHAR (5),
course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
course);
PRIMARY KEY (ID, course_id, sec_id, semester, YEAR),
FOREIGN KEY (course_id, sec_id, semester, YEAR)
REFERENCES SECTION,
FOREIGN KEY (ID)____instructor);

a)

Teaches

b)

Course

c)

Department

d)

Section

93.

What is the primary function of a primary key in a
relational database?

a)

To ensure that each row in a table is unique

b)

To store large amounts of data efficiently

c)

To provide a way to link multiple tables together

d)

To perform complex calculations on the data

94.

When designing a database, what is the significance
of normalizing the data?

a)

To increase data redundancy

b)

To complicate the database structure

c)

To prevent data inconsistencies

d)

To decrease data integrity

95.

The query given below will not give an error. Which
one of the following has to be replaced to get the
desired output?
SELECT ID, name, dept name, salary * 1.1
WHERE instructor;

a)

Salary*1.1

b)

ID

c)

Where

d)

Instructor

96.

Which of the following statements contains an error?

a)

Select * from emp where empid = 10003;

b)

Select empid from emp where empid = 10006;

c)

Select empid from emp;

d)

Select empid where empid = 1009 and lastname =
'GELLER';

97.

What is the purpose of the GROUP BY clause in SQL?

a)

To randomly group data without any logical
structure.

b)

To create a logical structure that accurately
represents real-world entities and their
relationships.

c)

To make the database more difficult to use.

d)

To organize the result set into groups based on one
or more columns.

98.

What is a foreign key?

a)

A foreign key is a type of key used in cryptography
to encrypt data

b)

A foreign key is a type of currency used in other
countries

c)

A foreign key is a column or a set of columns in a
table that references the primary key of another
table, establishing a link between the two tables.

d)

A foreign key is a key used to unlock doors in a
foreign country

99.

What is the function of the following command?
Delete from r where P;

a)

The function of the command is to update records
in the table 'r' where the condition 'P' is met.

b)

The function of the command is to insert new
records into the table 'r' where the condition 'P' is
met.

c)

The function of the command is to retrieve records
from the table 'r' where the condition 'P' is met.

d)

The function of the command is to delete records
from the table 'r' where the condition 'P' is met.

100.

The descriptive property possessed by each entity set
is ... .... ....

a)

Entity

b)

Attribute

c)

Relation

d)

Model

101.

What does the notnull integrity constraint do?

a)

It restricts the length of the column

b)

It enforces a unique value in a column

c)

It ensures that a column cannot have a null value.

d)

It allows a column to have a null value

102.

Which of the following commands do we use to delete
all the tuples from a relation (R)?

a)

DELETE FROM R;

b)

ERASE FROM R;

c)

DROP FROM R;

d)

REMOVE FROM R;

103.

Which of the following syntax of the basic query is
correct?

a)

select <relation> from <attribute>

b)

select <attribute> from <relation>

c)

select <tuple> from <relation>

d)

select <tuple> from <attribute>

104.

What is the role of SQL in relational databases?

a)

SQL is used to create and manipulate tables in a
relational database.

b)

SQL is used to design the user interface of a
relational database.

c)

SQL is not relevant to relational databases.

d)

SQL is used to perform mathematical calculations
in a relational database.

105.

The primary key must be

a)

Unique

b)

Not null

c)

Both Unique and Not null

d)

Either Unique or Not null

106.

What is the purpose of a database view in SQL?

a)

To store data permanently

b)

To provide a virtual table based on the result-set of
an SQL statement

c)

To execute complex queries

d)

To define primary keys

107.

What is the primary purpose of organizing supertypes
and subtypes in a relational database system?

a)

To make the database more difficult to use

b)

To randomly group data without any logical

c)

To create a logical structure that accurately
represents real-world entities and their
relationships.

d)

To confuse the database administrators

108.

What does the natural join operation do?

a)

The natural join operation removes duplicate rows
from two tables

b)

The natural join operation combines columns from
two tables based on a common value

c)

The natural join operation multiplies the rows of
two tables together

d)

The natural join operation combines rows from two
tables based on a common column between them.

109.

A ....... indicates an absent value that may exist but
be unknown or that may not exist at all.

a)

Empty tuple

b)

New value

c)

Null value

d)

Old value

110.

Which of the following is the correct option for the
given query?
SELECT DISTINCT name
FROM RDBMS
WHERE ID IS NOT NULL;

a)

The query gives all the possible RDBMS names
where a finite value exists for ID

b)

The query gives the RDBMS names where a finite
value exists for ID and it excludes identical names

c)

The query gives the names of the RDBMS that
have a null ID and it also excludes identical names

d)

The query is syntactically wrong

111.

Which MySQL clause is used to filter the results of a
SELECT statement?

a)

FILTER

b)

WHERE

c)

HAVING

d)

LIMIT

112.

Consider attributes ID, CITY and NAME. Which one of
these can be considered as a super key?

a)

NAME

b)

ID

c)

CITY

d)

CITY, ID

113.

What is the primary purpose of normalizing a
database?

a)

To make the database more difficult to use

b)

To randomly group data without any logical
structure

c)

To create a logical structure that accurately
represents real-world entities and their
relationships.

d)

To confuse the database administrators

114.

The ..... clause allows us to select only those rows in
the result relation of the ......... clause that satisfy a
specified predicate.

a)

Where, from

b)

From, select

c)

Select, from

d)

From, where

115.

What is the purpose of the HAVING clause in SQL?

a)

To filter rows based on a specified condition

b)

To sort the result set in ascending order

c)

To group rows that have the same values into summary rows

d)

To filter groups based on a specified condition

116.

From the script,
CREATE TABLE department
(dept_name VARCHAR (20),
building VARCHAR (15),
budget NUMBER,
PRIMARY KEY (dept_name));
CREATE TABLE course
(course_id VARCHAR (7),
title VARCHAR (50),
dept_name VARCHAR (20),
credits NUMERIC (2,0),
PRIMARY KEY (course_id),
FOREIGN KEY (dept_name)
department);
CREATE TABLE instructor
(ID VARCHAR (5),
name VARCHAR (20) NOT NULL,
dept_name VARCHAR (20),
salary NUMERIC (8,2),
FOREIGN KEY (dept_name)
CREATE TABLE SECTION
(course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
building VARCHAR (15),
room_number VARCHAR (7),

time_slot id VARCHAR (4),

PRIMARY KEY (course_id, sec_id, semester, YEAR),
FOREIGN KEY (_______)
___ course);
CREATE TABLE teaches
(ID VARCHAR (5),
course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
PRIMARY KEY (ID, course_id, sec_id, semester, YEAR),
FOREIGN KEY (course_id, sec_id, semester, YEAR)
REFERENCES SECTION,
FOREIGN KEY (ID) ________ instructor);
In the above DDL command the foreign key entries
obtained by using the keyword

a)

References

b)

Key reference

c)

Relating

d)

None of the mentioned

117.

What is the purpose of the GROUP BY clause in SQL?

a)

To filter rows based on a specified condition

b)

To sort the result set in ascending order

c)

To group rows that have the same values into
summary rows

d)

To perform a join operation on multiple tables

118.

________ deletes a data item from a database.

a)

Insert(RDBMS)

b)

Drop(RDBMS)

c)

Delete(RDBMS)

d)

None of the mentioned

119.

How does a super key differ from a candidate key in
the context of a relational database system?

a)

A super key uniquely identifies a tuple within a
relation, while a candidate key is a minimal super
key for a relation.

b)

A super key is a minimal super key for a relation,
while a candidate key uniquely identifies a tuple
within a relation.

c)

A super key is a combination of attributes that
uniquely identifies a tuple within a relation, while a
candidate key is a single attribute that uniquely
identifies a tuple within a relation.

d)

A super key and a candidate key are the same
thing in the context of a relational database
system.

120.

What is the definition of an attribute in the context of
a conceptual data model?

a)

A type of function in programming languages

b)

A specific value in a database table

c)

An attribute in the context of a conceptual data
model refers to a characteristic or property of an
entity.

d)

A method for organizing data in a spreadsheet

121.

Which of the following commands do we use to delete
a relation (R) from a database?

a)

DROP TABLE

b)

ERASE TABLE

c)

DELETE TABLE

d)

REMOVE TABLE

122.

Choose the correct statement regarding superkeys

a)

A superkey is a set of attributes that is always a
single attribute.

b)

A superkey is a set of attributes that can uniquely
identify a tuple within a relation.

c)

A superkey is a set of attributes that is not related
to the primary key of a relation.

d)

A superkey is a set of attributes that cannot
uniquely identify a tuple within a relation.

123.

What is the purpose of the GROUP BY clause in SQL?

SELECT dept_name, avg(salary) FROM instructor
GROUP BY dept_name;

a)

To group the result set by the specified column or
columns

b)

To order the result set by the specified column or
columns

c)

To filter the result set based on the specified
condition

d)

To perform a join operation on the result set

124.

In the context of a conceptual data model, which of
the following is true about relationships?

a)

Relationships are only used in relational databases

b)

Relationships represent the associations between
different entities or tables.

c)

Relationships have no impact on the data model

d)

Relationships represent the physical location of the data

125.

Which of the following is a fundamental operation in relational algebra?

a)

Selection

b)

Union

c)

Multiplication

d)

Division

126.

Course(course_id, sec_id, semester)
Here the course_id, sec_id and semester are.........
and course is a..........

a)

Relations, Attribute

b)

Attributes, Relation

c)

Tuple, Relation

d)

Tuple, Attributes

127.

The term ... is used to refer to a row.

a)

Attribute

b)

Tuple

c)

Field

d)

Instance

128.

What is the primary purpose of using foreign keys in a
relational database system?

a)

To make the database more difficult to use

b)

To create a logical structure that accurately
represents real-world entities and their
relationships.

c)

To randomly group data without any logical
structure

d)

To confuse the database administrators

129.

Entity is a ........

a)

Object of relation

b)

Present working model

c)

Thing in real world

d)

Model of relation

130.

Consider a Computer Sales Shop. Is the price of a
computer considered Data or Information?

a)

The price of a computer is considered data.

b)

The price of a computer is considered wisdom.

c)

The price of a computer is considered knowledge.

d)

The price of a computer is considered information.

131.

How does information differ from data?

a)

Data is qualitative, while information is quantitative

b)

Data is raw facts and figures, while information is
processed data that has meaning and context.

c)

Information is static, while data is dynamic

d)

Information is unprocessed, while data is processed

132.

Which of the following is true about the
Clothing, Shirt, and Shoe entities?

a)

Clothing, Shirt, and Shoe are all subtypes

b)

Clothing is a subtype, Shirt and Shoe are
supertypes

c)

Clothing is a supertype, Shirt and Shoe are
subtypes

d)

Shoe is a Cobbler type, Clothing is a Manufacturer
type, and Shirt is a Tailor type

133.

An entity in A is associated with at most one entity in B, and an entity in B is associated with at most one entity in A. This is called as

a)

One-to-many

b)

One-to-one

c)

Many-to-many

d)

Many-to-one

134.

What is the primary purpose of indexing in a
database?

a)

To make the database more difficult to use

b)

To randomly group data without any logical
structure

c)

To create a logical structure that accurately
represents real-world entities and their
relationships.

d)

To improve the speed of data retrieval and query
performance

135.

From the script,
CREATE TABLE department
(dept_name VARCHAR (20),
building VARCHAR (15),
budget NUMBER,
PRIMARY KEY (dept_name));
CREATE TABLE course
(course_id VARCHAR (7),
title VARCHAR (50),
dept_name VARCHAR (20),
credits NUMERIC (2,0),
PRIMARY KEY (course_id),
FOREIGN KEY (dept_name)
department);
CREATE TABLE instructor
(ID VARCHAR (5),
name VARCHAR (20) NOT NULL,
dept_name VARCHAR (20),
salary NUMERIC (8,2),
FOREIGN KEY (dept_name)____department);
CREATE TABLE SECTION
(course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
building VARCHAR (15),

room_number VARCHAR (7),
time_slot id VARCHAR (4),

PRIMARY KEY (course_id, sec_id, semester, YEAR),
FOREIGN KEY (_______) ___ course);
CREATE TABLE teaches
(ID VARCHAR (5),
course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
PRIMARY KEY (ID, course_id, sec_id, semester, YEAR),
FOREIGN KEY (course_id, sec_id, semester, YEAR)
REFERENCES SECTION,
FOREIGN KEY (ID) ________ instructor);
Which of the following can be used as a primary key
entry of the instructor relation.

a)

DEPT_NAME

b)

NAME

c)

ID

d)

All of the mentioned

136.

What is the primary key in a relational database?

a)

A primary key is a unique identifier for a record in a
table.

b)

A primary key is a foreign key in a table.

c)

A primary key is a non-unique identifier for a
record in a table.

d)

A primary key is not required in a relational
database.

137.

What is the purpose of a foreign key in a relational
database?

a)

To uniquely identify a record in a table

b)

To establish a link between two tables

c)

To store a unique identifier for a record

d)

To perform mathematical operations on data

138.

What is the purpose of the GROUP BY clause in SQL?

a)

To randomly group data without any logical
structure.

b)

To create a logical structure that accurately
represents real-world entities and their
relationships.

c)

To make the database more difficult to use.
Your Answer

d)

To organize the result set into groups based on one
or more columns.

139.

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

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);

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

140.

_____ is a set of one or more attributes taken
collectively to uniquely identify a record.

a)

Secondary key

b)

Foreign key

c)

Super key

d)

Primary key

141.

In MySQL, what is the purpose of the UNION operator
in a SELECT statement?

a)

The purpose of the UNION operator is to delete
duplicate rows from the result set

b)

The purpose of the UNION operator is to perform a
cross join between the result sets

c)

The purpose of the UNION operator in a SELECT
statement in MySQL is to combine the result sets of
two or more SELECT statements into a single result
set.

d)

The purpose of the UNION operator is to sort the
result set in ascending order

142.

From the script,
CREATE TABLE department
(dept_name VARCHAR (20),
building VARCHAR (15),
budget NUMBER,
PRIMARY KEY (dept_name));
CREATE TABLE course
(course_id VARCHAR (7),
title VARCHAR (50),
dept_name VARCHAR (20),
credits NUMERIC (2,0),
PRIMARY KEY (course_id),
FOREIGN KEY (dept_name)
department);
CREATE TABLE instructor
(ID VARCHAR (5),
name VARCHAR (20) NOT NULL,
dept_name VARCHAR (20),
salary NUMERIC (8,2),
FOREIGN KEY (dept_name)
CREATE TABLE SECTION
(course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
building VARCHAR (15),
department);
room_number VARCHAR (7),
time_slot id VARCHAR (4),

PRIMARY KEY (course_id, sec_id, semester, YEAR),
FOREIGN KEY (_______) ____ course);
CREATE TABLE teaches
(ID VARCHAR (5),
course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
PRIMARY KEY (ID, course_id, sec_id, semester, YEAR),
FOREIGN KEY (course_id, sec_id, semester, YEAR)
REFERENCES SECTION,
FOREIGN KEY (ID)
instructor);
Identify the error in the section relation

a)

No error

b)

Year numeric (4,0)

c)

Building varchar (15)

d)

Sec_id varchar (8)

143.

From the script,
CREATE TABLE department
(dept_name VARCHAR (20),
building VARCHAR (15),
budget NUMBER,
PRIMARY KEY (dept_name));
CREATE TABLE course
(course_id VARCHAR (7),
title VARCHAR (50),
dept_name VARCHAR (20),
credits NUMERIC (2,0),
PRIMARY KEY (course_id),
FOREIGN KEY (dept_name)
department);
CREATE TABLE instructor
(ID VARCHAR (5),
name VARCHAR (20) NOT NULL,
dept_name VARCHAR (20),
salary NUMERIC (8,2),
FOREIGN KEY (dept_name)
CREATE TABLE SECTION
(course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
building VARCHAR (15),
department);
room_number VARCHAR (7),
time_slot id VARCHAR (4),

PRIMARY KEY (course_id, sec_id, semester, YEAR),
FOREIGN KEY (_______)
___ course);
CREATE TABLE teaches
(ID VARCHAR (5),
X
course_id VARCHAR (8),
sec_id VARCHAR (8),
semester VARCHAR (6),
YEAR NUMERIC (4,0),
PRIMARY KEY (ID, course_id, sec_id, semester, YEAR),
FOREIGN KEY (course_id, sec_id, semester, YEAR)
REFERENCES SECTION,
FOREIGN KEY (ID) ____. instructor);
In the section relation which of the following is used as
a foreign key?

a)

Course_id

b)

Course_id,sec_id

c)

Room_number

d)

Course_id,sec_id,room_number

144.

Drop Table cannot be used to drop a table referenced by a _______ constraint.

a)

Local Key

b)

Primary Key

c)

Composite Key

d)

Foreign Key

145.

What does the following query do?
select name, ID, branch
from student, department
where student.branch = department.branch;

a)

It gives all values of name, ID, branch from both
the relations only if all those attributes are present
in both

b)

It gives all values of name, ID, branch from their
respective relations

c)

It gives the values of name, ID, branch from their
respective relations where the values in the branch
attribute are same

d)

It gives the values of name, ID, branch from their
respective relations where all the values are
matching with each other

146.

Which of the following statements contains an error?

a)

Select * from emp where empid = 10003;

b)

Select empid from emp where empid = 10006;

c)

Select empid from emp;

d)

Select empid where empid = 1009 and lastname =
'GELLER';

147.

What does the natural join operation do?

a)

The natural join operation removes duplicate rows
from two tables

b)

The natural join operation combines columns from
two tables based on a common value

c)

The natural join operation multiplies the rows of
two tables together

d)

The natural join operation combines rows from two
tables based on a common column between them.

148.

How does the GROUP BY clause work in the context of
SQL queries?

a)

It is used to sort the result set in ascending order

b)

It is used to filter the result set based on a specified
condition

c)

It is used to group the result set based on one or
more columns

d)

It is used to perform mathematical operations on
the result set

149.

This Query can be replaced by which one of the
following?
SELECT name, course_id
FROM instructor, teaches
WHERE instructor_ID= teaches_ID;

a)

Select name,course_id from teaches,instructor
where instructor_id=course_id;

b)

Select name, course_id from instructor natural join
teaches;

c)

Select name, course_id from instructor;

d)

Select course_id from instructor join teaches;

150.

Which of the following statement is incorrect about
SQL Views?

a)

Views are database objects.

b)

Views Are a logical representation of existing tables
or of another view.

c)

Views can contain data of their own.

d)

Views are not "real" tables.

151.

What is the syntax to load data into the database?
(Consider D as the database and a, b, c as data)

a)

INSERT INTO D (column1, column2, column3)
VALUES (a, b, c);

b)

CREATE TABLE D (a, b, c);

c)

UPDATE D SET a=b, c=d;

d)

ADD D (a, b, c) TO DATABASE;

152.

Which of the following cannot be used to modify the data in a database?

a)

delete

b)

update

c)

drop

d)

insert

153.

What is the role of a foreign key in a relational database?

a)

To uniquely identify each record in a table

b)

To establish a link between two tables

c)

To perform mathematical operations on numeric
data

d)

To define the primary key of a table