Vous êtes sur la page 1sur 98

DATABASE MANAGEMENT SYSTEM

6/15/2011

- B.U.Anu Barathi

Unit 1: Introduction :
         

Introduction to Database Database Systems Vs File Systems View of data Data Models Data base languages Transaction Management Database systems Structure History of Database Systems Database Systems Applications Entity Relationship Model
- B.U.Anu Barathi 2

6/15/2011

INTRODUCTION
What
 Data  Data

is Data ?

is stored facts.

may be numerical data which may be integers or floating point numbers, and non-numerical data such as characters, date and etc.,

6/15/2011

- B.U.Anu Barathi

Example:
98 89 87 92 phy chem maths biology

The above numbers may be anything: It may be distance in kms or amount in rupees or no of days or marks in each subject etc.,
6/15/2011 - B.U.Anu Barathi 4

What is information ?
Information is RELATED DATA. The data ( information) which is used by an organisation a college, a library, a bank, a manufacturing company is one of its most valuable resources.

phy chem maths biology


6/15/2011 - B.U.Anu Barathi

98 89 87 92
5

What is Database ?
Database is a collection of information organized in such a way that a computer program can quickly select desired pieces of data.

phy chem maths biology

98 89 87 92

phy chem maths biology

76 87 79 88

phy chem maths biology


6/15/2011

86 80 79 88

phy chem maths biology

91 67 87 77
6

- B.U.Anu Barathi

Database Management System (DBMS)


A collection of programs that enables you to store, modify, and extract information from a database.


DBMS contains information about a particular enterprise


Collection of interrelated data Set of programs to access the data An environment that is both convenient and efficient to use

Database Applications:
Banking: all transactions Airlines: reservations, schedules Universities: registration, grades Sales: customers, products, purchases Online retailers: order tracking, customized recommendations Manufacturing: production, inventory, orders, supply chain Human resources: employee records, salaries, tax deductions

Databases touch all aspects of our lives

6/15/2011

- B.U.Anu Barathi

Database Systems Vs File Systems


In the early days, database applications were built directly on top of file systems  Drawbacks of using file systems to store data:


Data redundancy and inconsistency


Multiple file formats, duplication of information in different files

Difficulty in accessing data


Need to write a new program to carry out each new task

Data isolation multiple files and formats Integrity problems


Integrity constraints (e.g. account balance > 0) become buried in program code rather than being stated explicitly Hard to add new constraints or change existing ones
6/15/2011 - B.U.Anu Barathi 8

Database Systems Vs File Systems Cont.




Drawbacks of using file systems (cont.)


Atomicity of updates
Failures may leave database in an inconsistent state with partial updates carried out Example: Transfer of funds from one account to another should either complete or not happen at all

Concurrent access by multiple users


Concurrent accessed needed for performance Uncontrolled concurrent accesses can lead to inconsistencies
Example: Two people reading a balance and updating it at the same time

Security problems
Hard to provide user access to some, but not all, data

Database systems offer solutions to all the above problems

6/15/2011

- B.U.Anu Barathi

View of data Data Abstraction:




Physical level: describes how a record (e.g., customer) is stored. Logical level: describes data stored in database, and the relationships among the data.
type customer = record customer_id : string; customer_name : string; customer_street : string; customer_city : integer;
end; (PASCAL CODE)

View level: application programs hide details of data types. Views can also hide information (such as an employees salary) for security purposes.
- B.U.Anu Barathi 10

6/15/2011

View of data Contd.


An architecture for a database system:

6/15/2011

- B.U.Anu Barathi

11

Instances and Schemas


 

Similar to types and variables in programming languages Schema the logical structure of the database
Example: The database consists of information about a set of customers and accounts and the relationship between them) Analogous to type information of a variable in a program Physical schema: database design at the physical level Logical schema: database design at the logical level

Instance the actual content of the database at a particular point in time


Analogous to the value of a variable

Physical Data Independence the ability to modify the physical schema without changing the logical schema
Applications depend on the logical schema In general, the interfaces between the various levels and components should be well defined so that changes in some parts do not seriously influence others.

6/15/2011

- B.U.Anu Barathi

12

Instances and Schemas


 DB

Schema Diagram for a Company:

Employee:

Eno

Ename

Salary

Address

6/15/2011

- B.U.Anu Barathi

13

Instances and Schemas


DB Schema Diagram for a Company:

Department: Dno Project: Pno


6/15/2011

Dname

Dlocation

