You are on page 1of 26

http://www.cs.sfu.ca/CourseCentral/354/zaiane/material/notes/contents.html http://msdn.microsoft.com/en-us/library/ms179422.

aspx

Database Management Systems


1. A database management system (DBMS), or simply a database system (DBS), consists of o A collection of interrelated and persistent data (usually referred to as the database (DB)). o A set of application programs used to access, update and manage that data (which form the data management system (MS)). 2. The goal of a DBMS is to provide an environment that is both convenient and efficient to use in o Retrieving information from the database. o Storing information into the database. 3. Databases are usually designed to manage large bodies of information. This involves o Definition of structures for information storage (data modeling). o Provision of mechanisms for the manipulation of information (file and systems structure, query processing). o Providing for the safety of information in the database (crash recovery and security). o Concurrency control if the system is shared by users.

Purpose of Database Systems


1. To see why database management systems are necessary, let's look at a typical ``file-processing system'' supported by a conventional operating system. The application is a savings bank: Savings account and customer records are kept in permanent system files. o Application programs are written to manipulate files to perform the following tasks: Debit or credit an account. Add a new account. Find an account balance. Generate monthly statements. 2. Development of the system proceeds as follows:
o

New application programs must be written as the need arises. New permanent files are created as required. o but over a long period of time files may be in different formats, and o Application programs may be in different languages. 3. So we can see there are problems with the straight file-processing approach: o Data redundancy and inconsistency Same information may be duplicated in several places. All copies may not be updated properly. o Difficulty in accessing data May have to write a new application program to satisfy an unusual request. E.g. find all customers with the same postal code. Could generate this data manually, but a long job... o Data isolation Data in different files. Data in different formats. Difficult to write new application programs. o Multiple users Want concurrency for faster response time. Need protection for concurrent updates. E.g. two customers withdrawing funds from the same account at the same time - account has $500 in it, and they withdraw $100 and $50. The result could be $350, $400 or $450 if no protection. o Security problems Every user of the system should be able to access only the data they are permitted to see. E.g. payroll people only handle employee records, and cannot see customer accounts; tellers only access account data and cannot see payroll data. Difficult to enforce this with application programs. o Integrity problems Data may be required to satisfy constraints. E.g. no account balance below $25.00. Again, difficult to enforce or to change constraints with the fileprocessing approach.
o o

These problems and others led to the development of database management systems.

Data Abstraction

1. The major purpose of a database system is to provide users with an abstract view of the system. The system hides certain details of how data is stored and created and maintained Complexity should be hidden from database users. 2. There are several levels of abstraction: 1. Physical Level: How the data are stored. E.g. index, B-tree, hashing. Lowest level of abstraction. Complex low-level structures described in detail. 2. Conceptual Level: Next highest level of abstraction. Describes what data are stored. Describes the relationships among data. Database administrator level. 3. View Level: Highest level. Describes part of the database for a particular group of users. Can be many different views of a database. E.g. tellers in a bank get a view of customer accounts, but not of payroll data. Fig. 1.1 (figure 1.1 in the text) illustrates the three levels.

Figure 1.1: The three levels of data abstraction

Data Models

1. Data models are a collection of conceptual tools for describing data, data relationships, data semantics and data constraints. There are three different groups: 1. Object-based Logical Models. 2. Record-based Logical Models. 3. Physical Data Models. We'll look at them in more detail now.

Object-based Logical Models o The E-R Model o The Object-Oriented Model Record-based Logical Models o The Relational Model o The Network Model o The Hierarchical Model Physical Data Models

Object-based Logical Models

1. Object-based logical models: o Describe data at the conceptual and view levels. o Provide fairly flexible structuring capabilities. o Allow one to specify data constraints explicitly. o Over 30 such models, including Entity-relationship model. Object-oriented model. Binary model. Semantic data model. Infological model. Functional data model. 2. At this point, we'll take a closer look at the entity-relationship (ER) and object-oriented models.

The E-R Model

