Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Week 1 Activity Sheet:: Defining A Database

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 30

WEEK 1 ACTIVITY SHEET:

DEFINING A DATABASE

YOUR DISCUSSION TEXT:


Purpose of Database Systems
The main purpose of database systems is to manage the data. Consider a university that keeps
the data of students, teachers, courses, books etc. To manage this data we need to store this data
somewhere where we can add new data, delete unused data, update outdated data, retrieve data, to
perform these operations on data we need a Database management system that allows us to store the
data in such a way so that all these operations can be performed on the data efficiently. Database
systems are much better than traditional file processing systems which we have discussed

Databases - Collection of related data that is stored in a central location or in multiple locations
Data hierarchy - Structure and organization of data involving fields, records, and files
Database management system (DBMS) — Hardware/Software for creating, storing, maintaining, and
accessing database files makes using databases more efficient

Methods for Accessing Files


A. Sequential file Structure
records are organized and processed in numerical or sequential order organized based on a primary key
social Security numbers or account numbers and used for backup and archive files as they rarely need
updating

B. Random access file structure


Records can be accessed in any order irrespective of the physical locations in storage media fast and
very effective when a small number of records need to be processed daily or weekly records are stored
on magnetic tapes

C. Indexed sequential access method (ISAM)


Records are accessed sequentially or randomly depending on the number being accessed, Random
access is used for a small number. Sequential access is used for a large number it also uses an index
structure and has two parts the Indexed value and pointer. to the disk location of the record matching
indexed value.

Types of Data in Database


A. Internal
 Collected from within an organization
 Stored in the organization's internal databases
B. External
 Comes from a variety of resources
 Stored in a data warehouse
Logical Database Design
A. Physical view
 Involves how is Stored on a from Storage media
 Hard disks, magnetic tapes, or CDs
B. Logical view
 Involves how information appears to and how it can be organized retrieved
 Includes more than one Digital View of data, depending on the user
C. Data model
 Determines how data is created, represented, organized, and maintained Contains Data
structure operations and Integrity rules
D. Hierarchical
 Relationships between records treelike structure

Logical Database Design


A. Network model
 Similar to the hierarchical model but records are organized differently
 Includes multiple parent and child records

Hierarchy model
ASYNCHRONOUS ACTIVITY:
DATABASE ARCHITECTURE

YOUR GOALS:
After completing the learning activities for this lesson, you are expected to:
 apply the importance of DBMS to different programming language
 understand the advantage of DBMS to a file system
 classify the different architecture used in DBMS.

YOUR INITIAL TASK:

Select one of your favorite character can be an anime, or an artist local or international write
down all information available to that person or character including hobbies, personal profile,
likes and dislikes that is available on the internet, lastly answer this question why do this
information exist in the internet?

YOUR DISCUSSION TEXT:

Database Applications – DBMS

Applications where we use Database Management Systems are:

Telecom: There is a database to keeps track of the information regarding calls made, network
usage, customer details etc. Without the database systems it is hard to maintain that huge
amount of data that keeps updating every millisecond.

Industry: Where it is a manufacturing unit, warehouse or distribution center, each one needs a
database to keep the records of ins and outs. For example, distribution center should keep a
track of the product units that supplied into the center as well as the products that got
delivered out from the distribution center on each day; this is where DBMS comes into picture.

Banking System: For storing customer info, tracking day to day credit and debit transactions,
generating bank statements etc. All this work has been done with the help of Database
management systems.

Sales: To store customer information, production information and invoice details.

Airlines: To travel though airlines, we make early reservations, this reservation information
along with flight schedule is stored in database.

Education sector: Database systems are frequently used in schools and colleges to store and
retrieve the data regarding student details, staff details, course details, exam details, payroll
data, attendance details, fees details etc. There is a hell lot amount of inter-related data that
needs to be stored and retrieved in an efficient manner.
Online shopping: You must be aware of the online shopping websites such as Amazon, Flipkart
etc. These sites store the product information, your addresses and preferences, credit details
and provide you the relevant list of products based on your query. All this involves a Database
management system.

Advantages of DBMS over file system

Drawbacks of File system

