Finance[US] Career Guide Free Tutorials Go to Your University Placement Preparation 
0 like 0 dislike
650 views
in RTU/BTU B.Tech (CSE-IV Sem) DBMS Lab by Goeduhub's Expert (7.6k points)
Implementation of Alter Query

1 Answer

0 like 0 dislike
by Goeduhub's Expert (7.6k points)
edited by
 
Best answer

SQL Alter Query 

Alter : ALTER TABLE is used to add, delete/drop or modify columns in the existing table. It is also used to add and drop various constraints on the existing table.

syntax : ALTER TABLE table_name  ADD (Columnname_1  datatype, Columnname_2  datatype,…Columnname_n  datatype);

  • ALTER Table - DROP :

syntax : ALTER TABLE table_name DROP COLUMN column_name;

Example :  

roll nonameclassaddressmarks
1Aman2GOA100
2Ankita3DELHI99
3Ananya4BHUTAN98
4Atul5SIKAR100
ALTER TABLE school DROP COLUMN address;

Output : 

roll nonameclassmarks
1Aman2100
2Ankita399
3Ananya498
4Atul5100
  • ALTER Table - MODIFY :

syntax : ALTER TABLE table_name MODIFY column_name column_type;

Example : 

ALTER TABLE school ADD (AGE number(3),Subject varchar(20)); 


Output : 

roll nonameclassmarksAGESubject
1Aman2100
2Ankita399
3Ananya498
4Atul5100
ALTER TABLE school ADD (AGE number(3),Subject varchar(40)); 

For more Manipal University Jaipur CSE-IV Sem DBMS Lab Experiments CLICK HERE

Learn & Improve In-Demand Data Skills Online in this Summer With  These High Quality Courses[Recommended by GOEDUHUB]:-

Best Data Science Online Courses[Lists] on:-

Claim your 10 Days FREE Trial for Pluralsight.

Best Data Science Courses on Datacamp
Best Data Science Courses on Coursera
Best Data Science Courses on Udemy
Best Data Science Courses on Pluralsight
Best Data Science Courses & Microdegrees on Udacity
Best Artificial Intelligence[AI] Courses on Coursera
Best Machine Learning[ML] Courses on Coursera
Best Python Programming Courses on Coursera
Best Artificial Intelligence[AI] Courses on Udemy
Best Python Programming Courses on Udemy

Related questions

 Important Lists:

Important Lists, Exams & Cutoffs Exams after Graduation PSUs

 Goeduhub:

About Us | Contact Us || Terms & Conditions | Privacy Policy ||  Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 

 

Free Online Directory

...