1. The entity-relationship model is based on a perception of the world as consisting of a collection of basic objects (entities) and relationships among these objects. o An entity is a distinguishable object that exists. o Each entity has associated with it a set of attributes describing it. o E.g. number and balance for an account entity. o A relationship is an association among several entities. o e.g. A cust_acct relationship associates a customer with each account he or she has. o The set of all entities or relationships of the same type is called the entity set or relationship set. o Another essential element of the E-R diagram is the mapping cardinalities, which express the number of entities to which another entity can be associated via a relationship set. We'll see later how well this model works to describe real world situations. 2. The overall logical structure of a database can be expressed graphically by an E-R diagram: o rectangles: represent entity sets. o ellipses: represent attributes. o diamonds: represent relationships among entity sets. o lines: link attributes to entity sets and entity sets to relationships. See figure 1.2 for an example.

Figure 1.2: A sample E-R diagram.


The Object-Oriented Model

1. The object-oriented model is based on a collection of objects, like the E-R model.

o o o o o o o o o o o o

An object contains values stored in instance variables within the object. Unlike the record-oriented models, these values are themselves objects. Thus objects contain objects to an arbitrarily deep level of nesting. An object also contains bodies of code that operate on the the object. These bodies of code are called methods. Objects that contain the same types of values and the same methods are grouped into classes. A class may be viewed as a type definition for objects. Analogy: the programming language concept of an abstract data type. The only way in which one object can access the data of another object is by invoking the method of that other object. This is called sending a message to the object. Internal parts of the object, the instance variables and method code, are not visible externally. Result is two levels of data abstraction.

For example, consider an object representing a bank account. The object contains instance variables number and balance. o The object contains a method pay-interest which adds interest to the balance. o Under most data models, changing the interest rate entails changing code in application programs. o In the object-oriented model, this only entails a change within the payinterest method. 2. Unlike entities in the E-R model, each object has its own unique identity, independent of the values it contains: o Two objects containing the same values are distinct. o Distinction is created and maintained in physical level by assigning distinct object identifiers.
o

Record-based Logical Models

1. Record-based logical models: o Also describe data at the conceptual and view levels. o Unlike object-oriented models, are used to Specify overall logical structure of the database, and Provide a higher-level description of the implementation.

o o o o o o o o

Named so because the database is structured in fixed-format records of several types. Each record type defines a fixed number of fields, or attributes. Each field is usually of a fixed length (this simplifies the implementation). Record-based models do not include a mechanism for direct representation of code in the database. Separate languages associated with the model are used to express database queries and updates. The three most widely-accepted models are the relational, network, and hierarchical. This course will concentrate on the relational model. The network and hierarchical models are covered in appendices in the text.

The Relational Model


Data and relationships are represented by a collection of tables. Each table has a number of columns with unique names, e.g. customer, account. Figure 1.3 shows a sample relational database.

Figure 1.3: A sample relational database. The Network Model


Data are represented by collections of records. Relationships among data are represented by links. Organization is that of an arbitrary graph. Figure 1.4 shows a sample network database that is the equivalent of the relational database of Figure 1.3.

Figure 1.4: A sample network databaseThe Hierarchical Model


Similar to the network model. Organization of the records is as a collection of trees, rather than arbitrary graphs. Figure 1.5 shows a sample hierarchical database that is the equivalent of the relational database of Figure 1.3.

Figure 1.5: A sample hierarchical database The relational model does not use pointers or links, but relates records by the values they contain. This allows a formal mathematical foundation to be defined. Physical Data Models 1. Are used to describe data at the lowest level. 2. Very few models, e.g. o Unifying model. o Frame memory. 3. We will not cover physical models.

The foremost value of a database is availability of relevant information. As part of their primary purpose, government agencies provide information feedback and exchange to the court systems, the prison systems, the defense systems, the school systems, the private business sector, individual citizens, and more. Such an information management and exchange system demands quality and accuracy from every involved corner of the operations, including data collection, data entry, data distribution, and data protection. Many of these government systems are colossal in scope and application, so not all of the data can be obtained through safe channels. Recovery of certain lost or damaged data contents could involve placing researchers into extremely hazardous environments. Furthermore, the very existence of certain data stands as an education link to the risks and nature of various unsafe materials. Any unscheduled downtime in such a system can involve great amounts of time and money, not to mention the safety factor for those who use OSHA for government agency reports and information. The causes of computer and database failure can range from an accidental electrical spike to a purposeful introduction of invasive software. Whether it s the result of a fried hard drive or a destructive windstorm, the effects of a contaminated database remains the same: system operations, information management and scheduled government agency routines come to a screeching halt. In an emergency, offsite information redundancy is critical to continued operations. No one center of operations is safe from disaster. Consider the temporary loss of functionality when the New York City Office of Emergency Management s (OEM) IT department collapsed along with the World Trade Center. If any files or hardware survived the disaster, they were of no immediate use to the IT department. The availability of offsite data files became decisive to sustained operations. Every available backup technology method comes complete with a list of strengths and weaknesses. Examine them all. The primary concern is that you grasp the essential necessity for dependable government agency database backup system.

