Keys in Database
A key is a field or column value in a table. It is used to identify a record in a table which is unique and it is used to establish a relationship with other table in a database.
Types of Keys in Database:
Primary Key
- It is a special key which is must be unique
- Value must not be repeated/not redundant
- Value should not be null
Foreign key
- Foreign key is the field which matches with the primary key field to establish a relation among that table.
- Derived from primary key
Super Key
- Super key is a set of one or more attributes that taken collectively allows us to identify each record uniquely.
- Super key [id, password no, LN, CN]
Candidate Key
- A combination of one or more fields whose value uniquely identifies a record in a table.
- A candidate key is a subset of a super key
- Eg. StudentId is a primary key ad in same table CourseId is candidate key
Index key: The index key speeds up of searching and storing operation.
Meta data
The Data inside data is called meta data. It summarized the additional information of data.
Schema
- The overall design of the database is called schema.
- The blue print of the database is called schema
- The structure of the database is called schema
- Total design of the database is called schema
SQL (Structured Query Language):
- SQL is used for communication between user and RDBMS. It extracting information from a database by using given criteria or requesting for data.
- SQL is a high level language.
- It is a non procedural language.
- It is a fourth generation language
- It can run any computer so it is portable.
- SQL retrieve, insert, delete, update, create data in database.
- It can set permission on a table.