At Unlock Gifts, we simplify your interview and viva preparation with expert-curated questions and answers.
1. What exactly is a DBMS?
A Database Management System (DBMS) is software that helps users create, store, organize, and manipulate data in a structured way. It acts as an interface between the data and the application programs, ensuring smooth data management.
2. How is RDBMS different from a regular DBMS?
While a DBMS can store data, an RDBMS (Relational DBMS) does it more efficiently by using tables with rows and columns. RDBMS allows relationships between data using keys, making it more powerful for handling structured data.
3. What do we mean by a table in a database?
A table is the most basic unit in a database, where data is organized in a grid format — rows represent records, and columns represent fields or attributes.
5. What is the role of a Primary Key?
A primary key is a unique identifier for each row in a table. No two rows can have the same value in the primary key column, and it can’t be left blank (NULL).
6. What is a Foreign Key used for?
A foreign key creates a link between two tables. It points to the primary key in another table and helps maintain referential integrity — meaning, the data across tables remains consistent.
7. Why do we need normalization in databases?
Normalization is a technique used to organize data efficiently. It helps eliminate duplicate data, reduce redundancy, and ensures data integrity by splitting large tables into smaller ones and linking them properly.
8. What are 1NF, 2NF, and 3NF?
-
1NF: Ensures that all data is stored in individual cells (atomic values).
2NF: Removes partial dependencies — every non-key column should depend on the full primary key.
-
3NF: Removes transitive dependencies — non-key columns should not depend on other non-key columns.
9. What does the term “query” mean in DBMS?
A query is simply a request made to the database to retrieve or manipulate information. You write queries using SQL to get exactly the data you need.
10. What are the categories of SQL commands?
SQL is divided into several types of commands:
-
DDL (Data Definition Language): For creating/modifying tables.
-
DML (Data Manipulation Language): For adding/updating/deleting records.
-
DCL (Data Control Language): For managing permissions.
-
TCL (Transaction Control Language): For handling transaction flow like COMMIT or ROLLBACK.
11. What is a JOIN, and why is it useful?
A JOIN allows you to combine data from two or more tables based on a common column. It's useful when your data is spread across multiple tables and you want a unified view.
12. What is a View in SQL?
A view is a virtual table that shows data from one or more tables through a saved SQL query. It doesn’t store data itself but makes complex queries easier to manage and reuse.
13. What is Indexing in a database?
Indexing works like a shortcut in a phone book — it helps you locate data faster without scanning every row. Indexes are created on columns that are often used in search conditions.
14. What are ACID properties in DBMS?
ACID stands for:
-
Atomicity: All parts of a transaction must complete or none at all.
-
Consistency: Data must always be in a valid state.
-
Isolation: Transactions should not affect each other.
-
Durability: Once a transaction is done, the changes should be permanent.
15. What is a transaction in DBMS?
A transaction is a group of one or more SQL operations that are treated as a single unit of work. For example, transferring money from one account to another should either happen completely or not at all.
16. What are Constraints in SQL?
Constraints are rules you can apply to columns to enforce data integrity. Examples include:
-
NOT NULL
: Field must have a value.
-
UNIQUE
: No duplicates allowed.
-
CHECK
: Values must meet a condition.
-
DEFAULT
: Auto-assign a value if none is provided.
-
PRIMARY KEY
/ FOREIGN KEY
: For unique identification and relationships.
17. What is a Schema in a database?
A schema is like a blueprint of the database. It defines how data is organized — including tables, fields, views, relationships, and constraints.
18. What is a Trigger in DBMS?
A trigger is an automatic action that runs when a specific change happens in the database — like before inserting a record or after updating a field. Triggers help automate tasks like logging or enforcing rules.
19. What is a Candidate Key? How is it different from a Primary Key?
A candidate key is any column (or combination of columns) that can uniquely identify a row in a table. Among all candidate keys, one is chosen as the primary key, and the others remain as backups.
20. What is Denormalization? When is it used?
Denormalization is the process of reversing normalization by combining tables to improve read performance. While normalization reduces redundancy, denormalization adds some redundancy for faster data retrieval.
21. What is the difference between WHERE and HAVING clauses in SQL?
Example:
SELECT * FROM employees WHERE salary > 50000;
SELECT department, COUNT(*)
FROM employees
GROUP BY department
HAVING COUNT(*) > 5;
Keep Learning, Keep Growing, and Keep Enjoying the Journey.
— Unlock Gifts
Comments
Post a Comment