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

What is a JOIN in SQL and what types of JOINs exist?

sqljoins
Practice in bot
EasySQL & Databases

Explain the differences between GROUP BY and HAVING.

sqlgroup byhaving
Practice in bot
EasySQL & Databases

What are indexes and how do they work in PostgreSQL?

postgresqlindexes
Practice in bot
MediumSQL & Databases

Explain what a CTE is and when it should be used.

sqlcte
Practice in bot
MediumSQL & Databases

How does the MVCC mechanism work in PostgreSQL?

postgresqlmvcc
Practice in bot
MediumSQL & Databases

Compare ACID and BASE. In what scenarios should each model be used?

databasesacidbase
Practice in bot
MediumSQL & Databases

When should subqueries be used instead of JOINs?

sqlsubqueriesjoins
Practice in bot
HardSQL & Databases

What is a deadlock and how can it be avoided in transactions?

transactionsdeadlocks
Practice in bot
HardSQL & Databases

How does sharding work in NoSQL databases?

nosqlsharding
Practice in bot
HardSQL & Databases

Explain how ClickHouse works and how it differs from relational databases.

clickhousecolumnar dbs
Practice in bot
EasySQL & Databases

What are indexes in databases and how do they work?

indexesdatabases
Practice in bot
EasySQL & Databases

What is a subquery and how does it differ from a regular query?

subqueriessql
Practice in bot
EasySQL & Databases

Explain the difference between HAVING and WHERE in SQL.

group bysql
Practice in bot
MediumSQL & Databases

How do window functions work in SQL and when should they be used?

window functionssql
Practice in bot
MediumSQL & Databases

Explain what MVCC is and how it works in PostgreSQL.

postgresqlmvcc
Practice in bot
MediumSQL & Databases

What is ACID and why is it important for transactions in databases?

transactionsacid
Practice in bot
HardSQL & Databases

Compare SQL and NoSQL databases. In what cases might each be preferable?

sql vs nosqldatabases
Practice in bot
HardSQL & Databases

Explain the CAP theorem. How does it affect the design of distributed systems?

cap theoremdistributed systems
Practice in bot
HardSQL & Databases

When does it make sense to use table partitioning in PostgreSQL?

partitioningpostgresql
Practice in bot
MediumSQL & Databases

How does replication work in databases and what types are there?

replicationdatabases
Practice in bot

Prepare for your next interview with Vibe Interview.

Download Vibe Interview
SQL & Databases interview questions | Vibe Interview