Switch to full style
Include SQL commands
Post a reply

SQL ALTER Command

Sun Jul 15, 2012 1:08 pm

ALTER sql command is used to change the table structure. For instance changing
Code:

ALTER TABLE 
'Department' CHANGE 'DepName' 'Name' varchar( 50 )  NOT NULL


Also we can used ALTER command to add constrain to a specific column to be UNIQUE :

Code:

ALTER TABLE 
'Department' ADD UNIQUE ('Dep_id')
 


You can also it to add auto increment to a specific table's column
Code:

ALTER TABLE 
'Department' CHANGE 'Dep_id' 'Dep_id' INTNOT NULL AUTO_INCREMENT




Post a reply
  Related Posts  to : SQL ALTER Command
 Types of Databases and statements, Create, Alter, delete     -  
 DDL Statements-Adding Constraints-CREATE-ALTER-TABLE     -  
 BETWEEN SQL COMMAND     -  
 Average SQL command     -  
 PHP echo command     -  
 SQL COUNT Command     -  
 JVM does not recognize MQ command.     -  
 SQL LIKE query Command     -  
 SQL LOCATE command     -  
 Calling the man Command     -