ALTER TABLE Command in SQL || Lesson 41 || DBMS || Learning Monkey ||
ALTER TABLE Command in SQL
In this class, we will understand ALTER TABLE Command in SQL.
We have already discussed the creation of a table.
ALTER TABLE Command in SQL
Whenever we want to change the structure of a table, then we will use the Data Definition Language Commands or DDL commands.
We use the ALTER TABLE command to add, delete, and modify columns on an existing table or add and drop various constraints on a current table.
This class will use alter table command to add, delete, and modify columns on an existing table.
In the next class, we will cover the alter table command to add and drop various constraints on a current table.
To understand, let us consider the user’s table as shown below.
To the above table, we try to ADD column, DROP column, and MODIFY the column’s datatype.
ADD Column
The syntax to ADD a column is as shown below.
ALTER TABLE table_name ADD column_name datatype;
ALTER TABLE is the keyword used to alter the structure of the table.
ADD is the keyword used to add a column, and we have to provide the name of the column to be added and the datatype of the column.
We add a new column by name pno of int datatype to the above user’s table, as shown below.
ALTER TABLE users ADD pno int;
DROP Column
The syntax to DROP a column is as shown below.
ALTER TABLE table_name DROP COLUMN column_name;
DROP is the keyword used to drop a column, and we have to provide the name of the column to be dropped.
We drop a column by name id.
ALTER TABLE users DROP COLUMN id;
ALTER Column
The syntax to MODIFY a column is as shown below.
ALTER TABLE table_name MODIFY column_name datatype;
MODIFY is the keyword used to modify the data type of a column, and we have to provide the name of the column and the new data type to which it has to be modified.
ALTER TABLE users MODIFY pno varchar(25);
To know whether the column data type has been modified or not we use the desc users; command.
#learningmonkey #dbms #placements #gatecse #gatedbms #campusplacements
Link for playlists:
https://www.youtube.com/channel/UCl8x4Pn9Mnh_C1fue-Yndig/playlists
Link for our website: https://learningmonkey.in
Follow us on Facebook @ https://www.facebook.com/learningmonkey
Follow us on Instagram @ https://www.instagram.com/learningmonkey1/
Follow us on Twitter @ https://twitter.com/_learningmonkey
Mail us @ [email protected]
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «ALTER TABLE Command in SQL || Lesson 41 || DBMS || Learning Monkey ||», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.