Question bank

Class 11

1 subject · 443 questions

Refine

All questions

443 results
341

Write an SQL query to display PrName and UnitPrice of products whose manufacturer name starts with 'A' from table GYM.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: SELECT PrName, UnitPrice FROM GYM WHERE Manufacturer LIKE 'A%';
342

Which logical operator returns true only if BOTH connected conditions are true?

MCQ Easy
a. ||
b. &&
c. !
d. ^
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
&&
Explanation: The && (AND) logical operator returns true only when both conditions it connects are true.
343

Write an SQL query to display PrName and UnitPrice of products whose name contains the word 'Exerciser' from table GYM.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: SELECT PrName, UnitPrice FROM GYM WHERE PrName LIKE '%Exerciser%';
344

Which method converts a String value to an int in Java?

MCQ Medium
a. String.parseInt()
b. Integer.parseInt()
c. Integer.toString()
d. Double.parseDouble()
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Integer.parseInt()
Explanation: Integer.parseInt() is used to convert a String value (e.g., from a text field) to an int value.
345

Write an SQL query to display Name and cost of shoes with size greater than 8 from table Shoes.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: SELECT Name, cost FROM Shoes WHERE size > 8;
346

Which method converts an integer value to a String in Java?

MCQ Medium
a. Integer.parseInt()
b. String.valueOf()
c. Integer.toString()
d. Both Integer.toString() and String.valueOf()
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Both Integer.toString() and String.valueOf()
Explanation: Both Integer.toString() and String.valueOf() convert an int value into its String representation.
347

Write an SQL query to display Name and cost of shoes with cost less than 2000 from table Shoes.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: SELECT Name, cost FROM Shoes WHERE cost < 2000;
348

In the code: if(condition) { statementBlock1; } else { statementBlock2; } — what happens if the condition evaluates to false?

MCQ Easy
a. statementBlock1 executes
b. statementBlock2 executes
c. Both execute
d. Neither executes
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
statementBlock2 executes
Explanation: If the condition is false, control passes to the else clause and statementBlock2 is executed.
349

Write an SQL query to display Name and cost of shoes of type 'Sports' from table Shoes.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: SELECT Name, cost FROM Shoes WHERE type = 'Sports';
350

Curly braces {} are mandatory around a statement block in an if statement when:

MCQ Medium
a. There is exactly one statement
b. There are multiple statements
c. The condition is always true
d. Never required
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
There are multiple statements
Explanation: Curly braces are optional for a single statement but mandatory when a block contains multiple statements.
351

Write an SQL query to display Name and cost of shoes with quantity in stock less than 10 from table Shoes.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: SELECT Name, cost FROM Shoes WHERE Qty < 10;
352

A switch statement is generally preferred over multiple if/else-if statements when:

MCQ Medium
a. Testing a range of values
b. Selection is based on a single value compared against multiple constants
c. Testing boolean conditions only
d. There is only one condition to check
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Selection is based on a single value compared against multiple constants
Explanation: A switch statement is easier to read and more appropriate than long if/else-if chains when selection is based on a single value.
353

Write the SQL statement to display the structure of the table 'Shoes'.

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: DESCRIBE Shoes; (or DESC Shoes;)
354

In Java, a variable must be declared before it can be used.

TRUE FALSE Easy
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
TRUE
Explanation: Java requires all variables to be declared (with a data type) before use.
355

Write the SQL statement to view the names of all tables in the currently selected database.

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: SHOW TABLES;
356

The float data type in Java occupies 8 bytes of memory.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
FALSE
Explanation: The float data type occupies 4 bytes (32 bits); it is the double data type that occupies 8 bytes.
357

Write the SQL statement to delete the table named 'Orders' from the database.

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: DROP TABLE Orders;
358

Object Oriented Programming allows wrapping of data and methods together into a single unit, known as data encapsulation.

TRUE FALSE Easy
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
TRUE
Explanation: Data encapsulation is a key feature of OOP where data members and methods are wrapped together within a class.
359

Write the SQL statement to add a new column 'Games' of type VARCHAR(20) to the table 'Student'.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: ALTER TABLE Student ADD Games VARCHAR(20);
360

Inheritance in OOP allows a programmer to give a generic name to various methods or operators.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
FALSE
Explanation: This describes Polymorphism, not Inheritance. Inheritance allows reuse of characteristics of an existing class in new classes.