Question Bank

SQL & Databases interview questions

A SQL query must remain correct with duplicates, NULL values and unusual relationships between tables. Explain joins and grouping before considering execution cost. Test your reasoning with a small table containing edge cases.

1635
questions
16
categories
50
companies

Showing 20 of 72 questions

EasySQL & Databases

Explain what a primary key is and its role in a relational database.

databaserelational
Practice in bot
EasySQL & Databases

What are the main differences between INNER JOIN and LEFT JOIN?

sqljoin
Practice in bot
MediumSQL & Databases

What is a CTE (Common Table Expression) and when should it be used?

sqlcte
Practice in bot
MediumSQL & Databases

Explain how B-tree indexes work and their advantages over hash indexes.

databaseindexes
Practice in bot
MediumSQL & Databases

When should window functions be used in SQL?

sqlwindow functions
Practice in bot
HardSQL & Databases

Explain the differences between ACID and BASE in the context of databases.

databaseacidbase
Practice in bot
HardSQL & Databases

How does the MVCC (Multiversion Concurrency Control) mechanism work in PostgreSQL?

postgresqlmvcc
Practice in bot
HardSQL & Databases

Explain how replication works in databases and what types exist.

databasereplication
Practice in bot
MediumSQL & Databases

What is sharding and what advantages does it provide in distributed databases?

databasesharding
Practice in bot
EasySQL & Databases

What is the role of the HAVING clause and how does it differ from the WHERE clause?

sqlhavingwhere
Practice in bot
EasySQL & Databases

What are window functions in SQL and how do they differ from aggregate functions?

sqlwindow_functions
Practice in bot
EasySQL & Databases

Explain what a primary key is and how it differs from a unique key.

sqlkeys
Practice in bot
EasySQL & Databases

What is a transaction and what are its main properties according to ACID?

sqltransactions
Practice in bot
MediumSQL & Databases

How does the MVCC mechanism work in PostgreSQL and how does it improve performance?

postgresqlmvcc
Practice in bot
MediumSQL & Databases

Compare B-tree and Hash indexes. When should each be used?

sqlindexes
Practice in bot
MediumSQL & Databases

What is JOIN and what are the main differences between INNER JOIN and LEFT JOIN?

sqljoins
Practice in bot
HardSQL & Databases

Explain the CAP theorem and how it applies to distributed database systems.

distributed_systemscap_theorem
Practice in bot
HardSQL & Databases

How does sharding work and what problems does it help to solve?

shardingdatabases
Practice in bot
HardSQL & Databases

What is pub/sub in Redis and what are its main advantages?

redispub_sub
Practice in bot
HardSQL & Databases

What are the main differences between normalization and denormalization in the context of data modeling?

data_modelingnormalization
Practice in bot

Prepare for your next interview with Vibe Interview.

Download Vibe Interview
SQL & Databases interview questions — page 2 | Vibe Interview