- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
SQL Top 10 Interview question: #sql #databaseconcepts #sqlinterview #programming #dataanlysis
Consider the following SQL query:
ALTER TABLE employees
ADD salary INT NOT NULL;
Assume the employees table already contains 1 million records.
Question: Will this query execute successfully? Why or why not?
Answer:
The query will fail because existing rows do not have values for the new salary column. Since the column is defined as NOT NULL, the database cannot populate existing records with NULL values.
To make this work, you can:
Add a default value:
ALTER TABLE employees
ADD salary INT NOT NULL DEFAULT 0;
Add the column as nullable first:
ALTER TABLE employees
ADD salary INT NULL;
Then update the values and later change the column to NOT NULL.
#sqlinterview #databaseconcepts #sqlinterviewquestionsandanswers #Databasedeveloper
#SQLinHindi
#sqldeveloper
SQL consecutive login streaks
15 SQL Interview Questions TO GET YOU HIRED in 2026 | SQL Interview Questions & Answers
sql interview questions and answers in Hindi
SQL Interview Questions and Answers for Data Analysts (2026)
Видео SQL Top 10 Interview question: #sql #databaseconcepts #sqlinterview #programming #dataanlysis канала SQLCodeClarity
ALTER TABLE employees
ADD salary INT NOT NULL;
Assume the employees table already contains 1 million records.
Question: Will this query execute successfully? Why or why not?
Answer:
The query will fail because existing rows do not have values for the new salary column. Since the column is defined as NOT NULL, the database cannot populate existing records with NULL values.
To make this work, you can:
Add a default value:
ALTER TABLE employees
ADD salary INT NOT NULL DEFAULT 0;
Add the column as nullable first:
ALTER TABLE employees
ADD salary INT NULL;
Then update the values and later change the column to NOT NULL.
#sqlinterview #databaseconcepts #sqlinterviewquestionsandanswers #Databasedeveloper
#SQLinHindi
#sqldeveloper
SQL consecutive login streaks
15 SQL Interview Questions TO GET YOU HIRED in 2026 | SQL Interview Questions & Answers
sql interview questions and answers in Hindi
SQL Interview Questions and Answers for Data Analysts (2026)
Видео SQL Top 10 Interview question: #sql #databaseconcepts #sqlinterview #programming #dataanlysis канала SQLCodeClarity
Комментарии отсутствуют
Информация о видео
5 июня 2026 г. 12:24:27
00:01:05
Другие видео канала





















