php

RDBMS


 

RDBMS stands for Relational Database Management System.


A database is a structured collection of data organized for efficient retrieval, storage, and management. It is designed to hold large amounts of information in a way that is easily accessible, scalable, and can be efficiently queried and updated.

A Relational Database Management System (RDBMS) is a type of database management system that organizes data into tables, which can be related to each other based on common fields. RDBMS is a widely used model for managing and manipulating structured data.


Characteristics of RDBMS

 

Tabular Structure:

Data is organized into tables, which consist of rows and columns.
Each table represents a specific entity, and each row in the table represents an instance of that entity, while columns represent attributes or properties.

 

Data Integrity:

RDBMS enforces data integrity through constraints like primary keys, foreign keys, and unique constraints.
Primary keys uniquely identify each record, and foreign keys establish relationships between tables.

 

Normalization:

RDBMS follows normalization principles to minimize data redundancy and dependency.
Data is organized into different normal forms (e.g., 1NF, 2NF, 3NF) to eliminate duplication and improve efficiency.

 

Structured Query Language (SQL):

SQL is the standard language for interacting with RDBMS.
SQL allows users to define, query, and manipulate data. Common SQL commands include SELECT, INSERT, UPDATE, DELETE, and more.

 

ACID Properties:

RDBMS transactions adhere to the ACID properties:
                   

  1. Atomicity: Transactions are treated as indivisible units of work.
  2. Consistency: The database transitions from one consistent state to another after a successful transaction.
  3. Isolation: Transactions are executed independently and do not interfere with each other.
  4. Durability: Committed transactions are permanent and survive system failures.

 

Important terms in RDBMS


Tables:

The RDBMS database uses tables to store data. A table is a fundamental structure used to store and organize data. It is a two-dimensional arrangement of rows and columns, where each row represents a record or a tuple, and each column represents a specific attribute or field.

Properties:

  1. Rows: Each row in a table represents a unique record or tuple.
  2. Columns: Columns in a table represent attributes or fields associated with the data.
  3. Primary Key: Tables typically have a primary key, which is a unique identifier for each row
  4. Relationships: Tables can be related to each other through the use of keys, such as primary keys and foreign keys.

 

Example:
 

ID

Name

SKILL

COURSE

1

Rohit

PHP

B.Tech

2

Altaf

JAVASCRIPT

BCA

3

Wasif

REACT

MCA

4

Rajesh

LARAVEL

M.Tech

 

Rows:

A row represents a single record or tuple within a table. It contains a collection of related data points, each corresponding to a specific attribute or field defined by the table's schema. Rows are horizontal entities, and each row in a table typically has a unique identifier known as the primary key, ensuring individuality, and facilitating efficient retrieval and manipulation of data.

Properties:

  • Uniqueness: Each row in a table is typically identified by a unique identifier known as the primary key.
  • Fields/Attributes: Rows contain values for each column in the table, for specific attribute.
  • Relationships: Rows in one table may be related to rows in other tables through foreign key relationships.
  • Identifiability: The primary key of a row is used to uniquely identify and retrieve that specific row.

 

Example: 

ID

Name

SKILL

COURSE

1

Rohit

PHP

B.Tech

 

Column/attribute:

A "column" refers to a vertical segment within a table that represents a specific attribute or field. Columns define the structure of the data stored in a table and organize it into a two-dimensional matrix of rows and columns.

 

Property:

  • Data Type: Each column has specific data type that defines the kind of data it can store.
  • Names: Columns are identified by unique names within a table.
  • Order: The order of columns in a table is significant.
  • Nullability: Columns can be either nullable or non-nullable.

 

Example: 

Name

Rohit

Altaf

Wasif

Rajesh

 

Cells:

A "cell" refers to the intersection of a specific row and column, representing a single data value within the table. Cell contains the actual data associated with a particular attribute or field for a specific tuple.


Property:

  • Data Value: A cell stores a single data value corresponding to the intersection of a particular row and column.
  • Record or Tuple: Cells collectively form rows, where each row represents a unique record or tuple within the table.

 

Example

ID

Name

SKILL

COURSE

1

Wasif

JavaScript

B.Tech

 


Cardinality:


Cardinality is the relationships between tables. It describes the number of instances of one entity (table) that can be associated with another entity through a relationship.

Some common cardinalities are:

One-to-One (1:1): In a one-to-one relationship, each record in the first table is associated with at most one record in the second table, and vice versa.

One-to-Many (1:N): In a one-to-many relationship, each record in the first table can be associated with multiple records in the second table, but each record in the second table is associated with at most one record in the first table. This is the most common type of relationship.

Many-to-One (N:1): This is essentially the reverse of a one-to-many relationship. Many records in the first table can be associated with one record in the second table. This type of relationship is less common but still important, particularly when modelling situations where many entities are related to a single entity.

Many-to-Many (N:N): In a many-to-many relationship, each record in the first table can be associated with multiple records in the second table, and vice versa. This often requires the use of an intermediary table (junction or linking table) to store the relationships.

 

Domain:

The domain defines the set of possible values that an attribute (or column) can contain. This definition includes specifying the standard data types, such as integers, floating-point numbers, strings, dates, and other data types, that are allowed for the attribute.

 

Null Values:

A "null value" represents the absence of a value in a particular data field (column) for a specific record (row). It does not mean that the field has a zero or empty value; rather, it signifies that no data or unknown data is present for that attribute in the given record.