- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
SQL Interview Question #10 | What is a Composite Key?
SQL Interview Question #10
What is a Composite Key in SQL?
A Composite Key is a combination of two or more columns that together uniquely identify a row in a table.
Individually, the columns may contain duplicate values.
But when combined, they create a unique record.
✅ Combination of multiple columns
✅ Uniquely identifies each row
✅ Used when one column alone is not sufficient
Example:
OrderDetails Table
## OrderID | ProductID
101 | 1
101 | 2
102 | 1
102 | 3
Here:
❌ OrderID is not unique
❌ ProductID is not unique
✅ OrderID + ProductID is unique
Therefore, (OrderID, ProductID) is a Composite Key.
💡 Interview Tip:
When one column cannot uniquely identify a row, combine multiple columns to create a Composite Key.
🔔 Subscribe for daily SQL interview questions and SQL Server interview preparation.
#sql #sqlserver #mssql #compositekey #database #sqlinterview #interviewquestions #learnsql #dba #softwareengineer
Видео SQL Interview Question #10 | What is a Composite Key? канала Krish for tech
What is a Composite Key in SQL?
A Composite Key is a combination of two or more columns that together uniquely identify a row in a table.
Individually, the columns may contain duplicate values.
But when combined, they create a unique record.
✅ Combination of multiple columns
✅ Uniquely identifies each row
✅ Used when one column alone is not sufficient
Example:
OrderDetails Table
## OrderID | ProductID
101 | 1
101 | 2
102 | 1
102 | 3
Here:
❌ OrderID is not unique
❌ ProductID is not unique
✅ OrderID + ProductID is unique
Therefore, (OrderID, ProductID) is a Composite Key.
💡 Interview Tip:
When one column cannot uniquely identify a row, combine multiple columns to create a Composite Key.
🔔 Subscribe for daily SQL interview questions and SQL Server interview preparation.
#sql #sqlserver #mssql #compositekey #database #sqlinterview #interviewquestions #learnsql #dba #softwareengineer
Видео SQL Interview Question #10 | What is a Composite Key? канала Krish for tech
Комментарии отсутствуют
Информация о видео
4 июня 2026 г. 12:45:06
00:00:36
Другие видео канала





















