DB Lesson 1 Class Note
DB Lesson 1 Class Note
Database Systems
Follow us on
@AcademyofGigaNerds
@GigaNerds
1. Hardware: This refers to the physical equipment where the database resides. It can be a
single computer, a server, or even a network of computers working together.
Think of it as the physical storage space for your database.
2. Data: This is the core element of any database system. It's the information itself, which can
be anything from text and numbers to images, videos, or even sounds. This data is
structured and organized in a specific way for efficient storage and retrieval.
Imagine it as the actual content stored in the database system.
3. Procedures: These are the guidelines and rules that govern how the database is designed,
used, and maintained.
Think of them as instructions or best practices for working with the database
effectively.
4. Software: Here's what makes the hardware work for the database. It includes several
parts:
o Database Management System (DBMS): This is the main software that manages
the creation, storage, retrieval, and manipulation of data within the database.
Imagine it as the organizer and controller of all the information stored.
o Operating System: This is the software that controls the overall functionality of the
computer or server, ensuring the smooth operation of the DBMS and other
applications. It's like the traffic controller for the computer system.
o Application Programs: These are specific programs that use the database to
perform tasks. For example, an inventory management system or a customer
relationship management system might rely on a database behind the scenes. Think
of them as tools that utilize the organized information in the database.
o User Interface: This is the part that allows users to interact with the database. It
could be a graphical user interface (GUI) with menus and buttons, or a command-
line interface (CLI) for more technical users. Think of it as the way you "talk" to the
database and retrieve information.
5. People: There are two main groups of people involved with a database system
o End-Users: These are the people who use the database to access information for
their daily tasks. This could include managers, employees, or anyone who needs to
retrieve data for their work. Think of them as the customers who come to the
database "store" to find information.
o Practitioners: These are the people who manage and maintain the database
system itself. This could include database administrators, designers, or application
developers. Think of them as the store managers and IT personnel who keep the
database system running smoothly.
Imagine you collect something, like stamps, photos, or newspaper clippings. Keeping track of a
large collection can be challenging. Here's where databases come in handy:
• Organization: Databases help you organize your collection efficiently. Instead of having
everything scattered, you can store information in a structured way, making it easier to find
what you need. Think of a database like a filing cabinet for your collection, with folders and
labels for easy access.
Databases become especially useful when dealing with vast amounts of information. Here's a
good example:
o Queries: You can ask specific questions about the collection, like "List of books
written by a particular author" or "List of books about a particular subject." The
database can quickly search through all the information and provide results, just like
searching keywords in a library catalog.
o Actions: Libraries can use the database to manage book borrowing and reservation
processes. For example, when you borrow a book, the database gets updated to
reflect its new status.
In essence, databases excel at storing, organizing, and manipulating large amounts of data,
making it easy to find specific information and perform actions efficiently. They act as
powerful tools for managing and utilizing vast collections of data.
What is Information:
• Not raw data: Information is processed or organized data that has meaning and provides
context. Imagine raw data like a pile of unlabelled photos. Information is like organizing
those photos into albums with labels, making them easier to understand.
Examples:
o Raw Data: 2002-01-15 (Someone's date of birth)
o Processing: We can process this date of birth to calculate the person's age (as of
today, assuming it's March 21, 2024).
o Information: The information derived from processing the data could be "Age: 22
years old" (This is more meaningful than just the date of birth).
Information takes raw data and adds value by making it organized, processed, and meaningful. It
gives context and helps us understand the bigger picture!
• Studying at university:
o Universities use databases for various purposes. Student information, course details,
grades, and library resources are all likely stored and managed in databases. This
allows professors and administrators to access student data, track academic
progress, and manage library resources efficiently.
These are just a few examples, and databases are used in countless other ways behind the
scenes in our daily lives. They are the backbone of many applications and services that
require efficient data storage, retrieval, and manipulation.
the olden days (think before computers were everywhere!), libraries used card catalogs to keep
track of all their books. It was like a giant recipe box for books.
• Cards for each book: Every book had its own card, like a recipe card.
• Information on the card: The card had details about the book, like its title, author, and
maybe even a Dewey Decimal number (a special code to find the book on the shelf).
• Lots of card catalogs: There were actually several sets of these cards, kind of like
different categories in a recipe box. One set might be listed by title (like recipes by name),
another by author (like recipes by chef), and maybe even one by subject (like dessert
recipes).
• Finding a book: To find a book, you had to look through the right card catalog, just like
finding a recipe in the right category. This could take a while, especially in big libraries with
tons of cards!
It wasn't the most efficient system, but it worked for a long time. Now, libraries use computers to
keep track of books, which is much faster and easier for everyone!
Like separate folders for different tasks. Each program manages its data, making sharing and
searching difficult. (Think messy desk drawer with unlabelled folders for projects.)
Data Redundancy
Same info in multiple places, like having duplicate copies of an attribute in different files. Wastes
space, confuses, and is hard to keep up-to-date.
(Like the above picture Name and Address can be seen in different applications/files !)
1. Separation and isolation of data /Data silos: Imagine separate islands of information.
Each program has its own data, and users might not even know about relevant data in
other programs.
2. Data duplication: Wasted space! The same information gets stored in multiple places,
leading to inconsistencies and confusion. (Think of duplicate files scattered across folders.)
3. Data dependence: File structure relies on program code. Changing the program can mess
up the data organization. (Imagine your desk drawer organization depending on a specific
folder type – changing folders could disrupt everything.)
4. Incompatible formats: Programs speak different languages! Data files from one program
might not be readable by another. (Think of finding a floppy disk and having no device to
read it with today!)
In essence, the database approach addresses the limitations of data being locked within
individual programs. It provides a central, organized storage solution with a management
system (DBMS) for efficient data access and control.
Database: Imagine a giant organized warehouse for all your information. This warehouse stores:
• Shared Collection: All the information is relevant to a specific organization or purpose (like
a company or library).
• Logically Related: The information pieces are connected and make sense together. Think
of products in a warehouse being grouped by category (electronics, clothing, etc.).
• Data Description (Metadata): There's a catalog (like a product list) that describes each
piece of information, making it easier to find what you need. Imagine labels on boxes in the
warehouse specifying what's inside.
This is the software that manages the warehouse! It's like the warehouse manager and IT team
combined:
• Defines & Creates: The DBMS helps design and set up the structure of the warehouse
(like how shelves and storage are organized).
• Maintains: The DBMS keeps the warehouse running smoothly, ensuring data is accurate
and secure. (Think of keeping track of stock levels and updating inventory.)
• Controlled Access: The DBMS controls who can enter the warehouse and what they can
do (some have access to add new products, while others can only view existing stock).
•
A database is the organized storage for information, while the DBMS is the software that
manages and controls access to that information. They work together to keep your data
safe, organized, and accessible!
Database Approach
Data Hierarchy
• A relational database is composed of multiple tables, and each table holds data.
• Within a table, each row represents a group of related data values.
• A row, or record, is also known as a tuple.
• The columns in a table is referred to as a field or attribute.
• A record is one instance of a set of fields in a table. You can also think of it this way-an
attribute is used to define the record and a record contains a set of attributes.