wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Pre-Final Exam in OOP

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What does the ResultSet.next() method do?

a)

Advances the cursor to the next row in the ResultSet.

b)

Retrieves the current row data without moving the cursor.

c)

Resets the cursor to the first row in the ResultSet.

d)

Closes the ResultSet and releases resources.

2.

The Connection object in Java is responsible for making a database connection. True or False?

a)

The Connection object is used for executing SQL queries.

b)

False

c)

The Connection object is a part of the Java GUI framework.

d)

The Connection object manages user sessions.

e)

True

3.

The UPDATE SQL command can change multiple fields at once. True or False?

a)

The UPDATE command can only change one field at a time.

b)

UPDATE cannot modify existing records.

c)

False

d)

True

4.

Which method is used to execute an SQL query that modifies the database?

a)

performModification()

b)

executeUpdate()

c)

executeQuery()

d)

runUpdate()

5.

What is the function of the DELETE SQL statement?

a)

To update existing rows in a table.

b)

To create a new table in the database.

c)

To retrieve data from a table.

d)

To remove rows from a table in a database.

6.

What does CRUD stand for?

a)

Create, Read, Update, Destroy

b)

Create, Retrieve, Update, Delete

c)

Create, Read, Upload, Delete

d)

Create, Read, Update, Delete

7.

Which of the following correctly retrieves a book record with ID 1?

a)

DELETE /books/1

b)

PUT /books/1

c)

POST /books/1

d)

GET /books/1

8.

What SQL command is used to add a new record?

a)

CREATE ENTRY

b)

UPDATE TABLE

c)

ADD RECORD

d)

INSERT INTO

9.

Which SQL statement is used to retrieve data from a database?

a)

SELECT

b)

DELETE

c)

INSERT

d)

UPDATE

10.

What is the purpose of the WHERE clause in SQL?

a)

To create new database tables.

b)

To sort records in ascending order.

c)

To filter records based on specified conditions.

d)

To join multiple tables together.