Top SQL Interview Questions and Answers for 2026

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/22

flashcard set

Earn XP

Description and Tags

A collection of vocabulary flashcards derived from SQL interview topics to aid in studying key terms and their definitions.

Last updated 4:06 AM on 2/3/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

23 Terms

1
New cards

SQL

Structured Query Language, used for interaction with relational database management systems (RDBMS). This includes fetching, updating, inserting, and removing data from tables.

2
New cards

What are the main applications of SQL?

  • Create, delete, and update tables in a database

  • access, manipulate, and modify data in a table

  • retrieve and summarize the necessary information from a table or several tables

  • add or remove certain rows or columns from a table.

3
New cards

Outer Join

returns matched values and unmatched values from either or both tables. Left Join and Right Join are considered types of Outer Join.

Use case: Useful for combining data that exists in either of the tables and capturing unmatched data from both tables.

4
New cards

Inner Join

returns only those records that satisfy a defined join condition in both (or all) tables. Default Join.

Use case: Used when you need to retrieve records with matching values in both tables. Commonly used for combining data that is related through a foreign key.

5
New cards

Cross Join

returns the Cartesian product of two tables, combining each row from the first table with every row from the second table.

Use case: Typically used when you need all combinations of two datasets, such as generating test data or exploring all possible combinations.

6
New cards

Left Join vs Right Join

Left Join returns all records from the left table and matched records from the right table, while Right Join returns all records from the right table and matched records from the left table. The result will include Null values in the columns of the unmatched records from the respective tables.

Use case (L): Useful for retrieving all records from the left table, with the matching data in the right table, if available. Often used when you need to find all entries in one table and see if they have corresponding entries in another.

Use case (R): Similar to LEFT JOIN but focuses on the right table. Used when you need all records from the right table whether or not they have matches in the left table.

7
New cards

Self Join

a join in which a table is joined with itself

Use case: Employed when you need to compare rows within the same table, such as finding relationships in hierarchical data or comparing values in various rows.

8
New cards
9
New cards
10
New cards

What is the difference between the WHERE and ON clauses in SQL JOINS?

The purpose of the ON clause is to specify the join conditions, in other words, to define how the tables should be joined. Specifically, you define how the records should be matched.

In contrast, the WHERE clause is used to specify the filtering conditions, that is, to define which rows should be kept in the result set. A JOIN that includes a filtering condition can be considered a conditional JOIN.

11
New cards

SQL Database

CREATE DATABASE: creates a new SQL database with specified name

DROP DATABASE: used to delete an existing SQL database

BACKUP DATABASE: used to create full back up of an existing SQL database

BACKUP DATABASE WITH DIFFERENTIAL: creates differential back up of an existing database. differential back up backs up only those parts of the database which have been changed since last back up.

12
New cards

Primary Key

A unique identifier for a record in a table, ensuring no duplicate or null values.

13
New cards

Foreign Key

A column that creates a relationship between two tables by linking to the primary key of another table.

14
New cards

Index

A data structure that improves the speed of data retrieval operations in a database.

15
New cards

Normalization

The process of organizing data in a way that reduces redundancy and dependency.

16
New cards

Denormalization

The process of combining data from multiple tables to improve read performance.

17
New cards

Constraint

A set of rules that defines the allowed values in a column, ensuring data integrity.

18
New cards

Aggregate Function

A function that performs a calculation on a set of values and returns a single value.

19
New cards

Scalar Function

A function that operates on a single value and returns a single value.

20
New cards

Transaction

A sequence of operations performed as a single logical unit of work, managed to ensure data integrity.

21
New cards

WHERE Clause

A clause used to specify conditions for filtering records in a SQL query.

22
New cards

HAVING Clause

A clause used to filter records after aggregation has been applied, often following GROUP BY.

23
New cards

View

A virtual table created by a query that selects data from one or more tables.