Basic Concepts
Basic Concepts
2. What is DBMS? How is it different from traditional file systems? DBMS is software that
manages databases; unlike file systems, it offers efficient data storage, retrieval, and security.
3. What are the advantages of DBMS over file systems? DBMS offers data redundancy control,
data integrity, data security, and support for concurrent access.
4. What are the types of DBMS? Explain briefly. Types include Hierarchical, Network,
Relational, and Object-Oriented, based on the data structure used.
5. What is a schema? Explain different types of schema. A schema defines the database
structure. Types: Physical, Logical, and View Schema.
6. What are keys in DBMS? Explain the different types. Keys uniquely identify records. Types
include Primary Key, Foreign Key, Candidate Key, and Super Key.
7. What is a relational database? A relational database stores data in tables, where each row is
a record and each column represents an attribute.
8. What is the difference between DDL, DML, DCL, and TCL? DDL manages schema, DML
manipulates data, DCL controls access, and TCL handles transactions.
9. What is normalization? Explain the different normal forms. Normalization eliminates data
redundancy. Normal forms: 1NF, 2NF, 3NF, BCNF, each reducing dependency issues.
10. What are the ACID properties in DBMS? ACID properties ensure transaction reliability:
Atomicity, Consistency, Isolation, Durability.
11. Explain the concept of ER (Entity-Relationship) model. The ER model represents entities,
attributes, and relationships in a database.
13. What is a view in DBMS? How is it different from a table? A view is a virtual table derived
from one or more tables but doesn't store data physically like a table.
14. What is indexing in DBMS? Indexing speeds up data retrieval by creating pointers to rows in
a table.
SQL Queries
15. Write an SQL query to fetch the first 10 records from a table. SELECT * FROM table_name
LIMIT 10;
16. How do you find the second highest salary from the employee table? SELECT MAX(salary)
FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);
17. What is the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER
JOIN? INNER JOIN returns matching rows; LEFT JOIN returns all from the left table; RIGHT
JOIN from the right; FULL OUTER JOIN returns all rows from both.
18. Explain the use of GROUP BY and HAVING clauses in SQL. GROUP BY aggregates data;
HAVING filters groups based on conditions.
19. What is a subquery? Give an example. A subquery is a query within another query, like
SELECT * FROM employees WHERE salary > (SELECT AVG(salary) FROM employees);
20. What is a stored procedure? How is it different from a function? A stored procedure
performs tasks without returning values, while a function returns a value.
21. What is a trigger in SQL? Give an example. A trigger is an automatic action executed
before/after changes in a table, e.g., AFTER INSERT.
22. Explain the use of aggregate functions like COUNT(), SUM(), AVG(), etc. Aggregate functions
perform calculations on multiple rows, e.g., COUNT() counts rows, SUM() adds values.