Skip to content

Commit d39061d

Browse files
committed
Alter functions....
1 parent 0e9d460 commit d39061d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

14. ALTER.sql

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+

0 commit comments

Comments
 (0)