Relational model basics
* Data is viewed as existing in two dimensional tables known as relation.
* A relation (table) consists of unique attributes (columns) and tuples (rows)
* Tuples are unique
* Sometimes the value to be inserted into a particular cell may be unknown, or it may have no value. This is represented by a NULL
* Null is not the same as zero, blank or an empty string
* Relational Database: Any database whose logical organization is based on relational data model.
* RDBMS: A DBMS that manages the relational database.
* Keys
* Candidate key
A Candidate key is a set of one or more attributes(minimal) that can uniquely identify a row in a given table.
* Primary Key
During the creation of the table, the Database Designer chooses one of the Candidate Key from amongst the several available, to uniquely identify row in the given table.
* Alternate Key
The candidate key that is chosen to perform the identification task is called the primary key and the remaining candidate keys are known as alternate keys.
* Super Key
Any superset of a candidate Key is a super key.
Key and Non-key Attributes
* Key Attributes
The attributes that participate in the Candidate key are Key Attributes
* Non-Key Attributes
The attributes other than the Candidate Key attributes in a table/relation are called Non-Key attributes.
OR
The attributes which do not participate in the Candidate key.
Foreign key
A Foreign Key is a set of attribute (s) whose values are required to match values of a column in the same or another table.
Database Design Techniques
* Top down Approach
o E R Modeling
* Bottom Up approach
o Normalization
ER modeling
* ER modeling: A graphical technique for understanding and organizing the data independent of the actual database implementation.
* Entity: Any thing that may have an independent existence and about which we intend to collect data.
Also known as Entity type. E.g.: Trainee
* Entity instance: a particular member of the entity type e.g. a particular trainee
* Attributes: Properties/characteristics that describe entities: Trainee name, Batchname, DOB, Address, etc.
* Relationships: Associations between entities.E.g.: Trainee belongs to a Batch
This is Relationship mode basics.
Some content taken from wikipedia and infosys Site.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment