0% found this document useful (0 votes)
10 views12 pages

Java MCQ Unit 5

Uploaded by

Dinesh S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views12 pages

Java MCQ Unit 5

Uploaded by

Dinesh S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 12

S .

NO QUESTION
What does DBMS stand for?
1
Which of the following is a type of DBMS?
2
What is a relational database?
3
Which SQL command is used to retrieve data?
4
What is the purpose of the INSERT statement in
5 SQL?
Which SQL statement is used to modify existing
6 data?
Which command is used to delete records from a
7 table?
What does SQL stand for?
8
What is a primary key in a database?
9
Which SQL keyword is used to filter records?
10
What is JDBC?
11
Which method is used to establish a connection with
12 the database in JDBC?

What does the executeQuery() method do in JDBC?


13
Which class is used to represent a SQL statement in
14 JDBC?
How do you create a statement object in JDBC?
15
What is a ResultSet in JDBC?
16
Which method is used to close a ResultSet in JDBC?
17
How do you insert data into a table using JDBC?
18
What does the term "CRUD" stand for?
19
What does the WHERE clause do in SQL?
20
Which of the following is a valid SQL SELECT
21 statement?
What is normalization in databases?
22
Which SQL command is used to remove a table?
23
How do you update data in a database using SQL?
24
Which type of join returns all records from both
25 tables?
What is the default SQL data type for string values?
26
Which keyword is used to sort the result set in SQL?
27
What is a foreign key?
28
Which JDBC driver type is the most commonly
29 used?
Which SQL function is used to count the number of
30 rows in a query?
How do you create a new table in SQL?
31
What is the purpose of the GROUP BY clause?
32
Which SQL statement is used to change the structure
33 of a table?
What is the use of the DISTINCT keyword in SQL?
34
How do you retrieve the first 5 records from a table?
35
Which of the following is true about JDBC?
36
How do you handle SQL exceptions in JDBC?
37
Which SQL function is used to get the maximum
38 value from a column?
What does the term "ACID" stand for in database
39 systems?
Which SQL statement is used to create an index?
40
Which of the following SQL commands will not
41 return any rows?
What does the LIMIT clause do in SQL?
42
Which SQL function is used to find the average
43 value of a column?
What is a composite key?
44
Which method in JDBC is used to execute an SQL
45 update?
What is the purpose of the ROLLBACK statement in
46 SQL?
What does the HAVING clause do in SQL?
47
Which SQL function is used to concatenate two
48 strings?
What is a view in SQL?
49
Which SQL command is used to change the name of
50 a column?
What is the output of SELECT COUNT(*) FROM
51 table;?
Which JDBC method is used to retrieve metadata
52 about the database?
What does the AUTO_INCREMENT attribute do in
53 MySQL?
Which SQL command is used to create a new user in
54 a database?
How do you retrieve unique values from a column
55 using SQL?
What is the purpose of the SET keyword in an
56 UPDATE statement?
Which of the following is not a SQL data type?
57
What does the JOIN clause do in SQL?
58
What is the purpose of the LIKE operator in SQL?
59
Which of the following is a valid SQL statement for
60 selecting data?
How can you increase the size of a VARCHAR
61 column?
What is the default isolation level in SQL?
62
Which of the following best describes a database
63 schema?
ANSWER OPTION 1
A Data Base Management System

D Hierarchical

A A database that uses tables

A SELECT

A To add new records

C MODIFY

B REMOVE

A Structured Query Language

A A unique identifier for a record

A WHERE

B Java Database Connection

A DriverManager.getConnection()

A Executes an SQL query

A Statement

A Connection.createStatement()

B A collection of SQL commands

A close()

B statement.executeInsert()

A Create, Read, Update, Delete

B Sorts data

A SELECT * FROM table;


A Reducing redundancy

C REMOVE TABLE

UPDATE table SET column = value


A
WHERE condition;

B INNER JOIN

A VARCHAR

A ORDER BY

A key in one table that refers to another


A
table

D Type 1

A COUNT()

A CREATE TABLE table_name;

C To sort results

A ALTER TABLE

A To return unique values

A SELECT * FROM table LIMIT 5;

A It allows Java to connect to databases

A try-catch

A MAX()

Atomicity, Consistency, Isolation,


A
Durability

A CREATE INDEX

A SELECT * FROM table WHERE 1=0;

A Limits the number of records returned

A AVG()
A A key made of two or more columns

A executeUpdate()

