Skip to main content

Key Terminologies used in Relational Database

 1. Database


Definition:

A database is a structured collection of data stored and managed electronically. It allows for efficient data retrieval, manipulation, and management.

Characteristics:

- Structured: Data is organized in tables with rows and columns.

- Persistent: Data remains available over time.

- Accessible: Allows querying and manipulation through a Database Management System (DBMS).


2. Database Management System (DBMS)

Definition:

A DBMS is software that facilitates the creation, manipulation, and management of databases. It provides an interface for users and applications to interact with the data.

Characteristics:

- Data Definition: Allows creation and modification of database schemas.

- Data Manipulation: Supports querying, updating, and deleting data.

- Data Security: Manages user access and data integrity.

 3. Table (Relation)

Definition:

A table, also known as a relation, is a collection of rows and columns used to store data in a relational database.

Characteristics:

- Rows: Each row represents a single record or entity.

- Columns: Each column represents an attribute of the entity.

- Schema: Defines the structure, including column names and data types.


 4. Row (Tuple)

Definition:

A row, or tuple, represents a single record in a table. It is a set of related data values corresponding to the columns of the table.

Characteristics:

- Unique: Each row represents a unique instance of the entity.

- Data Integrity: Must conform to the table schema.

5. Column (Attribute)

Definition:

A column, or attribute, represents a data field in a table. It defines a specific type of data that each row in the table can hold.

Characteristics:

- Data Type: Specifies the kind of data stored, such as integer, text, or date.

- Constraints: Includes rules such as NOT NULL or UNIQUE.


 6. Primary Key

 Definition:

A primary key is a unique identifier for each record in a table. It ensures that no two rows have the same key value and cannot be NULL.

 Characteristics:

- Uniqueness: Guarantees that each record can be uniquely identified.

- Non-nullable: Cannot have NULL values.

- Single Key: Each table can have only one primary key.


 7. Foreign Key

 Definition:

A foreign key is a column or set of columns in one table that uniquely identifies a row in another table. It establishes a relationship between two tables.

 Characteristics:

- Referential Integrity: Ensures that the value in the foreign key column matches a value in the primary key of the referenced table.

- Nullable: Can accept NULL values, indicating optional relationships.

 8. Unique Key

 Definition:

A unique key ensures that all values in a column or a set of columns are distinct from one another across the table.

 Characteristics:

- Uniqueness: No two rows can have the same value for the unique key column(s).

- Nullable: Unlike primary keys, unique keys can have NULL values.

 9. Index

 Definition:

An index is a database object that improves the speed of data retrieval operations on a table at the cost of additional storage and maintenance overhead.

 Characteristics:

- Speed: Enhances query performance by allowing quicker searches.

- Types: Includes unique, composite, and full-text indexes.

- Maintenance: Indexes need to be updated when the table data changes.


 10. Schema

 Definition:

A schema is the structure of a database, including tables, columns, data types, relationships, and constraints.

 Characteristics:

- Design: Defines the organization and design of the database.

- Documentation: Provides a blueprint for database creation and modification.

 11. Normalization

 Definition:

Normalization is the process of organizing data to reduce redundancy and improve data integrity. It involves dividing a database into two or more tables and defining relationships between them.

 Characteristics:

- Normal Forms: Includes First Normal Form (1NF), Second Normal Form (2NF), Third Normal Form (3NF), and Boyce-Codd Normal Form (BCNF).

- Reduction of Redundancy: Eliminates duplicate data.

- Dependency: Ensures that data dependencies are logical.

 12. Denormalization

 Definition:

Denormalization is the process of combining tables to improve read performance at the cost of increased redundancy and potential write anomalies.

 Characteristics:

- Performance: Enhances query performance by reducing the number of joins needed.

- Redundancy: Introduces some level of data duplication.


 13. Query

 Definition:

A query is a request for data or information from a database using a query language, such as SQL (Structured Query Language).

 Characteristics:

- Data Retrieval: Allows users to select and display data from one or more tables.

