Professional Documents
Culture Documents
(DBMS)
CAP200
By Priyanka Athia
Rows/Records/tuples
Notation: E X D
Salary
Salary
• Left outer join contains the set of tuples of all combinations in R and S that are
equal on their common attribute names.
• In the left outer join, tuples in R have no matching tuples in S.
• It is denoted by ⟕.
• Right outer join contains the set of tuples of all combinations in R and S that are
equal on their common attribute names.
• In right outer join, tuples in S have no matching tuples in R.
• It is denoted by ⟖.
A𝖴B
(A ∩ B) 𝖴 B
The ALTER TABLE statement is used to add, delete, or modify columns in an existing table . The ALTER TABLE
statement is also used to add and drop various constraints on an existing table.
• Add columns
alter table emp2 add class varchar(20 );
• Remove columns
alter table emp2 drop column class;
• Modify datatype
alter table emp2 modify numberr int;
• Modify datatype length
alter table emp2 add newname varchar(20);
alter table emp2 modify newname varchar(40);
• Add constraints
alter table emp2 add primary key(id);
• Remove constraints
alter table emp2 drop primary key;
• Rename column table
alter table emp2 rename column numberr to roll_no;
***
•Use of both insert and select
This will copy the table1 to table2
Insert into table1(column1,column2,columnN)
Select column,coulmn2,columnN from table2
Insert into table1(id,firstname,lastname)
Select id2,firstname2,lastname from table2
Example:
TRUNCATE TABLE Customer;