0% found this document useful (0 votes)
190 views10 pages

Chapter 1: Basics of Database Lesson 1: Introduction To Database

1. The document discusses the basics of database including the components of a database system, types of databases, and database design. 2. The key components of a database system are hardware, software, people, procedures, and data. Hardware includes physical devices while software includes operating systems, DBMS, and application programs. People include users like administrators, designers, and end users. 3. Databases can be classified by number of users (single or multi-user), location (centralized or distributed), and extent of use (operational or data warehouse). 4. Database design refers to structuring the database to efficiently manage end user data. Data modeling is the process of creating logical and physical representations of end

Uploaded by

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

Chapter 1: Basics of Database Lesson 1: Introduction To Database

1. The document discusses the basics of database including the components of a database system, types of databases, and database design. 2. The key components of a database system are hardware, software, people, procedures, and data. Hardware includes physical devices while software includes operating systems, DBMS, and application programs. People include users like administrators, designers, and end users. 3. Databases can be classified by number of users (single or multi-user), location (centralized or distributed), and extent of use (operational or data warehouse). 4. Database design refers to structuring the database to efficiently manage end user data. Data modeling is the process of creating logical and physical representations of end

Uploaded by

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

Chapter 1: Basics of Database

Lesson 1: Introduction to Database


Database
It is an organized computer structure
designed in such a way that a computer can
quickly selected desired pieces of data. It stores
end user data and metadata. Data and Information

End user is the person in which the Data → Process → Information


application software is designed for. Thus, end
user data is the raw facts of interest to the end Data are raw and unorganized facts
user. Customer (end user) the details na binibigay which may come in a form of text, numbers,
ng customer (end user data) symbols and images, among others.
Metadata is considered to be “data Data Processing operations can be as
about data”. It provides a description of the end simple as sorting of data classification and
user data characteristics. Describes the end user validation or as complex as drawing
data interferences using statistical modelling.
The result of processing raw facts to
reveal its meaning is called information.

Database Management System


It is a system software (program) used
for creating and managing databases. Database
– nag re-reside sa kaniya yung mga data. DBMS
presents the end user with an integrated view
over the database. It offers a systematic way of
creating, updating, deleting, and retrieving data
in the database.
Yung software na ginagamit natin for us
to efficiently manage our database specifically
for us to perform creating, updating, deleting, and
retrieving data in our database ay tinatawag na
database management system. Ginagamit ng end
user to manage the data.

The application software may be


