DBMS Data Models Flashcards
What is a key
A key is a attribute used to uniquely identify rows/tupples
Whats a candidate key?
A candidate key is used to uniquely differ between some tupples which are coincidently matching.
In short they are never equal and hence can be used to uniquely Identify
A candidate key is a minimal super key, or a super key with no redundant attributes.
Whats a primary key?!
A primary key can be assumed a mixture of candidate key and a condition that it can never be null.(Unique+ Not Null)
A primary key may have one or more attributes.
Whats a Foreign Key!?
It is an attribute or set of attributes, that references to primary key of same table or another table
Whats needed for a foreign key to work!?
There must be atleast one same column in both the table ( the main one and the foreign one)
Whats Reference Table and Referencing Table?
The table containing Foreign Key is called Referencing Table
Explain Relational Model
Relational Model
* Relational Model is the most widely used model.
* In this model, the data is maintained in the form of a two-dimensional tables called Relation.
* All the information is stored in the form of rows and columns where columns represents attributes and
row represents records or tuples.
Whats integrity Constraints
Integrity Constraints
Integrity constraints are a set of rules. It is used to maintain the quality of information.
Integrity constraints ensure that the data insertion, updating, and other processes have to be
performed in such a way that data integrity is not affected.
Thus, integrity constraint is used to guard against accidental damage to the database.
Whats Check Constraint
Check
This constraint defines a business rule on a column. All the rows in that column must satisfy this rule.
Limits the data values of variables to a specific set, range, or list of values.
Define entity
An entity is a person, a place or an object that is distinguishable from other objects based on
the values of the attributes it possess.
Define Relation Schema
A relation schema represents name of the relation with its attributes.
e.g.; STUDENT (ROLL_NO, NAME, branch, semester, SPI) is relation schema for STUDENT.
* If a schema has more than 1 relation, it is called Relational Schema.
Define Relation Instance:
Relation Instance: The set of tuples of a relation at a particular instance of time is called as relation instance.
It can change whenever there is insertion, deletion or updation in the database.
Define Degree
Degree: The number of columns or attributes in the relation is known as degree of the
relation.
Define Cardinality
Cardinality: The number of rows or tuples in a relation is known as cardinality.
Relation Key
Relation key: Every row has one or multiple attributes, that can uniquely identify the row in the relation, which is called relation key or primary key.