A question bank for every class and subject

Practice questions, with answers and explanations included

794 questions available

Refine

All questions

794 results
381

A table can have more than one candidate key but only one primary key.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
TRUE
Explanation: A table may have multiple candidate keys, but only one of them is designated as the primary key.
382

What will be the result of the Calc formula =8+12/4 ?

MCQ Medium
a. 11
b. 10
c. 12
d. 13
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
11
Explanation: Following operator precedence (parentheses, then multiplication/division, then addition/subtraction, left to right), =8+12/4 evaluates to 11.
383

The switch statement's expression must evaluate to which of the following data types?

MCQ Medium
a. float or double only
b. byte, short, int, or char
c. boolean only
d. String only (in this version)
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
byte, short, int, or char
Explanation: The expression in a Java switch statement must evaluate to byte, short, int, or char.
384

The primary key column and the foreign key column referencing it must have the same data type and size.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
TRUE
Explanation: For referential integrity, the primary key and its corresponding foreign key column must match in data type and size.
385

What will be the result of the Calc formula =(8+12)/4 ?

MCQ Medium
a. 5
b. 10
c. 4
d. 6
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
5
Explanation: Following operator precedence (parentheses, then multiplication/division, then addition/subtraction, left to right), =(8+12)/4 evaluates to 5.
386

In a switch statement, what does the 'break' statement after each case group do?

MCQ Easy
a. Ends the entire program
b. Terminates the switch and continues execution after the switch block
c. Restarts the switch from the top
d. Causes an infinite loop
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Terminates the switch and continues execution after the switch block
Explanation: The break statement terminates the switch statement and causes execution to continue with statements after the switch.
387

Name two benefits of using a DBMS.

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: Redundancy can be controlled; inconsistency can be avoided (also: data can be shared, and security restrictions can be applied).
388

What will be the result of the Calc formula =5*5-5 ?

MCQ Medium
a. 20
b. 40
c. 19
d. 21
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
20
Explanation: Following operator precedence (parentheses, then multiplication/division, then addition/subtraction, left to right), =5*5-5 evaluates to 20.
389

In a switch statement, if the expression does not match any case constant, which block executes?

MCQ Easy
a. The first case block
b. The last case block
c. The default block
d. No block executes and an error occurs
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
The default block
Explanation: If there's no match for any case, the statements in the default block are executed.
390

Differentiate between Primary Key, Candidate Key, Alternate Key, and Foreign Key with examples.

LONG Hard
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: Candidate Key: any column/set of columns that can uniquely identify a row (e.g., RollNo and Admission_No in a student table). Primary Key: the candidate key chosen to uniquely identify rows in the table (e.g., Admission_No). Alternate Key: candidate key(s) not chosen as primary key (e.g., RollNo, if Admission_No is the primary key). Foreign Key: a primary key of one table used as a column in another table to establish a relationship (e.g., DeptID in the Employee table referencing DeptID, the primary key of the Department table).
391

What will be the result of the Calc formula =5*(5-5) ?

MCQ Medium
a. 0
b. 1
c. 2
d. 3
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
0
Explanation: Following operator precedence (parentheses, then multiplication/division, then addition/subtraction, left to right), =5*(5-5) evaluates to 0.
392

Which loop structure evaluates its test condition BEFORE executing the loop body (entry-controlled loop)?

MCQ Easy
a. do-while loop
b. while loop
c. Both do the same
d. for loop only executes once
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
while loop
Explanation: The while loop tests the condition before executing the body, making it an entry-controlled loop.
393

MySQL is pronounced as:

MCQ Easy
a. My Sequel
b. My Squeal
c. My Sql
d. My System
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
My Sequel
Explanation: MySQL is pronounced as 'My Sequel'.
394

What will be the result of the Calc formula =100/10/2 ?

MCQ Medium
a. 5
b. 10
c. 4
d. 6
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
5
Explanation: Following operator precedence (parentheses, then multiplication/division, then addition/subtraction, left to right), =100/10/2 evaluates to 5.
395

Which loop structure is guaranteed to execute its body AT LEAST ONCE, regardless of the test condition?

MCQ Easy
a. while loop
b. do-while loop
c. for loop
d. if statement
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
do-while loop
Explanation: The do-while loop is exit-controlled — it evaluates the test condition AFTER executing the body, so the body executes at least once.
396

Which SQL command category permits creation or deletion of database tables and defines constraints?

MCQ Easy
a. DML
b. DDL
c. DCL
d. TCL
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
DDL
Explanation: DDL (Data Definition Language) commands like CREATE TABLE, ALTER TABLE, and DROP TABLE define/modify database structure.
397

Expand the abbreviation: ALU

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: Arithmetic Logic Unit
398

If int number = 6; and the loop is: while(number<=5){...}, how many times does the loop body execute?

MCQ Medium
a. Zero times
b. Once
c. Five times
d. Six times
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Zero times
Explanation: Since 6 is not <= 5, the while loop's condition is false from the start, so the body never executes (zero times).
399

Which MySQL data type is used for a fixed-length string, right-padded with spaces?

MCQ Medium
a. VARCHAR(size)
b. CHAR(size)
c. TEXT
d. INT
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
CHAR(size)
Explanation: CHAR(size) is a fixed-length string data type, right-padded with spaces to the specified length.
400

Expand the abbreviation: CPU

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: Central Processing Unit