developed through the use of a certain
programming language such as VB.NET, Java,
Hindi magiging descriptive yung data pag hindi
Python, C#, and C++ among others.
dinidescribe ng metadata.
According to the number of users
- Single-user database – it can support
one user at a given time
- Multi-user database – it can support
multiple number of users in a given time,
a multi-user database is called
workgroup database if it supports
computers fewer than 50. On the other
hand, it is called enterprise database if it
Time: 14:03 supports more than 50 computers
Advantages of Database Management System According to the location
• Improves data sharing – DBMS allows - Centralized database – a database
the data residing in the database to be located and maintained in a single
shared among multiple application and location
users. - Distributed database – a database that
• Improved data security – DBMS nag po- supports database located in the
provide ng way to impose data privacy different sites.
and security policies. According to the extent of use
• Better data integration – DBMS nag po- - Operational database – a database
provide ng integrated views in the which is designed to be used in the day-
organizations data. to-day operations
• Minimized data inconsistency – data - Data warehouse – a database focused
inconsistency occurs when similar data on storing historical data which can
with the different version are kept in produce information that can be used in
different places. Ex. Yung company formulating strategic decision.
sales department have a record of sales
representative named Juan Dela Cruz Database Systems Environment
and the human resource department Database Systems refers to the
has the same person as Pedro Dela organization of components which governs the
Cruz, nagkakaroon ng inconsistency ng management of data residing in the database.
data. These components are further discussed below:
• Improved data access – through real 1. Hardware – it includes all physical devices
time retrieval of data by means of such as computers, storage devices, printers,
queries (request being sent to DBMS for networking devices and other devices (barcode
data manipulation task and DBMS reader, RFID reader and a like)
sends back an answer to the request 2. Software – the database systems need an
which is called as query result set) operating system, DBMS software and
• Improved decision making – a well- application programs.
organized and managed data can a. Operating System Software – is a
produce an information-based system software that manages computer
knowledge which can be used in hardware and application software. Example of
decision making process Operating System includes Microsoft Windows,
• Increased end-user productivity – Linux, Mac OS, and UNIX.
because of the data management b. DBMS Software – is a software used
functionalities na kine-cater ng DBMS to manage database. Examples are SQL by
coupled with availability, relevance, and Microsoft, Server, MySQL by Sun and Oracle by
timeliness of the data, so we can use Oracle Corporation.
that to make rational decision making c. Application Program – is the
and to elicit pro-active actions leading software used to manipulate data in the DBMS.
to the success of the organization. 3. People – it includes all types of users who will
utilize the database system, The primary job
Types of Databases functions are identified as follows:
The Database Management System can a. System Administrator – is a person
support different types of databases which are responsible in overseeing the general
classified according to the number of users, operations of the database systems.
location, and the extent of use. b. Database Administrator – is a person
The classification and types of the responsible in maintaining and managing the
database are as follows:
DBMS. Ensuring that the database is functioning - There are different types of databases
properly is also part of its responsibility. and these are classified according to
c. Database Designers – it is the person the number of users, location, and the
responsible of designing the database structure. extent of use.
Poor database design will turn produce a poor - Database systems pertains to the
database environment which may lead to organization of components for the
different problems in managing the data. effective management of data. There
d. End Users – these are the people who are five important components to be
will use the application programs to perform the considered are the hardware, software,
organization’s daily activity. people, procedures, and data.
4. Procedures – this refers to the rules that
governs the operations of the certain Lesson 2: Database Design
organization. Procedures are in prime
importance in the company as it enforces the Database Design
standards in running the business together with It refers to the process of structing the
the stakeholders. database in order to efficiently manage the end
5. Data – the collection of the raw facts needed user data.
to generate substantial information. The data to
be entered into the database and how it will be Data modelling
organized are the vital duties needed to perform Is the process of creating logical and
by database designer. physical models.
Logical modelling - focused in the collection of
business requirements. It is important to gather
information about the organizational units. The
logical data model defines the structure of the
data elements and the relationship between
them.
Physical modelling - focused in the actual
database designing and it should be based on
the requirements gathered during logical
modelling. Physical data models describe the
database-specific implementation of the data
Summary model.
- Data are the raw facts which will be
transforms into information once it Types of Data model
undergoes data processing. This
accurate, timely and relevant
information can serve a basis for a
rational decision making, which will in
turn make a positive impact to the
company.
- The data are usually stored in the
database. The database stored data of
the end user and “data about data”,
known as metadata. This data inside the
database can be managed through the
use of Database Management System.
The DBMS serves as an intermediary
Data Model Basic Building Blocks
between the application being used by
the user and database.
1. Entity – it represents a particular type of
- A well-designed database can facilitate
object such as person, places, objects, or events
data management. With this, relevant
which have relevance to the database.
and accurate information will be
Example of Entities:
produced. In contrast, having a poorly
Person: Employee, Teacher, Student, Painter
designed database may entail data
Place: Store, Building
inconsistencies which may lead to bad
Object: Equipment, Car, Product
decision making.
Event: Registration, Sale
2. Attribute – it refers to the characteristics of A student attends many
the entity. For example, the employee entity has classes, and each class can be attended
the attributes of employee last name, middle by many students. The relationship
name, first name, employee address. “Student attend Class” would be labeled
as Many-to-Many (M:N).

One-to-one (1:1) relationship


One entity
from set A can be
associated with a
single entity in set B,
3. Relationship – it describes the association likewise, one entity
among entities. There are three types of from set B must be
relationship: one-to-one, many-to-many, and associated with only
one-to-many. The database designers usually one entity in set A
use a shorthand notations 1:N, M:N, 1:1 Example:
respectively. An employee may obtain one
One-to-many (1:N) relationship distinct employee ID number. In turn, an
One entity employee ID number can only be used
from set A can be by only one employee. The relationship
associated with “Employee obtains Employee ID
more than one entity number” would be labeled as one-to-
in set B. However, one.
entities from set B A Person may obtain one
must be associated passport, and each passport can be
with only one entity obtained by one person. The
in set A. relationship “Person obtains Passport”
Example: would be also be labeled as one to one.
An artist can create many
artworks, but each artwork can be 4. Constraints – it refers to the limits enforced
created by one artist. Thus, the artist to the data in order to maintain its integrity. For
(the “one”) is related to the artwork (the example:
“many”). In this case, the database * Each class must have only one teacher
designer would label the relationship * The prices must be between P100.00 to
“Artist created Artwork” as One-to- P150.00.
many (1:N) * The grade considered as passed if it is greater
A customer may generate many than or equal to 75.
invoices, but each invoice is generated
for a single customer. This relationship Business Rules
“Customer generates Invoice” can also In order to identify the data model
be labeled as One-to-many (1:N). building blocks: entity attributes, relationships,
and constraints, it is important that you clearly
Many-to-Many (M:N) relationship identified the business rules of the problem
Many entities domain you are trying to model.
from set A can be A business rules are a brief and precise
associated with more description of policy, standards, principle or
than one entity in set B, standard of a certain organization. All of the
entities from set B must organizations, may it be a small or large
be associated with business, government unit and religious group
more than one entity in among others have their own unique business
set A. rules.
Example: Example of business rules are as follows:
A student can learn many skills, 1. A customer may generate many
and each skill can be earned by many invoices
students. The designer would label the 2. An invoice is generated by only
relationship “Student learns Skill” as customer
Many-to-Many (M:N).
3. A training session cannot be real-world entities such as people, objects,
scheduled for fewer than 10 employees places, and events.
or for more than 30 employees
ER Diagram Representation
1. Entity – Entities are represented by
rectangles. Each rectangle has to be named by
the entity set they represent.