Data redundancy: Data redundancy refers to the duplication of data, let’s say we are managing
the data of a college where a student is enrolled for two courses, the same student details in
such case will be stored twice, which will take more storage than needed. Data redundancy
often leads to higher storage costs and poor access time.

Data inconsistency: Data redundancy leads to data inconsistency, let’s take the same example
that we have taken above, a student is enrolled for two courses and we have student address
stored twice, now let’s say student requests to change his address, if the address is changed at
one place and not on all the records then this can lead to data inconsistency.

Data Isolation: Because data are scattered in various files, and files may be in different formats,
writing new application programs to retrieve the appropriate data is difficult.

Dependency on application programs: Changing files would lead to change in application


programs.

Atomicity issues: Atomicity of a transaction refers to “All or nothing”, which means either all
the operations in a transaction executes or none.

For example: Let’s say Steve transfers 100 pesos to Negan’s account. This transaction consists
multiple operations such as debit 100 pesos from Steve’s account, credit 100 pesos to Negan’s
account. Like any other device, a computer system can fail let’s say it fails after first operation
then in that case Steve’s account would have been debited by 100 pesos but the amount was
not credited to Negan’s account, in such case the rollback of operation should occur to
maintain the atomicity of transaction. It is difficult to achieve atomicity in file processing
systems.

Data Security: Data should be secured from unauthorized access, for example a student in a
college should not be able to see the payroll details of the teachers, such kind of security
constraints are difficult to apply in file processing systems.

Advantage of DBMS over file system

There are several advantages of Database management system over file system. Few of them
are as follows:

No redundant data: Redundancy removed by data normalization. No data duplication saves


storage and improves access time.

Data Consistency and Integrity: As we discussed earlier the root cause of data inconsistency is
data redundancy, since data normalization takes care of the data redundancy, data
inconsistency also been taken care of as part of it

Data Security: It is easier to apply access constraints in database systems so that only
authorized user can access the data. Each user has a different set of access thus data is secured
from the issues such as identity theft, data leaks and misuse of data.

Privacy: Limited access means privacy of data.


Easy access to data – Database systems manages data in such a way so that the data is easily
accessible with fast response times.

Easy recovery: Since database systems keeps the backup of data, it is easier to do a full
recovery of data in case of a failure.

Flexible: Database systems are more flexible than file processing systems.

Disadvantages of DBMS:
 DBMS implementation cost is high compared to the file system
 Complexity: Database systems are complex to understand
 Performance: Database systems are generic, making them suitable for various
applications. However, this feature affects their performance for some applications

DBMS Architecture

The architecture of DBMS depends on the computer system on which it runs. For example, in a
client-server DBMS architecture, the database systems at server machine can run several requests made
by client machine. We will understand this communication with the help of diagrams.

Types of DBMS Architecture

1. Single tier architecture


2. Two tier architecture
3. Three tier architecture

1. Single tier architecture


In this type of architecture, the database is readily available on the client machine, any
request made by client doesn’t require a network connection to perform the action on the
database.

For example, lets say you want to fetch the records of employee from the database and the
database is available on your computer system, so the request to fetch employee details will be
done by your computer and the records will be fetched from the database by your computer as well.
This type of system is generally referred as local database system.

2. Two tier architecture


Figure 3: Two-tier architecture

In two-tier architecture, the Database system is present at the server machine and the DBMS
application is present at the client machine, these two machines are connected with each other through
a reliable network as shown in the above diagram.

Whenever client machine makes a request to access the database present at server using a
query language like sql, the server perform the request on the database and returns the result back to
the client. The application connection interface such as JDBC, ODBC are used for the interaction
between server and client.
Figure 4: Three-Tier architecture

In three-tier architecture, another layer is present between the client machine and server
machine. In this architecture, the client application doesn’t communicate directly with the database
systems present at the server machine, rather the client application communicates with server
application and the server application internally communicates with the database system present at the
server.

YOUR REINFORCEMENT TASKS:

TASK 1: In your own word, discuss the benefit of using a Database Management system from a
big data such as:

 Retail
 Financial services
 Advertising and public relations
 Government
 Manufacturing
 Media and telecommunications
 Energy
 Healthcare

Database Management systems may be used for a variety of purposes, including inventory
management for retailers and manufacturers, data evaluation, search and identification on big
databases, and data storage that is more secure than the traditional method of paper and
envelopes.