Pname
- B.U.Anu Barathi

Hours
14

Instances and Schemas


 Instance

Example: Ename
A B C

Eno
1 2 3

Salary
10,000 20,000 30,000

Address
First street Second street Third street

6/15/2011

- B.U.Anu Barathi

15

Data Independence
Three schema architecture for a database system: External schema View1 View2 View n

Conceptual Schema Internal/Physic al level Internal Schema

Conceptual mapping

Disk
6/15/2011 - B.U.Anu Barathi 16

Data Independence
 Two

types of Data Independence  Logical Data Independence


Capacity to change the conceptual schema without having to change external schema

 Physical

Data Independence

Capacity to change the Internal schema without having to change external schema
6/15/2011 - B.U.Anu Barathi 17

DBMS Languages:
Types

Data Definition Language( DDL) storage definition language (SDL) storage definition language (SDL)
6/15/2011

Data Manipulation Language (DML) Procedural DML

Non-Procedural DML
- B.U.Anu Barathi 18

DBMS Languages
Data Definition Language (DDL):
Used by the DBA and database designers to specify the conceptual schema of a database. In many DBMSs, the DDL is also used to define internal and external schemas (views). In some DBMSs, separate storage definition language (SDL) and view definition language (VDL) are used to define internal and external schemas. SDL is typically realized via DBMS commands provided to the DBA and database designers
6/15/2011 - B.U.Anu Barathi 19

DBMS Languages
Data Manipulation Language (DDL):


Data Manipulation Language (DML):


Used to specify database retrievals and updates DML commands (data sublanguage) can be embedded in a general-purpose programming language (AKA host language), such as COBOL, C, C++, or Java. Alternatively, stand-alone DML commands can be applied directly (called a query language).

6/15/2011

- B.U.Anu Barathi

20

Data Definition Language (DDL):

Used by the DBA and database designers to specify the conceptual schema of a database. In many DBMSs, the DDL is also used to define internal and external schemas (views). In some DBMSs, separate storage definition language (SDL) and view definition language (VDL) are used to define internal and external schemas.
SDL is typically realized via DBMS commands provided to the DBA and database designers
6/15/2011 - B.U.Anu Barathi 21

Data Manipulation Language (DML)


Language for accessing and manipulating the data organized by the appropriate data model DML also known as query language  Two classes of languages Procedural user specifies what data is required and how to get those data Declarative (nonprocedural) user specifies what data is required without specifying how to get those data  SQL is the most widely used query language

6/15/2011 - B.U.Anu Barathi 22

Data Definition Language (DDL)




 

Specification notation for defining the database schema Example: create table account ( account-number char(10), balance integer) DDL compiler generates a set of tables stored in a data dictionary Data dictionary contains metadata (i.e., data about data) Database schema Data storage and definition language Specifies the storage structure and access methods used Integrity constraints Domain constraints Referential integrity (references constraint in SQL) Assertions Authorization

6/15/2011

- B.U.Anu Barathi

23

DDL statements/commands in SQL


     

Create table table name(list of attribute & their datatypes); Create schema schema name authorization author name; Drop schema schema name cascade/restrict; Drop table tablename cascade/restrict; Alter table talename add/drop Create view view name as (select ..)

6/15/2011

- B.U.Anu Barathi

24

Transaction Management
A transaction is a collection of operations that performs a single logical function in a database application  Transaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures.  Concurrency-control manager controls the interaction among the concurrent transactions, to ensure the consistency of the database.

6/15/2011 - B.U.Anu Barathi 25

Database users and DBA (Database Administrator)

Database users
can classify users of db into many types.  Nave users  Application Programmers  Sophisticated users  Specialized users
 We
6/15/2011 - B.U.Anu Barathi 26

Database users and DBA (Database Administrator)

Database users


Nave users:

- who interact with the system by invoking one of the




application programs that have been previously written. Application Programmers: - Computer professionals who write application programs. Sophisticated users - form their requests in a db query language such as SQL and submit them to a query processor. Specialized users: - Sophisticated users who write specialized db applications
- B.U.Anu Barathi 27

6/15/2011

Database users and DBA (Database Administrator)

DBA (Database Administrator)


    

DBA is a person who has central control over the system. DBA is responsible for authorizing access to the db. DBA is responsible for acquiring s/w and h/w resources. DBA is responsible for coordinating and monitoring the use of db. DBA creates original db schema by executing a set of data definition stmts in DDL.
- B.U.Anu Barathi 28

