A question bank for every class and subject

Practice questions, with answers and explanations included

794 questions available

Refine

All questions

794 results
441

Which SQL statement removes data (rows) from a table?

MCQ Easy
a. DELETE
b. DROP
c. TRUNCATE
d. REMOVE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
DELETE
Explanation: DELETE FROM <table_name> [WHERE <condition>]; removes rows from a table matching the given condition (or all rows if no condition is given).
442

Differentiate between LAN and WAN.

LONG Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: LAN (Local Area Network) is a private network spanning up to about 1 Km, typically within a building or campus, operating at 10 Mbps to 1 Gbps. WAN (Wide Area Network) spans about 1000 Km, connecting networks across a country or continent, and may be owned by multiple organizations.
443

In Java, array indices start from:

MCQ Easy
a. 1
b. 0
c. -1
d. It depends on the array size
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
0
Explanation: Array indices in Java start from 0 and go up to n-1 for an array of size n.
444

Which operator is used for pattern matching of strings in SQL?

MCQ Easy
a. IN
b. BETWEEN
c. LIKE
d. IS
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
LIKE
Explanation: The LIKE operator is used for pattern matching, using wildcards % (any number of characters) and _ (single character).
445

Differentiate between LAN and MAN.

LONG Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: LAN spans a small area (up to 1 Km), such as a building or campus, and is usually privately owned. MAN (Metropolitan Area Network) spans up to about 50 Km, covering a city, and may be owned by a single organization or shared among several, connecting multiple LANs.
446

For an array declared as double[] marks = new double[5];, what is the valid range of index values?

MCQ Easy
a. 1 to 5
b. 0 to 4
c. 0 to 5
d. 1 to 4
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
0 to 4
Explanation: For an array of size 5, valid indices range from 0 to 4 (n-1).
447

Which wildcard character in the LIKE clause matches exactly one character?

MCQ Medium
a. %
b. _
c. *
d. ?
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
_
Explanation: The underscore (_) is used to match exactly one character in a pattern with the LIKE operator.
448

Differentiate between MAN and WAN.

LONG Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: MAN spans up to about 50 Km, typically linking networks within a single city. WAN spans about 1000 Km, connecting networks across a country or continent, and is generally larger and slower than a MAN.
449

Which property of an array gives its size (number of elements)?

MCQ Easy
a. size
b. length
c. count
d. capacity
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
length
Explanation: The length property of an array gives its size, e.g., marks.length.
450

Which operator is used to fetch records where a column value lies within a specified range, inclusive of the bounds?

MCQ Easy
a. IN
b. LIKE
c. BETWEEN
d. IS
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
BETWEEN
Explanation: The BETWEEN operator fetches data within a range of values, including both the upper and lower bounds.
451

Differentiate between Internet and WWW.

LONG Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: The Internet is a global network of interconnected networks (network of networks) that enables communication and data exchange between remote nodes using protocols like TCP/IP. The World Wide Web (WWW) is a service that runs over the Internet — a repository of linked documents (web pages) accessed via HTTP, containing text, images, and hyperlinks.
452

What exception is thrown when an array is accessed using an index outside its valid range?

MCQ Medium
a. NullPointerException
b. ArrayIndexOutOfBoundsException
c. ArithmeticException
d. ClassCastException
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
ArrayIndexOutOfBoundsException
Explanation: Accessing an array with an invalid index (e.g., index=5 for an array of size 5) throws an ArrayIndexOutOfBoundsException.
453

Which logical operator returns TRUE only when both conditions in a WHERE clause are TRUE?

MCQ Easy
a. OR
b. AND
c. NOT
d. IN
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
AND
Explanation: The AND operator returns TRUE only if both connected conditions evaluate to TRUE.
454

What will be the final value of sum1 after this code executes? int sum1 = 3; sum1 = sum1 + 1; sum1 = sum1 + 1; sum1 = sum1 + 1; sum1 = sum1 + 1;

MCQ Medium
a. 5
b. 6
c. 4
d. 7
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
7
Explanation: sum1 starts at 3 and is incremented by 1 four times: 3+1+1+1+1 = 7.
455

A method in Java is best described as:

MCQ Easy
a. A single variable
b. A block of statements grouped together to perform a specific task
c. A data type
d. A comment
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
A block of statements grouped together to perform a specific task
Explanation: A method is a block of statements grouped together to perform a specific task, having a name, return type, optional parameters, and a body.
456

Which operator/keyword must be used to test whether a column value IS a NULL value (since = NULL is undefined)?

MCQ Medium
a. #NAME?
b. IS NULL
c. <> NULL
d. !NULL
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
IS NULL
Explanation: The IS operator (IS NULL / IS NOT NULL) is used to test for NULL values; the operations = NULL and <> NULL are not defined in SQL.
457

Consider: int anumber = 14; if (anumber >= 10) jLabel1.setText("first string"); else jLabel1.setText("second string"); jLabel2.setText("third string"); What is displayed in jLabel1 and jLabel2?

MCQ Medium
a. first string, third string
b. second string, third string
c. first string only
d. second string only
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
first string, third string
Explanation: Since anumber (14) is >= 10, the if-condition is true, so jLabel1 displays 'first string'. The statement setting jLabel2 to 'third string' is outside the if-else block and always executes.
458

Which return type is used for a method that does NOT return any value?

MCQ Easy
a. int
b. void
c. null
d. empty
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
void
Explanation: The void return type is used for methods that do not return any value.
459

Which SQL clause is used to sort the result set of a query?

MCQ Easy
a. GROUP BY
b. ORDER BY
c. SORT BY
d. ARRANGE BY
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
ORDER BY
Explanation: ORDER BY clause sorts the result set based on one or more columns, in ascending (ASC, default) or descending (DESC) order.
460

What is wrong with the test condition: if( (ctr < 5) && (ctr > 30) )

MCQ Medium
a. The && operator cannot be used in a test condition
b. The test condition is always false
c. The test condition is always true
d. Nothing is wrong with it
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
The test condition is always false
Explanation: No value of ctr can be simultaneously less than 5 AND greater than 30, so this condition is always false.