ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

ADD and DROP a Constraint using ALTER TABLE command in SQL || Lesson 42 || DBMS || Learning Monkey |

ADD and DROP a Constraint using ALTER TABLE command in SQL

add constraint primary key

drop constraint oracle

drop constraint sql server

alter table in sql

alter table command in sql

sql

sql commands

sql commands tutorial for beginners

dbms

dbms for placements

dbms for placement preparation

learning monkey

learning monkey dbms

gate cse

gate cse dbms

gate cse full course

gate cse free lectures

gate cse free online coaching

gate cse free course

gate cs syllabus

Автор: Wisdomers - Computer Science and Engineering

Загружено: 2021-10-25

Просмотров: 22390

Описание: ADD and DROP a Constraint using ALTER TABLE command in SQL

In this class, we will understand ADD and DROP a Constraint using ALTER TABLE command in SQL.

We have already discussed the concepts of ADD, DROP, and MODIFY columns of a table.

ADD and DROP a Constraint using ALTER TABLE command in SQL

This class will understand how to ADD and DROP a Constraint using ALTER TABLE command in SQL.

To understand, we will consider the user’s table as shown below.

The above is what we have considered in our previous class.

We haven’t created a primary key for the user’s table.

We will now alter the table by adding the id column as the primary key.
ADD Constraint

ALTER TABLE users ADD CONSTRAINT pk_users PRIMARY KEY (id);

In the above command, ADD CONSTRAINT is the keyword used to add a constraint.

Whenever we add a constraint, we have to give the name of the ‘constraint.’

In our case, we have given the name pk_users.

These names are significant because they are used in the future to change the constraints.

The new constraint has been added.

To check whether the constraint has been altered, let us insert the row as shown below.

DROP Constraint

ALTER TABLE users DROP CONSTRAINT pk_users;

The DROP CONSTRAINT is the keyword used to drop the constraint.

In the above command, the constraint name has been used.

By executing the above command, the primary key constraint will get dropped.

To check whether the constraint has been dropped or not, we will insert the row as shown below.


Even though the id value exists in the id column, the row will get inserted.


#learningmonkey #dbms #placements #gatecse #gatedbms #campusplacements

Link for playlists:
   / @wisdomerscse  


Link for our website: https://learningmonkey.in

Follow us on Facebook @   / learningmonkey  

Follow us on Instagram @   / learningmonkey1  

Follow us on Twitter @   / _learningmonkey  

Mail us @ [email protected]

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
ADD and DROP a Constraint using ALTER TABLE command in SQL || Lesson 42 || DBMS || Learning Monkey |

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]