6/15/2011

Overall System Structure

6/15/2011

- B.U.Anu Barathi

29

Database system Structure


 The

functional components can be broadly divided into the manager  Query Processor.
 Storage

6/15/2011

- B.U.Anu Barathi

30

Storage Manager


It is a pgm module that provides the interface b/w the low level data stored in the db and the app.pgms & queries submitted to the system. It translates the various DML statements into file system commands. It is responsible for storing, retrieving and updating data in the database.
- B.U.Anu Barathi 31

6/15/2011

Storage Manager



The storage manager components includes:

Authorization & Integrity Manager:  - It tests for the satisfication of integrity constraints and checks the authority of users to access data.  File Manager:  - allocation of files and disk & data structures used to represent information stored on disk.
6/15/2011 - B.U.Anu Barathi 32

Storage Manager
 Buffer


Manger:

- to decide what data to cache in mainmemory in orde to speed up the accessing of data.  Transaction Manager:  - db remains in a consistent state despite system failures and that concurrent transaction execution proceed without conflicting.

6/15/2011

- B.U.Anu Barathi

33

Storage Manager
 The

SM implements several DS such

as,
Data files which store db  Data dictionary which stores meta data about the structure of the db.  Indices: It is a file that provides fast access of data items that hold particular values.


6/15/2011

- B.U.Anu Barathi

34

Query Processor
 

It includes DDL Interpreter: - which interprets DDL sts and records the definitions in the data dictionary. DML Compiler: - It translates DML sts into an evaluation plan consisting of low level instructions that the qury evaluation engine understands. Query Evaluation Engine: -Which executes low level instructions generated by DML compiler.
- B.U.Anu Barathi 35

6/15/2011

Data Models


A collection of tools for describing


Data Data relationships Data semantics Data constraints

    

Relational model Entity-Relationship data model (mainly for database design) Object-based data models (Object-oriented and Objectrelational) Semistructured data model (XML) Other older models:
Network model Hierarchical model

6/15/2011

- B.U.Anu Barathi

36

Data Models
A Data

model is a set of concepts that can be used to describe the structure of the db.
A collection of Conceptual tools for describing Data Data relationships Data semantics Data constraints Different data Models - Relational model - Entity-Relationship data model (Conceptual Model-mainly for database design) - Object-based data models (Object-oriented and Object-relational) - Semi structured data model (XML) Other older models: Network model Hierarchical model
- B.U.Anu Barathi 37

 

6/15/2011

EntityEntity-Relationship data model




It is a high level conceptual data model that describes the structure of db in terms of entities, relationship among entities & constraints on them..

Basic Concepts of E-R Model:

- Entity

- Entity Set - Attributes - Relationship - Relationship set - Identifying Relationship


I
6/15/2011 - B.U.Anu Barathi 38

EntityEntity-Relationship data model


 Entity:

-It is a an object that exists in the real world.  Example: - Person, Employee, Car, Home etc..
Object with conceptual Existence - Account, loan, job etc
6/15/2011 - B.U.Anu Barathi 39

EntityEntity-Relationship data model


 Entity

Set: - A set of entities of the same type.  Attributes: - A set of properties that describe an entity.
6/15/2011 - B.U.Anu Barathi 40

EntityEntity-Relationship data model





Types of Attributes:

Simple (or) atomic vs. Composite:  - An attribute which cant be sub divided. (Eg.Age)  - An attribute which can be divided into sub parts is called  as composite attribute. Address- Apartment no. e.g.. - Street - Place - City - District Single Valued vs. Multivalued:  -An attribute having only one value (e.g.. Age,eid,sno)  - An attribute having multiple values (e.g.. Deptlocat- A dept can be located in several places)
6/15/2011 - B.U.Anu Barathi 41

EntityEntity-Relationship data model


 

Stored Vs Derived - Stored attribute is one that has some value


where as derived attribute is a one where its value is derived from sa. -E.g.. SA-DOB DA- Age derived from DOB. Key Attribute: - An attribute which is used to uniquely identify records. E.g.. eid, sno, dno
- B.U.Anu Barathi 42

    

6/15/2011

EntityEntity-Relationship data model


 Relationship: 

- It is an association among
several entities. It specifies what type of relationship exists between entities.

6/15/2011

- B.U.Anu Barathi

43

EntityEntity-Relationship data model


 

E N T I T Y S E T

Relationship set: - It is a set of relationships of the same type. Entity