Database management systems will be useful for the following:


 Search data
 Inventory management
 Advertising management
 Security
 Etc.
For example:
Manufacturing and retail businesses can use database management software to
organize, evaluate, and search inventories more quickly and reliably than the traditional
method of paper and folders.

Financial services and healthcare can evaluate and identify the most needed for
attention and services faster, consistent, and with no redundancy of data.

Finally, database management systems are useful and highly reliable through vast databases,
particularly for those who have a large amount of data to manage.

TASK 2: Based on the information below of the cases of COVID-19 here in Caloocan City as of
March 2020, how do you think the LGU is able to determine the numbers or the data shown in
the image? Using the logic of Database architecture.
Figure 5: COVID-19 cases in Caloocan City as of March 2020

LGUs can use tracing systems like "ValTrace" to track, monitor, and investigate potential
COVID-19 cases. Such databases are critical for managing people's monitoring, especially
during pandemics. Looking at the cases of COVID-19 in Caloocan City as of March 2020,
you can see that they have people monitored, under investigation, and confirmed cases of
COVID-19 that are using the requisite processes for preparedness and response to COVID-19
as an opportunity to strengthen and sustain their local city surveillance.

LGUs can also use their database to determine if there is an outbreak in their region; if there
is a sudden increase in confirmed cases, they may need to increase contact tracing for a
specific region. However, without a database, it will be more difficult and time-consuming,
making it inefficient and unreliable. That is why database management systems are critical
for managing large amounts of data.

WEEK 3 ACTIVITY SHEET:


DBMS MODEL AND SCHEMA

YOUR GOALS:
After completing the learning activities for this lesson, you are expected to:
 understand the different structure of a database
 distinguish the database structed used in a program
 understand the importance of creating an architecture of database.

YOUR INITIAL TASK:

In our daily Internet activities, people normally use FACEBOOK, TWITTER, MICROSOFT, YAHOO
and GOOGLE as our main website to get news or any information we wanted too.

Write down the common information this website gets for us to LOGIN and WHY? Do they get
this information?
Figure 6: Internet websites

YOUR DISCUSSION TEXT:

Data models define how the logical structure of a database is modeled. Data Models are fundamental
entities to introduce abstraction in a DBMS. Data models define how data is connected to each other
and how they are processed and stored inside the system.

The very first data model could be flat data-models, where all the data used are to be kept in the same
plane. Earlier data models were not so scientific; hence they were prone to introduce lots of duplication
and update anomalies.

Entity-Relationship Model

Entity-Relationship (ER) Model is based on the notion of real-world entities and


relationships among them. While formulating real-world scenario into the database model, the
ER Model creates entity set, relationship set, general attributes and constraints.

ER Model is best used for the conceptual design of a database.

ER Model is based on:

 Entities and their attributes


 Relationships among entities.

These concepts are explained below.


Figure 7: Entity-Relationship Model

Entity − An entity in an ER Model is a real-world entity having properties called attributes. Every
attribute is defined by its set of values called domain. For example, in a school database, a
student is considered as an entity. Student has various attributes like name, age, class, etc.

Relationship − The logical association among entities is called relationship. Relationships are
mapped with entities in various ways. Mapping cardinalities define the number of associations
between two entities.

Mapping cardinalities:

 one to one
 one to many
 many to one
 many to many

Relational Model
The most popular data model in DBMS is the Relational Model. It is more scientific a
model than others. This model is based on first-order predicate logic and defines a table as an
n-array relation.

Figure 8: Relational Model

The main highlights of this model are:

 data is stored in tables called relations


 relations can be normalized
 in normalized relations, values saved are atomic values
 each row in a relation contains a unique value
 each column in a relation contains values from a same domain.
Database Schema

A database schema is the skeleton structure that represents the logical view of the
entire database. It defines how the data is organized and how the relations among them are
associated. It formulates all the constraints that are to be applied on the data.

A database schema defines its entities and the relationship among them. It contains a
descriptive detail of the database, which can be depicted by means of schema diagrams. It’s the
database designers who design the schema to help programmers understand the database and
make it useful.

Figure 9: Database Schema

A database schema can be divided broadly into two categories:

Physical Database Schema – This schema pertains to the actual storage of data and its form of
storage like files, indices, etc. It defines how the data will be stored in a secondary storage.

Logical Database Schema – This schema defines all the logical constraints that need to be
applied on the data stored. It defines tables, views, and integrity constraints.

Database Instance

It is important that we distinguish these two terms individually. Database schema is the
skeleton of database. It is designed when the database doesn't exist at all. Once the database is
operational, it is very difficult to make any changes to it. A database schema does not contain
any data or information.

A database instance is a state of operational database with data at any given time. It
contains a snapshot of the database. Database instances tend to change with time. A DBMS
ensures that its every instance (state) is in a valid state, by diligently following all the
validations, constraints, and conditions that the database designers have imposed.
WEEK 4 ACTIVITY SHEET:
ENTITY MODEL, DATA, LOGICAL AND PHYSICAL INDEPENDENCE

YOUR GOALS:
After completing the learning activities for this lesson, you are expected to:
 understand the different entity model
 classify the independence of a data
 able to define the attributes of a data

YOUR INITIAL TASK:

Any company or corporation uses an organizational chart in order to guide and inform the
employees of their role in an organization.

Search for any establishment, can be a School a private company a draw their organizational
chart

Figure 10: Sample organizational chart

YOUR DISCUSSION TEXT:

DBMS Data Independence


If the database system is not multi-layered then it will be very hard to make any changes
in the database system. Database systems are designed in multi-layers as we leant earlier.

Data Independence
There's a lot of data in whole database management system other than user's data.
DBMS comprises of three kinds of schemas, which is in turn data about data (Meta-Data).
Meta-data is also stored along with database, which once stored is then hard to modify. But as
DBMS expands, it needs to be changed over the time satisfy the requirements of users. But if
the whole data were highly dependent it would become tedious and highly complex.

Figure 11: Physical Data Independence

Data about data itself is divided in layered architecture so that when we change data at
one layer it does not affect the data layered at different level. This data is independent but
mapped on each other.

Logical Data Independence


Logical data is data about database, that is, it stores information about how data is
managed inside. For example, a table (relation) stored in the database and all constraints,
which are applied on that relation.

Logical data independence is a kind of mechanism, which liberalizes itself from actual
data stored on the disk. If we do some changes on table format it should not change the data
residing on disk.

Physical Data Independence


All schemas are logical and actual data is stored in bit format on the disk. Physical data
independence is the power to change the physical data without impacting the schema or logical
data.

For example, in case we want to change or upgrade the storage system itself, that is, using SSD
instead of Hard disks should not have any impact on logical data or schemas.

ER Model : Basic Concepts


Entity relationship model defines the conceptual view of database. It works around real-
world entity and association among them. At view level, ER model is considered well for
designing databases.

Entity
A real-world thing either animate or inanimate that can be easily identifiable and
distinguishable. For example, in a school database, student, teachers, class and course offered
can be considered as entities. All entities have some attributes or properties that give them
their identity.

An entity set is a collection of similar types of entities. Entity set may contain entities
with attribute sharing similar values. For example, Students set may contain all the student of a
school; likewise, Teachers set may contain all the teachers of school from all faculties. Entities
sets need not to be disjoint.

Attributes
Entities are represented by means of their properties, called attributes. All attributes
have values. For example, a student entity may have name, class, age as attributes.

There exist a domain or range of values that can be assigned to attributes. For example,
a student's name cannot be a numeric value. It has to be alphabetic. A student's age cannot be
negative, etc.

Types of attributes:

Simple attribute- Simple attributes are atomic values, which cannot be divided further. For
example, student's phone-number is an atomic value of 10 digits.

Composite attribute - Composite attributes are made of more than one simple attribute. For
example, a student's complete name may have first name and last name.

Derived attribute - Derived attributes are attributes, which do not exist physical in the
database, but their values are derived from other attributes presented in the database. For
example, average salary in a department should be saved in database instead it can be derived.
For another example, age can be derived from data of birth.

Single-valued attribute - Single valued attributes contain on single value.


For example: Social Security Number.

Multi-value attribute - Multi-value attribute may contain more than one values. For example, a
person can have more than one phone numbers, email address etc.