A To undo changes in a transaction

A Filters results after GROUP BY

A CONCAT()

A A virtual table

B RENAME COLUMN

A Total number of records

D getMetaData()

A Automatically increases a number

A CREATE USER

SELECT DISTINCT column FROM


A
table;

A To specify new values

C INT

A Combines rows from two or more tables

A To perform pattern matching

SELECT * FROM table WHERE


A
column = 'value';
ALTER TABLE table MODIFY
D
column VARCHAR(size);

B READ UNCOMMITTED

A The structure of a database


OPTION 2 OPTION 3
Database Management Software Data Management System

Relational Object-oriented

A flat-file database A database with no relationships

GET FETCH

To update existing records To delete records

CHANGE UPDATE

DELETE DROP

Simple Query Language Standard Query Language

A key that links two tables A key for searching

SELECT FILTER

Java DataBase Connectivity Java Data Connection

DriverManager.connect() Database.connect()

Updates the database Deletes records

Query Command

DriverManager.createStatement() Statement.create()

A set of results from a query A type of database

end() finish()

statement.executeUpdate() statement.executeQuery()

Create, Retrieve, Update, Delete Create, Read, Use, Delete

Filters data Groups data

SELECT table FROM *; FROM table SELECT *;


Increasing redundancy Merging tables

DELETE TABLE DROP TABLE

MODIFY table SET column = value; CHANGE table column = value;

OUTER JOIN CROSS JOIN

CHAR STRING

SORT BY GROUP BY

A key that uniquely identifies a record A key that can be duplicated

Type 2 Type 3

SUM() TOTAL()

NEW TABLE table_name; TABLE CREATE table_name;

To filter results To group records

CHANGE TABLE MODIFY TABLE

To filter results To join tables

SELECT * FROM table TOP 5; SELECT * FROM table FIRST 5;

It is a type of database It is only for MySQL

if-else switch-case

HIGH() TOP()

Atomicity, Consistency, Integrity, Accountability, Consistency, Isolation,


Durability Durability

ADD INDEX INDEX CREATE

SELECT * FROM table WHERE


SELECT * FROM table;
column IS NULL;

Limits the number of records deleted Limits the number of records updated

MEAN() AVERAGE()
A key that can be duplicated A key with no duplicates

executeInsert() executeQuery()

To save changes To commit changes

Filters results before GROUP BY Joins tables

JOIN() MERGE()

A physical table A temporary table

ALTER TABLE MODIFY COLUMN

Total number of columns Total number of tables

getDatabaseInfo() getDataInfo()

Automatically deletes a record Automatically sets a primary key

ADD USER NEW USER

SELECT UNIQUE column FROM


SELECT ONLY column FROM table;
table;

To filter records To join tables

VARCHAR STRING

Deletes rows from a table Updates multiple tables

To perform mathematical operations To join tables

SELECT table * WHERE column = FROM table SELECT * WHERE


'value'; column = 'value';
ALTER TABLE table CHANGE ALTER TABLE table ALTER
column VARCHAR(size); COLUMN column VARCHAR(size);

READ COMMITTED REPEATABLE READ

The data in a database The users of a database


OPTION 4
Database Base Management

All of the above

A graph database

READ

To retrieve records

ALTER

CLEAR

Sequential Query Language

A key that can be duplicated

HAVING

Java Database Compatibility

ConnectionManager.get()

Closes the connection

SQLStatement

Statement.new()

A connection type

disconnect()

statement.addData()

Create, Read, Update, Drop

Joins tables

SELECT table;
Splitting records

CLEAR TABLE

ALTER table column = value;

LEFT JOIN

TEXT

FILTER

A key for searching

Type 4

NUMBER()

MAKE TABLE table_name;

To join tables

UPDATE TABLE

To sort results

SELECT * FROM table FETCH 5;

It cannot handle transactions

loop

MAXIMUM()

Atomicity, Consistency, Isolation,


Dependency

NEW INDEX

SELECT * FROM table WHERE


column > 0;

None of the above

SUM()
A unique identifier

runUpdate()

To delete a table

Sorts results

COMBINE()

A type of index

CHANGE TABLE

None of the above

getDatabaseMetaData()

Automatically creates an index

INSERT USER

SELECT column FROM table GROUP


BY column;

To sort results

BOOLEAN

Sorts data

To sort results

SELECT column FROM table WHERE


* = 'value';

Both A and B

SERIALIZABLE

The transactions in a database

You might also like