1 AA 1000 1 AA AC

BB

2000

BB

AD

100

FFF 10000
- B.U.Anu Barathi Relationship Set

100

FFF

SD

6/15/2011 Emp.. ENTITY

TYPE

44 DEPT. ENTITY TYPE

EntityEntity-Relationship data model


Entity Set:  - No key attributes.  Identifying Relationship:  - The relationship associated with the weak entity type
 Weak

6/15/2011

- B.U.Anu Barathi

45

Constraints


Two of the most important constraints are

a. Mapping Constraints  b. Participation constraints




Participation constraints

Total Participation

Partial Participation

6/15/2011

- B.U.Anu Barathi

46

a. Mapping Cardinalities:
Mapping Cardinalities OR CARDINALITY RATIOS, EXPRESSS THE NUMBER OF ENTITIES TO WHICH ANOTHER ENTITY CAN BE ASSOCIATED VIA A RELATIONSHIPSET.
  

Several types of Mapping Cardinalities. They are, a.i. One-to-One An entity in set A is associated with at most one entity in set B and vice versa.

e1 e2 e3

d1 d2 d3

Employee
6/15/2011

- B.U.Anu Barathi

Works for

Dept.

47

a. Mapping Cardinalities:
a.i. One-to-many  An entity in set A is associated with zero or more no. of entities in set B and an entity in B is associated with at most one entity in A.


e1 e2 e3

d1 d2 d3 Works for
- B.U.Anu Barathi

Employee
6/15/2011

Dept.
48

a. Mapping Cardinalities:
a.i. Many-to-One  One or more no. of entities in set A is associated with at most one entity in B. An entity in B can be associated with any no. of entities in A.


e1 e2 e3 e4 Employee
6/15/2011

d1 d2 d3 Works for
- B.U.Anu Barathi

Dept.
49

a. Mapping Cardinalities:
 a.i.

Many-to-Many  One or more no. of entities in set A is associated with one or more no. of entities in set B.
e1 e2 e3 e4 Employee
6/15/2011

d1 d2 d3 Works for
- B.U.Anu Barathi

Dept.
50

b. Participation Constraints: Constraints: Total Participation




The participation of an entity set E in a relationship set R is said to be total if every entity in E participates in atleast one relationship in R.

Partial Participation:
an entity set E in a relationship set R is said to be partial if only a few of the entities in E participated in relationship in R.
The participation of

6/15/2011

- B.U.Anu Barathi

51

b. Participation Constraints: Constraints:


 E.G..

Employee Partial participation

Manages Total participation

Dept.

6/15/2011

- B.U.Anu Barathi

52

Keys
 It

is used to uniquely identify entities within a given entityset or a relationship set.  Keys in Entity set:  (i) Primary Key:
It is a key used to uniquely identify an entity in the entity set. E,g, eno,rno,dno etc
6/15/2011 - B.U.Anu Barathi 53

Keys
 Super

Key:  It is a set of one or more attributes that allow us to uniquely identify an entity in the entity set. Among them one must be a primary key attribute.  E.G.. Eid (primary key) and ename together can be identify an entity in entity set.
6/15/2011 - B.U.Anu Barathi 54

Keys
   

Candidate key: They are minimal super keys for which no proper subset is a superkey. E.g.. Ename and eaddr can be sufficient to identify an employee in employee set. {eid} and {ename,eaddr} Candidate keys

6/15/2011

- B.U.Anu Barathi

55

FOREIGN Keys
 An

-----------------------

attribute which makes a reference to an attribute of another entity type is called foreign key

6/15/2011

- B.U.Anu Barathi

56

Key


E.g

Employee E1 eid Ename eaddr dno

Foreign Key

dno
6/15/2011

dname
- B.U.Anu Barathi

dloc Dept E2
57

Domain


A range of values can be defined for an attribute and is called as Domain of that attribute.

 

E.g.. Age attribute A Domain (A)= {1,2,.100}

6/15/2011

- B.U.Anu Barathi

58

Keys in Relationship set:




Case 1: If the relationship set R has

no attributes, then the set of attributes Primarykey(E1) U Primarykey(E2) U Primarykey (n) Case2: If the relationship set R has attributes, then the set of attributes,
6/15/2011 - B.U.Anu Barathi 59

Keys in Relationship set


Primarykey(E1) U Primarykey(E2) U Primarykey (n)U{a1,a2,an} describes an individual relationship in set R. In both cases, Primarykey(E1) U Primarykey(E2) U Primarykey (n) forms a superkey for a relationship set.