These attribute types can come together in a way like:


 simple single-valued attributes
 simple multi-valued attributes
 composite single-valued attributes
 composite multi-valued attributes

Entity-set and Keys


Key is an attribute or collection of attributes that uniquely identifies an entity among
entity set. For example, rollnumber of a student makes her/him identifiable among students.

Super Key - Set of attributes (one or more) that collectively identifies an entity in an entity set.
Candidate Key - Minimal super key is called candidate key that is, supers keys for which no
proper subset are a superkey. An entity set may have more than one candidate key.
Primary Key - This is one of the candidate key chosen by the database designer to uniquely
identify the entity set.
Relationship
The association among entities is called relationship. For example, employee entity has
relation works at with department. Another example is for student who enrolls in some course.
Here, Works at and Enrolls are called relationship.

Relationship Set
Relationship of similar type is called relationship set. Like entities, a relationship too can
have attributes. These attributes are called descriptive attributes.
Degree of relationship
The number of participating entities in an relationship defines the degree of the
relationship.
 Binary = degree 2
 Ternary = degree 3
 n-array = degree

Mapping Cardinalities:
Cardinality defines the number of entities in one entity set which can be associated to
the number of entities of other set via relationship set.

One-to-one: one entity from entity set A can be associated with at most one entity of entity set
B and vice versa.

Figure 12: One to one entity

One-to-many: One entity from entity set A can be associated with more than one entities of
entity setB but from entity set B one entity can be associated with at most one entity.
Figure 13: One to many entity

Many-to-one: More than one entities from entity set A can be associated with at most one
entity of entity set B but one entity from entity set B can be associated with more than one
entity from entity set A.

Figure 14: Many to one entity

Many-to-many: one entity from A can be associated with more than one entity from B and vice
versa.
Figure 15: Many to many entity

ER Diagram Representation
Now we shall learn how ER Model is represented by means of ER diagram. Every object
like entity, attributes of an entity, relationship set, and attributes of relationship set can be
represented by tools of ER diagram.

Entity
Entities are represented by means of rectangles. Rectangles are named with the entity
set they represent.

Figure 16: Entities in a school database

Attributes
Attributes are properties of entities. Attributes are represented by means of eclipses.
Every eclipse represents one attribute and is directly connected to its entity (rectangle).
Figure 17: Sample attributes

If the attributes are composite, they are further divided in a tree like structure. Every
node is then connected to its attribute. That is composite attributes are represented by eclipses
that are connected with an eclipse.

Figure 18: Composite attributes


Multivalued attributes are depicted by double eclipse.

Figure 19: Multivalued attributes

Derived attributes are depicted by dashed eclipse.

Figure 20: Derived attributes

Relationship
Relationships are represented by diamond shaped box. Name of the relationship is
written in the diamond-box. All entities (rectangles), participating in relationship, are connected
to it by a line.
Binary relationship and cardinality
A relationship where two entities are participating, is called a binary relationship.
Cardinality is the number of instance of an entity from a relation that can be associated with
the relation.

One-to-one
When only one instance of entity is associated with the relationship, it is marked as '1'.
This image below reflects that only 1 instance of each entity should be associated with the
relationship. It depicts one-to-one relationship

Figure 21: One to one

One-to-many
When more than one instance of entity is associated with the relationship, it is marked
as 'N'. This image below reflects that only 1 instance of entity on the left and more than one
instance of entity on the right can be associated with the relationship. It depicts one-to-many
relationship.

Figure 22: One to many

Many-to-one
When more than one instance of entity is associated with the relationship, it is marked
as 'N'. This image below reflects that more than one instance of entity on the left and only one
instance of entity on the right can be associated with the relationship. It depicts many-to-one
relationship

Figure 23: Many to one


Many-to-many
This image below reflects that more than one instance of entity on the left and more
than one instance of entity on the right can be associated with the relationship. It depicts
many-to-many relationship.

Figure 24: Many to many

Participation Constraints
Total Participation - Each entity in the entity is involved in the relationship. Total participation
is represented by double lines.
Partial participation - Not all entities are involved in the relationship. Partial participation is
represented by single line.

Figure 25: Participation to Constraints

YOUR REINFORCEMENT TASKS:

