Page 32 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 32
Unit 2: Database Relational Model
Notes
Projection 3
Pno Pname Plocation Dno Eid
21 Computerization New York 7 12345261
31 Product A Detroit 8 12345265
51 Soft drinks New Jersey 7 12345263
71 Product B New Jersey 7 12345262
Project ( )
This operator is used to display the list of attributes/columns defined in the relation R.
The syntax for “Project” operator is
(tablename)’R’
(attributes)
(table name)’
(columns)
Example: To display project No, DNo from relation PROJECT,
we can write:
(PROJECT )
PNo, Dmo
Now only these columns are selected and displayed while other columns are eliminated from
the relation.
Projection 4
PNo DNo
21 7
31 8
41 9
51 7
61 8
71 9
(EMPLOYEE)
sex, salary
This query will display the columns sex and salary from employee. However, it must be noted
that the duplicate values are not repeated in the new relation. Only unique topples are listed.
This elimination of duplicate values is called as duplicate elimination and hence reduces
redundancy. The following relations will be displayed.
Projection 5
Sex Salary
M 25000
M 55000
M 20000
M 40000
F 35000
F 42000
LOVELY PROFESSIONAL UNIVERSITY 25