0% found this document useful (0 votes)
115 views4 pages

MySQL Viva Questions Class12 Finallllll

Uploaded by

Eshu Jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views4 pages

MySQL Viva Questions Class12 Finallllll

Uploaded by

Eshu Jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

MySQL Viva Questions & Answers (Class

12 IT - NCERT)
What is DBMS?
A Database Management System (DBMS) is software to store, organize, and manage data.

What is RDBMS?
Relational DBMS stores data in tables (rows & columns). MySQL is an RDBMS.

Difference between DBMS and RDBMS?


DBMS: simple storage, no relationships. RDBMS: related tables with keys.

What is MySQL?
MySQL is an open-source RDBMS used to manage structured data using SQL.

What is SQL?
SQL (Structured Query Language) is used to communicate with databases.

What are DDL, DML, DCL, TCL commands?


DDL: CREATE, DROP, ALTER. DML: INSERT, UPDATE, DELETE. DCL: GRANT, REVOKE. TCL:
COMMIT, ROLLBACK.

What is the difference between CHAR and VARCHAR?


CHAR: fixed length. VARCHAR: variable length.

What are constraints in MySQL?


Rules on columns: PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, DEFAULT.

How to display all constraints of a table?


SELECT * FROM information_schema.table_constraints WHERE table_name='employee';

What is the difference between PRIMARY KEY and UNIQUE?


PRIMARY KEY: unique + not null, one per table. UNIQUE: only ensures uniqueness, nulls
allowed.

What is a FOREIGN KEY?


A key in one table that refers to PRIMARY KEY in another table.

What is difference between DELETE and TRUNCATE?


DELETE: removes rows, can rollback. TRUNCATE: removes all rows, faster, cannot rollback.
Difference between DROP and DELETE?
DROP removes structure + data. DELETE removes only rows, keeps structure.

What is the difference between WHERE and HAVING?


WHERE filters rows before grouping. HAVING filters groups after GROUP BY.

What are aggregate functions in MySQL?


SUM(), AVG(), MAX(), MIN(), COUNT().

What is the difference between COUNT(*) and COUNT(column_name)?


COUNT(*) counts all rows, COUNT(column) counts only non-null values.

What is the use of GROUP BY?


Groups rows with same values into summary rows.

What is ORDER BY?


Used to sort results in ascending (ASC) or descending (DESC) order.

What are JOINs in MySQL?


INNER JOIN: matching rows. LEFT JOIN: all from left. RIGHT JOIN: all from right. FULL JOIN:
all from both.

What is difference between UNION and UNION ALL?


UNION removes duplicates, UNION ALL keeps duplicates.

What is difference between IS NULL and = NULL?


IS NULL checks null. = NULL is invalid.

What are views in MySQL?


A virtual table based on result of SQL query. Created using CREATE VIEW.

What is normalization?
Process of reducing redundancy and improving data integrity.

What are different normal forms?


1NF: atomic values, 2NF: no partial dependency, 3NF: no transitive dependency.

What is indexing in MySQL?


Indexes speed up searching and retrieval.

What is difference between DROP DATABASE and DROP TABLE?


DROP DATABASE deletes database. DROP TABLE deletes one table.

What is AUTO_INCREMENT?
Automatically generates unique numbers for primary key columns.
What is difference between NOW() and SYSDATE()?
NOW() fixed for query, SYSDATE() exact execution time.

What is difference between CHAR_LENGTH() and LENGTH()?


CHAR_LENGTH() counts characters, LENGTH() counts bytes.

What is difference between DELETE FROM table and DROP TABLE table?
DELETE FROM removes records, keeps structure. DROP TABLE removes structure +
records.
⚡ Last-Minute Revision Notes (MySQL
Class 12 IT)
• DBMS = manages data, RDBMS = manages data in related tables.

• MySQL = open-source RDBMS using SQL.

• SQL categories → DDL, DML, DCL, TCL.

• CHAR = fixed length, VARCHAR = variable length.

• Constraints → PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, DEFAULT.

• DELETE removes rows, TRUNCATE removes all rows (faster), DROP removes table.

• WHERE filters before grouping, HAVING after grouping.

• Aggregate functions → SUM, AVG, MAX, MIN, COUNT.

• GROUP BY groups rows, ORDER BY sorts rows.

• JOIN types → INNER, LEFT, RIGHT, FULL (via UNION).

• UNION removes duplicates, UNION ALL keeps duplicates.

• Views = virtual tables created from queries.

• Normalization reduces redundancy (1NF, 2NF, 3NF).

• Indexes → faster search.

• AUTO_INCREMENT generates unique numbers automatically.

• NOW() = query time, SYSDATE() = execution time.

• CHAR_LENGTH() → characters, LENGTH() → bytes.

You might also like