http://databases.about.com/cs/specificproducts/g/er.htm
Definition: An entity-relationship (ER) diagram is a specialized graphic that illustrates the relationships between entities in a database. ER diagrams often use symbols to represent three different types of information. Boxes are commonly used to represent entities. Diamonds are normally used to represent relationships and ovals are used to represent attributes. Also Known As: ER Diagram, E-R Diagram, entity-relationship model Examples: Consider the example of a database that contains information on the residents of a city. The ER digram shown in the image above contains two entities -- people and cities. There is a single "Lives In" relationship. In our example, due to space constraints, there is only one attribute associated with each entity. People have names and cities have populations. In a real-world example, each one of these would likely have many different attributes. Suggested Reading

E-R Diagram

http://databases.about.com/od/access/ss/Acce ss-2010-Tour-The-User-Interface_8.htm http://microsoftaccess.en.softonic.com/images


Access 2010 Tour: The User Interface
f you're switching to Microsoft Access 2010 from an earlier version, you're bound to immediately notice some changes. If you've been using Access 2007, the ribbon-based user interface will look similar, but it's received a facelift. If you're switching from an earlier version, you'll discover that the way you work with Access is now entirely different! In this article, we walk through the new Access interface step-by-step. We'll explore the Ribbon, the Navigation Pane and other features of Access 2010. Visit each of the numbered pages below to join our tour.

The new Getting Started page provides you with a quick shortcut to the features of Access 2010. The most notable feature on this page is the prominent set of dynamic links to Microsoft's Access 2010 templates. These are updated automatically through Office Online and offer you the ability to begin your database design with a predefined template, rather than starting from a blank database. Examples include databases for asset tracking, project management, sales, tasks, contacts, issues, events and students. Selecting any of these templates initiates an automatic download process which concludes by opening the database for you. You'll find other resources on the Getting Started page as well. From this page, you may create a new blank database, open recent databases or read content from Microsoft Office Online.

The Ribbon, introduced in Office 2007, is the biggest change for users of earlier versions of Access. It replaces the familiar drop-down menus (remember "File, Open"?) and toolbars with a contextsensitive interface that provides you with quick access to relevant commands. If you're a keyboard jockey that memorized command sequences like "Alt-F, O", rest easy. Access 2010 still supports these shortcuts from earlier versions. Access 2007 users will find that the ribbon received a facelift in Access 2010 with a smoother, cleaner look that uses space more efficiently.

Fans of the old File menu have something to celebrate in Access 2010 - it's back! (Well, kind of!) The Microsoft Office button is now gone and has been replaced with a File tab on the Ribbon. When you select this tab, a new window appears down the left side of the screen with many of the functions previously found on the File menu.

The command tabs help you navigate through the Ribbon by choosing the high-level task that you'd like to perform. For example, the Ribbon shown above has the Create command tab selected. The Home, External Data and Database Tools command tabs always appear at the top of the Ribbon. You'll also see context-sensitive tabs, such as the Datasheet tab in the example above.

The Quick Access Toolbar (shown in the image above) appears at the top of the Access window and provides you with one-click shortcuts to commonly used functions. You may customize the contents of the toolbar by clicking the arrow icon immediately to the right of the toolbar. By default, the Quick Access Toolbar contains buttons for Save, Undo and Redo. You may customize the toolbar by adding icons for New, Open, E-mail, Print, Print Preview, Spelling, Mode, Refresh All and other functions.

The Navigation Pane (shown above) provides you with access to all of the objects in your database. You may customize the contents of the Navigation Pane by using the expandable/collapsable subpanes.

Access 2010 incorporates the popular tabbed document browsing feature found in Internet Explorer 7. As shown in the image above, Access provides you with tabs representig each of your open database objects. You may quickly switch between open objects by clicking on the corresponding tab.