- Data Manipulation: Includes INSERT, UPDATE, and DELETE operations.


 14. Transaction

 Definition:

A transaction is a sequence of one or more SQL operations executed as a single unit of work. Transactions ensure that operations are completed successfully or not executed at all.

 Characteristics:

- ACID Properties: Ensures Atomicity, Consistency, Isolation, and Durability.

- Commit/Rollback: Either commits all changes or rolls back to the previous state if an error occurs.

 15. View

 Definition:

A view is a virtual table based on the result of a query. It provides a way to present data in a particular format without storing it separately.

 Characteristics:

- Virtual Table: Does not store data physically but displays data from underlying tables.

- Security: Restricts user access to specific data.


 Quick Recap:

- Database: Structured data storage.

- DBMS: Software for managing databases.

- Table (Relation): Collection of rows and columns.

- Row (Tuple): Single record in a table.

- Column: Data field in a table.

- Primary Key: Unique identifier for records.

- Foreign Key: Links tables.

- Unique Key: Ensures distinct values.

- Index: Speeds up data retrieval.

- Schema: Database structure.

- Normalization: Reduces redundancy.

- Denormalization: Enhances performance.

- Query: Request for data.

- Transaction: Group of operations.

- View: Virtual table for data presentation.



Comments

Popular posts from this blog

ORACLE Express Edition: Getting Started

1. Introduction to Oracle Database 21c Express Edition (XE) - Free, lightweight version of Oracle Database - Ideal for learning and small-scale applications - Limited to 12GB of user data and uses up to 2GB of RAM 2. Installation and Setup 2.1 Installing Oracle 21c XE 1. Download Oracle 21c XE from: https://www.oracle.com/database/technologies/xe-downloads.html 2. Run the installer:    - Windows: Double-click the .exe file    - Linux: Use `rpm` or `yum` command 3. Follow the installation wizard:  Accept the license agreement Choose an installation location (default is usually fine) Set a password for the SYS, SYSTEM, and PDBADMIN accounts (write this down!) Select the option to start the database service automatically (recommended)  4. Complete the installation: Wait for the installation process to finish Note down the database connection details provided at the end The default container database (CDB) name is XE The default pluggable database (PDB) nam...

Practical 1: Getting Started with MYSQL

 Getting Started with MySQL Introduction to MySQL Definition: MySQL is an open-source relational database management system (RDBMS) Uses: Web applications, data warehousing, e-commerce, logging applications Key features: Speed, reliability, scalability, and ease of use Installing MySQL Download MySQL Community Server from official website Follow installation wizard for your operating system Set root password during installation Verify installation: mysql --version MySQL Command-line Client Accessing MySQL: mysql -u root -p Basic commands: SHOW DATABASES ; CREATE DATABASE mydb ; USE mydb ; SHOW TABLES ; MySQL Workbench Introduction: Visual tool for database design and management Key features: SQL development Data modeling Server administration Example: Creating a new connection New Connection > Enter details (hostname, username, password) PHPMyAdmin Web-based MySQL administration tool Often comes pre-installed with web hosting packag...

MYSQL Constraints

 PK - Primary Key: Uniquely identifies each record in a table. NN - Not Null: Ensures a column cannot have a NULL value. UQ - Unique: Ensures all values in a column are different. B - Binary: Stores binary byte strings. UN - Unsigned: For numeric types, allows only non-negative values. ZF - Zero Fill: Pads numeric values with zeros to the left. AI - Auto Increment: Automatically generates a unique number for new records. G - Generated Column: Value is computed from an expression. PK - Primary Key A primary key uniquely identifies each record in a table. It must contain unique values and cannot have NULL values.  Example: CREATE TABLE Students ( StudentID INT PRIMARY KEY , Name VARCHAR ( 50 ) , Age INT ) ; Here, StudentID is the primary key. NN - Not Null  This constraint ensures that a column cannot have NULL values.  Example: CREATE TABLE Employees ( EmployeeID INT PRIMARY KEY , Name VARCHAR ( 50 ) NOT NULL , Email VA...