TASK 1: Given the following field below write down your personal information using MS
ACCESS Database.
Figure 26: MS ACCESS DB

TASK 2: In your Visual basic create a simple program that can store the following information.

Figure 27: Adding student information

References:
https://beginnersbook.com/2015/04/dbms-tutorial/
https://www.tutorialspoint.com/dbms/dbms_data_schemas.htm
https://www.guru99.com/dbms-tutorial.html
https://www.studytonight.com/dbms/
http://www.ssmargolcollege.org/style/notes/computer%20science/
Database_Management_System.pdf
https://www.db-book.com/db4/slide-dir/ch1-2.pdf
WEEK 5 ACTIVITY SHEET:
AGGREGATION, CODD’S RULES AND DATA MODEL RELATION

YOUR GOALS:
After completing the learning activities for this lesson, you are expected to:
 design a database system using MS Access
 enumerate the importance codd’s rules in database
 compare different data model how does it use to different program.

YOUR INITIAL TASK:

Companies often collect data on their online customers and website visitors. The
aggregate data would include statistics on customer demographic and behavior metrics, such as
average age or number of transactions. This aggregated data can be used by the marketing
team to personalize messaging, offers, and more in the user’s digital experience with the brand.

Figure 28: Collecting data

Create a simple survey using “MS FORMS” to get the following information

 Gender
 Age
 Internet connection
 Hobby
 Interest
 How often do you surf the internet?
 Do you do online shopping?
YOUR DISCUSSION TEXT:

Generalization Aggregation

ER Model has the power of expressing database entities in conceptual hierarchical


manner such that, as the hierarchical goes up it generalize the view of entities and as we go
deep in the hierarchy it gives us detail of every entity included.
Going up in this structure is called generalization, where entities are clubbed together to
represent a more generalized view. For example, a student named, Chrysler can be generalized
along with all the students, the entity shall be student, and further a student is person. The
reverse is called specialization where a person is student, and that student is Chrysler.

Generalization

As mentioned above, the process of generalizing entities, where the generalized entities
contain the properties of all the generalized entities is called Generalization. In generalization,
several entities are brought together into one generalized entity based on their similar
characteristics. For an example, pigeon, house sparrow, crow and dove all can be generalized as
Birds.

Figure 29: Generalization

Specialization
Specialization is a process, which is opposite to generalization, as mentioned above. In
specialization, a group of entities is divided into sub-groups based on their characteristics. Take
a group Person for example. A person has name, date of birth, gender etc. These properties are
common in all persons, human beings. But in a company, a person can be identified as
employee, employer, customer or vendor based on what role do they play in company.

Figure 30: Specialization

Similarly, in a school database, a person can be specialized as teacher, student or staff; based
on what role do they play in school as entities.

Inheritance
We use all above features of ER-Model, in order to create classes of objects in object-
oriented programming. This makes it easier for the programmer to concentrate on what she is
programming. Details of entities are generally hidden from the user, this process known as
abstraction.
One of the important features of Generalization and Specialization, is inheritance, that
is, the attributes of higher-level entities are inherited by the lower level entities.

Figure 31: Inheritance

For example, attributes of a person like name, age, and gender can be inherited by lower level
entities like student and teacher etc.

Codd's 12 Rules

Dr Edgar F. Codd did some extensive research in Relational Model of database systems
and came up with twelve rules of his own which according to him, a database must obey in
order to be a true relational database.

These rules can be applied on a database system that is capable of managing is stored
data using only its relational capabilities. This is a foundation rule, which provides a base to
imply other rules on it.

Rule 1: Information rule


This rule states that all information (data), which is stored in the database, must be a
value of some table cell. Everything in a database must be stored in table formats. This
information can be user data or meta-data.

Rule 2: Guaranteed Access rule


This rule states that every single data element (value) is guaranteed to be accessible
logically with combination of table-name, primary-key (row value) and attribute-name (column
value). No other means, such as pointers, can be used to access data.

Rule 3: Systematic Treatment of NULL values


This rule states the NULL values in the database must be given a systematic treatment.
As a NULL may have several meanings, i.e. NULL can be interpreted as one the following: data is
missing, data is not known, data is not applicable etc.

Rule 4: Active online catalog


