What Is A Database
What Is A Database
What Is A Database
Attributes
Attributes are the characteristics of an
entity. In a table, each attribute
becomes a field. For example, in a
“Customer” table, attributes might
include “Customer ID,” “Name,”
“Email,” and “Phone Number.”
Attributes define what data is stored
about each entity.
Data Integrity
Data Integrity is about making sure the
data in the database is accurate,
complete, and reliable. Here’s how it’s
maintained:
Data Accuracy: Good-quality data
entry is critical because accurate data
leads to useful information.
Data Validation: This process
ensures only valid data can be
entered. For example:
o Record Validation Rules: Check
all fields before saving a record. If
one part is incorrect, the entire
transaction is rejected.
This validation ensures data entered
follows the rules, so errors are minimized.
Database Locking
Database Locking prevents two people
from changing the same data at the same
time. This lock makes sure data remains
consistent and avoids errors.
For example, if two people are editing the
same customer record, locking prevents
conflicting updates.
Data Security
Data Security protects the database
from unauthorized access, destruction, or
misuse. Key elements include:
1. Preventing Unauthorized
Access: Only approved users can
access the database.
2. Database Activity Monitoring:
Tracks and detects potential intrusions
or security risks.
3. Preventing Data Loss: Involves
regular backups and a disaster-
recovery plan, which allows for data
restoration if there’s a system failure
or attack.
Data Security is essential for both
internal (in-house) databases and cloud
databases.
Data Privacy
Data Privacy focuses on protecting
personal information stored in databases.
With so much personal data collected
today, breaches are a growing concern. In
fact:
Some states require businesses to
inform customers if their data has
been compromised.
Data breaches are costly, estimated at
about $200 per breached record.
Protecting personal data is essential to
build trust and avoid high costs
associated with data breaches.
o Allowable Range: Setting limits
on values (e.g., age can’t be
negative).
o Required Field: Whether the field
must be filled out or can be left
blank.
Column Databases
Column Databases store data by
columns instead of rows.
o How It Works: Think of data for
each attribute (like “Name” or
“Age”) stored in a separate column,
rather than each individual record
(row) stored together.
o Benefits: Improves performance
by making data reading faster. It’s
especially useful for analyzing large
data sets in applications like data
warehouses and big data
processing, where quick access to
specific data is needed.
3. Relating Tables:
o After creating tables, you can link
them using Primary Keys (unique
identifiers for each table).
o Relationships help maintain data
integrity, for example, by linking
“Customer ID” in an Orders table to
“Customer ID” in a customer’s
table. This ensures each order is
correctly associated with a
customer.
Retrieving Information from a
Relational Database
Query: A query is a request for
specific information from a database.
For example, you might query a
database to find all customers who
bought a particular product.
o Every database management
system (DBMS) provides tools to
help users query the database
using certain criteria to quickly
retrieve the data they need.
Cloud Databases
Cloud Databases are hosted by a
cloud provider (like Amazon, Microsoft,
or Google) and accessed online,
making them very flexible and easy to
scale up as needed. Users can access
them from anywhere via the internet.
Examples of Cloud Database Uses:
o Information Retrieval: Cloud
databases are widely used for
storing data that people search for
online, like on search engines.
o E-Commerce: They support online
stores by providing information on
products, pricing, and customer
details. Cloud databases allow web
pages to be dynamic, meaning
they can change and update
automatically with new data (for
example, showing an updated
shopping cart).
Benefits:
o Less Hardware and
Maintenance: Since they’re
hosted on the cloud, businesses
don’t need as much hardware on-
site and require less maintenance.
o Web Apps: Individuals can also
use tools like Microsoft Access to
create cloud databases for simple
web applications.
How They Work:
o When a user interacts with a web
form (e.g., selecting a menu item
or filling out a form), the web
server sends this request as a
query to the database server.
o The database server processes the
query and returns the requested
data, which the web server then
displays to the user.
Middleware
Middleware is software that connects
different applications, allowing them to
work together. For example,
middleware links a web server (which
hosts the website) with a database
management system (where the data
is stored).
Common Middleware Languages:
o JavaScript
o VBScript
o CGI Scripts
o Active Server Pages (ASP)
o PHP
Middleware handles communication
between the web server and database,
enabling the website to pull data from the
database and display it to users. This
behind-the-scenes software is essential
for making cloud databases and websites
work smoothly together.