A question bank for every class and subject

Practice questions, with answers and explanations included

794 questions available

Refine

All questions

794 results
721

Which command lists all the tables created in the currently selected database?

MCQ Easy
a. LIST TABLES
b. SHOW TABLES
c. DISPLAY TABLES
d. VIEW TABLES
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
SHOW TABLES
Explanation: SHOW TABLES; displays all the tables created in the current database.
722

A shopping website's database design typically requires separate tables for entities like Category, Product, Customer, and Orders.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
TRUE
Explanation: Different entities (Category, Product, etc.) are typically modeled as separate tables in the database design of a shopping website, connected via primary/foreign keys.
723

Which statement is used to modify data in a table (from the textbook's MCQ exercise)?

MCQ Easy
a. CHANGE
b. MODIFY
c. UPDATE
d. SAVE AS
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
UPDATE
Explanation: UPDATE is the correct SQL statement used to modify existing data in a table.
724

Which constraint ensures that a user-specified value (e.g., 40000) is stored when no value is provided for an attribute?

MCQ Easy
a. NOT NULL
b. DEFAULT
c. CHECK
d. UNIQUE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
DEFAULT
Explanation: The DEFAULT constraint specifies a default value to be used when the user does not provide a value for that attribute.
725

List any four domains/sectors where database management applications are commonly used, as mentioned in the textbook.

SHORT Easy
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: Any four of: Education, Banking, Hospitals, Government Sector, Companies, E-Commerce, Airlines, Railways, Telecommunications, Hotels.
726

Which SQL statement is used to delete data (rows) from a table (from the textbook's MCQ exercise)?

MCQ Easy
a. DELETE
b. DROP
c. TRUNCATE
d. REMOVE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
DELETE
Explanation: DELETE is the correct SQL statement used to remove rows of data from a table.
727

Which constraint is used to restrict the values of an attribute to a specific range (e.g., Dept_No <= 110)?

MCQ Medium
a. NOT NULL
b. DEFAULT
c. CHECK
d. PRIMARY KEY
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
CHECK
Explanation: The CHECK constraint restricts attribute values within a specified range or condition (note: MySQL does not enforce CHECK, though it doesn't give an error).
728

Write the CREATE TABLE command for the CATEGORY table with schema CATEGORY(Category_id INT(10) Primary Key, Name VARCHAR(20), Description VARCHAR(40)).

LONG Medium
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: CREATE TABLE CATEGORY (Category_id INT(10) PRIMARY KEY, Name VARCHAR(20), Description VARCHAR(40));
729

Fill in the blank: ___________ command is used to add records in a relation.

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: INSERT (INSERT INTO command).
730

By default, primary key columns are:

MCQ Medium
a. Nullable and can have duplicates
b. NOT NULL, with no need to specify it separately
c. Optional and rarely used
d. Always of type VARCHAR
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
NOT NULL, with no need to specify it separately
Explanation: By default, primary keys are NOT NULL — this constraint does not need to be mentioned separately when declaring a primary key.
731

Explain the four phases of database application development as applied to designing a shopping website, referencing entity identification and table design.

LONG Hard
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: Requirement Definition: identify what the shopping website needs to do (browse products, add to cart, checkout) and check feasibility. Design: identify entities like CATEGORY, PRODUCT, CUSTOMER, ORDERS; design their schemas with attributes, data types, and primary/foreign key relationships (e.g., Category_id as foreign key in PRODUCT). Implementation: write the CREATE TABLE SQL statements for the backend database, build the frontend pages (product listing, cart, checkout), and connect them via database connectivity code. Testing: test browsing, cart operations, and payment processing with sample data, fixing any bugs found.
732

Fill in the blank: SELECT is a type of ___________ command.

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: DML (Data Manipulation Language).
733

If a table's primary key comprises MORE than one attribute, how must it be specified in the CREATE TABLE command?

MCQ Medium
a. Each attribute individually marked PRIMARY KEY
b. As a list of attributes within parentheses using PRIMARY KEY(...)
c. It cannot have more than one attribute
d. Using the FOREIGN KEY clause
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
As a list of attributes within parentheses using PRIMARY KEY(...)
Explanation: A composite primary key must be specified separately as PRIMARY KEY (attribute1, attribute2, ...) listing all attributes comprising it.
734

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

MCQ Easy
a. 3
b. 60
c. 11
d. 4
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
3
Explanation: The % operator returns the remainder of a divided by b. 15 % 4 = 3.
735

Fill in the blank: BETWEEN operator includes __________ and __________ values given in the range.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: The lower bound value and the upper bound value (i.e., both boundary/extreme values are included).
736

Which clause is used to specify a foreign key and the table/column it references?

MCQ Easy
a. REFERENCES only
b. FOREIGN KEY ... REFERENCES ...
c. LINK TO
d. JOIN ON
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
FOREIGN KEY ... REFERENCES ...
Explanation: FOREIGN KEY (column) REFERENCES table(primary_key_column) is used to specify a foreign key relationship.
737

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

MCQ Easy
a. 1
b. 3
c. 154
d. 15
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
1
Explanation: The % operator returns the remainder of a divided by b. 22 % 7 = 1.
738

Write SQL statements for the following operations on table GYM(PrCode, PrName, UnitPrice, Manufacturer): (a) Display details of all products with unit price less than Rs. 20000. (b) Add a new row for product 'P106', 'Vibro Exerciser', 23000, manufacturer 'Avon Fitness'. (c) Display details of all products with manufacturer name starting with 'A'.

LONG Hard
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: (a) SELECT * FROM GYM WHERE UnitPrice < 20000; (b) INSERT INTO GYM VALUES('P106','Vibro Exerciser',23000,'Avon Fitness'); (c) SELECT * FROM GYM WHERE Manufacturer LIKE 'A%';
739

In the Key column of a DESC output, what does 'MUL' next to a foreign key column indicate?

MCQ Hard
a. The column is a primary key
b. Multiple occurrences of a given value can appear in that column
c. The column cannot be NULL
d. The column is unique
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Multiple occurrences of a given value can appear in that column
Explanation: 'MUL' indicates the column is a foreign key permitting multiple occurrences of a given value.
740

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

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