This rule states that the structure description of whole database must be stored in an
online catalog, i.e. data dictionary, which can be accessed by the authorized users. Users can
use the same query language to access the catalog which they use to access the database itself.

Rule 5: Comprehensive data sub-language rule


This rule states that a database must have a support for a language which has linear
syntax which is capable of data definition, data manipulation and transaction management
operations. Database can be accessed by means of this language only, either directly or by
means of some application. If the database can be accessed or manipulated in some way
without any help of this language, it is then a violation.

Rule 6: View updating rule


This rule states that all views of database, which can theoretically be updated, must also
be updatable by the system.

Rule 7: High-level insert, update and delete rule


This rule states the database must employ support high-level insertion, update and
deletion. This must not be limited to a single row that is, it must also support union,
intersection and minus operations to yield sets of data records.

Rule 8: Physical data independence


This rule states that the application should not have any concern about how the data is
physically stored. Also, any change in its physical structure must not have any impact on
application.

Rule 9: Logical data independence


This rule states that the logical data must be independent of its user’s view (application).
Any change in logical data must not imply any change in the application using it. For example, if
two tables are merged or one is split into two different tables, there should be no impact the
change on user application. This is one of the most difficult rule to apply.

Rule 10: Integrity independence


This rule states that the database must be independent of the application using it. All its
integrity constraints can be independently modified without the need of any change in the
application. This rule makes database independent of the front-end application and its
interface.

Rule 11: Distribution independence


This rule states that the end user must not be able to see that the data is distributed
over various locations. User must also see that data is located at one site only. This rule has
been proven as a foundation of distributed database systems.

Rule 12: Non-subversion rule


This rule states that if a system has an interface that provides access to low level
records, this interface then must not be able to subvert the system and bypass security and
integrity constraints.
Relation Data Model
Relational data model is the primary data model, which is used widely around the world
for data storage and processing. This model is simple and have all the properties and
capabilities required to process data with storage efficiency.

Concepts
Tables - In relation data model, relations are saved in the format of Tables. This format stores
the relation among entities. A table has rows and columns, where rows represent records and
columns represents the attributes.
Tuple - A single row of a table, which contains a single record for that relation is called a tuple.
Relation instance - A finite set of tuples in the relational database system represents relation
instance. Relation instances do not have duplicate tuples.
Relation schema - This describes the relation name (table name), attributes and their names.
Relation key - Each row has one or more attributes which can identify the row in the relation
(table) uniquely, is called the relation key.
Attribute domain - Every attribute has some pre-defined value scope, known as attribute
domain.

Constraints
Every relation has some conditions that must hold for it to be a valid relation. These
conditions are called Relational Integrity Constraints. There are three main integrity constraints.

 Key Constraints
 Domain constraints
 Referential integrity constraints

Key Constraints
There must be at least one minimal subset of attributes in the relation, which can
identify a tuple uniquely. This minimal subset of attributes is called key for that relation. If there
are more than one such minimal subsets, these are called candidate keys.

Key constraints forces that


 In a relation with a key attribute, no two tuples can have identical value for key
attributes.
 key attribute cannot have NULL values.
 Key constrains are also referred to as Entity Constraints.

Domain constraints
Attributes have specific values in real-world scenario. For example, age can only be
positive integer. The same constraints have been tried to employ on the attributes of a relation.
Every attribute is bound to have a specific range of values. For example, age cannot be less than
zero and telephone number cannot be an outside 0-9.

Referential integrity constraints


This integrity constraints works on the concept of Foreign Key. A key attribute of a
relation can be referred in other relation, where it is called foreign key.

Referential integrity constraint states that if a relation refers to a key attribute of a


different or same relation, that key element must exists.
YOUR REINFORCEMENT TASKS:
TASK 1 and 2: During your “practical research” subject, part of your research is the summary of
your survey write the following
1. Title of your research
2. Your sample questionnaire
3. Summary of your survey

Figure 32: Sample survey using MS FORMS

References:
https://beginnersbook.com/2015/04/dbms-tutorial/
https://www.tutorialspoint.com/dbms/dbms_data_schemas.htm
https://www.guru99.com/dbms-tutorial.html
https://www.studytonight.com/dbms/
termux

You might also like