Class 12

Information Technology (802)

351 questions available

Refine

All questions

351 results
321

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.
322

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.
323

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.
324

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.
325

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.
326

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.
327

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.
328

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.
329

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

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

MySQL server 5.6.20 fully supports the RESTRICT and CASCADE options for the DROP TABLE command.

TRUE FALSE Hard
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
FALSE
Explanation: MySQL server 5.6.20 does NOT support RESTRICT and CASCADE options (though they are permitted syntactically for porting ease); it simply won't allow dropping a table referenced elsewhere.
331

Given int a=15, b=4; what is the value of a/b using integer division?

MCQ Medium
a. 3
b. 3.75
c. 19
d. 4
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
3
Explanation: Integer division truncates the fractional part. 15 / 4 = 3.
332

The referenced table (containing the primary key) must be created before the referencing table containing the foreign key.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
TRUE
Explanation: The referenced table must be created first, since the foreign key clause in the referencing table needs to point to an existing primary key.
333

Given int a=22, b=7; what is the value of a/b using integer division?

MCQ Medium
a. 3
b. 3.14
c. 1
d. 29
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
3
Explanation: Integer division truncates the fractional part. 22 / 7 = 3.
334

A primary key can be dropped using ALTER TABLE even if it is the only primary key of the table, without any error.

TRUE FALSE Hard
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
FALSE
Explanation: Attempting to drop the only primary key of a table using ALTER TABLE will result in an error.
335

Given int a=9, b=5; what is the value of a/b using integer division?

MCQ Medium
a. 1
b. 1.8
c. 4
d. 14
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
1
Explanation: Integer division truncates the fractional part. 9 / 5 = 1.
336

Write the SQL command to create a database named 'School'.

SHORT Easy
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: CREATE DATABASE School;
337

Given int a=31, b=6; what is the value of a/b using integer division?

MCQ Medium
a. 5
b. 5.17
c. 1
d. 37
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
5
Explanation: Integer division truncates the fractional part. 31 / 6 = 5.
338

Write the SQL command to view the structure/description of the table 'Teacher'.

SHORT Easy
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: DESC Teacher; (or DESCRIBE Teacher;)
339

Given int a=18, b=4; what is the value of a/b using integer division?

MCQ Medium
a. 4
b. 4.5
c. 2
d. 22
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
4
Explanation: Integer division truncates the fractional part. 18 / 4 = 4.
340

Write the CREATE TABLE command for a Department table with Dept_ID (INTEGER, Primary Key) and Dept_Name (VARCHAR(30), NOT NULL).

SHORT Medium
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: CREATE TABLE Department (Dept_ID INTEGER PRIMARY KEY, Dept_Name VARCHAR(30) NOT NULL);