"Ready to consider upgrading to Access 2010 or Access 2007? It may well be worth it!..."
If you have been using Microsoft Access 2007 for a while now, moving to Access 2010 will be seamless and all you need to do is understand what new features have been introduced and what it has also replaced (where applicable). However, a lot more users havent yet upgraded to Microsoft Access 2007 and are still using Access 2003 (or even an earlier version). So Ive decided to include and combine the latest two versions and their new features to help with the transition and migration. I will clearly point out where a feature is exclusive to either version so that you have the heads up and understanding of what you will expect to see and more importantly how to access the feature due to new GUI (graphical user interface). Getting Started Microsoft Access 2010 (& 2007) offer plenty of templates that allow users to create databases, tables, queries, forms and reports with a simple one click action. There are new layout views for the form and report objects and design tools to assist in managing data. In previous versions, wizards were provided when creating a database or building new tables. Now templates make it easier to start the process taking you straight into the applications environment (and in most cases a help window is displayed). Microsoft also provides a wealth of free downloadable templates and could save a lot of planning designing time. The obvious aspect when creating a new database is the default new file extension.ACCDB replacing the older .MDB format. This must be used in order to take advantage of the newer features on offer but if you really insist on staying with the previous file format then not a problem, just dont expect to use any of the richer tools that are exclusive to .ACCDB.

Note: If you are upgrading an existing .MDB file to .ACCDB be careful as some of the features from Access of old is no longer available. Continue reading this article to know a little more about your options. Tables and Fields In Access 2007, table (and now field) templates makes your planning and decision process even easier as it now provides pre-defined fields names with preset properties.

In Access 2010, these similar features appear in a different way via the Fields - Ribbon Bar. In addition, Access 2010 exclusively introduces the ability to add Application Parts to an existing database saving a lot of design time of tables, forms and reports. You simply choose the template theme for your additional objects and the system generates its for you.

The datasheet view for a table has changed too. You can add new fields on the fly and set their data types and formatting. Copy and paste from Excel is now more consistent as Microsoft Access will fit to size and automatically change the data types. New from Access 2007 is the Field List pane which lets you add existing fields from other tables (not necessarily related ones) and embed them into your new table. If there is a potential relationship between the two tables, a prompt will appear to help you link them together.

There is a new data type and control types for fields in a table includingAttachment, Multi-

Values, Enhanced Memo and a built in Calendar control.

The Attachment data type allows you to store external documents as pointers to the source file without impeding database file sizes and it is not restricted to only a single document (as OLE Object is) it can handle multiple files too. The Multi-Values control can store more than one value for a list or combo box control creating a multi value store. Handy for capturing multiple category types without using separate fields or records. The Enhanced Memo control is enabled with the Rich Text property setting to theMemo data type and opens up character formatting. The Calendar Control is utilised as an option (by default) to display a date picker control when the cursor is placed in the field.

Exclusive to Access 2010 is the ability to now calculate directly into a table with fields of that table only using the Expression Builder tool when adding it as a new field.

General table functionality introduced from Access 2007 includes the ability to change alternating colour backgrounds, adding total rows with basic aggregate functions (sum, average, count etc.) and enhanced sorting and filtering tools. New Look Interface One of the obvious change users will see is the new look and feel of the Access GUI (Graphical User Interface) which includes the Ribbon Bar (Microsoft Office Fluent user interface) replacing Command Bars (Menu and Toolbars).

Other tabs (Contextual) dynamically appear and disappear based on the task and object in use. It makes Access more accessible without the need to return to a central point and is deemed more intuitive to the user (especially if you have never used an earlier version). Added galleries now show a preview before it is applied.

Existing users may feel a little dis-orientated at first but it wont take you too long to adapt and youll look back and wondered what the fuss was all about. Access of old had a Database Window which is where you managed all the objects. Now we have the Navigation Pane which is positioned to the left edge of the application window.

Use the Navigation Pane to manage and organise all the objects by dates, types, dependencies or even a custom group of your own design. There is an easy way to collapse and expand this view using the double chevron icon (top right hand corner).

Also new for Microsoft Access 2010 & 2007, is the Tabbed Objects feature which is the default and is displayed along the top of working area which is in essence a way to lock and maximise

