Database and SQLMedium#31What is a database index, and why is it important?A database index speeds up data retrieval, similar to a book's index, improving query performance.
Database and SQLMedium#32Explain the differences between SQL and NoSQL databases.SQL databases use structured query language with a predefined schema; NoSQL databases store schema-less data with flexible models.
Database and SQLMedium#33What is a foreign key in a database?A foreign key links two tables by referring to the primary key in another table, ensuring referential integrity.
Database and SQLHard#34Describe the ACID properties in database transactions.ACID: Atomicity (indivisible transactions), Consistency (consistent state transitions), Isolation (independent transactions), Durability (persisted changes).
Database and SQLEasy#35How do you optimize a SQL query for better performance?Optimize using indexes, efficient SQL, limiting data retrieval, analyzing query performance, and considering denormalization.
Database and SQLHard#36What is normalization in database design?Normalization organizes data into separate tables to reduce redundancy and improve integrity, following normalization forms.
Database and SQLMedium#37Explain the difference between INNER JOIN and LEFT JOIN in SQL.INNER JOIN returns matching rows from both tables; LEFT JOIN returns all rows from the left table and matching rows from the right.
Database and SQLMedium#38What is a stored procedure, and when would you use one?Stored procedures are precompiled SQL statements for data manipulation and logic, used for repetitive tasks and improving performance.
Database and SQLMedium#39What is database denormalization, and when is it appropriate?Denormalization introduces redundancy for performance, useful in read-heavy scenarios at the expense of storage and complexity.
Database and SQLMedium#40Discuss the advantages and disadvantages of using an ORM tool.ORM simplifies database interactions and is language-agnostic. It can introduce performance overhead and may limit database features.