DATABASE
Data: facts that can be recorded. It can be text, numbers, videos, speech, images, audio etc.
Database: collection of related data that represent some real world entities.
Information: meaningful/processed data.
DBMS: software tool to manage data.
[DB + DBMS = Database System]
Flat File - coma-separated(CSV) File
DBMS - table
DRAWBACKS OF USING FILE SYSTEMS TO STORE DATA
- Data redundancy & inconsistency
- Difficulty in accessing data
- Data isolation
- Integrity Problems
- Atomicity(all-or-nothing property) of updates
- Concurrent access by multiple users
- Security problems
Data Model
- Relational
- Key/Value
- Graph
- Document
- Column-Family
- Array/Matrix
- Hierarchical
- Network
RELATIONAL DATABASE
Defines by E.F Codd in 1970(IBM), a relational database is a digital database based on the relational model of data.
LANGUAGES
- SQL(Structured Query Language)
- MySQL
- PostgreSQL
- sqlite3
PROS
- SIMPLICITY
- DATA ACCURACY
- EASY ACCESS TO DATA
- DATA INTEGRITY
- FLEXIBILITY
- SECURITY
CONS
- POSSIBLE PERFORMANCE ISSUES
- SET-UP CAN BE LONG
- NO SUPPORT OF COMPLEX DATA TYPES
NON-RELATIONAL DATABASE
A non-relational database is a database that does not use
the tabular schema of rows and columns found in most traditional database
systems. Flexible to used for Big-Data & real-time Web Applications.
Examples: Amazon DynamoDB, Mongo DB, Firebase
PROS
- HANDLING UNSTRUCTURED DATA
- AGILITY
- READABILITY
- HIGHLY SCALABLE AT LOW COST
CONS
- DEPENDENCY ON A SPECIFIC DATABASE MANAGEMENT SYSTEM
- LIMITED FUNCTIONALITY
- HIRING DIFFICULTIES
- NOT MATURE
DATA ABSTRACTION
Data abstraction is a process of hiding the implement details(such as how the data are stored and maintained) and representing only the essential features to simplify user's interaction with the system.
LEVELS OF ABSTRACTION
To simplify user's interaction with the system, the complexity is hidden from the database users through several levels of abstraction.
- Lowest level of Data abstraction.
- Describes how the Data is actually stored.
- Next highest level of Data abstraction.
- Describes what Data are stored and what relationship are exist among the data entities in relatively simple structures.
- Database administrator level.
- Highest level of Data abstraction.
- Multiple views of the same Database may exist.
- Users can just view the data and interact with the Database.
INSTANCES & SCHEMAS
INSTANCES
SCHEMA
- Logical Schema-the overall logical structure of the Database.
- Physical Schema-the overall physical structure of the Database.
ANALOGY OF SCHEMA & INSTANCE
DATA DEFINITION LANGUAGE (DDL)
DDL commands are used to define the database structure or
schema.
It includes:
CREATE: To create database instances or objects.
ALTER: To alter the database structure or schema.
DROP: To delete the database instances or objects.
TRUNCATE: To remove all records from a table, including all
spaces allocated for the records are removed
RENAME: To rename a
database object or instance.
COMMENT: To add comments to the data dictionary.
Data Manipulation Language (DML)
DML commands are used for managing data within schema
objects.
It includes:
INSERT: To insert data into a table.
UPDATE: To update existing data within a table.
DELETE: To deletes all records from a table.
MERGE: To merging two rows or two tables.
ADDITIONAL NOTES:
HOW TO CHOOSE A DATABASE?
1. What type of Data will you be analyzing?
2. How much Data are you dealing with?
3. Are you ready to invest time and budget in the setup of your Database?
4. Do you need real-time Data?
DB-ENGINES RANKING
DB-Engine Ranking |