6/15/2011

- B.U.Anu Barathi

60

E-R Diagram
 Symbol

Description

Entity Type Attribute

Key Attribute
6/15/2011 - B.U.Anu Barathi 61

E-R Diagram
Symbol Description
Composite Attribute

Multivalued attribute Attribute

6/15/2011

- B.U.Anu Barathi

62

E-R Diagram
Symbol Description
Derived Attribute

Relationship

6/15/2011

- B.U.Anu Barathi

63

E-R Diagram
 Symbol

Description
Identifying Relationship

Weak Entity Type

6/15/2011

- B.U.Anu Barathi

64

E-R Diagram
 Symbol

Description
R E2
Total participation of E2 in R & Partial Participation of E1 in R

E1

1 E1 R R
6/15/2011

1 E2
Min,max

Cardinality Ratio
Structural constraints (min,max) on participation of 65 Environmental in R

E2
- B.U.Anu Barathi

Recursive Relationship
 If

the same entity type partcipates in a relationship more than once in different roles.  E.g.. Employee
Supervise Supervisor Supervising
6/15/2011 - B.U.Anu Barathi 66

Design of an E-R Database Schema EThe steps involved in designing an E-R database schema are, Identify entity types and their entity sets. List out the attributes of each entity type. Relate several entities by specifyiing some relationship that exists among them. Specify some attributes of relation if any. Specify Generalization and specialization any exists. Specify Aggregation (global) if any used.
- B.U.Anu Barathi 67

     

6/15/2011

Design Process:


The main phases involved in designing a ER db schema is shown below,

Mini world Requirements collection & Analysis


Data Requirements

Functional Requirements

Functional Analysis
High level Transaction specification DBMS Independent

Conceptual Design
Conceptual schema

Logical Design
Application program Design Transaction 6/15/2011 implementation
DBMS Specific

Logical schema

Physical design
- B.U.Anu Barathi

App.pgms

Internal Schema

68

Requirements collection & Analysis


 

The db designers interview db users to understand & document their requirements. They find out data requirements (what data are stored in the db).

Conceptual Design:


Once the requirements are documented , the next step is to create conceptual schema which carried out in conceptual design Phase. It describes the structure of a db in the form of entity type, relationship among them & constraints.
- B.U.Anu Barathi 69

6/15/2011

Logical Design


The actual implementation of the db is carried out using DBMS.

Physical Design


The last phase is the internal storage structures, indexes, access paths, and file organizations for the db files are specified. In parallel with these activities, Application programs are designed and implemented as db transactions.

6/15/2011

- B.U.Anu Barathi

70

EER Model- Enhanced or Extended E-R model ModelE 

Using E-R model only the basic features of a db. Some enhanced features such as Specialization, Generalization, Union & aggregation can be shown using EER model.

A.

SPECIALIZATION: The process of designating sub grouping within an entity set..

6/15/2011

- B.U.Anu Barathi

71

E.g..
eid ename Employee Mgrid eaddr Job

Typing speed

IS A

Secretary

Technician

Manager

6/15/2011

- B.U.Anu Barathi

72

It is also represented as
eid ename Employee Job Type eaddr

Defining attribute

Job

Salary Type

d
Secretary Technician Manager Hourly

d
Regular

Sub classes
6/15/2011 - B.U.Anu Barathi 73

Generalization
The

process of defining a generalized entity type from the given entity types.
- B.U.Anu Barathi 74

6/15/2011

E.g
No. of seats Vehicle ID

Vehicle ID

Tonnage

CAR

TRUCK

Max speed

Price
- B.U.Anu Barathi

No. Of Axles

Price
75

6/15/2011

Vehicle ID

Price Vehicle
d

CAR Max speed


6/15/2011

TRUCK No. of seats - B.U.Anu Barathi Tonnage No. Of Axles


76

History of Database Systems




1950s and early 1960s:


Data processing using magnetic tapes for storage
Tapes provide only sequential access

Punched cards for input




Late 1960s and 1970s:


Hard disks allow direct access to data Network and hierarchical data models in widespread use Ted Codd defines the relational data model
Would win the ACM Turing Award for this work IBM Research begins System R prototype UC Berkeley begins Ingres prototype

High-performance (for the era) transaction processing


6/15/2011 - B.U.Anu Barathi 77

History (cont.)


1980s:
Research relational prototypes evolve into commercial systems
SQL becomes industrial standard

