Class 12

Information Technology (802)

351 questions available

Refine

All questions

351 results
281

Which method of the Integer wrapper class allows access to the primitive int value it holds?

MCQ Medium
a. getInt()
b. intValue()
c. toInt()
d. valueOf()
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
intValue()
Explanation: The intValue() method returns the primitive int value held by an Integer wrapper object.
282

Define Superkey, Key, Candidate Key and Primary Key in one or two lines each.

SHORT Medium
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: Superkey: a set of attributes for which no two tuples have the same combination of values. Key (Candidate Key): a minimal superkey — removing any attribute would cause it to lose uniqueness. Candidate Key: any such minimal key of a relation (a relation may have several). Primary Key: the candidate key chosen to uniquely identify tuples in the relation.
283

A parameterless wrapper class cannot convert a String into its corresponding numeric value.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
FALSE
Explanation: Wrapper classes CAN convert Strings to numeric values, e.g., Integer.parseInt("345") converts the String "345" to the int 345.
284

Explain the five types of constraints in the relational model with a suitable example for each.

LONG Hard
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: Domain Constraint: attribute values must come from the attribute's domain (e.g., Employee_ID must be a 4-digit number). Key Constraint: relates to superkeys, keys, candidate keys, and primary keys ensuring uniqueness of tuples. Null Value Constraint: certain attributes (e.g., Name) may be constrained to NOT NULL. Entity Integrity Constraint: the primary key of a relation cannot be NULL, since it must uniquely identify each tuple. Referential Integrity Constraint: a foreign key in one relation (R1) must either match a primary key value in the referenced relation (R2) or be NULL, ensuring consistency between related relations (e.g., Dept_No in Teacher referencing Dept_ID in Department).
285

Thread priority levels in Java can range from 1 to 10, set using the setPriority() method.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
TRUE
Explanation: The Thread class's setPriority() method allows setting a thread's priority level, ranging from 1 to 10.
286

SQL comprises which two sub-languages?

MCQ Easy
a. HTML and CSS
b. DDL and DML
c. GUI and CLI
d. JSON and XML
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
DDL and DML
Explanation: SQL comprises a Data Definition Language (DDL) used to define structure/constraints, and a Data Manipulation Language (DML) used to insert, modify and delete data.
287

How can threads be created in Java? Briefly name the two approaches.

SHORT Medium
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: Threads can be created in two ways: (1) by creating a class that extends the Thread class and overriding its run() method, or (2) by creating a class that implements the Runnable interface and overriding its run() method, then passing an instance of it to a Thread object.
288

In SQL terminology, what do relation, tuple, and attribute correspond to respectively?

MCQ Easy
a. Table, row, column
b. Column, row, table
c. Row, column, table
d. Table, column, row
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Table, row, column
Explanation: SQL uses the terms table, row, and column for the relational model terms relation, tuple, and attribute respectively.
289

Give the wrapper class names for the primitive data types: int, float, double, long, short, byte.

SHORT Easy
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: int -> Integer, float -> Float, double -> Double, long -> Long, short -> Short, byte -> Byte.
290

Which data type in MySQL is used to store a fixed-length character string?

MCQ Easy
a. VARCHAR(n)
b. CHAR(n)
c. DATE
d. DECIMAL(m,d)
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
CHAR(n)
Explanation: CHAR(n) is used for a fixed-length character string of exactly n characters.
291

Write a Java class 'ExtendThread' that extends the Thread class, overrides run() to print 'Created a Thread' followed by counts 1 to 3, and show how to instantiate and start it from main.

LONG Hard
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: public class ExtendThread extends Thread { public void run() { System.out.println("Created a Thread"); for (int count=1; count<=3; count++) System.out.println("Count="+count); } } // In main: public static void main(String args[]) { ExtendThread t1 = new ExtendThread(); t1.start(); }
292

Which data type stores a variable-length character string with a maximum of n characters?

MCQ Easy
a. CHAR(n)
b. VARCHAR(n)
c. INTEGER
d. DATE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
VARCHAR(n)
Explanation: VARCHAR(n) stores a variable-length character string, where n is the maximum number of characters allowed.
293

Which of the following sectors is mentioned as a domain where database applications are commonly used?

MCQ Easy
a. Only Banking
b. Education, Banking, Hospitals, Government, and E-Commerce among others
c. Only E-Commerce
d. None, databases are only for schools
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Education, Banking, Hospitals, Government, and E-Commerce among others
Explanation: The textbook lists several domains for database applications: Education, Banking, Hospitals, Government Sector, Companies, E-Commerce, Airlines, Railways, Telecommunications, and Hotels.
294

In the data type DECIMAL(m,d), what does 'd' represent?

MCQ Medium
a. The total number of significant digits stored
b. The number of digits stored after the decimal point
c. The maximum value allowed
d. The default value
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
The number of digits stored after the decimal point
Explanation: In DECIMAL(m,d), m represents total significant digits, and d represents the number of digits after the decimal point.
295

In a hospital database application, which of these would typically be stored?

MCQ Easy
a. Only patient names
b. Patient health records, hospitalization dates, and staff/equipment details
c. Only doctor salaries
d. Only medicine prices
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Patient health records, hospitalization dates, and staff/equipment details
Explanation: A hospital's database stores patient personal details, health records, hospitalization dates, and information on doctors, nurses, staff, rooms, and equipment.
296

Which SQL command is used to create a new table?

MCQ Easy
a. MAKE TABLE
b. CREATE TABLE
c. NEW TABLE
d. BUILD TABLE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
CREATE TABLE
Explanation: CREATE TABLE <table_name> (column definitions); is used to create a new table/relation.
297

In the XYZ Shopping Website case study, the CATEGORY table's primary key is:

MCQ Easy
a. Name
b. Category_id
c. Description
d. Product_id
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Category_id
Explanation: Category_id is the primary key of the CATEGORY table, uniquely identifying each product category.
298

Which command is used to remove an entire database from the server?

MCQ Easy
a. DROP DATABASE
b. DELETE DATABASE
c. REMOVE DATABASE
d. TRUNCATE DATABASE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
DROP DATABASE
Explanation: DROP DATABASE <name>; is used to remove a database from the server.
299

In the PRODUCT table schema PRODUCT(Product_id, Name, Category_id, Price, Quantity, Discount, Brand, Color, Size, Seller_id, Description), Category_id in this table acts as a:

MCQ Medium
a. Primary Key
b. Foreign Key referencing the CATEGORY table
c. Candidate Key only
d. Domain constraint
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Foreign Key referencing the CATEGORY table
Explanation: Category_id in the PRODUCT table is a Foreign Key referencing the Category_id (primary key) of the CATEGORY table, linking each product to its category.
300

Which command tells the MySQL server which database to use for subsequent statements?

MCQ Easy
a. SELECT DATABASE
b. USE
c. OPEN DATABASE
d. SET DATABASE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
USE
Explanation: The USE <databasename>; command tells the server which database to use for subsequent statements.