WorksheetsPre-Final Exam in OOP
Total questions: 10
Worksheet time: 5mins
What does the ResultSet.next() method do?
Advances the cursor to the next row in the ResultSet.
Retrieves the current row data without moving the cursor.
Resets the cursor to the first row in the ResultSet.
Closes the ResultSet and releases resources.
The Connection object in Java is responsible for making a database connection. True or False?
The Connection object is used for executing SQL queries.
False
The Connection object is a part of the Java GUI framework.
The Connection object manages user sessions.
True
The UPDATE SQL command can change multiple fields at once. True or False?
The UPDATE command can only change one field at a time.
UPDATE cannot modify existing records.
False
True
Which method is used to execute an SQL query that modifies the database?
performModification()
executeUpdate()
executeQuery()
runUpdate()
What is the function of the DELETE SQL statement?
To update existing rows in a table.
To create a new table in the database.
To retrieve data from a table.
To remove rows from a table in a database.
What does CRUD stand for?
Create, Read, Update, Destroy
Create, Retrieve, Update, Delete
Create, Read, Upload, Delete
Create, Read, Update, Delete
Which of the following correctly retrieves a book record with ID 1?
DELETE /books/1
PUT /books/1
POST /books/1
GET /books/1
What SQL command is used to add a new record?
CREATE ENTRY
UPDATE TABLE
ADD RECORD
INSERT INTO
Which SQL statement is used to retrieve data from a database?
SELECT
DELETE
INSERT
UPDATE
What is the purpose of the WHERE clause in SQL?
To create new database tables.
To sort records in ascending order.
To filter records based on specified conditions.
To join multiple tables together.
