A question bank for every class and subject

Practice questions, with answers and explanations included

794 questions available

Refine

All questions

794 results
741

In a database, table Cabinet has a column where the data entry operator is unable to enter NULL values, and also unable to enter duplicate values. What is the likely reason?

LONG Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: This behaviour indicates that the column has been set as the PRIMARY KEY of the table (or has both a NOT NULL and a UNIQUE constraint applied), since a primary key column does not accept NULL values and does not accept duplicate values.
742

Which referential action automatically sets the foreign key value to NULL when the referenced primary key row is deleted?

MCQ Medium
a. CASCADE
b. SET NULL
c. RESTRICT
d. NO ACTION
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
SET NULL
Explanation: ON DELETE SET NULL sets the corresponding foreign key attribute to NULL when the referenced row is deleted.
743

Given int a=31, b=6; what is the value of a%b?

MCQ Easy
a. 1
b. 5
c. 186
d. 25
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
1
Explanation: The % operator returns the remainder of a divided by b. 31 % 6 = 1.
744

Convert: 2 KB = ______ Bytes.

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: 2 KB = 2 x 1024 Bytes = 2048 Bytes.
745

Which referential action automatically deletes the corresponding rows in the referencing table when the referenced row is deleted?

MCQ Medium
a. SET NULL
b. RESTRICT
c. CASCADE
d. IGNORE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
CASCADE
Explanation: ON DELETE CASCADE deletes the corresponding rows in the referencing (child) table when the referenced row in the parent table is deleted.
746

Given int a=18, b=4; what is the value of a%b?

MCQ Easy
a. 2
b. 4
c. 72
d. 14
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
2
Explanation: The % operator returns the remainder of a divided by b. 18 % 4 = 2.
747

Convert: 3 KB = ______ Bytes.

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: 3 KB = 3 x 1024 Bytes = 3072 Bytes.
748

Which referential action rejects the delete/update operation on the referenced table if there are related rows in the referencing table?

MCQ Medium
a. CASCADE
b. SET NULL
c. RESTRICT
d. SET DEFAULT
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
RESTRICT
Explanation: RESTRICT rejects the delete or update on the referenced table if there are related foreign key values in the referencing table.
749

Given int a=50, b=7; what is the value of a%b?

MCQ Easy
a. 1
b. 7
c. 350
d. 43
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
1
Explanation: The % operator returns the remainder of a divided by b. 50 % 7 = 1.
750

Convert: 4 KB = ______ Bytes.

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: 4 KB = 4 x 1024 Bytes = 4096 Bytes.
751

How can constraints be named in a CREATE TABLE command?

MCQ Medium
a. Using the NAME keyword
b. Using the CONSTRAINT keyword followed by a name and its specification
c. Constraints cannot be named
d. Using the ALIAS keyword
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Using the CONSTRAINT keyword followed by a name and its specification
Explanation: The keyword CONSTRAINT followed by a name (e.g., CONSTRAINT TEACHER_PK PRIMARY KEY (Teacher_ID)) is used to name a constraint so it can be easily referenced/dropped later.
752

Given int a=13, b=3; what is the value of a%b?

MCQ Easy
a. 1
b. 4
c. 39
d. 10
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
1
Explanation: The % operator returns the remainder of a divided by b. 13 % 3 = 1.
753

Convert: 5 KB = ______ Bytes.

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: 5 KB = 5 x 1024 Bytes = 5120 Bytes.
754

Which command is used to remove a table's structure and data from a database?

MCQ Easy
a. DELETE TABLE
b. DROP TABLE
c. TRUNCATE
d. CLEAR TABLE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
DROP TABLE
Explanation: DROP TABLE <table_name>; is used to delete a table completely from the database.
755

Given int a=27, b=5; what is the value of a%b?

MCQ Easy
a. 2
b. 5
c. 135
d. 22
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
2
Explanation: The % operator returns the remainder of a divided by b. 27 % 5 = 2.
756

Convert: 6 KB = ______ Bytes.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: 6 KB = 6 x 1024 Bytes = 6144 Bytes.
757

Which command is used to add a new column to an existing table?

MCQ Easy
a. ALTER TABLE ... ADD
b. UPDATE TABLE ... ADD
c. MODIFY TABLE ... ADD
d. INSERT TABLE ... ADD
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
ALTER TABLE ... ADD
Explanation: ALTER TABLE <table> ADD <column> <datatype>; adds a new column to an existing table.
758

Given int a=44, b=9; what is the value of a%b?

MCQ Easy
a. 8
b. 4
c. 396
d. 35
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
8
Explanation: The % operator returns the remainder of a divided by b. 44 % 9 = 8.
759

Convert: 7 KB = ______ Bytes.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: 7 KB = 7 x 1024 Bytes = 7168 Bytes.
760

Which command changes the default value of an existing column, e.g. setting Salary's default to 30000?

MCQ Medium
a. ALTER TABLE Teacher ALTER Salary SET DEFAULT 30000;
b. UPDATE Teacher SET DEFAULT Salary=30000;
c. MODIFY Teacher SET Salary DEFAULT 30000;
d. CREATE DEFAULT Teacher.Salary=30000;
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
ALTER TABLE Teacher ALTER Salary SET DEFAULT 30000;
Explanation: ALTER TABLE Teacher ALTER Salary SET DEFAULT 30000; changes the default value for the Salary column.