CSC 213 Database Management System 2 Credits Compulsory · Here are some examples of popular DBMS,...
Transcript of CSC 213 Database Management System 2 Credits Compulsory · Here are some examples of popular DBMS,...
CSC 213 Database Management System 2 Credits Compulsory
Objectives:
At the end of the course, students should be able to:
I. Identify and explain different types and modules of database.
II. List the advantages and disadvantages of database models.
III. Explain data storage, retrieval, security, and integrity.
IV. Use database management system to store, update, insert, retrieve and delete records.
V. Identify and explain at least three Dbase administrative functions.
Course Content:
An Overview Database Management
Nature of Database Management system (DBMS)
Different types of DBMS
Models of Database: Network, Hierarchical, Relational, Distributed
Advantages and Disadvantages
Concept of Fields, Records, Access Methods
Data Storage and Retrieval
Data Security and Integrity
Database Administration (DBA)
Methods of Data Organization
Data capturing
Query, sorting, Report generation
Wizard and Design view etc
Application in student record, payroll, inventory control etc Intensive Practice with Relational
Data base
Overview of Database
A Database is a collection of related data organised in a way that data can be easily accessed,
managed and updated. Any piece of information can be a data, for example name of your school.
Database is actually a place where related piece of information is stored and various operations
can be performed on it.
For example, a university database might contain information about the following:
• Entities such as students, faculty, courses, and classrooms.
• Relationships between entities, such as students' enrollment in courses, faculty teaching
courses, and the use of rooms for courses.
DBMS
A DBMS (Database Management System)is software that allows creation, definition and
manipulation of database. DBMS is actually a tool used to perform any kind of operation on data
in database. DBMS also provides protection and security to database. It maintains data
consistency in case of multiple users. Here are some examples of popular DBMS, MySql,
Oracle, Sybase, Microsoft Access and IBM DB2 etc.
The alternative to using a DBMS is to use ad-hoc approaches that do not carry over from one
application to another; for example, to store the data in files and write application-specific code
to manage it.
Components of Database System
The database system can be divided into four components.
• Users: Users may be of various types such as DB administrator, System developer and
End users.
• Database application : Database application may be Personal, Departmental, Enterprise
and Internal
• DBMS: Software that allow users to define, create and manages database access, Ex:
MySql, Oracle etc.
• Database: Collection of logical data.
The functions performed by a typical DBMS are the following:
1. Data Definition: The DBMS provides functions to define the structure of the data in the
application. These include defining and modifying the record structure, the type and size
of fields and the various constraints/conditions to be satisfied by the data in each field.
2. Data Manipulation: Once the data structure is defined, data needs to be inserted, modified
or deleted. The functions which perform these operations are also part of the DBMS. This
function can handle planned and unplanned data manipulation needs. Planned queries are
those which form part of the application. Unplanned queries are ad-hoc queries which are
performed on a need basis.
3. Data Security & Integrity: The DBMS contains functions which handle the security and
integrity of data in the application. These can be easily invoked by the application and
hence the application programmer need not code these functions in his/her programs.
4. Data Recovery & Concurrency: Recovery of data after a system failure and concurrent
access of records by multiple users are also handled by the DBMS.
5. Data Dictionary Maintenance: Maintaining the Data Dictionary which contains the data
definition of the application is also one of the functions of a DBMS.
6. Performance: Optimizing the performance of the queries is one of the important functions
of a DBMS. Hence the DBMS has a set of programs forming the Query Optimizer which
evaluates the different implementations of a query and chooses the best among them.
ADVANTAGES OF A DBMS
Using a DBMS to manage data has many advantages:
• Data independence: Application programs should be as independent as possible from
details of data representation and storage. The DBMS can provide an abstract view of the
data to insulate application code from such details.
• Efficient data access: A DBMS utilizes a variety of sophisticated techniques to store and
retrieve data efficiently. This feature is especially important if the data is stored on
external storage devices.
• Data integrity and security: If data is always accessed through the DBMS, the DBMS
can enforce integrity constraints on the data. For example, before inserting salary
information for an employee, the DBMS can check that the department budget is not
exceeded. Also, the DBMS can enforce access controls that govern what data is visible to
different classes of users.
• Data administration: When several users share the data, centralizing the administration
of data can offer significant improvements. Experienced professionals, who understand
the nature of the data being managed, and how different groups of users use it, can be
responsible for organizing the data representation to minimize redundancy and for fine-
tuning the storage of the data to make retrieval efficient.
• Concurrent access and crash recovery: A DBMS schedules concurrent accesses to the
data in such a manner that users can think of the data as being accessed by only one user
at a time. Further, the DBMS protects users from the effects of system failures.
• Reduced application development time: Clearly, the DBMS supports many important
functions that are common to many applications accessing data stored in the DBMS.
This, in conjunction with the high-level interface to the data, facilitates quick
development of applications. Such applications are also likely to be more robust than
applications developed from scratch because many important tasks are handled by the
DBMS instead of being implemented by the application.
DISADVANTAGES OF A DBMS
Given all these advantages, is there ever a reason not to use a DBMS?
• Complexity: A DBMS is a complex piece of software, optimized for certain kinds of
workloads (e.g., answering complex queries or handling many concurrent requests), and
its performance may not be adequate for certain specialized applications. Examples
include applications with tight real-time constraints or applications with just a few well-
defined critical operations for which efficient custom code must be written.
• Application data requirement: Another reason for not using a DBMS is that an
application may need to manipulate the data in ways not supported by the query
language. In such a situation, the abstract view of the data presented by the DBMS does
not match the application's needs, and actually gets in the way. As an example, relational
databases do not support flexible analysis of text data (although vendors are now
extending their products in this direction). If specialized performance or data
manipulation requirements are central to an application, the application may choose not
to use a DBMS, especially if the added benefits of a DBMS (e.g., flexible querying,
security, concurrent access, and crash recovery) are not required.
• Costly
• Large in size
NATURE OF DATABASE MANAGEMENT SYSTEM (DBMS)
1.Self-describing nature of the database system: A DBMS catalog stores the description of the
database. The description is called metadata. This allows the DBMS software to work with
different databases.
2.Insulation between program and data:It is called program-data independence.It allows
changing the data storage structure and operations without changing the DBMS access program.
3.Data Abstraction: A data model is used to store hide storage details and present the user with
a conceptual view of the database.
4.Support the multiple views of the data: Each user may see a different view of the database,
which describes only the data of interest to that user.
5.Sharing of data and multiuser transaction processing:It says that it allows a set of
concurrent users to retrieve and to update the Database.Concurrency with the DBMS guarantees
that each transaction is correctly executed or completely aborted.
DIFFERENT TYPES OF DBMS
1. Numeric and Textual databases
2. Multimedia databases
3. Geographic information system databases
4. Data warehouses
5. Real and active databases
Data Types
A data type is a type of data. ... They may also be more specific types, such as dates, text,
memo, and Number formats. Some programming languages require the programmer to define
the data type of a variable before assigning it a value.
Data Type Description
AutoNumber An AutoNumber field creates unique values automatically when Access creates a
new record. The AutoNumber field is primarily used for Primary Keys in Access.
Text A Text field can contain values that are text, numeric or a combination of both. A
text field can contain a maximum length of 255 characters.
Memo
A much larger version of the text field, allowing storage of up to 2 GB of data. A
new feature of the Microsoft Access Memo field is that it now supports rich text
formatting.
Number The Number field can store numeric values up to 16 bytes of data.
Date/Time The Date/Time field allows storage of date and time information. The date/time
field now also includes the Auto Calendar feature.
Currency The Currency data type stores values in a monetary format. This can be used with
financial data as 8-byte numbers with precision to four decimal places.
Yes/No Boolean data storage of true/false values.
OLE Object
The OLE Object field stores images, documents, graphs etc. from Office and
Windows based programs. The maximum data size is 2 GB, although this will
slow down a database.
Hyperlink The Hyperlink field type is used to store web addresses. This has a maximum size
limit of 1 GB of data.
Attachment The Attachment field type is used to store images, spreadsheet files, documents,
charts and other types of supported files to the records in your database. This is a
new feature that has been introduced with Microsoft Access 2007.
MODELS OF DATABASE: NETWOORK, HIERRACHICAL, RELATIONAL AND
DISTRIBUTED
What is database model? A database model is a type of data model that determines the logical
structure of a database and fundamentally determines in which manner data can be stored,
organized, and manipulated. The most popular example of a database model is the relational
model, which uses a table-based format.
HIERARCHICAL MODEL
In a hierarchical model, data is organized into a tree-like structure, implying a single parent for
each record. A sort field keeps sibling records in a particular order. Hierarchical structures were
widely used in the early mainframe database management systems, such as the Information
Management System (IMS) by IBM, and now describe the structure of XML documents. This
structure allows one one-to-many relationship between two types of data. This structure is very
efficient to describe many relationships in the real world; recipes, table of contents, ordering of
paragraphs/verses, any nested and sorted information.
Network model
The network model expands upon the hierarchical structure, allowing many-to-many
relationships in a tree-like structure that allows multiple parents. It was most popular before
being replaced by the relational model, and is defined by the CODASYL specification.
The network model organizes data using two fundamental concepts, called records and sets.
Records contain fields (which may be organized hierarchically, as in the programming language
COBOL). Sets (not to be confused with mathematical sets) define one-to-many relationships
between records: one owner, many members. A record may be an owner in any number of sets,
and a member in any number of sets.
Relational model
The relational model was introduced by E.F. Codd in 1970 as a way to make database
management systems more independent of any particular application. It is a mathematical model
defined in terms of predicate logic and set theory, and systems implementing it have been used
by mainframe, midrange and microcomputer systems.
The products that are generally referred to as relational databases in fact implement a model that
is only an approximation to the mathematical model defined by Codd. Three key terms are used
extensively in relational database models: relations, attributes, and domains. A relation is a table
with columns and rows. The named columns of the relation are called attributes, and the domain
is the set of values the attributes are allowed to take.
CONCEPTS
PRIMARY KEY: A primary key, also called a primary keyword, is a key in a relational
database that is unique for each record. It is a unique identifier, such as a driver license number,
telephone number (including area code), or vehicle identification number (VIN). A relational
database must always have one and only one primary key.
FOREIGN KEY: In the context of relational databases, a foreign key is a field (or collection of
fields) in one table that uniquely identifies a row of another table or the same table. In simpler
words, the foreign key is defined in a second table, but it refers to the primary key in the first
table.
FIELDS: Fields are the smallest units of information you can access. In spreadsheets, fields are
called cells.
RECORDS: A collection of fields is called a record.
ACCESS METHODS:
DATA STORAGE AND RETRIEVAL
WHAT IS DATA STORAGE?
Computer data storage, often called storage or memory, is a technology consisting of computer
components and recording media used to retain digital data. It is a core function and
fundamental component of computers. The central processing unit (CPU) of a computer is what
manipulates data by performing computations.
WHAT IS DATA RETRIEVAL?
Data retrieval means obtaining data from a database management system such as ODBMS. In
this case, it is considered that data is represented in a structured way, and there is no ambiguity
in data. In order to retrieve the desired data the user present a set of criteria by a query.
DATA SECURITY AND INTEGRITY
DATA SECURITY?
Data security refers to protective digital privacy measures that are applied to prevent
unauthorized access to computers, databases and websites. Data security also protects data from
corruption. Data security is the main priority for organizations of every size and genre.
Data security is also known as information security (IS) or computer security.
Examples of data security technologies include software/hardware disk encryption, backups, data
masking and data erasure.
A key data security technology measure is scrambling, where digital data, software/hardware,
and hard drives are scrambled and rendered unreadable to unauthorized users and hackers.
DATA INTEGRITY?
Data integrity refers to the overall completeness, accuracy and consistency of data. This can be
indicated by the absence of alteration between two instances or between two updates of a data
record, meaning data is intact and unchanged.
DATABASE ADMINISTRATION (DBA)
Database administration is the function of managing and maintaining database management
systems (DBMS) software. Mainstream DBMS software such as Oracle, IBM DB2 and
Microsoft SQL Server need ongoing management.
Database administrators (DBAs) use specialized software to store and organize data.
The role may include capacity planning, installation, configuration, database design, migration,
performance monitoring, security, troubleshooting, as well as backup and data recovery.
METHODS OF DATA ORGANIZATION
DEFINATION: Data organization, in broad terms, refers to the method of classifying and
organizing data sets to make them more useful. Some IT experts apply this primarily to physical
records, although some types of data organization can also be applied to digital records.
METHODS
There are many ways that IT professionals work on the principle of data organization. Many of
these are classified under the more general heading of "data management." For example, re-
ordering or analyzing the arrangement of data items in a physical record is part of data
organization.
One other main component of enterprise data organization is the analysis of relatively structured
and unstructured data. Structured data is comprised of data in tables that can be easily integrated
into a database and, from there, fed into analytics software or other particular applications.
Unstructured data is data that is raw and unformatted, the kind of data that you find in a simple
text document, where names, dates and other pieces of information are scattered throughout
random paragraphs. Experts have developed tech tools and resources to handle relatively
unstructured data and integrate it into a holistic data environment.
Businesses adopt data organization strategies in order to make better use of the data assets that
they have in a world where data sets represent some of the most valuable assets held by
enterprises across many different industries. Executives and other professionals may focus on
data organization as a component of a comprehensive strategy to streamline business processes,
get better business intelligence and generally improve a business model.
DATA CAPTURING
In (Computer Science) any process for converting information into a form that can be handled by
a computer.
Input of data, not as a direct result of data entry but instead as a result of performing a different
but related activity. Barcode reader equipped supermarket checkout counters, for example,
capture inventory related data while recording a sale.
QUERY, SORTING, REPORT GENERATION
QUERY
A query is a request for information from a database. There are three general methods for posing
queries:
Choosingparameters from a menu: In this method, the database system presents a list
of parameters from which you can choose. This is perhaps the easiest way to pose a query
because the menus guide you, but it is also the least flexible.
Query by example (QBE): In this method, the system presents a blank record and lets
you specify the fields and values that define the query.
Query language: Many database systems require you to make requests for information
in the form of a stylized query that must be written in a special query language. This is
the most complex method because it forces you to learn a specialized language, but it is
also the most powerful.
SORTING
The fields of a database can be sorted or rearranged in a number of ways: Ascending order --
Arrangement of data from lowest to highest in sequence. Descending order -- Arrangement of
sorted data from highest to lowest in sequence.
REPORT GENERATION
A report generator is a computer program whose purpose is to take data from a source such as a
database, XML stream or a spreadsheet, and use it to produce a document in a format which
satisfies a particular human readership.