Translating Business Rules into Data Model


Components
Discovering the business rules paves 2. Attribute – are being represented
way for the proper identification of the entities, through the use of ellipses. Every ellipse is
attributes, relationships, and constraints. As a directly connected to the entity.
general rule, the noun in a business rule
translates to the entity, the verb (active or Types of Attributes
passive) associating nouns will translate into the 1. Single Attribute – this attribute can’t be
relationship among the entities. divided any further.
Example: For example, student_number. It is also
Student enrolls in classes called atomic.
The noun Student and Class translates
to entity while the verb enrolls translates to
relationship.
In order to properly identify the type of
relationship, it is important to consider that it is
bidirectional. As a rule, you have to ask two
questions:
1. How many instances of A are related to one
instance of B?
2. How many instances of B are related to one
instance of A?
2. Composite Attribute – an attribute tends to
Using the same example above, we can ask: be composite, if it comprises two or more other
How many students can enroll in one class? The attributes. For example, the attribute name
answer is many students. comprises first name and last name. Composite
In how many classes can one student enroll? The attributes can be represented like a tree
answer is many classes. structure.
Therefore, the relationship between
Student and Class entity is classified as Many-
to-many (M:M)

A customer may generate many invoices


The noun Customer and Invoice
translates to entities and the verb generate
translates to the relationship between the
entities.

For how many customers does one generated 3. Derived Attribute – a type of attribute in which
invoice is intended? The answer is one customer. their values are derives from other attribute,
How many invoices can be generated in one such as age from birthdate.
customer? The answer is many invoices
Therefore, there is a one-to-many
relationship between customer and invoice.

Entity Relationship Diagram


An entity relationship diagram (ERD),
also known as Entity Relationship Model, is a
visual representation of the relationship among
4. Multivalued Attribute – More than one
attribute value is denoted, such as multiple
phone numbers for a person.

3. Relationship – Relationship is Summary


represented through the use of diamond- - Database design refers to the process
shaped box. Its name is being written inside the of structuring the database in order to
box. To show the relationship among the entities efficiently manage the end user data.
through the use of ER diagram, the rectangle - In designing the database, one of the
symbol (entities) must be connected to the important processes to do is data
diamond-shaped box (relationship). modelling, the process of creating
Additionally, the diagram must also indicate the logical and physical models. Logical
type of the relationship. modelling is focused on the collection
of business requirements, while
physical database modelling refers to
the actual creation of the database. The
physical model must adhere to the
logical model.
- The basic data-modeling components
are entities, attributes, relationships,
and constraints.
- Business rules are a brief and precise
description policy, principle or
standards of a certain organization
which is used to identify and define the
basic modeling components within a
How to draw ER Diagrams?
specific real-world environment.
Below are the points you have to
- In translating business rules to data
consider in creating ER diagram.
models, the noun in a business rule
1. identify all the entities
translates to entity and the verb
2. identify relationships
associated with the nouns translated
3. add attributes
into the relationship among the entities.
- Entity Relationship Diagram (ERD)
refers to the visual relationship among
real-world entities.
- The type of attributes includes single
attribute, composite attribute, derived
attribute, and multivalued attribute.
- To create an ER Diagram, you have first
to identify all the entities, next is to
identify the relationships and last step is
to identify and add attributes.
Lesson 3: Relational Database Comparison between RDMS and Traditional
Database Terminologies
Design
In the current era, the relational model is the
most important data model used in various data
processing application to its simplicity. In this
lesson, you will learn the essential and primary
uses of the relational model.

What is Relational Model?