Parallel and distributed database systems Object-oriented database systems




1990s:
Large decision support and data-mining applications Large multi-terabyte data warehouses Emergence of Web commerce

2000s:
XML and XQuery standards Automated database administration

6/15/2011

- B.U.Anu Barathi

78

6/15/2011

- B.U.Anu Barathi

79

Relational Model:
 It

uses a collection of tables to represent both data and relationships among those data. Basic Structure this model each table is called as relation. Each relation has a no. of row is called tuples and columns called as fields or attributes.
- B.U.Anu Barathi 80

 In

6/15/2011

Relational Model:
 For

an attribute, a range of permitted values can be specified. That range is called as Domain of that attribute. Age attribute Domain (Age) = {1,2100}

 E.g.. 

6/15/2011

- B.U.Anu Barathi

81

Relational Model:
A

table of n attributes must be a subset of D1*D2*.Dn Employee Relation  E.g..


Eid
1 2 3
6/15/2011

Ename
Aaa Bbb ccc

Eaddr

South street West street New


82

- B.U.Anu Barathi

Relational Model:
 To

denote the value of attribute a on second tuple, then it can be denoted as t2[a]=value.  E.g..  t2[ename]=bbb.

6/15/2011

- B.U.Anu Barathi

83

Relation schema
 It

is the description about the structure of the relation and the relation instance is the snapshot of data in the relation at a given instant in time.
E.g.. Employee_schema=(eid,ename,eaddr) Name of the schema

6/15/2011

- B.U.Anu Barathi

84

Relation schema
 

Empoyee(Employee_schema) denote that Employee is a relation on Employee_schema

6/15/2011

- B.U.Anu Barathi

85

Keys
 Strong 

Entity set:

The Primary key of the entity set becomes the primary key of the relation.

 Weak 

Entity Set:

The table corresponding a weak entity set includes  the attributes of the weak entity set &  primary key of the strong entity set on which the weak entity set depends.
6/15/2011 - B.U.Anu Barathi 86

Keys
Relationship Set: The union of the primary key of the related entity sets becomes a super key of the relation. Combined Tables: If there exists many to one relationship set from A to B, then the prim.key of A becomes the prim.key of the relation & the relation consists of the attribues of A and attributes of the relationship set.
6/15/2011 - B.U.Anu Barathi 87

Keys
Foreign Key: An attribute of a relation r1 that references relation r2 is called as foreign key attribute. Schema Diagram: A relation schema can be depicted pictorially by schema diagram,

6/15/2011

- B.U.Anu Barathi

88

Keys
 E.g..

Employee Ename eaddr dno

eid Dept dno Project


6/15/2011

dname pname - B.U.Anu Barathi

dloc eid

pno

89

Query Languages:
 It

is a lang in which a user requests information from db.

Query Languages
Non Procedural Language Specifies what data are Specifies what data are required without specify how required & specify how to get to get those data e.g. those data e.g Relational 6/15/2011 - B.U.Anu Barathi 90 Relational calculus Algebra Procedural Language

Relational Algebra
         

It consistes of a set of operations Select Project Union Set difference Intersection Cartesian Product Join Division Rename
- B.U.Anu Barathi 91

6/15/2011

Select


It selects tuples that satisfy a given predicate, To denote selection


(Sigma) is

used.

Syntax:

cond (Table name)

6/15/2011

- B.U.Anu Barathi

92

Select
 E.g..
Sal>1000 (Employee)

Selects tuples whose emp sal is > 1000

6/15/2011

- B.U.Anu Barathi

93

Project
 It

selects attributes from the relation.  II Symbol for project Syntax: ll <Attribute (table name)
list>

E.g
6/15/2011

ll Eid,sal (employee)
- B.U.Anu Barathi

Selects all tuples from emp relation & only eid & sal attributes are projected 94

Join
 Natural

Join (or) Equi Join  Outer Join Natural Join (or) Equi Join
- Used to combine related tuples from two relations.
- It requires that the two join attributes have the same name. - Symbol:
6/15/2011 - B.U.Anu Barathi 95

Join
 Syntax:

6/15/2011

- B.U.Anu Barathi

96

Select Operation:
 It

selects tupules that satisfy a given predicate.  To denote selection -

6/15/2011

- B.U.Anu Barathi

97

END OF UNIT-1 UNITReferences:  Database system concepts Siberschatz, korth and sudharsan

6/15/2011

- B.U.Anu Barathi

98