the view of each open object. This setting can be changed back to the independent window (as in the previous versions). Navigation Forms are a new feature with Microsoft Access 2010 and allows you to quickly design a switchboard interface (replacing the former Switchboard Managaer tool) from predefined templates. There are six different layouts to choose for the Navigation Form feature and all have better formatting including buttons, colour schemes and shapes. This can also be used for publishing to the internet as a web interface too. New Views Alongside the traditional Design and Open view, there is a new view called Layout View which applies to forms and reports. It is a combination of both the design-time and run-time views for a form or a report which allows you to preview the data and carry out some basic grouping and formatting. It has been extended in Access 2010 and must be the view used when designing interfaces for the web. Exclusively new to Access 2010 is the Backstage View which is where you manage the database system including Compact and Repair, creating new databases, setting Access options and publishing your database.

In Access 2007, to manage similar functionality, you use the Office button located in the top left corner of the Application Window.

Creating Objects Now it is far easier and more intuitive to create new objects for forms and reports with a single click action. In addition to the traditional Wizards (which are still present), by picking a table or query first, pre-defined template forms and reports are created with the formatting and layouts all in place (even logos) giving you a head start to the design process.

Note: Pages have been dropped from Access 2007 and you can still use this object if working with .MDB file formats. In Access 2007 and 2010, you now have better web compatibility and Pages has now been integrated in other layout objects. Reports have a layout view which is now more interactive and further enhanced in Access 2010. This view is where you make layout and formatting changes whilst in the browsing view and therefore no need to switch between the design view and print preview mode. The print preview is now a better tool too with extra functionality and better rendering. Report designs provide better grouping and sorting functionality with an easy and more intuitive utility of a sort and grouping pane (bottom of the design view) -Group, sort and totals are managed here.

Forms and reports have better control layout options to help manage tabular and column groups of natural data sets. Grouping blocks of fields together (Stacking) keeps design controls under control when moving, resizing and formatting.

Split forms are new to Access where a form in the upper half is a Form view and the lower half is a Datasheet view and can be positioned to the top, left and right of a form. Conditional Formatting has been improved further with ability to add Data Bars(Access 2010 only) that calculate against other values with a gradient indicator making numbers for legible. There are now more (and better) themes and professional designs for forms and reports allowing you to customise your own colours and fonts styles. Importing and exporting Access objects is more intuitive and the task can be saved for re-use at a later point. This also extends to importing and exporting data to and other formats. The Import Spreadsheet Wizard lets you override data types that Access chooses for you. From Access 2007, you now have the capability to export a report as PDF file (and XPS) great news indeed! Macros From Access 2010, the macro designer tool is completely new offering IntelliSenseand a far user-friendlier interface with inline arguments.

More keyword commands are available making a good case to handle most the standard procedures instead of having the need to use VBA (Visual Basic for Applications).

Data Macros are also a new feature where you can now code events to data changes in a table and trigger certain actions. For example, you may want to set a status for a limit of credit to a customer and flag it as Authorised or Pending Authorisation. From Access 2007, macros used in forms and reports now have an Embeddedfeature which is stored with the form or report and not as a separate macro. Security Using the .ACCDB file format, you no longer have multi-user level (workgroup) security (you must keep the file as an .MDB). You still have Encrypt with Passwordoption and the file must first be opened in Exclusive mode before you can apply it. Access files should be trusted (by location) which is managed in the Access options tool and now security is enhanced further with Windows SharePoint Services. Other Improvements Enhanced Expression Builder using IntelliSense so you can see what you are typing with display prompts. Improved proofing tools - better spell checker tool. Better functionality with external data especially the web. Integrating the Windows SharePoint Services offering better collaboration and permission setting.

Having migrated to Access 2007 and now working with Access 2010, I'm a convert. I still use Access 2003 for some of my clients and realise how much users are missing when trying to design standard forms and reports with added macros. The difference between Access 2010 and 2007 is not major unless you are going to use the following two features - Macros and Web Services.

http://it.toolbox.com/wiki/index.php/Relational_Database_Management_System http://www.compinfo-center.com/apps/rdbms.htm
Toolbox for IT Topics Wiki

EditDiscussHistoryInvite PeersConnect(13) Parent Categories: Relational Database Management System | Dbms-select

Major Editors: deWriterMD All Editors

Relational Database Management System


