PyCodePro

Previously LP16 - A website that teaches Python programming language through interactive tutorials, practice exercises, and real-world projects.

Alter Commands - 02

ALTER COMMANDS - 02


Hey Guys Welcome To Our New Blog Post In this Post We learn about the alter commands of SQL .


IN PREVIOUS BLOG

 In our previous blog we also learn about the alter commands of the SQL but in previous blog we learn to add column in the after the creation of the table .

IN TODAY'S BLOG


 In todays post we also learn more about the alter commands of the sql and in this post we also learn that how to modify the columns and we also learn that how to delete a particular column or how to delete the entire table now without any late lets begin todays blog -


ALTER COMMAND TO MODIFY THE RANGE


sometimes while creating the table we put very small range for the characters which we enter later but after creating and writing the range of table you realize that the range is too short but to increase the range there is a command in SQL which is basically known as the modify command of the sql this command is enter as -


ALTER TABLE ________ MODIFY ________


in the first space we need to enter the table name and in the second space we need to enter the column name data type and the range of the characters which we enter later . lets expand this command this command is used as -

ALTER TABLE ( TABLE NAME ) MODIFY ( COLUMN NAME DATA TYPE ( RANGE ) ) ;

 NOW LETS TAKE A EXAMPLE suppose there is a table named studies and there is a column named subject and the range of the column  named subject is 15 and now you wish to increase the range from 15 to 20 then you need to enter the modify command as -
 ALTER TABLE STUDIES MODIFY SUBJECT CHAR ( 20 ) ;
   this is all about the alter command to modify range

ALTER COMMAND TO DELETE  COLUMN 


sometime you need to delete a particular column from the table and you are the maddest person in this world if you gonna create a new table without adding that column you wish to delete but in this updated world there is a command in sql to delete the particular column from the table then we need to use the drop command of the sql now we use this command as -

ALTER TABLE _________  DROP ___________

NOW IN THIS COMMAND In the first space we need to enter the table name and in the second space we need to enter the column name as shown below -

ALTER TABLE ( TABLE NAME ) DROP ( COLUMN NAME ) ;

NOW LETS take a example suppose there is a table named furniture and from that table we need to remove the column of chairs now to remove the column we need to enter the drop command which is used as -
ALTER TABLE FURNITURE DROP CHAIRS ;
this is all about the alter command to delete columns

ALTER COMMAND TO DELETE COMPLETE TABLE 


now to delete the whole table we need to enter the another drop command As -

DROP TABLE ________ ;

in the first space we need to enter the table name and then we need to terminate the command lets take a example suppose there is a table named copies and we need to enter the command as -

DROP TABLE COPIES ;

this is all about the alter commands in the sql and thank you for visiting .


IN THE NEXT BLOG WE LEARN MORE ABOUT THE DDL IN THE SQL AND OTHER COMMANDS AND THE OTHER WORKING  IN PYTHON AND OTHER IMPORTANT SUB TOPICS . THANK YOU FOR VISITING , KEEP LEARNING STAY TUNED FOR NEXT BLOG , FOLLOW OUR BLOG FOR REGULAR UPDATES , VIEW OUR PREVIOUS BLOG FOR THE BASIC CONCEPTS OF PYTHON AND OTHER BASIC CONCEPTS OF COMPUTER AND ALSO FOR THE IMPORTANT DEFINITIONS OF THE SQL , VISIT OUR SECOND BLOG – indianbasics.blogspot.com , VISIT OUR YOUTUBE CHANNEL -  Learn Python Our youtube channel will give you the short motivational speeches of the great person in the present there is only five motivational videos on channel but in future I will upload the motivational videos soon .VISIT OUR INSTAGRAM PAGE – instagram.com/learnpython16 , Our instagram page is also a new page i just created few days ago but stay tuned I will upload the post very soon . Please support us by following our blog and by subscribing our youtube channel and by following our instagram page .

Alter Commands - 02 Alter Commands - 02 Reviewed by Learn Python on December 16, 2019 Rating: 5

No comments:

Powered by Blogger.