Docsity

Database Management System: Altering Tables and Data Manipulation, Slides of Introduction to Database Management Systems

Partial preview of the text

Download Database Management System: Altering Tables and Data Manipulation and more Slides Introduction to Database Management Systems in PDF only on Docsity!

Database

Management

System

Lecture - 27

Alter Table Statement

Purpose is to make changes in the

definition of a table already created

through Create statement

Can add, drop attributes or

constraints, activate or deactivate

constraints; the format is

ALTER TABLE Student

add constraint fk_st_pr

foreign key (prName) references

Program (prName)

ALTER TABLE program

add constraint ck_totSem

check (totSem < 9)

Alter Table Command

Removing or Changing Attribute

ALTER TABLE student

ALTER COLUMN stFName char(20)

Alter table student

drop column curSem

Alter table student

drop constraint ck_st_pr

Data Manipulation Language

Insert

Select

Update

Insert Statement

 To insert records into tables
 INSERT [ INTO] table
{ [ ( column_list ) ]
{ VALUES
( { DEFAULT | NULL | expression } [ , ... n ] )
| DEFAULT VALUES