Islamabad
Database Design
& Concepts
Submitted by:
Submitted to:
(HD-92224)
Table of Contents
As Instructed by my Unit Tutor this Unit Report contains some extra
documentation on Database. Therefore the actual LO1 starts at page No. 14.
Introduction
Database/Types of Databases
Terminologies of Database
What is DBMS
Types of DBMS
Some Dominating DBM Softwares
DBMS Language
SQL
SQL Statements and their functions/Formats
03
03
05
06
06
08
10
11
12
Lo1
14
Task 1
Based on the case study of FastCabs company, analyze the key issues and
application of database within that organization.
14
14
15
16
Features of MS Access
Advantages of MS Access for FastCabs
16
16
Lo2
18
Task 1
Based on the requirements and the assumptions you have made of FastCabs
case study, analyze the use of popular Prototyping database development
methodology.
Discuss entity-relationship modeling and normalization
18
21
21
Lo3
23
Task 1
23
23
Complete the design of FastCabs database and implement it using MSAccess as a target DBMS including user interface.
Evaluate the effectiveness of the database solution and suggest methods of
improvement.
24
33
33
34
User manual
Career in Database
References
34
36
37
Task 2
Task 2
Task 2
Task 3
Task 4
21
33
Introduction
Database:
"A database is a collection of information that is organized so
that it can easily be accessed, managed, and updated. In one
view, databases can be classified according to types of content:
bibliographic, full-text, numeric, and images."
Types of Database:
Following are types of Database:
2. Embedded Database:
An embedded database system is a database which is tightly integrated with an application software
that requires access to stored data, such that the database system is "hidden" from the application's
end-user and requires little or no ongoing maintenance.
Major implementations of this Database are SQL Server Compact from Microsoft Corporation, InnoDB
from Oracle Corporation and Informix Dynamic Server (IDS) from IBM.
3. Graph Database:
A graph database, also called a graph-oriented database, is a type of NoSQL
database that uses graph theory to store, map and query relationships.
A graph database is essentially a collection of nodes and edges. Each node represents an entity (such
as a person or business) and each edge represents a connection or relationship between two nodes.
Graph databases are well-suited for analyzing interconnections, which is why there has been a lot of
interest in using graph databases to mine data from social media just like Facebook graph search. The
concept behind graphing a database is often credited to 18th century mathematician Leonhard Euler.
4. Hypertext Database:
Hypertext databases are particularly useful for organizing large
amounts of disparate information. in which objects (text,
pictures, music, programs, and so on) can be creatively linked to
each other. When you select an object, you can see all the other
objects that are linked to it. For example they are useful for
maintaining online encyclopedias.
5. Operational Database:
Operational database management systems are used to manage dynamic data in real-time. These
types of databases allow you to do more than simply view archived data. Operational databases
allow you to modify that data (add, change or delete data), doing it in real-time.
Operational databases are used to store, manage and track real-time business information. For
example, a company might have an operational database used to track warehouse/stock quantities.
As customers order products from an online web store, an operational database can be used to keep
track of how many items have been sold and when the company will need to reorder stock.
6. Distributed Database:
A database that consists of two or more data files located at different sites on a computer network.
Because the database is distributed, different users can access it without interfering with one
another. However, the DBMS must periodically synchronize the scattered databases to make sure
that they all have consistent data.
In Pakistan NADRA is a good example of distributed database which generates massive amount of
data through numerous offices throughout the country. This data is synced periodically & is accessed by
many authorized governmental agencies/departments.
Terminologies:
Term
Database
Table
Field
Data Type
Row/Record
Primary Key
Relation
Foreign Key
Definition
A database is a collection of data that is organized in a specific way. The data is
stored in a way that makes it easy to access using queries. For example, a
database called 'Grafton Students'.
A database can have multiple tables in it. All the data is stored in the tables. A
table has a set of fields in it. These fields makes the design or the structure of
the database.
A field is the basic unit of data entry in a record. To define a new field, we give
it a name. Then we select options that determine how the field interprets,
enters, calculates, stores, and displays data.
Each field can have only one kind of data. That is called the Data Type of that
field. This can be a string, an integer, a date, etc.
rowalso called a record or tuplerepresents a single, implicitly structured
data item in a table. In simple terms, a database table can be thought of as
consisting of rows and columns or fields.
Primary key is a field that will uniquely identify each row in the table. The value
of this field will be unique through the table.
There will be many cases when the data in one table can be related to the data
in another table. This connection between two tables is called a relation.
When there is a relation between 2 tables, these tables will be connected by
inserting the primary key of one table into the corresponding row of the other
table. The field used in such a way to connect the 2 tables is called the foreign
key.
What is DBMS?
"A database management system (DBMS) is system software
for creating and managing databases. The DBMS provides users
and programmers with a systematic way to create, retrieve,
update and manage data."
A DBMS makes it possible for end users to create, read, update and delete data in a database. The
DBMS essentially serves as an interface between the database and end users or application
programs, ensuring that data is consistently organized and remains easily accessible.
The Data.
The database engine that allows data to be accessed, locked and modified.
The database schema, which defines the databases logical structure.
These three foundational elements help provide concurrency, security, data integrity and
uniform administration procedures.
Typical database administration tasks supported by the DBMS include
change management, performance monitoring/tuning and backup and
recovery.
The DBMS is perhaps most useful for providing a centralized view of data
that can be accessed by multiple users, from multiple locations, in a
controlled manner.
Types of DBMS:
There are four types of Database Management Softwares:
1. Hierarchal Database:
A hierarchical database is a design that uses a one-to-many relationship for
data elements. Hierarchical database models use a tree structure that links a
number of disparate elements to one "owner," or "parent," primary record.
The hierarchical database model mandates that each child record has only one
parent, whereas each parent record can have one or more child records. In
order to retrieve data from a hierarchical database the whole tree needs to be
traversed starting from the root node.
2. Network Database:
A network database is a type of database model wherein multiple
member records or files can be linked to multiple owner files and
vice versa. The model can be viewed as an upside-down tree where
each member information is the branch linked to the owner, which is
the bottom of the tree. Essentially, relationships are in a net-like form where a single element can
point to multiple data elements and can itself be pointed to by multiple data elements.
The network model's original inventor was Charles Bachman, and it was developed into a standard
specification published in 1969 by the Conference on Data Systems Languages (CODASYL) Consortium.
This was followed by a second publication in 1971, which became the basis for most implementations
3. Relational Database(RDBMS):
A relational database (RDB) is a collective set of multiple data
sets organized by tables, records and columns. RDBs establish a
well-defined relationship between database tables. Tables communicate and
share information, which facilitates data searchability, organization and reporting.
RDBs use Structured Query Language (SQL), which is a standard user application that provides an
easy programming interface for database interaction.
The relational database was first defined in June 1970 by Edgar Codd, of IBM's San Jose Research
Laboratory. Codd's view of what qualifies as an RDBMS is summarized in Codd's 12 rules. A relational
database has become the predominant type of database.
IBM DB2:
DB2 is the database management system that delivers a flexible and costeffective database platform to build robust on demand business
applications. The DB2 Universal Database (UDB) Enterprise Server Edition (ESE) is one of the best
RDBMS. IBM positions DB2 as the database of choice for robust, enterprise-wide solutions handling
high-volume workloads.
TERDATA:
Teradata Database, with an interesting tagline, - "When the world gets
smaller, the data gets bigger," is the most powerful Very Large Database
(VLDB) system. Nowadays the concept of VLDB has shifted to Big Data which focuses on the value of
data for business decision-making. Many large scale data warehousing and business intelligence
systems are powered by Teradata. Teradata database is often used by big retailers and telecom
enterprises.
My SQL:
MySQL. an open source database, is the most popular database for webbased business applications, and is moving to enterprise level. MySQL is the
most popular database for internet systems such as e-commerce and dynamic website. If you run
your own blog with Wordpress, you are using MySQL. Many of the world's largest and fastestgrowing organizations including Facebook, Google, Adobe, Alcatel Lucent and Zappos rely on MySQL
to save time and money powering their high-volume Web sites, business-critical systems and
packaged software.
Ahmed Ali Khan HD-92224
Islamabad
ADABAS:
Software AGADABAS is the maker of Adabas. Adabas once was
the most powerful mainframe database, now runs in multiple
platforms, and provides superior reliability and performance. Software AG says that Adabas is the
comprehensive and scalable enterprise database management system optimized for big data and
designed for reliability, high performance and low total cost of ownership. Available for mainframe,
Linux, UNIX and Windows (LUW) platforms. ADABAS is integrated with NATURAL, - Software AG's
application development and deployment environment known for ease of-use, cross-platform
portability and developer productivity.
File Maker:
FileMaker was the #1-selling easy-to-use database software for Windows and Mac OS.
However, on the rise of Microsoft Access, FileMake has lost its competitive edge in the
Windows environment, which forced FileMaker strategically build strength on the Mac
platform. FileMaker, Inc., is now an Apple subsidiary, which may secure FileMaker's future
supported by the strength of Apple products. FileMaker Server maximizes performance of shared
databases while increasing security.
Microsoft Access:
Microsoft Access is the most used desktop database application in Windows.
Coming with the Microsoft Office suite, Access is cheap and accessible from
most Windows laptops and workstations. Although mainly considered as a
desktop database, Access becomes ever popular database for internet systems, - many e-commerce
and content management systems is powered by Access database running on the Microsoft's IIS web
server platform. Skills of Microsoft Access are always in demand, although the pay may not be great.
Informix:
Informix, now under IBM, once was the most promising objectoriented database. It had been speculated that the object-oriented
database would one day replace the traditional RDBMS (relational
database management system), which means Infomix could have taken over Oracle in the IT world,
but it had never happened. Thus as a falling star, Infomix was acquired by IBM. The latest version of
Infomix has built with some new features, such as NoSQL capability, which unleashes the way to
combine unstructured and structured data in a smart way, bringing NoSQL to the SQL database.
Database Schema:
DBMS Language:
Database languages are used for read, update and store data in a
database. There are several such languages that can be used for this
purpose; one of them is SQL (Structured Query Language).
DDL is used for specifying the database schema. Lets take SQL for instance to categorize the
statements that comes under DDL.
All these commands specify or update the database schema thats why they come under Data
Definition language.
In practice, the data definition and data manipulation languages are not two separate
languages. Instead they simply form parts of a single database language such as Structured
Query Language (SQL). SQL represents combination of DDL and DML, as well as statements
for constraints specification and schema evaluation.
Although the current Database era is Fully dominated by SQL but some other Query languages are:
Contextual Query Language (CQL), Cypher, DMX for Data Mining models, HTSQL is a query language that
translates HTTP queries to SQL, OQL is Object Query Language, Gremlin is a graph traversal language.
10
SQL:
SQL (Structured Query Language) is a special-purpose programming
language designed for managing data held in a relational database
management system (RDBMS), or for stream processing in a relational data
stream management system (RDSMS).
Originally based upon relational algebra and tuple relational calculus, SQL
consists of a data definition language, data manipulation language, and a
data control language. The scope of SQL includes data insert, query,
update and delete, schema creation and modification, and data access
control.
Historically, SQL has been the favorite query language for database management systems running on
minicomputers and mainframes. Increasingly, however, SQL is being supported by PC database
systems because it supports distributed databases (databases that are spread out over several
computer systems). This enables several users on a local-area network to access the same database
simultaneously.
Arguably, the most popular NoSQL database is Apache Cassandra. Cassandra, which was once Facebooks
proprietary database, was released as open source in 2008. Other NoSQL implementations include
SimpleDB, Google BigTable, Apache Hadoop, MapReduce, MemcacheDB, and Voldemort. Companies
that use NoSQL include NetFlix, LinkedIn and Twitter.
11
Capabilities of SQL:
SQL Statement:
Some database systems require a semicolon at the end of each SQL statement.
Semicolon is the standard way to separate each SQL statement in database systems that
allow more than one SQL statement to be executed in the same call to the server.
AND
Operator
12
OR Operator
ORDER BY
INSERT INTO
UPDATE
DELETE
DELETE ALL
SELECT TOP
LIKE
Operator
IN Operator
BETWEEN
ALIASES
UNIOIN
SELECT INTO
INSERT INTO
SELECT
Create DB
Create Table
The OR operator displays a record if either the first condition OR the second
condition is true.
SELECT * FROM Customers WHERE City='Berlin' OR
City='Mnchen';
The ORDER BY keyword is used to sort the result-set by one or more columns.
SELECT column_name, column_name FROM table_name ORDER BY
column_name ASC|DESC, column_name ASC|DESC;
The INSERT INTO statement is used to insert new records in a table.
INSERT INTO table_name (column1,column2,column3,...)
VALUES (value1,value2,value3,...);
The UPDATE statement is used to update records in a table.
UPDATE table_name SET column1=value1,column2=value2,...
WHERE some_column=some_value;
The DELETE statement is used to delete records in a table.
DELETE FROM table_name WHERE some_column=some_value;
It is possible to delete all rows in a table without deleting the table.
DELETE * FROM table_name;
The SELECT TOP clause is used to specify the number of records to return.
SELECT column_name(s) FROM table_name LIMIT number;
The LIKE operator is used in a WHERE clause to search for
a specified pattern in a column.
SELECT column_name(s) FROM table_name WHERE column_name
LIKE pattern;
The IN operator allows us to specify multiple values in a WHERE clause.
SELECT column_name(s) FROM table_name WHERE column_name IN
(value1,value2,...);
The BETWEEN operator selects values within a range. The values can be
numbers, text, or dates.
SELECT column_name(s) FROM table_name
WHERE column_name BETWEEN value1 AND value2;
SQL aliases are used to give a database table, or a column in a table, a
temporary name.
SELECT column_name AS alias_name FROM table_name;
The SQL UNION operator combines the result of two or more SELECT
statements.
SELECT column_name(s) FROM table1
UNION
SELECT column_name(s) FROM table2;
The SELECT INTO statement copies data from one table and inserts it into a
new table.
SELECT * INTO newtable [IN externaldb] FROM table1;
The INSERT INTO SELECT statement selects data from one table and inserts it
into an existing table. Any existing rows in the target table are unaffected.
INSERT INTO table2 SELECT * FROM table1;
The CREATE DATABASE statement is used to create a database.
CREATE DATABASE dbname;
The CREATE TABLE statement is used to create a table in a database.
CREATE TABLE table_name
(column_name1 data_type(size),
column_name2 data_type(size),
column_name3 data_type(size),
....);
Ahmed Ali Khan HD-92224
Islamabad
13
LO
Task
Mistakes:
Huge amounts of paperwork & lack of communications means there is more room
for mistakes. Some serious management and misguidance of Drivers is a major issue
in FastCabs.
FastCabs Bankruptcy:
The company CEO is already suspecting that the success of his company will be short
lived. In order to avoid this the issue mentioned above must be addressed
immediately.
14
Absolute Detailing:
In depth details of everyday work and company assets including satff will be maintained
through dedicated columns in each table. For each staff store information such as staffNo,
fName, lName, sAddress, jobDescription, salary, NIN, sex, and DOB. Each office office
number, address, and phone number.
Tracking:
Tracking of clients, Contracts and Drivers will configured to be logged in the DBMS.
Report Generation:
A real time latest state report generation capability will configured in the DBMS. Current
reports will be generated in the matter of seconds.
Query Generation:
Options for Query generation can be configured in the DBMS to show only the specific data
asked by Users and Staff.
15
Task
Features of MS Access:
Cost Benefits:
Microsoft Access is virtually free. If FastCabs computers already have the Microsoft Office
Professional Suite of business products installed that is automatically bundled as part of Microsoft
Office Professional, Microsoft Access is already available and there is no additional database
software that is required.
Cost of Development:
There is a tremendous amount of Access developer resources to choose from. Due to the wide
spread popularity of Access, Access developers are often available at a very competitive market rate
that is significantly lower than Oracle or SQL Server database consultants.
16
User Friendly:
Access is user friendly and features the familiar Windows look and feel which is appealing to most
users.
Unique Identifier:
Each piece of information is assigned a unique identifier. This is extremely important since it ensures
that each piece of information is only entered once, eliminating human and duplication errors.
Custom Design:
Customized forms can be created that will make it easy for FastCabs employees to enter your
information.
Scalability:
If FastCabs is growing, one of the benefits of Microsoft Access is that it has upgrade capabilities. If
the size of FastCabs database is continually growing and the performance starts to suffer, we can
easily upgrade to SQL Server along with an Access Data Project (ADP).
Backup:
The database can be backed up to prevent the loss of data.
GUI interface:
Another advantage is, it provides excellent graphical user interface (GUI) whereas most database
management tools provide console operating interface (CUI). This feature creates excellent Userfriendly environment.
17
LO
Task
For Prototyping and Database development process we can use The SDLC(System Development Life
Cycle).
Prototyping:
SDLC:
As a specific type of information system, Database Design can be modeled using a similar SDLC type
approach, sometimes referred to as DBLC or the Database Development Life Cycle. As in the SDLC
approach, DBLC consists of several iterative steps (which vary slightly depending on the model used).
However, the overall approach is the same:
Our DBLC will comprise of the following Six steps:
Purposes
Analyze company situation
Operating environment
Organizational structure
Define problems and constraints
Define objectives
Define scope and boundaries
18
19
STEP-5: Operation
The Database is up and running! Of course problems arise, and changes are always necessary!
Preventative maintenance
Corrective maintenance
Adaptive maintenance
Assignment of access permissions
Generation of database access statistics
to monitor performance
Periodic security audits based on
system-generated statistics
Periodic system usage-summaries
20
Task
2
What is Entity Relationship Diagram?
An entity-relationship diagram (ERD) is a graphical representation of an
information system that shows the relationship between people,
objects, places, concepts or events within that system. An ERD is a data
modeling technique that can help define business processes and can be
used as the foundation for a relational database.
Three main components of an ERD are the entities, which are objects or
concepts that can have data stored about them, the relationship
between those entities, and the cardinality, which defines that
relationship in terms of numbers.
ERM:
The entity-relationship model (or
ER model) is a way of graphically
representing the logical
relationships of entities (or
objects) in order to create a
database. The ER model was first
proposed by Peter Pin-Shan Chen
of Massachusetts Institute of
Technology (MIT) in the 1970s.
Normalization:
One of the ways an ERD is enhanced during the logical design phase is through the process of
normalization. Normalization is one of the key tenets in relational model design. It is the process of
removing redundancy in a table so that the table is easier to modify. It usually involves dividing an
entity table into two or more tables and defining relationships between the tables. The objective is
to isolate data so that additions, deletions, and modifications of an attribute can be made in just one
table and then propagated through the rest of the database via the defined relationships.
Performing normalization during ERD development can improve the conceptual model, and speed its
implementation.
21
Drivers
Driver ID
Driver Name
Mobile Num
Gender DOB
Driver Add
License No
License Type
License Expiry
Penalty Points
Job
Job ID
Job
Phone
Contract ID
Pickup Add
Drop Add
Pickup Date
Pickup Time
Vehicles
Vehicle ID
Reg Number
Veh_Model
Veh_Make
Veh_Color
Veh_Capacit
Milage
MOT Due
Office
Staff ID
First Name
Last Name
Staff Add
Designation
Salary
NIN
Gender
DOB
User Name
Password
Address
Address ID
Address
City
Postal Code
Office
Office ID
Office Add
Office Mail
Manager
Phone No
Client
Client ID
Client Name
Phone No
Client Add
City
Staff
22
LO
Task
is to
23
Task
1. Create the tables for the FastCabs database. Where appropriate set field and table properties,
including any required indexes. Ensure that referential integrity is established between related
tables.
Creation & All Tables
24
As Shown Above I created All of the required Tables and their fields.
Forms Shown Below:
Ahmed Ali Khan HD-92224
Islamabad
25
Info
Main
Menu
Clients
Form
Clients Theme
Record Navigation
Record Manipulation
26
27
28
29
generation:
Date Stamp
Report Preview
30
Set control sources for LoginID and Password which were in staff table:
After that I set the close events for exit button.
Set properties as modal form so on startup the user
must enter username password.
Set masking's for Password so they can't be visible.
Started working on the VB Code for Login Button
As Shown Below:
31
To be Sure of the security measures. I ran some further tests on the "login"
which turned out to be Satisfactory.
32
Task
Problem
Is it Solved
Remarks
Paperwork is almost eliminated. Through ERecords. A good Sign for Operating Costs.
Clerical and paper handling staff can now be
reduced to minimum.
Now with DBMS deployed strong
Communication & Distribution is in Place.
No mistakes with DBMS.
All of the above ultimately result in dramatic
reduction of Operating cost.
No chance of Bankruptcy if All of the above
problems are solved.
The Database should be integrated with a web based application so Customers can
make an On-Line booking.
The database should be configured as a JET Database so just install and run.
User Level Security clearance should be configured to tighten the security.
A web integrated report generation system should be deployed so the CEO can see his
company's progress anywhere anytime.
33
Task
Create a user manual that describes your database solution for the FastCabs
database. The user manual should introduce the database application to the users,
describe the functionality of the database application and clearly demonstrate how
to use the application.
User manual:
1. Open the Database File:
34
Use Navigation to
explore other records
5. To view or Print report just click on the desired report from main Menu and Right Click for more
Options:
In main Menu.
35
Career In Database
Database managers, sometimes referred to as database administrators, identify a
company's information management needs and create a database to meet those needs.
They also merge old and new databases, ensure that databases operate correctly, ensure
that database information is secure, and fix any related problems.
Besides
No business solution could work without database. SQL is the language to use in almost all
databases. SQL programming skill is a must for all IT professionals, especially database
programmers and solution developers. In addition to basic SQL programming skill, you
should also master vendor-based SQL extensions - SQL in Oracle, IBM DB2, and Microsoft
SQLServer.
Some Work designations Database Administration:
Designation
Description
Database
Administrator
(DBA)
Database
Developer
Database
Designer/Database
Architect
Data Analyst/Data
Scientist
Data
Mining/Business
Intelligence(BI)
Specialist
Data Warehousing Specializes in assembling and analyzing data from multiple operational
systems (orders, transactions, supply chain information, customer data and
Specialist
so forth) to establish data history, analyze trends, generate reports and
forecasts, and support general ad hoc queries.
36
References
http://searchsqlserver.techtarget.com/definition/database
http://bin-co.com/database/sql_tutorial/db_terms_meanings.php
http://searchsqlserver.techtarget.com/definition/database-management-system
http://www.itcareersuccess.com/tech/database.htm
https://en.wikipedia.org/wiki/Object_Query_Language
http://searchdatamanagement.techtarget.com/definition/NoSQL-Not-Only-SQL
https://www.access-programmers.com/benefits.aspx
http://pkirs.utep.edu/cis4365/Tutorials/Database%20Design/General%20Design/Tutorial%207.0010
0/tutorial%207.00100.htm
http://searchcrm.techtarget.com/definition/entity-relationship-diagram
37