PYQs (English)
✅ SQL / MySQL (DBMS) Important Questions – PYQ Style
🔹 Section 1: Basic Concepts (Theory)
-
What is DBMS? Explain its advantages.
-
What is RDBMS? Difference between DBMS and RDBMS.
-
What is SQL? Explain its types.
-
Explain different data types in MySQL.
-
What is a Primary Key?
-
What is a Foreign Key?
-
Difference between Candidate Key and Primary Key.
-
Difference between Unique Key and Primary Key.
-
What are Constraints? Explain types.
-
What is Normalization? Explain 1NF, 2NF, 3NF.
🔹 Section 2: SQL Commands
⭐ DDL (Data Definition Language)
-
Explain CREATE TABLE syntax.
-
What is ALTER TABLE?
-
Difference between DROP, DELETE, and TRUNCATE.
-
How to add a column in an existing table?
-
How to rename a table?
⭐ DML (Data Manipulation Language)
-
INSERT statement syntax.
-
UPDATE statement with example.
-
DELETE statement with example.
-
Explain SELECT statement.
🔹 Section 3: Query-Based Questions (Most Important)
Example Table:
Student(id, name, marks, city)
Basic Queries
-
Display all records from Student.
-
Display only name column.
-
Show students with marks > 60.
-
Show students from city = 'Delhi'.
-
Show marks between 50 and 80.
Aggregate Functions
-
Count total students.
-
Find maximum marks.
-
Find minimum marks.
-
Find average marks.
-
Find sum of marks.
GROUP BY
-
Count students city-wise.
-
Find average marks city-wise.
ORDER BY
-
Sort marks in descending order.
-
Sort names in ascending order.
LIKE Operator
-
Names starting with 'A'.
-
Names ending with 'n'.
-
Names containing 'ra'.
🔹 Section 4: JOINs (Very Frequently Asked ⭐)
-
What is JOIN? Explain types.
-
Write query for INNER JOIN.
-
Write query for LEFT JOIN.
-
Write query for RIGHT JOIN.
-
What is Self Join?
🔹 Section 5: Subqueries
-
Find student with highest marks.
-
Find students having marks greater than average.
🔹 Section 6: Constraints Practical
-
Create table with Primary Key.
-
Use NOT NULL constraint.
-
Set DEFAULT value.
-
Use CHECK constraint.
🔹 Section 7: Index, View & Advanced
-
What is Index? Advantages.
-
What is View? Syntax to create view.
-
Advantages of View.
-
What is Stored Procedure?
-
What is Trigger?
🔹 Section 8: MySQL Specific
-
What is MySQL?
-
How to create a database?
-
How to delete a database?
-
SHOW DATABASES command.
-
SHOW TABLES command.
-
USE database command.
-
What is AUTO_INCREMENT?
-
Explain LIMIT clause.
🔹 Section 9: Long/Descriptive Questions
-
Draw ER diagram.
-
Explain normalization with example.
-
Explain ACID properties.
-
What is Transaction? Explain COMMIT and ROLLOBACK.
-
Difference between SQL and NoSQL.
-
Clustered vs Non-clustered Index.
-
Function vs Procedure difference.
-
What is Deadlock?
-
Backup and Recovery methods.
-
Explain 3-tier architecture of DBMS.