Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
RDBMS terminologies
RDBMS (Relational Database Management System) uses specific terminologies to describe its components. These include Database, Table, Column, Row, and various types of keys. Let us see them one by one −
Database
A database is a collection of related tables. For example, a university database may contain tables like Student, Professors, Courses, etc.
Table
A table (also called a relation) is a collection of rows and columns that stores data about a specific entity. Here's an example of a Student table −
| StudentId | StudentName | StudentRank |
|---|---|---|
| 052 | Tom | 1 |
| 035 | David | 2 |
| 077 | John | 3 |
Column and Row
A column (also called an attribute or field) represents a specific property of the entity, such as StudentId or StudentName. A row (also called a tuple or record) represents a single entry in the table.
Primary Key
A Primary Key uniquely identifies each row in a table and cannot have NULL values. For example, ProjectID is the primary key in the Project table −
| ProjectID (PK) | ProjectName |
|---|---|
| P01 | Cluster Grouping System |
| P02 | Hospital Management System |
Foreign Key
A Foreign Key links two tables by referencing the primary key of another table. For example, DEPT_ID in the Employee table is a foreign key referencing DEPT_ID (primary key) in the Department table.
Candidate Key
A Candidate Key is an attribute (or minimal set of attributes) that can uniquely identify each row in a table. A table can have multiple candidate keys, but only one is chosen as the primary key.
Super Key
A Super Key is an attribute (or set of attributes) that uniquely identifies a tuple. It is a superset of Candidate Key, since candidate keys are selected from super keys.
Composite Key
A Composite Key is a primary key consisting of two or more columns combined to uniquely identify each row. For example, {OrderID, ProductID} in an order details table.
Conclusion
Understanding RDBMS terminologies is fundamental to working with relational databases. Tables store data in rows and columns, primary keys ensure uniqueness, foreign keys establish relationships, and various key types (super, composite, candidate) serve different identification purposes.