Relational model is the conceptual
basis of relational database. It was proposed by
E.F Codd in 1969 (Edgar Frank Ted Codd). This
model represents the database as a collection
of relations or table. A relation is nothing but a
table of values, it also represents the real-world
entity.

The relation has the following characteristics:


- Each row represents one tuple of a
relation (table)
- The ordering of rows is not important in
relation.
- Each tuple must be distinct to the other.
This can be done through having a
unique identifier. Relational Integrity Constraints
- Relation is a two – dimensional Referred to the condition enforced to
structure which is made up of tuples produce a valid relation. Relational integrity
and attributes. constraints are used to ensure accuracy and
- The intersection of a tuple and an consistency of data in the database.
attribute should contain a single value.
Relational Integrity Constraints are categorized
Relational Model Components into three:
1. Attribute and Degree – attribute corresponds
to each column in a relation or table. Attributes 1. Domain Constraints – it defined a valid set of
is considered to be the characteristics of the values for an attribute. The data type of domain
table. E.g., student_id, name, etc. Degree includes character, integer, date, time, etc.
represents the total number of attributes in the
relation.
2. Tuple and Cardinality – Tuple is the single
row of a table, which contains a single record.
Cardinality represents the total number of rows 2. Key Constraints – an attribute used to
in the table. uniquely a tuple in a relation is called the key of
3. Tables – it has two properties, the rows and the table or primary key.
columns. Rows represent the records and
column represents the attributes.
4. Domain – the values of attributes are derived
from some valid set of predefined values, which
is known as the domain of an attribute. 3. Referential Integrity Constraints – A foreign
key in a column is an attribute that provides a
Example: the domain of student_id field is an link between two relations.
integer, the domain of the student_name field is In the referential integrity constraints, if
a set of characters. a foreign key in Table 1 refers to the primary key
of Table 2, then every value of the foreign key in
table 1 must be available in table 2.
domain are some important
components of relational database.
- Relational integrity constraints referred
to the condition enforced to produce a
valid relation
- Domain constraints defines a valid set
of values for an attribute. It can be
violated if the attribute value is not in
Operations Performed in Database appropriate data type.
There are four basic operations - Key constraints are a type of constraint
performed in a relational database. which limits duplicate tuple in a relation.
- The four basic operations performed in
1. inserting data into the table relational database includes insert,
delete, update, and select.

MySQL Environment
What is MySQL?
MySQL is an open-source relational
database management system which is based
on Structured Query Language (SQL). SQL is a
standard language which is being used for
2. deleting tuples/records from the table storing manipulating and retrieving data in the
database. It is used to perform commands such
as Add, Drop, Insert, and Update.
In this course, we will use XAMPP, a
free and open-source cross platform web server
solution developed by Apache Friends. XAMPP
stands for Cross-Platform (X), Apache HTTP
server (A), MySQL (M), PHP (P), and Perl (P).

Setting up MySQL Database Management


3. modify the values of some data in the existing System in your PC
tuples/records. 1. Download XAMPP from Apache friends
(https://www.apachefriends.org)
2. Run the XAMPP installer by double
clocking the downloaded executable
file.
3. Click the next button.
4. XAMPP caters different components
like MSQL, Apache, PHP, and Perl
among others. In most cases, you will be
using it, so it is recommended to leave
the default option and click Next button.
4. select one or more records in the database. In 5. Use the default file path location and
this example, the female customers were click the next button.
filtered. 6. Untick the checkbox to clear the Learn
more about Bitnami for XAMPP option
and click next button
7. Click the next button.
8. Wait until the installation is finished.
Summary
Once completed, the XAMPP Control Panel will
- The relational database represents the
launch, and you are now ready to use the
database as a collection of relations or components it offers.
table,
- Attribute/column, tuple or row, - To start, you need to Start the Apache
relation/table, degree, cardinality and and MySQL module by clicking the start
button.
- Apache is being run in order to use the
web browser in storing, manipulating,
and retrieving data in MySQL database.
- That’s it you have already installed the
XAMPP in your computer.
Opening MySQL
If you are done installing the XAMPP
using the instruction above, then it would be
easy to open the MySQL.

You can open it through these steps:


1. Open File Explorer and go to drive C: (the
default file path location)
2. Open XAMPP folder
3. Open xampp - control
4. You may now start the Apache and MySQL
module by clicking start
5. Open your browser (e.g., Internet Explorer,
Google Chrome, Mozilla Firefox, etc.)
6. In the browser’s address bar, you type in
localhost.
7. The XAMPP dashboard will be displayed in
the webpage. In the menu, click phpMyAdmin.
This will bring you to MySQL setup page.

You might also like