CHAPTER 3 Dbms Flashcards
RELATIONAL ALGEBRA
Relational algebra is a procedural query language. It gives a step by step process to obtain the result of the query. It uses operators to perform queries.
UNARY OPERATIONS
Theselect, project, and rename operations
are called unary operations, because they operate on one relation.
- Select Operation:
- The select operation selects tuples that satisfy a given predicate.
- It is denoted by sigma (σ).
Project Operation:
- This operation shows the list of those attributes that we wish to appear in the result. Rest of the attributes are eliminated from the table.
- It is denoted by ∏.
EX. 1. ∏NAME,CITY(CUSTOMER)
Rename Operation:
- The rename operation is used to rename the output relation. It is denoted byrho(ρ).
Example:We can use the rename operator to rename STUDENT relation to STUDENT1.
Cartesian PRODUCT
- The Cartesian product is used to combine each row in one table with each row in the other table. It is also known as a cross product.
- It is denoted by X.
1. Notation:EXD
Union Operation:
- Suppose there are two tuples R and S. The union operation contains all the tuples that are either in R or S or both in R & S.
- It eliminates the duplicate tuples. It is denoted by ∪.
- Notation:R∪S, A union operation must hold the following condition:
- Duplicate tuples are eliminated automatically.
SET INTERSECTION :
- Suppose there are two tuples R and S. The set intersection operation contains all tuples that are in both R & S.
- It is denoted by intersection ∩.
1. Notation:R∩S - IT ELIMINATE OTHER THAN SAME ITEMS
CONDITION :
- DOMAIN SHOULD BE SAME
- NUMBER OF COLUM REMIAN SAME
RELATIONAL MODEL :
- Relational model can represent as a table with columns and rows.
- Each row is known as a tuple. Each table of the column has a name or attribute.
RELATIONAL MODEL REPRESENTS HOW DATA IS STORED IN RELATIONAL DATABASES, A RELATIONAL DATABASE STORES DATA IN FORM OF RELATIONS
RELATIONAL MODEL CONCEPTS
- RELATION : A RELATION IS A TABLE WITH COLUMS AND ROWS
Attribute:
It contains the name of a column in a particular table.
Tuples :
it contains the values of a Rows in a particular table
-
DOMAIN : A domain isa unique set of values that can be assigned to an attribute in a database
. For example, a domain of strings can accept only string values. -
Relational schema:
A relational schema contains the name of the relation and name of all columns or attributes.
Properties of Relations.
- Each relation cell contains exactly one atomic (single) value
- Each attribute contains a distinct name
- Attribute domain has no significance
- tuple has no duplicate value
- Order of tuple can have a different sequence
WHAT IS RDBMS?
- RDBMS STANDS FOR RELATIONAL DATABASE MANAGMENT SYSTEM
- RDBMS IS THE BASIS FOR SQL AND ALL MORDEN DATABASE SYSTEM LIKE MS SQL ORACLE
- IN RDBMS DATA WILL STORE IN TABULAR FORM
JOIN : A JOIN STATEMENT IS MAINLY USED TO COMBINE TWO TABLES
IN HERE WE ARE GOING TO STUDY ABOUT INNER JOIN , NATURAL JOIN , OUTER JOIN AND THIER TYPES .
INNER JOIN :
THIS JOIN STATEMENT ONLY CONTAINS THOSE TUPLES THAT SATISFY THE MATCHING CONDITION
NATURAL JOIN :
IN NATURAL JOIN WE DONT NEED ANY CONDIATION TO JOIN IT SIMPLY COMBINE THE TABLE