Class 12

Information Technology (802)

351 questions available

Refine

All questions

351 results
341

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

MCQ Medium
a. 7
b. 7.14
c. 1
d. 57
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
7
Explanation: Integer division truncates the fractional part. 50 / 7 = 7.
342

Write the SQL command to add a new column 'Age' of type INTEGER to the table 'Teacher'.

SHORT Easy
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: ALTER TABLE Teacher ADD Age INTEGER;
343

Evaluate the Java relational expression: 15 > 9

MCQ Easy
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
TRUE
Explanation: The expression 15 > 9 evaluates to true.
344

Write the SQL command to drop the column 'Age' from the table 'Teacher'.

SHORT Easy
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: ALTER TABLE Teacher DROP Age;
345

Evaluate the Java relational expression: 22 == 22

MCQ Easy
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
TRUE
Explanation: The expression 22 == 22 evaluates to true.
346

Write the SQL command to drop the named foreign key constraint 'TEACHER_FK' from the table 'Teacher'.

SHORT Medium
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: ALTER TABLE Teacher DROP FOREIGN KEY TEACHER_FK;
347

Evaluate the Java relational expression: 7 != 7

MCQ Easy
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
FALSE
Explanation: The expression 7 != 7 evaluates to false.
348

Write the CREATE TABLE command for a Teacher table with columns: Teacher_ID (INTEGER, Primary Key), First_Name (VARCHAR(20), NOT NULL), Last_Name (VARCHAR(20)), Gender (CHAR(1)), Salary (DECIMAL(10,2), default 40000), Date_of_Birth (DATE), and Dept_No (INTEGER, Foreign Key referencing Dept_ID of Department).

LONG Hard
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: CREATE TABLE Teacher (Teacher_ID INTEGER PRIMARY KEY, First_Name VARCHAR(20) NOT NULL, Last_Name VARCHAR(20), Gender CHAR(1), Salary DECIMAL(10,2) DEFAULT 40000, Date_of_Birth DATE, Dept_No INTEGER, FOREIGN KEY (Dept_No) REFERENCES Department(Dept_ID));
349

Evaluate the Java relational expression: 4 >= 12

MCQ Easy
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
FALSE
Explanation: The expression 4 >= 12 evaluates to false.
350

Explain, with the CREATE TABLE syntax, the difference between ON DELETE SET NULL, ON DELETE CASCADE, and ON DELETE RESTRICT for a foreign key.

LONG Hard
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: ON DELETE SET NULL: if the referenced row in the parent table is deleted, the foreign key value(s) in the child table referring to it are set to NULL. ON DELETE CASCADE: if the referenced row is deleted, all corresponding rows in the child table are also automatically deleted. ON DELETE RESTRICT: the delete operation on the parent table is rejected if there are any related rows in the child table — you cannot delete a referenced row while dependent rows exist.
351

Evaluate the Java relational expression: 6 <= 6

MCQ Easy
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
TRUE
Explanation: The expression 6 <= 6 evaluates to true.