File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ -- can be used to change the schema.
2
+
3
+ -- > (ADD)
4
+
5
+ -- this will add 2 new column with following names.
6
+ alter table Student ADD ABCID varchar (12 ) ADD PLACEMENTID INT ;
7
+
8
+ alter table Student PRN int not null ;
9
+
10
+ -- -> (MODIFY)
11
+
12
+ -- to change the datatype of column to int
13
+ alter table Student modify PRN int ;
14
+
15
+ alter table Customer modify fname char (1026 );
16
+
17
+ -- > (CHANGE COLUMN) to rename the column attribute and change the datatype of varchar.
18
+ alter table Student CHANGE COLUMN fnmae fname varchar (22 );
19
+
20
+
21
+ -- > (DROP COLUMN) - drop a table completely.
22
+ alter table Student DROP COLUMN col- namee;
23
+
24
+ -- > (RENAME ) to change the name of table.
25
+ alter table Student RENAME TO new- Student;
26
+
27
+
You can’t perform that action at this time.
0 commit comments