Professional Documents
Culture Documents
Database Architecture
A Database may contain different levels of abstraction in its architecture. Typically, the three
levels: External, Conceptual and Internal make up the database architecture.
External level defines how the users view the data. A single database can have multiple views.
The internal level defines how the data is physically stored.
The conceptual level is the communication medium between internal and external levels.
It provides a unique view of the database regardless of how it is stored or viewed. There are
several types of databases such as Analytical database, Data warehouses and Distributed
databases. Databases (more correctly, relational databases) are made up of tables and they contain
rows and columns, much like spreadsheets in Excel. Each column corresponds to an attribute
while each row represents a single record. For example, in a database, which stores employee
information of a company, the columns could contain employee name, employee Id and salary,
while a single row represents a single employee.
DBMS
DBMS, sometimes just called a database manager, is a collection of computer programs that is
dedicated for the management (i.e. organization, storage and retrieval) of all databases that are
installed in a system (i.e. hard drive or network). There are different types of Database
Management Systems existing in the world, and some of them are designed for the proper
management of databases configured for specific purposes. Most popular commercial Database
Management Systems are Oracle, DB2 and Microsoft Access. All these products provide means of
allocation of different levels of privileges for different users, making it possible for a DBMS to be
controlled centrally by a single administrator or to be allocated to several different people. There
are four important elements in any Database Management System. They are the modeling
language, data structures, query language and mechanism for transactions. The modeling language
defines the language of each database hosted in the DBMS. Currently several popular approaches
•Why Databases?
Purpose of Database Systems
Database management systems were developed to handle the following difficulties of typical file-
processing systems supported by conventional operating systems.
• Reduction of redundancy
• Avoidance of inconsistency
• Sharability
• Standards
• Improved security
• Concurrent access by multiple users
• Data integrity
• Difficulty in accessing data
• Atomicity of updates
• Programmer productivity: More data independence
• Flat files should be used for data exchange between databases.
Characteristics of DBMS
Traditionally, data was organized in file formats. DBMS was a new concept then, and all the
research was done to make it overcome the deficiencies in traditional style of data management. A
modern DBMS has the following characteristics:
Real-world entity: A modern DBMS is more realistic and uses real-world entities to design its
architecture. It uses the behavior and attributes too. For example, a school database may use
students as an entity and their age as an attribute.
Relation-based tables: DBMS allows entities and relations among them to form tables. A user
can understand the architecture of a database just by looking at the table names.
Isolation of data and application: A database system is entirely different than its data. A
database is an active entity, whereas data is said to be passive, on which the database works and
organizes. DBMS also stores metadata, which is data about data, to ease its own process.
Less redundancy: DBMS follows the rules of normalization, which splits a relation when any
of its attributes is having redundancy in values. Normalization is a mathematically rich and
scientific process that reduces data redundancy.
Primary Key
Every table must have a primary key. The primary key is a column or set of columns that
identifies a particular row. For example, in the customer table you might use customer name to
find a particular entry. But that column does not make a good key. What if eight customers are
named John Smith? In many cases you will create new key columns to ensure they are unique. For
example, a customer identification number is often created to ensure that all customers are
correctly separated. The relationship between the primary key and the rest of the data is one-to-
one. That is, each entry for a key points to exactly one customer row. To highlight the primary
key, the names of the columns that make up the key will be underlined. The DB Design system
uses a star in front of primary key column names because it is easier to see. You can use either
approach (or both) if you draw class diagrams by hand. As long as everyone on your development
team uses the same notation, it does not matter what notation you choose.
Backup and Recovery Procedures: In a computer file-based system, the user creates the backup
of data regularly to protect the valuable data from damaging due to failures to the computer system
or application program. It is a time-consuming method, if volume of data is large. Most of the
DBMSs provide the 'backup and recovery' sub-systems that automatically create the backup of
data and restore data if required. For example, if the computer system fails in the middle (or end)
of an update operation of the program, the recovery sub-system is responsible for making sure that
the database is restored to the state it was in before the program started executing.
Database Users
The next thing is that it will take you to the screen where you will create the tables as you can’t
just create a blank database. This is illustrated in the screenshot below.
The Parts table of our example stock control database contains the following fields:
The Customers table above is designed for a business whose customers are predominantly
individuals as assumed earlier. When your customers are mainly larger businesses, and you may
have several contacts at each business, or each business might have several sites, then you will
need a more complex solution.
Once you've got the hang of it, go through the rest of your planned tables setting them up too.
You’ll see your new tables appearing in the object browser on the left as you make them (press
F11 to bring this browser up if you can't see it).
Relationships
Relationships are set up within the database, to show the way in which one table relates to
another. A one-to-many relationship is the most common kind of relationship. In this
relationship, a record in one table can have more than one matching record in a second table, but
each record in the second table can have only one matching record in the first table. For example,
each Part can have only one Part Type, but for each PartType there are likely to be many parts of
that type.
If each part has only one supplier as in our example, then this is another straightforward one-to-
many relationship. If each part can be supplied by several different suppliers, then you will need a
different design.
In our example database, the following relationships between tables are required.
Suppliers - Parts, to specify the supplier of each part.
The query should be visible in the object browser on the left. Double click on the query to view
the parts with low stock levels once you have some working data in the system.
One more thing about the query: the lines between the tables in the query dataset are called Joins.
Joins are automatically created between tables when there are fields that already have a
relationship between them or between a primary key and another field with the same name.
Usually you would want a join here, but there will be cases where you don’t want to join these
fields for various reasons, so keep in mind that you may need to check all the joins once they are
created.
Join Properties in queries are very important when your query uses more than one table. If the
query does not seem to give you the results you expect, check these by right-clicking on the line
joining the two tables in Design view. Here you can choose whether you only want to see parts
that have a supplier, or all parts with low stock regardless of whether they have a supplier (by
picking “Include all records from ‘Parts’ and only those records from ‘Suppliers’ where the joined
fields are equal.”). You might want to use this option in this example. The 3rd option is the reverse
of this, so show all suppliers even if they don’t supply any low stock parts, which in this case
wouldn’t make any sense, so just ignore that one.
Join Properties in queries are very important when your query uses more than one table. If the
query does not seem to give you the results you expect, check these by right-clicking on the line
joining the two tables in Design view. Here you can choose whether you only want to see parts
that have a supplier, or all parts with low stock regardless of whether they have a supplier (by
picking “Include all records from ‘Parts’ and only those records from ‘Suppliers’ where the joined
fields are equal.”). You might want to use this option in this example. The 3rd option is the reverse
of this, so show all suppliers even if they don’t supply any low stock parts, which in this case
wouldn’t make any sense, so just ignore that one.
So now we have completed the database as per our design. We can enter all the data we need and
it will tell us when to reorder products. Of course, the potential uses of a database are many, so
now we’re going to discuss briefly a few ways you might want to expand on this database to make
it more useful and more user-friendly
Forms in MS Access
In MS Access, you use forms to view, enter and edit data, and to control the database. When you
have set up all the tables and relationships in your database, the Form Wizard is very helpful in
The CRUD functions are the user interfaces to databases, as they permit users to create, view, modify and
alter data. CRUD works on entities in databases and manipulates these entities. Any simple database table
enforces CRUD constraints.
For instance, a simple student database table adds (creates) new student details, accesses (reads) existing
student, modifies (updates) existing student data such as subjects, and deletes student details when students
leave the school.
The commands corresponding to these operations in SQL are INSERT, SELECT, UPDATE and DELETE.
INSERT adds new records, SELECT retrieves or selects existing records based on selection conditions,
UPDATE modifies existing records and DELETE removes tables or records.
The most efficient way to accomplish CRUD in SQL is through stored procedures, which are automated
and controlled by the person managing the procedure generation process. The individual SQL commands
INSERT, SELECT, UPDATE and DELETE can be executed by a single statement that calls the stored
procedure.
Queries
A query is a derived item in the database meant to answer specific questions that relate to the
information in the database. Queries are handy during data processing.
To find and retrieve just the data that meets conditions that you specify, including data from
multiple tables, create a query. A query can also update or delete multiple records at the same
time, and perform predefined or custom calculations on your data.
A query requests data from the database. At its simplest, a query merely fetches all data from a
single table. But as you create more complex (and more typical) queries, you can assemble exactly
the data you want (i.e. unique sets of data that you require at any given time).
Queries can also be used to execute mathematical and logical functions to obtain certain
information in the database.
Queries are derived from and linked to tables or other queries. (Due to these linkages, they
tend to largely inflate the size of the database and should thus only be used to execute the intended
functions, and stored only if updated information is to be retrieved)
There are various types of queries for different uses:
DATABASE SECURITY
In this section, we will discuss about database security. What do you think about security in general? Do
you feel safe at home or on the road? What about database security. Do you think that database security is
important? What is the value of the data? What if your personal data or your financial data is being stolen?
Do you think that harm could come to you? I am sure that some of you have watched spy movies where
computer hackers hack the computer system to access the confidential data and what they could do with it.
These are some of the questions that you might need to think and consider.
Well, now let us focus on our Topic. Database security involves protecting a database from unauthorized
access, malicious destruction and even any accidental loss or misuse. Due to the high value of data
incorporate databases, there is strong motivation for unauthorized users to gain access to it, for instance,
competitors or dissatisfied employees. The competitors may have strong motivation to access confidential
information about product development plans, cost-saving initiatives and customer profiles. Some may
want to access information regarding unannounced financial results, business transactions and even
customer’s credit card numbers. They may not only steal the valuable information, in fact, if they have
access to the database, they may even destroy it and great havoc may occur (Mannino 2001). Furthermore,
the database environment has grown more complex where access to data has become more open through
the Internet and mobile computing. Thus, you can imagine the importance of having database security.
Security is a broad subject and involves many issues like legal and ethical issues. And of course, there are
a few approaches that can be applied in order to maintain the database security. But, before talking about
the ways to protect our database, let us first discuss about the various threats to a database in more detail in
the next section.
If your company collects any data about customers, suppliers, or the wider community, then it will have
some sort of database where this is stored. Sometimes this data can be sensitive and private, and can be
subject to strict privacy agreements. For example, your customers may provide you with an email address,
postal address, and phone number when they purchase something from you. You will most likely store this
information somewhere. However, if other people manage to get their hands on it or if hackers gain access,
you could be subject to strict legal action from the people whose privacy has been compromised.
Computer-based Controls
I hope that by now you have understood the various types of threats that may attack the database.
And now, it is time to discuss the various ways how we can secure our system. The types of
computer-based controls to threats on computer systems range from physical controls to
administrative policies and procedures
Authorization
“Authorization is the granting of a right or privilege that enables a subject to have legitimate
access to a system or a system’s object” (Connolly and Begg 2005). The process of authorization
involves authentication of the subject or a person requesting access to objects or systems.
“Authentication is a mechanism that determines whether a user is who he or she claims to be”
Database Management Study Pack28 by Prince Asade Mojeed Adeniyi
(Connolly and Begg 2005). Usually, a user or subject can gain access to or a system through
individual user accounts where each user is given a unique identifier, which is used by the
operating system to determine that they have the authorization to do so. The process of creating
the user accounts is usually the responsibility of a system administrator. Associated with each
unique user account is a password, chosen by the user and known to the operating system. A
separate but similar process would be applied to give the authorized user to access a DBMS. This
authorization is the responsibility of a Database Administrator. In this case, an authorized user to a
system may not necessarily have access to a DBMS or any associated application programs
(Connolly and Begg, 2005).
Authorization rules are controls integrated in the data management system that controls the access
to the data and the actions that client or personnel may take when they access the data. Table
below illustrates an example of authorization rule represented as a table. By referring to Table
below, we can see that personnel whose password is “SUMMER” can only read the data while the
personnel with the password “SPRING” can perform read, insert and modify the data. But, notice
that the authorization table that consists of the authorization rules contain highly sensitive data,
they themselves should be protected by stringent security rules.
Usually, one selected person in data administration has the authority to access and modify the
table (Hoffer et.al. 2007).
Access controls
Usually, access controls to a database system is based on the granting and revoking of privileges. A
privilege allows a user to create or access (that is read, write or modify) a database object or to execute a
DBMS utility. The DBMS keeps track of how these privileges are granted to users and possibly revoked,
and ensures that at all times only users with necessary privileges can access an object.
Most commercial DBMS provide an approach to manage privileges that uses SQL Discretionary Access
Control (DAC). The SQL standard support DAC through the GRANT and REVOKE commands. The
GRANT command gives privileges to users while the REVOKE command takes away privileges (Connolly
and Begg 2005).
Views
“A view is the dynamic result of one or more relational operations operating on the base relations to
produce another relation. It is a virtual relation that does not actually exist in the database, but is produced
upon request by a particular user at the end of request‰ (Connolly and Begg 2005). In other words, a view
is created by querying one or more of the base tables, producing a dynamic result table for the user at the
time of the request” (Hoffer et. Al. 2007). The user may be allowed to access the view but not the base
tables which the view is based. The view mechanism hides some parts of the database from certain users
and the user is not aware of the existence of any attributes or rows that are missing from the view. Thus, a
user is allowed to see what they need to see only. Several users may share the same view but only restricted
ones may be given the authority to update the data.
Encryption