5.2 Structured Data
5.2 Structured Data
2 STRUCTURED DATA
Prepared by: Mohammad Nabeel Arshad
• Structured data is data that has been organized into a formatted repository,
typically a database, so that its elements can be made addressable for
more effective processing and analysis.
• Structured data refers to any data that resides in a fixed field within a record
or file. This includes data contained in relational databases and
spreadsheets.
• For example, a simple database for a small business might contain only two
columns, product name, or brand and price. If a customer calls to ask about
pricing, the store employee scans down the first column to find the product
and then looks at the associated price column to answer the customer's
question.
5.2.2 PURPOSE OF A RELATIONAL
DATABASE
• A relational database is a collection of data items organized as a set of
formally-described tables from which data can be accessed or reassembled
in many different ways without having to reorganize the database tables.
• In a relational database, all data are stored and accessed via relations.
Relations that store data are called "base relations", and in implementations
are called "tables". Other relations do not store data, but are computed by
applying relational operations to other relations.
A relational database is one that offers extremely complex and sophisticated
queries and searches, thanks to two factors:
tables and cross-referencing.
It stores data as tables rather than plain lists, making it easier to filter individual
elements of each record. It also allows cross-referencing between different
sets of data.
Field a single piece of data about one person or one thing. Many of these make up a record.
Record all of the data about one person or one thing. This is made up of one or more 'fields'.
describes the characteristics of an object. For example, House number - address / surname -
Attribute (Field)
person.
Primary Key A field within a database which enables every record to be uniquely identified.
two fields in different tables depend on one another. For example, a foreign key in one table will
Relationship (Link)
be the primary key in another table, so when one changes the other must change as well.
a field in a relational table that matches a primary key of another table. It can be used to cross-
Foreign Key
reference tables.
Composite Key consists of more than one attribute to uniquely identify an entity occurrence.
5.2.3 ENTITIES AND THE
RELATIONSHIPS BETWEEN THEM
• The entity relationship (ER) data model is well suited to data modelling for
use with databases because it is fairly abstract and is easy to discuss and
explain. ER models are readily translated to relations. ER models, also called
an ER schema, are represented by ER diagrams.
• An entity is any object in the system that we want to model and store
information about. Entities are usually recognizable concepts, either
concrete or abstract, such as person, places, things, or events which have
relevance to the database. Some specific examples of entities are
Employee, Student, Lecturer.
• Attribute
An attribute describes the property of an entity. An attribute is represented as Oval in
an ER diagram. There are four types of attributes:
1. Key attribute
2. Composite attribute
3. Multivalued attribute
4. Derived attribute
• 1. Key attribute:
A key attribute can uniquely identify an entity from an entity set. For example, student
roll number can uniquely identify a student from a set of students. Key attribute is
represented by oval same as other attributes however the text of key attribute is
underlined.
• ER diagram key attribute
2. Composite attribute:
An attribute that is a combination of other attributes is known as composite attribute. For example, In
student entity, the student address is a composite attribute as an address is composed of other
attributes such as pin code, state, country.
ER diagram composite attribute
3. Multivalued attribute:
An attribute that can hold multiple values is known as multivalued attribute. It is represented with
double ovals in an ER Diagram. For example – A person can have more than one phone numbers so
the phone number attribute is multivalued.
4. Derived attribute:
A derived attribute is one whose value is dynamic and derived from another attribute. It is represented
by dashed oval in an ER Diagram. For example – Person age is a derived attribute as it changes over
time and can be derived from another attribute (Date of birth).
Ellipses: Attributes
to Relationship Set
Ellipses: Attributes
Lines: They link attributes to Entity Sets and Entity sets to Relationship Set