updated Mar 28, 2008 9:25 pm | 27,610 views

Contents [Hide TOC]



1 Overview 2 1. A Collection of Related Data 2.1 Databases and Database Management Systems 2.2 Storage Requirements 2.3 Management Systems 3 2. The Database as a Collection of Tables 3.1 Relational Databases and SQL 3.2 History 3.3 Relational Data Modeling 3.4 SQL Language 4 Reference [edit]

Overview
When considering the various configurations for creating a database, one of the most robust designs is the Relational Database Management System. There are two major categories to review, the general use of the database and the destinguishing features involved in designing and implementing a relational database.

[edit]

1. A Collection of Related Data


[edit]

Databases and Database Management Systems


Let's start from basics. What is a database? In very general terms, a database is a collection of related data. Notice the word related, this implies that the collection of letters on this page do not by themselves constitute a database. But if we think of them as a collection of letters arranged to form words, then they can be conceptualised as data in a database. Using similar reasoning, we can also say that a tome such as a telephone directory is also a database. It is a database first, because it is a collection of letters that form words and second, because it is an alphabetical listing of people's names, their addresses and their telephone numbers. How we think of a database depends on what use we want to make of the information that it contains. So far, we have talked about a database in its broadest sense. This very general definition is not what most people mean when they talk about a database. In this electronic age, the word database has become synonymous with the term "computerised database". Collins English Dictionary describes a database as "A store of a large amount of information, esp. in a form that can be handled by a computer." In this book, we will be dealing only with computerised databases. In keeping with popular trend though, we will be using the word database to refer to a computerised database.
[edit]

Storage Requirements
A database (computerised) by itself, is not much use. The data is stored electronically on the computer's disk in a format which we humans cannot read or understand directly. What we need is some way of accessing this data and converting it into a form which we do understand. This is the job of the database management system or DBMS for short.
[edit]

Management Systems
A DBMS is essentially a suite of programs that act as the interface between the human operator and the data held in the database. Using the DBMS, it is possible to retrieve useful information, update or delete obsolete information and add new information to the database. As well as data entry and retrieval, the DBMS plays an important role in maintaining the overall integrity of the data in the database. The simplest example of is ensuring that the values entered into the database conform to the data types that are specified. For example, in the telephone book database, the DBMS might have to ensure that each phone number entered conforms to a set format of XXX-XXXXXXX where X represents an integer.
[edit]

2. The Database as a Collection of Tables


[edit]

Relational Databases and SQL


In the early days of computerised databases, all large database systems conformed to either the network data model or the hierarchical data model. We will not be discussing the technical details of these models except to say that they are quite complex and not very flexible. One of the main drawbacks of these databases was that in order to retrieve information, the user had to have an idea of where in the database the data was stored. This meant that data processing and information retrieval was a technical job which was beyond the ability of the average office manager. In those days life was simple. data processing staff

were expected to prepared the annual or monthly or weekly reports and managers were expected to formulate and implement day to day business strategy according to the information contained in the reports. Computer literate executives were rare and DP staff with business sense were even more rare. This was the state of affairs before the advent of relational databases.
[edit]

History
The relational data model was introduced in 1970, E. F. Codd, a research fellow working for IBM, in his article `A Relational Model of Data for Large Shared Databanks'. The relational database model represented the database as a collection of tables which related to one another. Unlike network and hierarchical databases, the relational database is quite intuitive to use, with data organised into tables, columns and rows. The table is a list of rows e.g. names and telephone numbers. It is similar to how we might go about the task of jotting down the phone numbers of some of our friends, in the back of our diary for example. The relational data model consists of a number of intuitive concepts for storing any type of data in a database, along with a number of functions to manipulate the information.
[edit]

Relational Data Modeling


The relational data model as proposed by Codd provided the basic concepts for a new database management system, the relational database management system (RDBMS). Soon after the relational model was defined, a number of relational database languages were developed and used for instructing the RDBMS. Structured Query Language being one of them.
[edit]

SQL Language
The SQL language is so inextricably tied to relational database theory that it is impossible to discuss it without also discussing the relational data model. The next two sections briefly describe some of the concepts of this model.
[edit]

Reference
NOTE: This extract is from Akeel Din's book SQL : A Practical Introduction which is reproduced here with permission of the copyright holder. Full book can be freely downloaded

You might also like