0% found this document useful (0 votes)
6 views

Databases Class Notes

A database is an organized collection of structured information stored electronically, essential for data storage and analysis. Key concepts include data, information, DBMS, schema, and types of databases such as relational and NoSQL. Important considerations for choosing a database involve data type, volume, access patterns, scalability, consistency, and cost.

Uploaded by

salihsami79
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Databases Class Notes

A database is an organized collection of structured information stored electronically, essential for data storage and analysis. Key concepts include data, information, DBMS, schema, and types of databases such as relational and NoSQL. Important considerations for choosing a database involve data type, volume, access patterns, scalability, consistency, and cost.

Uploaded by

salihsami79
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Databases Class Notes

What is a Database?

A database is an organized collection of structured information, or data,


typically stored electronically in a 1 computer system. It provides a way
to efficiently store, manage, and retrieve data. Databases are essential for
a wide range of applications, from simple data storage to complex data
analysis.

Key Concepts:

 Data: Raw facts, figures, and symbols.


 Information: Data that has been processed and organized to give
it meaning.
 Database Management System (DBMS): Software that allows
users to interact with a database. It provides tools for creating,
managing, and accessing the data. Examples: MySQL,
PostgreSQL, Oracle, SQL Server, MongoDB.
 Schema: The structure of the database, defining the tables,
columns, and relationships.
 Instance: A specific snapshot of the database at a given point in
time.

Types of Databases:

 Relational Databases (SQL): Data is stored in tables with rows


(records) and columns (attributes). Relationships between tables
are defined using keys. Use SQL (Structured Query Language) for
data manipulation. Emphasize data integrity and consistency
(ACID properties).
 NoSQL Databases: Designed for handling unstructured or semi-
structured data. Various types exist:
o Document Databases: Store data as documents (e.g., JSON,

XML). Example: MongoDB.


o Key-Value Stores: Store data as key-value pairs. Example:

Redis.
o Column-Family Stores: Store data in columns grouped into

families. Example: Cassandra.


o Graph Databases: Store data as nodes and edges

representing relationships. Example: Neo4j.

Relational Database Concepts:

 Tables: Store data in rows and columns.


 Rows (Records): Represent individual entities or instances.
 Columns (Attributes): Represent characteristics of the entities.
 Primary Key: A unique identifier for each row in a table.
 Foreign Key: A column in one table that refers to the primary key
of another table, establishing a link between the two tables.
 Relationships:
o One-to-One: One record in a table is related to one record in

another table.
o One-to-Many: One record in a table is related to many

records in another table.


o Many-to-Many: Many records in a table are related to many

records in another table.


 Normalization: A process of organizing data to reduce
redundancy and improve data integrity.
SQL (Structured Query Language):

 A language for interacting with relational databases.


 Data Definition Language (DDL): Used to define the structure of
the database (e.g., CREATE TABLE, ALTER TABLE, DROP
TABLE).
 Data Manipulation Language (DML): Used to manipulate the
data in the database (e.g., SELECT, INSERT, UPDATE,
DELETE).
 Data Control Language (DCL): Used to control access to the
database (e.g., GRANT, REVOKE).

ACID Properties (for Relational Databases):

 Atomicity: Transactions are treated as indivisible units of work.


Either all changes are made, or none are.
 Consistency: Transactions preserve the integrity constraints of the
database.
 Isolation: Transactions are isolated from each other. Concurrent
transactions do not interfere with each other.
 Durability: Once a transaction is committed, the changes are
permanent, even in the event of a system failure.

NoSQL Database Concepts:

 Schema-less: Data can be stored without a predefined schema.


 Scalability: Designed for handling large volumes of data and high
traffic.
 Different Data Models: Document, key-value, column-family,
graph.

Choosing a Database:
Factors to consider:

 Data type: Structured, semi-structured, unstructured.


 Data volume: How much data needs to be stored.
 Data access patterns: How will the data be accessed and queried?
 Scalability requirements: How much will the data volume and
traffic grow?
 Consistency requirements: How important is data integrity?
 Cost: Open-source vs. commercial databases.

Further Study:

Databases are a critical component of many software systems. Further


study should include exploring specific database systems, learning SQL
or other query languages, understanding database design principles, and
practicing working with databases through projects. Understanding data
modeling, normalization, transaction management, and indexing are
important for efficient database usage.

You might also like