A Database or Data Bank
A Database or Data Bank
The most common applications are for the management of companies and public
institutions. They are also widely used in scientific environments in order to store
experimental information.
Although databases can contain many types of data, some of them are protected
by the laws of various countries. For example, in Spain personal data is protected
by the Organic Law on the Protection of Personal Data (LOPD).
Content
[ disguise ]
1 Types of database
o 1.1 Depending on the variability of the stored data
1.1.1 Static databases
1.1.2 Dynamic databases
o 1.2 According to the content
1.2.1 Bibliographic databases
1.2.2 Full text databases
1.2.3 Directories
1.2.4 Databases or "libraries" of chemical or biological
information
2 Database models
o 2.1 Hierarchical databases
o 2.2 Network database
o 2.3 Transactional databases
o 2.4 Relational databases
o 2.5 Multidimensional databases
o 2.6 Object-oriented databases
o 2.7 Documentary databases
o 2.8 Deductive databases
2.8.1 Language
2.8.2 Advantages
2.8.3 Disadvantages
2.8.4 Phases
2.8.5 Interpretation
2.8.6 Mechanisms
o 2.9 Distributed Database Management (DBMS)
3 See also
Database Types
Static databases
They are read-only databases, used primarily to store historical data that can later
be used to study the behavior of a set of data over time, make projections , make
decisions , and perform data analysis for business intelligence .
Dynamic databases
These are databases where the stored information is modified over time, allowing
operations such as updating, deleting and adding data, in addition to fundamental
query operations. An example of this may be the database used in an information
system of a supermarket, a pharmacy, a video store or a company.
Bibliographic databases
They only contain a surrogate (representative) of the primary source, which allows
it to be located. A typical record in a bibliographic database contains information
about the author, publication date, publisher, title, edition, of a given publication,
etc. It may contain a summary or extract of the original publication, but never the
full text, because otherwise we would be in the presence of a full-text database (or
primary sources - see below). As its name indicates, the content is figures or
numbers. For example, a collection of laboratory analysis results, among others.
They store primary sources, such as all the content of all editions of a collection of
scientific journals.
Directories
One example are the phones guides in electronic format.
They are databases that store different types of information from chemistry , life
sciences or medicine . They can be considered in several subtypes:
Database models
Hierarchical databases
In this model the data is organized in a way similar to a tree (seen in reverse),
where a parent information node can have several children . The node that has no
parents is called the root , and the nodes that have no children are known as
leaves .
Hierarchical databases are especially useful in the case of applications that handle
a large volume of information and highly shared data, allowing the creation of
stable and high-performance structures.
One of the main limitations of this model is its inability to efficiently represent data
redundancy.
Network database
Main article: Network database .
This is a slightly different model from the hierarchical one; Its fundamental
difference is the modification of the node concept: the same node is allowed to
have several parents (a possibility not allowed in the hierarchical model).
Transactional databases
They are databases whose sole purpose is to send and receive data at high
speeds. These databases are very rare and are generally aimed at the quality
analysis environment, production and industrial data. It is important to understand
that their sole purpose is to collect and recover data at the highest speed possible,
therefore redundancy and duplication of information is not a problem as with other
databases, generally in order to make the most of them they allow some type of
connectivity to databases relational.
Relational databases
This is the model currently used to model real problems and manage data
dynamically. After its foundations were postulated in 1970 by Edgar Frank Codd ,
from the IBM laboratories in San José (California) , it did not take long to
consolidate itself as a new paradigm in database models. Its fundamental idea is
the use of "relations". These relationships could logically be considered as sets of
data called " tuples ." Although this is the theory of relational databases created by
Codd, most of the time it is conceptualized in a way that is easier to imagine. This
is thinking of each relationship as if it were a table that is composed of records (the
rows of a table), which would represent the tuples, and fields (the columns of a
table).
In this model, where and how data is stored is irrelevant (unlike other models such
as hierarchical and network). This has the considerable advantage of being easier
for a casual user of the database to understand and use. Information can be
retrieved or stored using "queries" that offer extensive flexibility and power to
manage information.
Multidimensional databases
Object database
This model, quite recent, and typical of object-oriented computer models , tries to
store complete objects (state and behavior) in the database.
Documentary databases
They allow full-text indexing, and generally perform more powerful searches.
Tesaurus is an index system optimized for this type of databases.
Deductive databases
A deductive database system is a database system but with the difference that it
allows deductions to be made through inferences. It is mainly based on rules and
facts that are stored in the database. Deductive databases are also called logical
databases, because they are based on mathematical logic. This type of database
arises due to the limitations of the Relational Database in responding to recursive
queries and deducing indirect relationships from the data stored in the database.
Language
It uses a subset of the Prolog language called Datalog which is declarative and
allows the computer to make inferences to answer queries based on stored facts
and rules.
Advantages
Disadvantages
Phases
Interpretation
Facts are base axioms that are considered true and do not contain variables. Rules
are deductive axioms since they are used to deduce new facts.
Mechanisms
Ascending: where you start from the facts and obtain new ones by applying
inference rules.
Descending: where we start from the predicate (objective of the query
carried out) and try to find similarities between the variables that lead us to
correct facts stored in the database.
The database and DBMS software may be distributed across multiple sites
connected by a network. There are two types:
See also
Some examples of DBMS are Oracle, DB2, PostgreSQL, MySQL, MS SQL Server,
etc.
It is a set of programs not visible to the end user that are responsible for privacy, integrity,
data security and interaction with the operating system. It provides an interface between
data, the programs that handle it, and end users.
Any operation that the user does against the database is controlled by the manager.
The manager stores a description of data in what we call a data dictionary, as well as
allowed users and permissions.
There must be an administrator user in charge of centralizing all these tasks.
Data Dictionary
It is a database where all the properties of the database, structure description, relationships
between data, etc. are stored.
The dictionary must contain:
The languages
A database management system must provide a series of languages for the definition and
manipulation of the database. These languages are the following:
A database is not only the file where the data is, but in said file is the structure of
the data, that is, to know what length it has to contain everything from letters to
numbers or even other more complex data, depending on the structure of the base
and the management system.
In reality, apart from the data that is stored in the file, there is also a series of data,
in which the type of field, the fields and the length of each field are reported, this is
what is called a data manager, which allows know that each record (a record is a
sum of fields, for example to Ana LOPEZ LOPEZ, Ana we store in the Name field
and LOPEZ LOPEZ in the Surname field, each record is each person that we store
in the base, that is, a person is a record and each record is made up of the fields
Name and Last Name
A Database System (DBS) is a series of resources to manage large volumes of
information, however not all systems that manage information are databases.
==== ~- Data Independence. That is, the data does not depend on the program and
therefore any application can use the data.
~- Security. An SBD must allow us to have control over the security of the data.
====
2. Database
3. Components of a Database
4. Types of Users in Database
5. Database Basics
6. Abstraction Levels in Database
7. DBMS
8. Data Integrity
9.
10. Data recovery
11. Mirror or Mirror
12. Data Security
13. Control and Administration of Resources
14. Database operations lifecycle
15. Database Design
16. Entity – Relationship Model
17. Exercises
It is a repository where we keep integrated information that we can store and retrieve.
A set of information stored in auxiliary memory that allows direct access and a set
of programs that manipulate that data
Components of a Database:
End User: is the person who uses the data, this person sees data converted into
information:
Application Developer: is the person who develops the systems that interact with
the Database.
DBA: is the person who ensures integrity, consistency, redundancy, security. This is
the Database Administrator who is in charge of carrying out daily or periodic
maintenance of the data.
NAIVE USERS. – They are those that interact with the system through permanent
applications.
SOPHISTICATED USERS - are those with the ability to access information through query
languages.
APPLICATION PROGRAMMERS - are those with extensive knowledge of DML capable
of generating new modules or utilities capable of handling new data in the system.
SPECIALIZED USERS - are those who develop modules that do not refer precisely to data
management, but rather to advanced applications such as expert systems, image
recognition, audio processing and others.
External: that is the vision of the end user, it is seen how the data already converted into
information is handled.
It is the one in which it is presented to the end user and that allows combinations or
relationships between the data that make up the global database. It can be defined as the
way in which the user appreciates information and its relationships.
Conceptual: you see how the Database is structured, field teams have how the records are
structured.
It is the one in which the logical storage structures and the relationships that will exist
between them are defined. Common examples of this level are the design of records and
links that will allow the connection between records of the same file , of different files ,
even links to files.
It is the one in which the storage characteristics in the secondary medium are determined.
Designers at this level have extensive knowledge of technical issues and hardware
management. Many times it is chosen to maintain the physical level provided by the
operating system to facilitate and speed up development .
Database Management Systems are a very specific type of software , dedicated to serving
as an interface between databases and the applications that use it. It consists of a data
definition language , a data manipulation language, and a query language. In the texts that
deal with this topic, or related topics, the terms SGBD and DBMS are mentioned, both
being equivalent, and acronyms, respectively, of Database Management System and
DataBase Management System , its English expression.
Subsystem of a DBMS
DBMS Engine or Core: receives logical I/O requirements and converts them into read and
write operations .
Logical: are any type of query requiring reading with data entry (structure requirement) is
helped by the Operating System to convert these logical requirements into physical ones
that act on storage devices.
Definition tools: allows you to define and modify the structure of the Database, at this level
we define what is known as "Schema" which is the total definition of the Database, it is that
we define the structure of the table, the types of fields, the restrictions for the fields.
Processing Interface: it provides me with the facilities for updating, displaying and
visualizing data.
Data Dictionary: this is the subsystem component with which the DBA interacts directly,
providing query levels and reports useful for their administration work . It is the description
of the Database structure and relationships between data and programs.
DBMS
Data Independence: the DBMS provides me with independence of my data vs. the
applications.
Change in data does not imply change in programs and vice versa (Lower
maintenance cost).
Redundancy , data repeated and distributed anywhere. The effect of redundancy is data
inconsistency and waste of storage space.
This occurs when data is unnecessarily repeated in the files that make up the database.
Data Inconsistency: data that is in place with one value and found in another place
with another value. Ex: the client file is updated but the transaction file is not
updated.
Data Integrity
It occurs when uniform validation procedures for data do not exist throughout the system.
Error Source: These error sources originate if the data entry program is not
validated. Ex: hardware failures, incomplete updates, software defects, invalid data
insertion, human errors.
One technique that the BDMS uses for an invalid data entry is validation.
Validation: is to protect the data, validate the data in the data entry. There are types of
validations:
Data Type: it is if a field is defined as character or char and you cannot enter
integers.
Data Value: if an integer value is defined, a range can be specified and cannot go
beyond that value.
Key Values / Not Null: ensures unique records and whose values are not null.
Referential Integrity: ensures the DBMS that no child records exist without their
corresponding parent records.
It occurs in a multi-user environment , trying to access a data object at the same time .
It occurs when the system is multi-user and the appropriate controls are not established to
synchronize the processes that affect the database. It commonly refers to the little or no
effectiveness of blocking procedures.
Granularity: which is the size of the insured units. Ex: granularity can protect a field, a
record , a file, etc.
Dead-look (blocking): it is the technique that avoids concurrency errors, it occurs when a
circular wait develops between two transactions and each of these requests an update on the
same file, it does not allow other users the resource until it ends. the process , there is
circular waiting.
Data recovery
Recover data against the error sources mentioned above. Restoring the Database to its
normal state is the responsibility of the DBA, who is responsible for implementing error
detection and recovery procedures.
The DBA is the one who has centralized control of the database. This is intended to reduce
the number of people who have access to the technical and design details for the operation
of the DBMS.
SCHEMA DEFINITION.- Creates the original database schema and generates the data
dictionary through DDL propositions.
To recover:
Mirror or Mirror
Log Files: (transaction record)
These are the daily transactions that are recorded in the Database. When a problem occurs,
the log files are used, a REVERSE is performed and the last transaction that was made can
also be recovered.
Data Security
They occur when it is not possible to establish access and security codes uniformly for the
entire system, thus facilitating access for intruders.
Object to secure: the first object to secure are the objects, programs and finally the
schema.
Key Coding: the DBMS provides login security (username and password).
Access Control: security is specified against indicated access aimed at unauthorized
persons.
The DBMS must provide the DBA with all the mechanisms for control and management of
resources. So that the DBA with data integrity, error recovery and security implementation.
The BDMS must provide the resources for establishing relationships between the data,
which are the relationships: 1 -> 1, 1 -> n, n -> n
Stages :
Project planning
System Definition
Collection and Analysis of Requirements
Design of the topic base
SGDB / DBMS selection
Application Design
Prototype
Implementation
Data Conversion and Loading
Proof
Maintenance
These stages are not strictly sequential, in fact some of the stages must be repeated several
times doing what is known as "Feedback Cycles" For example: problems found in the
Database Design stage may require additional requirements gathering and subsequent
analysis.
Analysis of needs
Viability study
Definition of requirements
Conceptual/logical design
Implementation
Project planning :
This stage involves planning how the life cycle stages can be carried out in the most
efficient way. There are three main components:
System Definition
In this stage, the scope and indexes of the Database application are specified, as well as
what other systems it interacts with. You also have to determine who the users are and the
areas of the application.
Interviewing the company 's personnel , specifically those who are considered
experts in the area in question.
Observing the operation of the company .
Examining documents , especially those that are used to collect or display
information.
Using questionnaire to collect information from large groups of users.
They use the experience acquired in the Design of similar Systems.
This stage results in a set of documents with the specifications of user requirements where
the operations carried out in the company are described from different points of view.
The development requirements involve the software and hardware necessary for
implementation, the necessary human resources (both internal and external), and staff
training.
Database Design:
In this stage, a conceptual schema of the database is created. Specifications are developed
to the point where implementation can begin. During this stage, detailed models of the user
views and especially the relationships between each element of the system are created,
documenting the use and manipulation rights of the different user groups.
The design consists, as seen previously, of three phases: the global or conceptual design,
the logical design and the physical model .
This stage consists of three phases: conceptual design, logical design, physical design of
the Database.
The first phase consists of the production of a conceptual scheme that is independent of all
physical considerations. This model is then refined into a
logical scheme eliminating constructions that cannot be represented in the chosen Database
model (relational, object-oriented, etc.). In the third
phase the logical schema that translates a physical schema for the chosen Database
management system. The physical design phase considers the structures of
storage and access methods necessary to provide efficient access to the Database in
secondary memory.
If you do not have a Database Management System or it is obsolete, you must choose a
DBMS that is suitable for the information system in question.
App Design:
In this stage of designing the application programs that will use and apply the Database,
this stage the design of the Database are parallel in most of
In some cases, the design of the applications cannot be finalized until the Database design
has been completed. On the other hand, the Database requires to support
to the applications so now a feedback from the design of the applications to the design of
the Database. At this stage you must ensure that
All functionality specified in the user requirements is found in the application design.
Prototype:
This optional stage is to build a prototype of the application that allows the designers and
the user to test the system, a prototype is a working model of the system applications. The
prototype does not have all the functionality of the final system but it is enough for users to
be able to use the system and identify which aspects are good, which are not adequate, as
well as being able to suggest improvements or the inclusion of new elements.
Implementation:
In this stage, the definitions of the Database are created at an external or internal conceptual
level, as well as the application programs. The implementation of the Database is carried
out through SQL statements. These statements are responsible for creating the database
system. , the files where the data and user views will be stored.
The application programs are implemented using third and fourth generation language,
parts of these applications are Database transactions that are also implemented using SQL
language. The statements of this language can be embedded in a host programming
language such as Visual Basic, Java , etc. All security and integrity controls are also
implemented at this stage.
Once the conceptual model is fully detailed, the physical implementation of the data model
begins. As the model progresses, the system administrator ensures the correctness of the
model and the validator ensures its usefulness .
This stage is necessary when replacing an old system with a new one. The data is loaded
from the old system to the new system directly or if necessary it is converted to the format
required by the new DBMS and then loaded. This stage is usually called "Migration".
Proof:
In this stage the system is tested and validated with the requirements specified by the users.
To do this, a test subject must be designed with real data that must be carried out in a
methodical and rigorous manner. If the testing phase is carried out correctly, it will discover
errors in the application programs and in the structure of the Database.
Maintenance:
Once the system is fully tested or implemented, it is launched. The system is now in the
maintenance phase in which the following tasks are carried out: monitoring of system
performance and maintenance, and updating of the system.
In this last stage, all users of the system access the database and must ensure its correct
functioning, that their rights are appropriate, and have all the information they need at their
disposal. They must also ensure that access to data is convenient, practical, secure and that
the possibilities of error have been eliminated, as far as possible.
The administrator ensures that all rights and restrictions have been implemented correctly
and that the style manual has been followed throughout the implementation
Modeling: it is the process by which we can identify the dynamic or static properties
of an application domain with a view to transforming it into a design interpretable in
a computerized system. It is the expression of user requirements in a program to be
able to implement it.
Entity: is the object about which information is required to be maintained or stored.
Relationship: is the significant and stable association between two entities
Attribute: are the properties that describe and qualify an entity. Ex: Client entity
(name, surname, address, age, sex )
Entities are represented by boxes with the name of the entity in capital letters. Ex:
Relationships are represented with lines that connect the boxes of the entities. Ex:
Attributes are included within entity boxes and are written in lowercase letters. Ex:
Entities: Subjects, objects, events , places and abstractions can be considered entities.
Relationships: relationships have three properties or characteristics:
One-to-one: an instance of entity A is related to one and only one instance of entity
B.
Recursive Relationship
Attribute:
Attributes are used to identify, describe, qualify or express the state of an entity.
Every entity has an attribute or combination of attributes called "primary key" and which it
uses to differentiate each instance from the others.
The attributes that are part of the primary key are identified by prefixing them with
the number sign (#).
Mandatory attributes are preceded by an asterisk (*).
Optional attributes are preceded by a circle (o).
Example:
In an entity-relationship diagram you can also group entities into supertype and subtype.
The supertype groups two or more subtype entities.
Subtypes inherit the attributes of supertype entities.
Each subtype can have its own relationships independent of the supertype.
Subtypes are represented as boxes drawn inside the supertype box.
EXERCISES:
San Juan is an agent that rents boats to clients for a certain fee. San Juan does not own
boats, instead renting them on behalf of owners who wish to earn income when their boats
are not in use. For this service, San Juan charges a fee and specializes in boats that can be
used for trips of several days or weeks.
The smallest boat is 28 feet long and the largest is 44. Each boat is fully equipped when
rented; Much of the equipment is provided by the owner, San Juan adds another part. The
equipment provided by the owner includes what is part of the boat such as: radio ,
compass , depth indicators . Other important instruments such as stoves and refrigerators.
Other implements provided by the owner are not installed as part of the boat such as sails,
ropes, anchors, rubber bags, life preservers, and in the cabin dishes, cutlery, kitchen
utensils, etc. San Juan provides consumer equipment that could be considered provisions,
books , soap, kitchen towels and similar items.
An important responsibility of San Juan is to record the equipment that is on the boat,
particularly what is not fixed to the boat.
San Juan prefers to keep accurate records of its clients and trips to have statistics of which
clients have gone and on what trip; Some itineraries are more dangerous than others, for
this reason San Juan would like to know which clients have certain experiences.
On some trips, clients request crew services and San Juan hires such people by the hour.
Boats need maintenance, San Juan includes precise services for all those maintenance
processes and costs including normal activities such as cleaning, oil changes or
unscheduled performances.
In some cases invitations are necessary during a trip, in which case customers communicate
by radio with the San Juan dispatcher who determines the best option to make the repair.
Therefore, in these decisions, dispatchers need information about their repair options and
background information on repair costs and quality .
ENTITIES:
CUSTOMER
OWNER
BOAT
EQUIPMENT
JOURNEY
MAINTENANCE
REPAIR
CREW
TEAM_TIP
Videoclub
In a video store you need to keep information on around 3000 cassettes, each of the
cassettes is assigned a number for each movie, you need to know a title and category, for
example: comedy, suspense, drama, action , science fiction, etc. Some copies of many films
are kept. Each film is given an identification and track is kept of what each cassette
contains.
A cassette can come in various formats and a movie is recorded on a single cassette;
Frequently, movies are requested according to a specific actor. Tom Cruise and Demi More
are the most popular, which is why information must be maintained on the actors who
belong to each movie.
Not all movies feature famous artists; store customers like to know information such as the
actor's real name and date of birth.
In the store, information is kept only on the actors who appear in the films and that are
available. Videos are only rented to those who belong to the video club. To belong to the
club you must have good credit . For each member of the club, a file is maintained with
their name, telephone number and address , each member of the club is assigned a
membership number. It is desired to maintain information on all the cassettes that a client
rents. When a client rents a cassette, the name of the film, the date on which it was rented
and the date of return should be known.
ENTITY
CUSTOMER
FILMS
PEL_TYPE
ACTORS
CASSETTE
RENT
VANDALIC ACTS
A hotel chain has decided to put an end to customers who damage the hotel furniture . They
want to save in a database the clients who have damaged or stolen furniture and what the
furniture is.
In the database we will have information about each hotel ( code , address, telephone), as
well as a set of rooms identified with a unique identification number for each hotel and a
standard real estate number with a code, price description , for example: " Leather chair,
classic design, $43."
After making an inventory, all the hotel furniture is identified, that is, we know what and
how much furniture is in each room of each hotel.
The furniture can change rooms but we do not need to keep the old room. For each room
we will also keep if it is sunny, if it has a washing machine and if it has a refrigerator. Each
client has personal information ( identity card, name, etc.) and also a history of their acts of
vandalism. For each client we will keep which furniture and how much has been damaged.
We also want to know the stay that each client has made in the hotel, we will save in an
attribute the date of arrival and departure, as well as the date of the room in which they
stayed.
We want to know the acts of vandalism (what and how many pieces of furniture) that each
client has done as a whole, regardless of the room that was produced.
ENTITIES
CUSTOMER
HOTEL
ROOM
FURNITURE
STAY
CLIENT TYPE
VANDAL_ACT
ROOM_TYPE
FURNITURE_TYPE
Proposed Exercises
It is desired to have information about each bullfight, jointly identified by an order number,
the fair in which it is held and the year of celebration (for example: order = 2, fair = San
Isidro, Year = 1999).
In each bullfight a bullfighter obtains a series of prizes (how many ears, how many tails and
whether he left through the front door or not) about which information is desired.
A bullfight is held in a bullring where you want to know its name, which is supposed to be
unique, location, address and capacity.
In each bullfight at least 6 bulls are stabbed. Each bull is identified by the code of the farm
to which it belongs, the year in which it was born and an order number. In addition, it is
desired to maintain information about its name and color as well as the order in which it
was bullfighted.
Each bull belongs to a specific farm. For each livestock farm, the aim is to know its code,
location and age (date of creation).
Examples of Statements
1.
2. Each purchase order gives rise to an invoice .
RELATIONAL MODEL
Model
Programmer Field
Relational
Relationship Archive Board
Tuple Record Row
Attribute Field Column
NORMALIZATION.- The process that checks that the table is well structured is called
normalization .
Normalization is based on the concept of normal forms, each normal form has a set of rules
that must be verified (1NF, 2NF, 3NF).
These normal forms are nested, that is, for a relationship to be in 3NF it must have passed
through 2NF and this one through 1NF.
EMPLOYEE
Employee_Cod
Name
e
001 Juan Perez
002 Ana Quiroz
X to Y
Keys or keys.- It is the attribute that gives the difference to each table. This
attribute means that we do not have tuples or repeated rows.
XYZ = Given a value of "X" there is a value of "Y" and given a value of "Y" there is a
value of "Z" then it is said that "z" is transitively dependent on "X".
First Normal Form (1NF)
ID Sport Worth
100 Ski 200
Swimmi
150 50
ng
175 Squas 50
Swimmi
200 50
ng
When performing operations on the table, problems may arise, these problems are called
anomalies, these anomalies can be insertion, update, deletion, etc.
Every non-key attribute depends on a key attribute "Remove partial dependencies on the
Primary key of a Table"
A relation is in 3NF if and only if it is in 2NF and has transitive dependencies, that is,
chained dependency.
1FN
* Bill number
Invoice date
* Total bill
* order_number
order_date
Account_bco_client
* Client name
customer_address
Delivery address
Product code
Product_Description
product_size
ordered_quantity
Delivered quantity
Remaining amount
Sale price
discount_price
Special price
line_value
2FN
Bill number
*
Invoice date
Total bill
order_number
*
order_date
Account_bco_clie
nt
*
Client name
customer_address
Delivery address
* Product code
Product_Description
product_size
ordered_quantity
Delivered quantity
Remaining amount
Sale price
discount_price
Special price
line_value
3 FN
Bill number
*
Invoice date
Total bill
order_number
*
order_date
Account_bco_clie
nt
*
Client name
customer_address
Delivery address
Product code
Product_Description
*
product_size
Sale price
discount_price
Special price
* invoice_code
* Product code
ordered_quantity
Delivered quantity
Remaining amount
line_value
Exercise 1. Vandalism
A hotel chain has decided to put an end to customers who damage the hotel's furniture.
They want to save in a database the clients who have damaged or stolen furniture and what
these furniture are.
In the database we will have information about each hotel (code, address and telephone), as
well as a set of rooms identified by a unique room number for each hotel and a set of
standard furniture elements with a code, description and price, for example: "classic design
leather chair, €98.75".
After making an inventory, all the hotel furniture is identified, that is, we know what and
how many furniture elements are in each room of each hotel. The furniture can change
rooms, but we don't need to save the old room.
For each room, we will also save if it is sunny, if it has a sink and if it has a refrigerator.
Each client has personal information (ID, name, etc.), and also a history of their acts of
vandalism: for each client we will save which furniture and how much they have damaged.
We also want to know the stays that each client has made in the hotels, saving in a The only
attribute is the date of arrival and departure, as well as the room in which you have stayed.
A client can stay in the same hotel room in different stays.
Exercise 1.1: We want to know the acts of vandalism (what and how many pieces of
furniture) that each client has done together, regardless of the room and hotel that occurred.
Exercise 1.2: We want to know the acts of vandalism of each client in each room of the
hotel.
Exercise 2. Warehouses
Some stores want to do a study on the purchasing habits of their customers. They have a set
of items identified by their barcode, each one with a description and the name of its
manufacturer. For each item, they want to test different placements to study how its sale
varies.
For each placement we will have a price and a slogan (such as "Sweeter than honey"), not
necessarily different. Since an item and a place determine a collocation, a collocation
cannot exist without any article.
Our warehouse customers are identified by their name, visa number, and we also want to
save their address and telephone number. Of the purchases you make, we only want to
know what item, in what placement and the number of units you have purchased. Various
purchases of the same item in the same placement are accumulated in the same tuple by
adding the number of units.
Exercise 3. Library
In a library you have to store the information of all the publications you have. Each post has
a unique title. Publications may or may not be periodic. Of the periodic ones you have to
know their periodicity. Periodicals consist of magazines, each defined by a volume , issue,
and year. Each journal contains articles, specified by authors, title, and journal pages. You
can have more than one copy of each magazine (volume and number), characterized by a
copy number. You can have more than one copy, although not all volumes or numbers.
Publications can be classified into different topics, which can be grouped in a hierarchical
topic-subtopic relationship.
Library members can borrow as many periodicals as they wish for a period of fifteen days.
The loans always refer to the specific copies of the publications. If when requesting a loan
of a publication, it has all the copies occupied, the member can be put on a waiting list for
the periodical publication, to be notified when any of the copies are returned.
Exercise 4. Electrician
The electrical supply company "El Chispa" asks you to create a stock control and billing
database design with the following requirements:
"El Chispa" sells items. For each item you want to save the item code, name, color,
measurements, manufacturer and sales price. For example:
An item cannot be supplied by more than one manufacturer and we do not want to save old
sales prices , only the current one.
For each manufacturer we want to save information on the manufacturer's code, name,
address, town, telephone number and payment method (cash, check or transfer).
For each sale, "El Chispa" makes a delivery/sale document, which includes the
delivery/sale code, date, customer information, number and code of the items sold, price
per unit and total price per item (number of units). x price/unit).
At the end of the month or whenever necessary, the delivery notes made to a client are
grouped into an invoice where we want it to appear: invoice code, date, customer data, the
information on each delivery note (number and name of the items, price per unit and total
price per item), invoice total, payment method and expiration date if payment is not in cash.
Each delivery note can only be invoiced once.
You want to save a client's NIF, name, address, city and telephone number. An invoice
belongs to only one customer.
We have a single warehouse where we keep all items. We want to save the number of items
we have in the warehouse at a given time.
Manufacturers send items to the warehouse. We want to save incoming shipments to the
warehouse. Each shipment consists of only one item. For each shipment we want to know
the date, item code and number of units shipped. A manufacturer can ship units of the same
item on the same day. In this case, the number of units shipped on the same date is added.
Exercise 5. Wars
An international organization wants to monitor the war conflicts that occur in the world.
For this reason, you want to create a database that meets the following requirements:
A conflict is any armed struggle that affects one or several countries, where deaths and/or
injuries occur. Every conflict will be identified by a name or cause that causes the conflict.
This name may change over time, so each conflict will be identified with a unique
numerical code. For each conflict we want to save the countries it affects as well as the
number of deaths and injuries for each country and the total.
Conflicts can be of different types, depending on the cause that originated them, being
classified, at most, into four groups: territorial, religious, economic and racial. Different
data will be saved in each one. In the territorial ones we will have the affected regions, in
the religious ones the religions in conflict, in the economic ones the disputed raw materials
and in the racial ones the opposing races.
Different armed groups (at least two) and different intermediary organizations intervene in
conflicts, and there may not be any. The same armed groups and intermediary organizations
can intervene in different conflicts. Both groups and organizations will be able to enter and
exit the conflict. In this case, the incorporation and departure dates will be collected. It
could be that at a given time a group or organization did not intervene in any conflict.
For each armed group, a code assigned to it and a name are saved. Each armed group has
one or more divisions and is led by a single political leader . The divisions available to a
group are numbered consecutively and the number of ships, tanks, planes and men
available is recorded, as well as the casualties they have suffered. For armed groups, the
number of casualties is obtained as the sum of the casualties in all divisions.
Arms traffickers supply different types of weapons to armed groups. For each type of
weapon, a name and an indicator of its destructive capacity are collected. For each
trafficker there is a name and the different types and quantities of weapons they can supply.
The total number of weapons of each type that each trafficker supplies to an armed group is
recorded.
Political leaders are identified by their name and by the code of the armed group they lead.
Each division can be jointly led by a maximum of three military commanders, although
each military commander only commands one division. Each military leader is identified
by a code and rank he or she has. Given that a military leader does not act on his own
initiative, but rather on the initiative of a single political leader of those who lead the armed
group to which the leader belongs, we want to know who this political leader is whom he
obeys.
From the intermediary organizations, their code, name, type (governmental, non-
governmental, international), the organization on which they depend (maximum one), the
number of people deployed in each conflict and the type of aid they provide will be
collected. each conflict that can only be one of the following types: medical, diplomatic or
face-to-face.
For different purposes, political leaders dialogue with organizations. We wish to explicitly
collect this information. Thus, for each leader those organizations with which he dialogues
will be saved and vice versa.
An Autonomous Community (CA) can have several natural parks. In the entire autonomous
community there is a single body responsible for the parks. A park can be shared by more
than one community.
A natural park is identified by a name and the date it was declared a natural park, and is
made up of several areas identified by a name (unique within the park but can be generic
among natural parks) and an area in square kilometers. For reasons of efficiency , we want
to favor consultations that refer to the number of existing parks in each AC and the total
area declared as a natural park in each AC.
In each area reside species that can be of three types: plants, animals and minerals .
Each species has a scientific name, a common name and a number of individuals in each
area. For plant species we want to know if they have flowering and in what period (month)
it occurs. We want to know about the animals their type of diet (herbivorous, carnivorous
or omnivorous) and their heat period. Regarding minerals, we want to know if they are
crystals or rocks . It is also interesting to record which species serve as food for other
species, taking into account that no mineral species is considered food for any other species
and that a plant species does not feed on any other species.
Each park has a dedicated staff. The DNI, SS number, name and surname, address,
telephone numbers (landline and mobile) and salary are kept for this personnel. There are
four types of personnel:
• Management staff: records the data of park visitors and is located at the park entrance.
Entrances are identified by a number and orientation (N, S, E, W).
• Surveillance personnel: monitor a specific area of the park that a vehicle of a specific type
and with a license plate travels through.
• Conservation staff: maintains and conserves a specific area of the park. Each one
performs a specific task (cleaning, feeding, gardening, etc.) in a specific place in the area
(paths, recreational area, gardens, etc.).
• Research staff: they have a qualification that must be kept and can carry out research
projects on a specific species alone or in a group.
A research project has a title, budget , a single principal investigator, a period of completion
and a set of participating researchers.
A visitor (ID, name, surname, address and profession) can stay in the accommodations that
the park has. The accommodations have a limited capacity and a certain category.
The accommodations organize excursions to the park by vehicle or on foot on certain days
of the week and at certain times. To go on these excursions you must be a visitor to the
park.
Exercise 7. NGO
The national NGO coordinator wants to maintain a database of associations of this type that
exist in our country. For this reason, you need to save information about each association,
the partners that form them, the projects they carry out and the workers who participate. For
the associations, we want to store their CIF, name, address, province, the type of NGO
(ecologist, integration , development, etc.) as well as whether it is declared of public utility
by the Ministry of the Interior.
Each association is made up of members whose ID, name and surname, address, province,
date of registration of the association, monthly fee with which they collaborate and the
annual contribution they make. The annual contribution will be the total of the monthly fees
plus other voluntary contributions.
Each NGO worker is identified by their ID, first and last name, address, telephone numbers
and date of entry. Every worker works for a single NGO. These workers can be of two
types: professionals and volunteers. Professionals earn a salary and hold a certain position
in the association. You want to save the position they hold, the amount they pay to the SS
and the percentage of personal income tax that is deducted from them. Volunteers work in
the organization selflessly. We want to know their age, profession and hours they dedicate
to the association.
The associations carry out projects to which their workers are assigned. A worker can work
on different projects in the same country. For each project we want to store an identification
number in the NGO, country and region where it is carried out, the objective it seeks and
the name of the people it affects.
Exercise 8. Gallery
The Ministry of Education and Science wants to have information about all the paintings
found in art galleries.
For each art gallery we want to know the unique name, city where it is located, address and
extension in square meters.
Each art gallery has a set of paintings for which you want to save the code (unique for all
art galleries), name, measurements, date it was painted and technique used to paint it.
Each painting is painted by a single painter, of whom we want to know the name and
surname, city and country where he or she was born, date of birth and date of death . A
painter can have a single teacher, but a teacher can be the teacher of several painters.
The painters may or may not belong to a school whose name, as well as the country and
date in which it appeared, is desired.
Painters may also have one or more patrons who protect them. From the patrons we want to
know the name and surname, country and date of birth, date of death and the start and end
date of the support they gave to the painter. A patron can be a patron of several painters and
a painter can have several patrons in different periods. The aim is to capture the relationship
that exists between a painter and his patron.
At the UAB we want to keep track of the research projects that are carried out.
We want to design a database that contains all the information about the projects,
departments, research groups and professors. The following requirements are considered: A
department is identified by a name, code, center (Faculty or School) where it is located,
address, university professor who serves as department director and a contact telephone
number (department secretary).
Within a department, Units are created where teachers are assigned. Every teacher must
belong to a unit. Each unit has a unique name within the university, belongs to a single
department and is associated with a knowledge area (CCIA, ATC, etc.). Each unit has a
unit head who must be a university professor.
Each research project has a name, unique code, budget, start and end dates of the project,
and a single professor who serves as the project's principal investigator. A project may be
financed by one or more national programs.
A national program is identified by a unique name and the total amount of money that the
program has available to finance projects. Within each program, each project has an
associated number and an amount of money with which the program finances the project.
A professor can participate in several projects and can be the principal investigator of
several projects. In each project a teacher joins on a certain date and leaves on another with
a certain dedication (hours per week). A teacher can join a project more than once on
separate dates.
The ETSE wants to control the reservation system for its rooms that it makes available to
the School staff during an academic year with the following restrictions:
For each room (degree room, assembly hall, seminars, classrooms) we want to know the
code (Q2/xxxx,Q0/xxxx, etc.), the type of room (classroom, seminar , assembly hall, degree
hall, etc.), capacity and audiovisual equipment that it permanently contains.
For the audiovisual equipment that the School has, we want to save a unique code, name
(projector, cannon, etc.), whether it is permanent or mobile, and the room where it is
located, if it is fixed. We have four types of equipment: projection cannon, overhead
projector, slide projector and computer. From the projection cannon we want to know the
brand , model, luminosity and maximum resolution at which it works. We want to know
about the transparency projector its luminosity and whether it accepts color transparencies
or not. Of the slide projector, it is important to keep the brand, model, whether it supports a
classic or modern charger, and brightness. From the computer we want to know the
processor , RAM and maximum resolution.
A teacher can reserve a room on a specific date (day, month and year) at hourly intervals
(12:00 to 13:00, 17:00 to 18:00). When reserving the room, the teacher also reserves all the
fixed equipment that the room contains.
A teacher can also reserve mobile audiovisual equipment with a variable number (2 guns, 3
projectors, etc.) on a specific date (day, month and year) at one-hour intervals. Given a date
and time, we want to know the available rooms and the audiovisual equipment available. At
the end of the course we want to know the degree of occupancy of the rooms.
The term databases was heard for the first time in 1963, at a symposium held in California,
USA. A database can be defined as a set of related information that is grouped or
structured.
From a computer point of view, the database is a system made up of a set of data stored on
disks that allow direct access to them and a set of programs that manipulate that set of data.
Each database is made up of one or more tables that stores a set of data. Each table has one
or more columns and rows . The columns store a part of the information about each
element that we want to store in the table, each row of the table makes up a record.
Definition of database
A database is defined as a series of organized and related data, which are collected and
exploited by the information systems of a particular company or business.
Characteristics
Database Management Systems (DataBase Management System) are a very specific type of
software, dedicated to serving as an interface between the database, the user and the
applications that use it. It consists of a data definition language, a data manipulation
language, and a query language.
Advantages of databases
File systems store multiple copies of the same data in different files. This wastes storage
space and causes data inconsistency.
In database systems all these files are integrated, so multiple copies of the same data are not
stored. However, redundancy cannot be completely eliminated in a database, as it is
sometimes necessary to model the relationships between data.
Data consistency:
Eliminating or controlling data redundancies greatly reduces the risk of inconsistencies. If a
piece of data is stored only once, any updates must be made only once, and are available to
all users immediately. If a piece of data is duplicated and the system is aware of this
redundancy, the system itself can take care of ensuring that all copies remain consistent.
Data sharing:
In file systems, files belong to the people or departments that use them. But in database
systems, the database belongs to the company and can be shared by all authorized users.
Standards maintenance:
Thanks to the integration, it is easier to respect the necessary standards , both those
established at the company level and the national and international ones. These standards
can be established on the format of the data to facilitate its exchange, they can be
documentation standards, update procedures and also access rules.
Database integrity refers to the validity and consistency of stored data. Typically, integrity
is expressed by constraints or rules that cannot be violated. These restrictions can be
applied to both the data and their relationships, and it is the DBMS that must be in charge
of maintaining them.
Improved security:
Database security is the protection of the database from unauthorized users. Without good
security measures, the integration of data in database systems makes them more vulnerable
than in file systems.
Many DBMSs provide query languages or report generators that allow the user to make any
type of query on the data, without requiring a programmer to write an application to
perform such a task.
Improved productivity:
The DBMS provides many of the standard functions that the programmer needs to write to
a file system. At a basic level, the DBMS provides all the file management routines typical
of application programs.
Having these functions allows the programmer to better focus on the specific function
required by users, without having to worry about low-level implementation details.
Improvement in maintenance:
In file systems, data descriptions are embedded in the application programs that handle
them.
This makes programs dependent on data, so that a change in their structure, or a change in
the way they are stored on disk, requires major changes to the programs whose data is
affected.
However, DBMSs separate data descriptions from applications. This is what is known as
data independence, thanks to which the maintenance of the applications that access the
database is simplified.
Increased attendance:
In some file systems, if there are several users who can simultaneously access the same file,
it is possible that the access interferes with each other so that information is lost or integrity
is lost. Most DBMSs manage concurrent access to the database and ensure that problems of
this type do not occur.
Many file systems leave it to the user to provide the necessary measures to protect data
against system or application failures. Users have to make backup copies every day, and if
any failure occurs, use these copies to restore them.
In this case, all work done on the data since the last backup is lost and has to be done again.
However, current DBMSs operate in a way that minimizes the amount of work lost when a
failure occurs.
Disadvantages of databases
Complexity:
DBMSs are sets of programs that can be complex with great functionality. It is necessary to
understand this functionality very well to be able to make good use of them.
Both the DBMS and the database itself may make it necessary to purchase more storage
space. Additionally, to achieve the desired performance, it may be necessary to purchase a
larger machine or a machine dedicated solely to the DBMS. All this will make the
implementation of a database system more expensive.
Vulnerable to failures:
The fact that everything is centralized in the DBMS makes the system more vulnerable to
failures that may occur. That is why you must have backup copies.
Field Types
Each Database System has types of fields that can be similar or different. Among the most
common we can name:
Numeric: among the different types of numerical fields we can find integers “without
decimals” and “decimal” reals.
Boolean: they have two states: True “Yes” and False “No”.
Memos: are alphanumeric fields of unlimited length. They have the disadvantage of not
being indexed.
Dates: they store dates, facilitating their exploitation later. Storing dates in this way makes
it possible to sort records by date or calculate the days between one date and another.
Alphanumeric: contain numbers and letters. They have a limited length (255 characters).
Autoincrementable: they are integer numerical fields that increase their value by one unit
for each incorporated record. Its usefulness is: Serve as an identifier since they are unique
to a record.
Database Types
Entity-relationship model
One-to-one relationships: An instance of entity A is related to one and only one of entity
B.
One-to-many relationships: Each instance of entity A is related to multiple instances of
entity B.
Many-to-many relationships: Any instance of entity A is related to any instance of entity
B.
Structure of a Database
A database, in order to organize information logically, has an order that must be met to
access the information in a coherent manner. Each database contains one or more tables,
which fulfill the function of containing the fields.
Boards
Fields
Records
SQL language
The SQL language is the most universal in database systems. This language allows us to
make queries to our databases to display, insert, update and delete data.
Show: the Select statement is used to show the records. Select * From comments .
Insert: records can be introduced from statements that use the Insert statement. Insert
Into comments (title, text, date) Values ('greetings', 'how is
this', '10-22-2007')
Delete: To delete a record, the Delete instruction is used. In this case we must specify
which records we want to delete. It is therefore necessary to establish a selection that will
be carried out through the Where clause. Delete From comments Where id='1' .
Update: the Update statement is used to update the records. As in the case of Delete, we
need to specify through Where which are the records in which we want to make our
modifications effective. Additionally, we will have to specify which are the new values of
the fields that we want to update. Update comments Set title='My First
Comment' Where id='1'.
Don't miss the Web Forums section dedicated especially to the topic of databases .
Database (module)
Database
Database Features
Add a database
Details of a database
Database templates
Database fields
Predefined set
Add a record to the database
View a database
Delete a Database
Didactic uses
Links
Moodle 1.6
This activity allows users to enter data into a form designed by the course instructor.
Entries can be sorted, searched, etc. Entries can contain text, images and other information
formats.
This module is new in Moodle version 1.6, but also works with Moodle 1.5.4.
It allows creating an accessible database, in reading and writing, to both students and
teachers.
The Database Module allows teachers and/or students to build, display and search a
repository of entries with records on any conceivable topic. The format and structure of
these entries can be almost unlimited, including images, files, URLs, numbers and text
among other things. You may be familiar with similar technologies for creating databases
such as Microsoft Access or Filemaker.
Content
[ disguise ]
Database Examples
On Moodle.org we have three good examples of Database module application:
Moodle Buzz , A database of articles about Moodle with their title, author and Web link.
Themes , A database of Moodle Themes with capture, download link and user comments.
Modules and plugins , A database on Moodle modules containing web links (download,
docum
A relational database is a database that complies with the relational model , which is the
most used model today to implement already planned databases. They allow
interconnections (relationships) to be established between the data (which are stored in
tables), and through these connections to relate the data of both tables, hence its name:
"Relational Model" . After its bases were postulated in 1970 by Edgar Frank Codd , from
the IBM laboratories in San José (California), it did not take long to consolidate itself as a
new paradigm in database models. 1
Content
[ disguise ]
1 Features
2 Elements
o 2.1 Base and derived relations
o 2.2 Restrictions
o 2.3 Domains
o 2.4 Unique key
o 2.5 Primary key
o 2.6 Foreign key
3 Index key
o 3.1 Stored procedures
4 Structure
5 Information manipulation
6 Relational database managers
7 Advantages and disadvantages
8 Design of relational databases
9 See also
10 References
11 External links
[ edit ] Features
A relational database is made up of several tables or relationships.
There cannot be two tables with the same name or record.
Each table is in turn a set of records (rows and columns).
The relationship between a parent table and a child is carried out through primary
and foreign keys.
Primary keys are the primary key of a record within a table and these must comply
with data integrity .
Foreign keys are placed in the child table, they contain the same value as the parent
record's primary key; Through these relationships are made.
[ edit ] Elements
[ edit ] Base and derived relations
In a relational database, all data is stored and accessed through relationships. The
relationships that store data are called "base relationships" and their implementation is
called "table." Other relationships do not store data, but are calculated by applying
relational operations. These relationships are called "derived relationships" and their
implementation is called a "view" or "query." Derived relations are convenient because
they express information from several relations acting as if they were a single one.
[ edit ] Restrictions
A constraint is a condition that forces certain conditions to be met in the database. Some are
not determined by users, but are inherently defined by the simple fact that the database is
relational. Some other restrictions can be defined by the user, for example, using a field
with integer values between 1 and 10.
Constraints provide a method of implementing rules in the database. Constraints restrict the
data that can be stored in tables. They are usually defined using expressions that result in a
Boolean value, indicating whether the data satisfies the constraint or not.
Constraints are not a formal part of the relational model, but they are included because they
play the role of better organizing the data. Constraints are much discussed along with
relational concepts.
[ edit ] Domains
A domain describes a set of possible values for a certain attribute. Since a domain restricts
the values of the attribute, it can be considered a constraint. Mathematically, attributing a
domain to an attribute means "all values of this attribute must be elements of the specified
set."
Different types of domains are: integers, text strings, date, non-procedurals, etc.
Each table can have one or more fields whose values uniquely identify each record in said
table, that is, there cannot be two or more different records whose values in said fields are
identical. This set of fields is called a unique key.
There can be several unique keys in a given table, and each of these is usually called a
primary key candidate.
A primary key is a unique key chosen from all the candidates that uniquely defines all the
other attributes of the table, to specify the data that will be related to the other tables. The
way to do this is through foreign keys.
There can only be one primary key per table and no field in that key can contain NULL
values.
A foreign key is a reference to a key in another table, it determines the relationship between
two tables. Foreign keys do not need to be unique keys in the table where they are located,
but rather where they are referenced.
For example, the department code can be a foreign key in the employees table. Multiple
employees are allowed in the same department, but there will be one and only one
department for each distinct department key in the employees table.
Relational databases include multiple sorting techniques, each of which is optimal for a
certain data distribution and relationship size.
Indexes are generally not considered part of the database, as they are an added detail.
However, the index keys are developed by the same group of programmers as the other
parts of the database.
A stored procedure is executable code that is associated and stored with the database.
Stored procedures usually collect and customize common operations, such as inserting a
record into a table, collecting statistical information, or encapsulating complex calculations.
They are frequently used by an API for security or simplicity.
Stored procedures are not part of the relational model, but all commercial implementations
include them.
[ edit ] Structure
The database is organized into two distinct sections; the schema and the data (or instance).
The schema is the definition of the database structure and mainly stores the following data:
The data or instance is the content of the database at a given time. It is in itself the content
of all records.
The most common language to build queries to relational databases is SQL (Structured
Query Language), a standard implemented by the main relational database management
engines or systems.
In the relational model, attributes must be explicitly related to a name in all operations,
however, the SQL standard allows the use of unnamed columns in result sets, such as the
shorthand asterisk ( * ) as query notation.
Unlike the relational model, the SQL standard requires that columns have a defined order,
which is easy to implement on a computer since memory is linear.
It should be noted, however, that in SQL the order of the columns and records returned in a
certain result set is never guaranteed, unless explicitly specified by the user.
Among the most popular current managers or handlers we find: MySQL , PostgreSQL ,
Oracle , DB2 , INFORMIX , Interbase , FireBird , Sybase and Microsoft SQL Server .
Disadvantages
They present deficiencies with graphic data, multimedia, CAD and geographic
information systems .
Blocks of text as a data type are not manipulated in a manageable way.
Object-oriented databases (OBDO) were proposed with the objective of satisfying
the needs of previous applications and thus complement but not replace relational
databases.
Planning the structure of the database, particularly the tables, is vital for its effective
management. The design of the structure of a table consists of a description of each of the
fields that make up the record and the values or data that each of these fields will contain.
The fields are the different types of data that make up the table, for example: first name,
last name, address. Defining a field requires: the field name, the field type, the field width,
etc.
The records constitute the information that is contained in the fields of the table, for
example: the patient's name, the patient's last name and the patient's address. Generally, the
different types of fields that can be stored are the following: Text (characters), Numerical
(numbers), Date / Time, Logical (logical information yes/no, true/false, etc.), images.
In summary, the main aspect to take into account during the design of a table is to clearly
determine the necessary fields, define them appropriately with a name specifying their type
and length.
Hierarchical database
Jump to: navigation , search
Content
[ disguise ]
Shortly after, in 1970 , E. F. Codd proposed the relational model . The advantages of this
model and its mathematical approach focused the industry's efforts, giving rise to relational
database management systems. The latter have replaced hierarchical databases today, but
not completely. Most of the old hierarchical databases of banks and Public Administrations
are still active. This is because the performance of hierarchical databases is still not
surpassed by relational databases. Furthermore, these sectors suffer a large volume of
transactions. Note, for example, the number of accounting entries that a network of ATMs
requires in a single day.
Data is stored in the form of records , the equivalent of rows in the relational model. Each
record consists of a set of fields , the equivalent of the columns of the relational model. A
set of records with the same fields is called a file ( record type , in English), the equivalent
of the tables of the relational model.
The hierarchical model facilitates parent-child relationships, that is, 1:N (one-to-many)
relationships of the relational model. But unlike the latter, the relationships are
unidirectional. In fairness, these relationships are son-father , but not father-son . For
example, an employee's record ( child node) can be related to its department's record (
parent node), but not the other way around. This implies that the database can only be
queried from the leaf nodes to the root node. The reverse query requires a sequential search
through all records in the database (for example, to query all employees in a department).
In hierarchical databases there are no indexes that facilitate this task.
Note that, a priori, there are no N:M (many-to-many) relationships in the hierarchical
model. Unless they are simulated using several 1:N relationships. However, this can cause
inconsistency problems, since the database manager does not control these relationships.
As already mentioned, relationships are established through pointers between records. That
is, a child record contains the physical address on the storage medium of its parent record.
This has a fundamental advantage over relational databases: performance. Access from one
record to another is practically immediate without the need to consult correspondence
tables.
Hierarchical relationships between different types of data can make it very easy to answer
certain questions, but very difficult to answer others.
The absence of duplicate records is not guaranteed. This is also true for "key" fields. That
is, any two records are not guaranteed to have different values in a particular subset of
fields.
There is no guarantee that a child record is related to a valid parent record. For example, it
is possible to delete a parent node without first deleting the child nodes, so that the latter
are related to an invalid or non-existent record.
[ edit ] Denormalization
This is not so much a problem with the hierarchical model as with the use made of it.
However, unlike the relational model, hierarchical databases do not have controls that
prevent denormalization of a database. For example, there is no concept of key fields or
unique fields.
Combine relationships
Duplicate non-key attributes
Introducing repeating groups
Create extraction tables
When to denormalize:
Network database
Jump to: navigation , search
A record is a collection or set of fields ( attributes ), where each one contains only a single
stored value, exclusively the link is the association between two records, so we can see it as
a strictly binary relationship.
Thus, the tree structure can be considered as a special case of the network structure .
[ edit ] Example
To illustrate the structure of the records in a network database , we will show the student
– subject database , with the following records (in the Pascal programming language ):
In computing, there are database management systems (DBMS), which allow data to be
stored and later accessed in a quick and structured way. The properties of database
management systems are studied in computer science.
The most common applications are for the management of companies and public
institutions. They are also widely used in scientific environments in order to store
experimental information.
Although databases can contain many types of data, some of them are protected by the laws
of various countries. For example, in Spain, personal data is protected by the Organic Law
on the Protection of Personal Data (LOPD).
Types of databases
Databases can be classified in several ways, according to the criteria chosen for their
classification:
Static databases
These are read-only databases, used primarily to store historical data that can later be used
to study the behavior of a data set over time, make projections and make decisions .
Dynamic databases
These are databases where the stored information is modified over time, allowing
operations such as updating and adding data, in addition to fundamental query operations.
An example of this may be the database used in an information system of a grocery store, a
pharmacy, a video store, etc.
They only contain a surrogate (representative) of the primary source, which allows it to be
located. A typical record in a bibliographic database contains information about the author,
publication date, publisher, title, edition, of a given publication, etc. It may contain a
summary or extract of the original publication, but never the full text, because otherwise we
would be in the presence of a full-text database (or primary sources—see below). As its
name indicates, the content is figures or numbers. For example, a collection of laboratory
analysis results, among others.
They store primary sources, such as all the content of all editions of a collection of
scientific journals.
Directories
They are databases that store different types of information from life or medical sciences.
They can be considered in several subtypes:
Database models
In addition to classification by database function, they can also be classified according to
their data management model.
These are databases that, as their name suggests, store your information in a hierarchical
structure. In this model the data is organized in a way similar to a tree (seen in reverse),
where a parent information node can have several children . The node that has no parents is
called the root , and the nodes that have no children are known as leaves .
Hierarchical databases are especially useful in the case of applications that handle a large
volume of information and highly shared data, allowing the creation of stable and high-
performance structures.
One of the main limitations of this model is its inability to efficiently represent data
redundancy.
Network database
This is a slightly different model from the hierarchical one; Its fundamental difference is
the modification of the node concept: the same node is allowed to have several parents (a
possibility not allowed in the hierarchical model).
It was a great improvement over the hierarchical model, as it offered an efficient solution to
the data redundancy problem; But even so, the difficulty of managing information in a
network database has meant that it is a model used mostly by programmers rather than end
users.
Relational database
This is the most used model today to model real problems and manage data dynamically.
After its foundations were postulated in 1970 by Edgar Frank Codd, from the IBM
laboratories in San José (California), it did not take long to consolidate itself as a new
paradigm in database models. Its fundamental idea is the use of “relations”. These
relationships could logically be considered as sets of data called “tuples.” Although this is
the theory of relational databases created by Edgar Frank Codd, most of the time it is
conceptualized in a way that is easier to imagine. This is thinking of each relationship as if
it were a table that is composed of records (the rows of a table), which would represent the
tuples, and fields (the columns of a table).
In this model, where and how data is stored is irrelevant (unlike other models such as
hierarchical and network). This has the considerable advantage of being easier for a casual
user of the database to understand and use. Information can be retrieved or stored through
“queries” that offer extensive flexibility and power to manage information.
The most common language to build queries to relational databases is SQL, Structured
Query Language , a standard implemented by the main relational database management
engines or systems.
During its design, a relational database goes through a process known as database
normalization.
Object database
This model, quite recent, and typical of object-oriented computer models, tries to store
complete objects (state and behavior) in the database.
An object-oriented database is a database that incorporates all the important concepts of the
object paradigm:
Encapsulation – Property that allows information to be hidden from the rest of the
objects, thus preventing incorrect access or conflicts.
Inheritance – Property through which objects inherit behavior within a class
hierarchy.
Polymorphism – Property of an operation through which it can be applied to
different types of objects.
In object-oriented databases, users can define operations on data as part of the database
definition. An operation (called a function) is specified in two parts. The interface (or
signature) of an operation includes the name of the operation and the data types of its
arguments (or parameters). The implementation (or method) of the operation is specified
separately and can be modified without affecting the interface. User application programs
can operate on data by invoking those operations through their names and arguments,
regardless of the way they are implemented. This could be called independence between
programs and operations.
Work is underway on SQL3, which is the expanded SQL92 standard, which will support
the new object-oriented concepts and maintain compatibility with SQL92.
Documentary databases
They allow full-text indexing, and generally perform more powerful searches. Tesaurus is
an index system optimized for this type of databases.
Deductive database
A deductive database system is a database system but with the difference that it allows
deductions to be made through inferences. It is mainly based on rules and facts that are
stored in the database. Deductive databases are also called logical databases , because they
are based on mathematical logic.
The database is stored on several networked computers. They arise due to the physical
existence of decentralized organizations. This gives them the ability to join the databases of
each location and thus access different universities, store branches, etc.
2.
3. Main elements
4. In summary
5. Some background, why was it created?
6. Evolution of client-server architecture
7. What is an architecture
8. What is a client
9. What is a server
10. Elements of the client/server architecture
11. Characteristics of the client/server model
12. Types of clients, servers
13. Client Server Model Styles
14. Remote presentation
15. Distributed logic
16. Remote data management
17. Distributed database
18. Definition of Middleware
19. Functions of a server program
20. Bibliography
INTRODUCTION
In view of the learning we have daily in the classroom, we are challenged by a world full of
knowledge that calls for research .
This work was carried out precisely to fulfill the expectations and desire for intellectuality
that the career offers us, from databases , we see the importance of the client- server
architecture .
This is exactly what will be reflected in the following work, the way of
Knowing an architecture that is currently one of the most important and used in the field of
sending and receiving information is also a powerful tool for saving data in a database as a
server.
-------------------------------------
Regarding the definition of client/server architecture, the following definitions are found:
Any combination of systems that can collaborate with each other to give users all
the information they need without them having to know where it is located.
It is a cooperative processing architecture where one of the components requests
services from another.
It is collaborative data processing between two or more computers connected to a
network .
The term client/server is originally applied to the software architecture that
describes processing between two or more programs : an application and a
supporting service .
IBM defines the Client/Server model . "It is the technology that provides the end
user with transparent access to applications, data, computing services or any other
resource of the work group and/or, throughout the organization , on multiple
platforms. The model supports a distributed environment in which service requests
made by intelligent workstations or " clients " result in work performed by other
computers called servers .
"It is a model for building information systems, which is based on the idea of
distributing the processing of information and data throughout the computer
system , allowing the performance of the global information system to be improved"
Main elements
"The main elements of the client-server architecture are precisely the element called client
and the other element called server." For example, within a multimedia environment, the
client element would be the device that can view the video, pictures and text , or reproduce
the audio distributed by the server element.
On the other hand, the client can also be a personal computer or a smart television that has
the ability to understand digital data. Within this case, the server element is the repository
of the digital video, audio, digital photographs and text and distributes them on demand as
it is a machine that has the capacity to store the data and execute all the software that
provides these to the client.
IN SUMMARY
Service request.
Answer
There are various points of view on the way in which data processing should be carried out,
although the majority who agree agree that we are in the middle of an evolutionary process
that will continue for some years and that will change the way in which we obtain data. and
we use electronically stored information.
The main reason behind this evolution is the need for organizations (public or private
companies or institutions ) to carry out their operations more agilely and efficiently, due to
the growing competitive pressure to which they are subjected, which translates into the
need for their staff to be more productive, to reduce operating costs and expenses , while
generating products and services more quickly and with better quality .
The Client/Server model brings together the necessary characteristics to provide this
infrastructure, regardless of the size and complexity of the operations of public or private
organizations and, consequently, plays an important role in this evolution process.
"From its beginnings, the data management model through computers was based on the use
of remote terminals, which were connected directly to a central computer." This central
computer was responsible for providing services characterized by the fact that each service
was provided only to an exclusive group of users.
This is the era when each service employed its own computer that allowed users of that
service to connect directly. This is a consequence of the appearance of small, easy-to-use
computers, cheaper and more powerful than conventional ones.
It has been more than 10 years since desktop computers appeared en masse. This allowed
an appreciable portion of the computing workload in both the calculation scope and the
presentation scope to be carried out from the user's desktop. In many cases the user obtains
the information he needs from a service computer. These desktop computers connect to the
service computers using software that allows the emulation of some type of terminal. In
other cases, the information is transferred using magnetic resources or by transcription.
This is the era that is based on the concept of computer networks , in which the information
resides in one or several computers, the users of this information use computers to work
and all of them are connected to each other. This provides the possibility for all users to
access information from all computers and at the same time for the various systems to
exchange information.
"In this architecture, the computer of each of the users, called the client, produces a demand
for information to any of the computers that provide information, known as servers," the
latter responding to the demand of the client that produced it.
Clients and servers can be connected to a local network or a wide network, such as one that
can be implemented in a company, or to a global network such as the Internet .
Under this model, each user has the freedom to obtain the information they require at a
given time from one or more local or distant sources and to process it as they see fit. The
different servers can also exchange information within this architecture.
WHAT IS AN ARCHITECTURE
We must point out that to select an architecture model, we must start from the technological
and organizational context of the moment and that the Client/Server architecture requires a
certain specialization of each of the different components that make it up.
WHAT IS A CUSTOMER
It is the one that initiates a service request. The initial request can become multiple work
requests over LAN or WAN networks . The location of data or applications is completely
transparent to the client.
WHAT IS A SERVER
It is any computing resource dedicated to responding to customer requirements. Servers can
be connected to clients through LANs or WANs, to provide multiple services to clients and
citizens such as printing, database access, fax , image processing, etc.
To view the graph select the "Download" option from the top menu
In this approach, and with the objective of defining and delimiting the reference model of a
Client/Server architecture, we must identify the components that allow said architecture to
be articulated, considering that every application of an information system is characterized
by three basic components:
Presentation/Collection of Information
Processes
Information Storage
Client/Server Applications
To view the graph select the "Download" option from the top menu
And they are integrated into a Client/Server architecture based on the elements that
characterize said architecture, that is:
Job positions
Communications
Servers
Client/Server Architecture
To view the graph select the "Download" option from the top menu
Mainframes
Minicomputers
Specialized (Network Devices, Image , etc.)
A characteristic to consider is that the different services, depending on the case, can be
provided by a single Server or by several specialized Servers.
The comunications
Network infrastructure
Communications infrastructure
Network infrastructure
Hardware and Software components that guarantee the physical connection and data
transfer between the different computers on the network.
Communications infrastructure
Hardware and Software components that allow communication and management between
clients and servers.
The Client/Server architecture is the result of the integration of two cultures. On the one
hand, that of the Mainframe that provides storage capacity, integrity and access to
information and, on the other, that of the computer that provides ease of use (PC culture ),
low cost , attractive presentation (playful aspect) and a wide range of products and
applications.
2. Client and Server functions can be on separate platforms, or on the same platform.
To view the graph select the "Download" option from the top menu
4. Each platform can be independently scalable. Changes made to the Client or Server
platforms, whether due to updating or technological replacement, are made in a transparent
manner for the end user.
It is also important to note that Client/Server functions can be dynamic. For example, a
server can become a client when it makes a request for services to other platforms within
the network.
1. Its typical representation is a work center (PC), where the user has their own office
applications and their own databases, without direct dependence on the
organization's central information system, while at the same time being able to
access the
2. resources of this central host and other systems of the organization put at your
service.
TYPES OF CUSTOMERS
1. "skinny customer":
1. "fat customer":
SERVER TYPES
File servers
Server where files and productivity applications are stored, such as word processors ,
spreadsheets, etc.
Database servers
Server where databases, tables, indexes are stored. It is one of the servers with the most
load.
Transaction servers
Server that fulfills or processes all transactions. Validate first and then generate a request to
the database server.
Groupware Servers
They contain objects that must be outside the database server. These objects can be videos,
images, multimedia objects in general.
Web Servers
They are used as an intelligent way to communicate between companies through the
Internet.
DISTRIBUTED PRESENTATION
1.
2. The interface is distributed between the client and the server platform.
3. The application and data are both on the server.
4. Similar to the traditional architecture of a Host and Terminals.
5. The PC is used only to improve the graphical user interface.
Advantages
Disadvantages
REMOTE PRESENTATION
1.
2. The user interface is completely on the client.
3. The application and data are on the server.
Advantages
The user interface makes good use of the GUI and LAN.
The application takes advantage of the Host.
Suitable for some types of decision support applications.
Disadvantages
DISTRIBUTED LOGIC
1.
2. The interface is on the client.
3. The database is on the server.
4. The application logic is distributed between the client and the server.
Advantages
Disadvantages
It is difficult to design.
Difficult testing and maintenance if the client and server programs are made in
different programming languages.
They are not handled by the 4GL GUI.
1.
2. Both the interface and the application processes reside on the client.
3. The databases are on the server.
4. It is what we commonly imagine as a client-server application.
Advantages
Disadvantages
Does not handle heavy applications efficiently.
All data travels over the network, since there is no processing carried out by the
Host.
DISTRIBUTED DATABASE
1.
2. The interface, the application processes, and some of the database data are on the
client.
3. The rest of the data is on the server.
Advantages
Disadvantages
Definition of middleware
"It is a term that encompasses all distributed software necessary to support interactions
between Clients and Servers."
This is initiated in the client-side API module that is used to invoke a real service; this
belongs to the server domains. Neither to the user interface nor to the application logic in
the client domains.
Types of Middleware
BIBLIOGRAPHY
www.elrincondelvago.com
Information Systems Workshop 1
InCo – Faculty of Engineering
2005
www.ciber-tec.com/ads.htm
www.virtual.unal.edu.co/cursos/sedes/manizales/4060029/lecciones/cap6-3.html
www.pcm.gob.pe/portal_ongei/publicaciones/cultura/Lib5038
Client-server
Jump to: navigation , search
In this architecture, the processing capacity is distributed between clients and servers,
although the organizational advantages due to the centralization of information
management and the separation of responsibilities are more important, which facilitates and
clarifies the design of the system. .
The separation between client and server is a logical separation, where the server does not
necessarily run on a single machine nor is it necessarily a single program. Specific types of
servers include web servers, file servers, mail servers, etc. While their purposes vary from
one service to another, the basic architecture will remain the same.
A very common arrangement is multi-tier systems in which the server is decomposed into
different programs that can be executed by different computers , thus increasing the degree
of distribution of the system.
The client-server architecture replaces the monolithic architecture in which there is no
distribution, both at the physical level and at the logical level.
The client-server network is that communications network in which all clients are
connected to a server, in which the various resources and applications available are
centralized; and that makes them available to clients whenever they are requested. This
means that all the procedures carried out are concentrated on the server, so that it contains
the requirements from the clients that have priority, the files that are for public use and
those that are for restricted use, the files that are read-only and those that, on the contrary,
can be modified, etc. This type of network can be used together if it is being used in a
mixed network.
Content
[ disguise ]
1 Features
2 Comparison of C/S architecture with other network architectures
o 2.1 Comparison with peer networks
o 2.2 Comparison with Client-Queue-Client architecture
3 Multi-layer architectures
4 Advantages
5 Disadvantages
6 Address
7 Examples
8 Client-server cooperation
o 8.1 Multiple Server
8.1.1 Cooperation of parallel processes
8.1.2 Database cooperation
9 See also
[ edit ] Features
In the C/S architecture, the sender of a request is known as the client . Their
characteristics are:
It is the one who initiates requests or requests, therefore they have an active role in
communication ( master or master device).
Wait and receive responses from the server.
You can usually connect to multiple servers at once.
It typically interacts directly with end users using a graphical user interface .
When contracting a network service, you have to take into account the connection speed
provided to the client and the type of cable used, for example: copper cable ranges
between 1 ms and 50 ms.
The recipient of the request sent by the client is known as the server . Their characteristics
are:
When they start, they wait for client requests to arrive, thus playing a passive role in the
communication ( slave device).
Upon receipt of a request, they process it and then send the response to the client.
They usually accept connections from a large number of clients (in certain cases the
maximum number of requests may be limited).
It is not often that they interact directly with end users.
While the classic C/S architecture requires one of the communication endpoints to act as a
server , which can be somewhat more difficult to implement, the Client-Queue-Client
architecture enables all nodes to act as simple clients, while that the server acts as a queue
that captures client requests (a process that must pass its requests to another, does so
through a queue, for example, a query to a database, then the second process connects to
the database, prepares the request, passes it to the database, etc.). This architecture allows
software implementation to be greatly simplified. The P2P architecture was originally
based on the “Client-Queue-Client” concept.
It puts more load on the network, due to a greater amount of network traffic.
It is much more difficult to program and test software than in two-tier architecture
because more devices have to communicate to complete a user's transaction.
[ edit ] Advantages
Centralization of control: access, resources and data integrity are controlled by the server
so that a defective or unauthorized client program cannot damage the system. This
centralization also makes it easier to update data or other resources (better than in P2P
networks).
Scalability : The capacity of clients and servers can be increased separately. Any element
can be increased (or improved) at any time, or new nodes can be added to the network
(clients and/or servers).
Easy maintenance: With functions and responsibilities distributed among several
independent computers, it is possible to replace, repair, update, or even move a server,
while your clients will not be affected by that change (or will be minimally affected). This
independence of changes is also known as encapsulation .
There are sufficiently developed technologies designed for the C/S paradigm that ensure
transaction security , interface friendliness, and ease of use.
[ edit ] Disadvantages
Traffic congestion has always been a problem in the C/S paradigm. When a large number
of clients send simultaneous requests to the same server, it may cause many problems for
it (the greater the number of clients, the more problems for the server). On the contrary,
in P2P networks, since each node in the network also acts as a server, the more nodes
there are, the better the bandwidth you have.
The classic C/S paradigm does not have the robustness of a P2P network. When a server is
down , client requests cannot be satisfied. In most P2P networks, resources are generally
distributed across several nodes in the network. Although some leave or abandon the
download; others can still finish downloading by getting data from the rest of the nodes in
the network.
The software and hardware of a server are generally very determining. Regular personal
computer hardware may not be able to serve a certain number of customers. Specific
software and hardware, especially on the server side, is usually needed to fulfill the job. Of
course, this will increase the cost.
The client does not have the resources that may exist on the server. For example, if the
application is a Web application , we cannot write to the client's hard drive or print
directly to the printers without first opening the browser's print preview window.
[ edit ] Address
The management methods in client server environments can be described as follows:
[ edit ] Examples
Most Internet services are client-server type. The action of visiting a website requires a
client-server architecture, since the web server serves web pages to the browser (the client).
When reading this article on Wikipedia , the user's computer and web browser would be
considered a client; and the computers, databases , and applications that make up Wikipedia
would be considered the server . When the user's web browser requests a particular article
from Wikipedia, the Wikipedia server collects all the information to display in the
Wikipedia database, articulates it into a web page , and sends it back to the client's web
browser.
Another example could be the operation of an online game . If there are two game servers,
when a user downloads and installs it on their computer they become a client. If three
people play on a single computer, there would be two servers, one client and three users. If
each user installs the game on their own computer, there would be two servers, three clients
and three users.
For a process to be carried out in the best way, it is preferable to use different terminals
performing the same task, rather than centralizing resources and using more hardware /
software to perform the same task. By running multiple servers, processing is faster,
response time is decentralized, and reliability is increased.
If certain existing information is required, why create it again, simply interact and take
advantage of the information already created.
Most of the functions are transparent to users, whether they are end users or administrators,
which is why a DBMS provides abstraction towards its operators, meaning that in some
cases we are not aware of the functionalities that are carried out in the background.
• Allow users to access and manipulate the database by providing methods to build data
processing systems for applications that require access to data.
• Provide administrators with the tools that allow them to perform maintenance and data
management tasks.
• Definition of the database - how the information will be stored and organized.