Saturday, 11 October 2014

Introduction to Database and DBMS

Introduction to Database

Q. What is database approach?
Data Base is the shared collection of logical data which fulfills the users requirements. Database are so widely used today they can found in organization of all sizes, ranging from large government agencies such as the Internal Revenue Service to small business and homes. Everyday activities often bring into contact with databases. For Example: if you work your employment record may be kept in a database that stores basic information such as your name, address, employee ID social security number, job information and performance evaluations. Your payroll is probably produced using a database that stores information about each pay period and about the year's gross pay, tax deductions and taxes withheld, among other things. Your pay stub reflects this data each payday.

In order to solve the problems of traditional file approach, the concept of a database was introduced. A database is a collection of related data. By data we mean known facts that can be recorded and that have implicit meaning. For example consider the names, telephone numbers and addresses of the people you know. You may have recorded this data in an indexed address hook or you may have stored it on a diskette using a personal computer and a software such as DBASE V, Microsoft ACCESS or EXCEL. This is a collection of data with an implicit meaning and hence is a database. All the data belonging to the entire organization is centralized in a common pool of data accessible by all applications. This solved the problem of redundancy and inconsistency. A database can be of any size and complexity. For example, the list of names and addresses may consist of only a few hundred records, each with a simple structure. On the other hand a large library database may contain half a millions records with greater size and complexity.

Q. What are the advantages of database approach?
Compared with the traditional file processing approach the integrated database approach has several advantages:

Sharing of Data
Unlike files which are owned by the departments whose applications they serve the database belongs to the entire organization. The DBA manages the data but it does not belong to any individual or department. Many users can be authorized to access the same piece of information. Thus the organization now has control over the data it needs to conduct its business.

Control of Data Redundancy
The file processing system wasted space by storing some information in two or more files. For example: the AD/HR's faculty files and the faculty payroll file contained several items that were identical. When converted to an integrated database information is integrated so that several copies of the same data are not stored. Some limited redundancy is permitted to keep logical connections among data items or to improve performance but the system is usually aware of which items are stored twice.

Data Consistency
One effect of eliminating or controlling redundancy is that the data is consistent. If a data item appears only once any update to its value needs to perform only once and all users have immediate access to the new value. If the system has some controlled redundancy when it receives an update to an item that appears more than once it can often do cascading updates automatically updating every occurrence of that item keeping the database consistent.

Improved Data Standards
The DBA who is responsible for designing and maintaining the database to serve the needs of all users must define and enforce organization wide standards for representation of data in the database. This includes such concerns as the format of all data items convention on data names, documentation standards, frequency of update, update procedures and permitted usage of the database.

Better Data Security
Data security is the protection of the database from unauthorized access. All authorize access to the database is through the DBMS which can require that users go through security procedures or use additional passwords to gain access to data. To preclude the possibility of having a user bypass the DBMS to gain illegal access the DBMS can data before storing it. Then when an authorized user wishes to retrieve data it will be decrypted automatically but data retrieved in any other way will appear in its encrypted form. Authorized users may be unaware of data encryption. Each user is provided with a view or predefined portion of database.

Improved Data Integrity
Some database management systems allow the DBA to define integrity constraints or consistency rules that the database must obey. These constraints may apply to items within records or to the relationship between records or may be general constraints.

Balancing of Conflicting Requirements
Each department or individual user has data needs that may be in conflict when those of other users. The DBA is aware of the needs & can make decisions about the design, use & maintenances of the database that provide the best solution for the organization as a whole. These decisions should favor the most important applications possibly at the expenses of the less vital once.

Faster Development of New Applications
A well-designed database provides an accurate model of the operations of the organizations. When a new application is proposed it is likely that the data required is already stored in the database. Development is reduced because no file creation phase is needed for the new application.

Better Data Accessibility
In addition to providing data for programs most database management systems allow on line access by users. They provide Query languages that permit users to ask one of a-kind questions & obtained the required information at interactive terminals, rather than by waiting for a programmer.

Economy of Scale
When all of the organization's data requirements are satisfied by one data base instead of many separate files the size of combined operation provides several advantages. The portion of budget that would ordinarily be allocated to various departments for their data design, storage & maintenance costs can be pooled possibly resulting in the lower total cost. The pooled resources may be used to purchase a more sophisticated powerful system than any department could afford individually. Programmer time that would ordinarily be devoted to designing files can be spent on improving the data base. Any improvement in the data base benefits many users.

More Control over Concurrency
In the file system if two users are permitted to access data simultaneously, it is possible that they will interfere with each other. For example, if both attempt to perform updates one update may be lost because one may over write the value recorded by the other. Most data base management systems have sub systems to control concurrency so that transactions are not lost on performed incorrectly.

Better Backup & Recovery Procedures
In a file processing system the recovery system may consist of making a tape of all files each night in the event of failure during the day recovery is performed by taking the data from the previous night's tape & informing users that none of that day's changes have been performed so that they can reenter any updates. In a data base environment the tape is usually supplemented by a log of changes. When ever the database is modified a log entry is made. If the system fails the tape & log are used to bring the data base to the state it was in just prior to the failure. The system is therefore self-recovering.

Q. What is database?
A collection of information organized in such a way that a computer program can quickly select desired pieces of data. You can think of a database as an electronic filing system. A database is a collection of logically related data sets or files. These files are normally of different natures and are used for specific purposes. The files may be organized in different ways to meet different processing and retrieval requirements of the users.
Example:
A bank may have separate files for the clients as follows:
  • Saving A/C
  • Automobile  Loan
  • Personal Loan
  • Clients Biographic Information
This is a data structure used to store organized information. A database is typically made up of many linked tables of rows and columns. For example, a company might use a database to store information about their products, their employees and financial information. Databases are now also used in nearly all e-commerce sites to store product inventory and customer information. Database software such as Microsoft Access, FileMaker Pro and MySQL is designed to help companies and individuals organize large amounts of information in a way where the data can be easily searched, sorted and updated.

Computer databases typically contain aggregations of data records or files such as sales transactions product catalogs and inventories and customer profiles. Typically a database manager provides users the capabilities of controlling read/write access specifying report generation and analyzing usage. Databases and database managers are prevalent in large mainframe systems but are also present in smaller distributed workstation and mid-range systems such as the AS/400 and on personal computers. SQL (Structured Query Language) is a standard language for making interactive queries from and updating a database such as IBM's DB2, Microsoft's Access, and database products from Oracle, Sybase and Computer Associates.

Q. What is DBMS?
DBMS stands for DataBase Management System. DBMS is a program that lets one or more computer users create and access data in a database. The DBMS manages user requests and requests from other programs so that users and other programs are free from having to understand where the data is physically located on storage media and in a multi-user system who else may also be accessing the data. In handling user requests the DBMS ensures the integrity of the data and security. The most typical DBMS is a relational database management system (RDBMS). A DBMS can be thought of as a file manager that manages data in databases rather than files in file systems. A DBMS is usually an inherent part of a database product. On PCs Microsoft Access is a popular example of a single or small-group user DBMS. Microsoft's SQL Server is an example of a DBMS that serves database requests from multiple (client) users. Other popular DBMSs are IBM's DB2, Oracle's line of database management products and Sybase's products.

A computer database relies on software to organize the storage of data. This software is known as a database management system (DBMS). Database management systems are categorized according to the database model that they support. The model tends to determine the query languages that are available to access the database. A great deal of the internal engineering of a DBMS, however is independent of the data model and is concerned with managing factors such as performance, concurrency, integrity and recovery from hardware failures. In these areas there are large differences between products.

Q. What is ER Model?
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 1976s. The ER data model views the real world as a set of basic objects (entities) and relationships among these objects. It is intended primarily for the DB design process by allowing the specification of an enterprise scheme. This represents the overall logical structure of the DB.

When a system analyst sits down to design a new system one crucial task is to identify and state what data needs to be held. From the statement of data requirements a conceptual data model is produced. This describes how the data elements in the system are to be grouped. Three terms are used in building a picture of the data requirements.

Entity: An entity is a thing of interest to an organization about which data is to be held. Examples of entities include Customer, Employee, Stock Item and Supplier etc. 

Attribute: An attribute is a property or characteristic of an entity. Examples of attributes associated with a Customer include Customer ID, Surname, Initials, Title and Address etc.

Relationship: A relationship is a link or association between entities. An example is the link between Physician and Patient; one Physician has many patients but each patient only one Physician.


Q. What are the types of relationship?
There are three different types of relationship between two attributes.

One-to-one: One-to-one relationships occur when there is exactly one record in the first table that corresponds to exactly one record in the related table. Example of such a relationship includes the relationship between Husband and Wife.

One-to-many: One-to-many relationships occur when each record in Table A may have many linked records in Table B but each record in Table B may have only one corresponding record in Table A. Examples include the relationship between Mother and children, between Customer and Order, between Borrower and Library Book.

Many-to-many: Many-to-many relationships occur when each record in Table A may have many linked records in Table B and vice-versa. Examples include the relationship between Student and Course, between Stock Item and Supplier, between Film and Film Star.
Diagrams created using this process are called entity-relationship diagrams or ER diagrams or ERDs for short. The definitive reference for entity relationship modeling is generally given as Peter Chen's 1976.

Q. Explain Entity-Relationship Diagram or ER Diagram with example.
An entity-relationship (ER) diagram is a specialized graphic that illustrates the interrelationships 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.
Example:

Consider the example of a database that contains information on the teacher of a student. The ER diagram shown in the above image contains two entities teacher and student. There is a single "Study" relationship and there is only one attribute associated with each entity. Teacher have name and student have roll number.

Q. What is relational database?
A relational database is a collection of data items organized as a set of formally-described tables from which data can be accessed or reassembled in many different ways without having to reorganize the database tables. The relational database was invented by E. F. Codd at IBM in 1970. A relational database is a set of tables containing data fitted into predefined categories. Each table called a relation contains one or more data categories in columns. Each row contains a unique instance of data for the categories defined by the columns. For example a typical business order entry database would include a table that described a customer with columns for name, address, phone number and so on. A user of the database could obtain a view of the database that fitted the user's needs. For example a branch office manager might like a view or report on all customers that had bought products after a certain date. A financial services manager in the same company could from the same tables obtain a report on accounts that needed to be paid.
We have several different types of Database Management System available. The most common type of DBMS is the relational database widely used on all systems from micros to mainframes. In a relational database data is held in tables called relations and the tables are linked by means of common fields. Conceptually one row of table holds one record each column in the table holds one field or attribute. A table holding data about an entity BOOK may have the following rows and columns:

Picture 1 

There is a standard notation for describing a table in a relational database. For example, to describe the table shown above you would write
BOOK (Book ID, Title, Author, Date Published)
Note that:
  • The entity name is shown in uppercase letters
  • The primary key field (unique identifier) is underlined
  • The attributes are shown in brackets, separated by commas

Q. What are the tasks performed by DBA?
In a database system there is the danger that one user will damage or change data used by other people without their knowledge there is the question of how to protect confidential information, there may be problems if more than one person tries to change the same item of data. If a hardware failure occurs everyone using the database is affected and recovery procedures must ensure that no data is lost. In order to minimize such hazards a group known as database administration or a person in charge of the group known as the database administrator is responsible for supervising both the database and the use of the DBMS.
The DBA's tasks include the following:
  • The design of the database. After the initial design the DBA must monitor the performance of the database and if problems surface, such as a particular report taking an unacceptably long time to produce, appropriate changes must be made to the database structure.
  • Keeping users informed of changes in the database structure that will affect them; for example if the size or format of a particular field is altered or additional fields added.
  • Responsibility for establishing conventions for naming tables, columns, indexes and so on.
  • Implementing access privileges for all users of the database, that is specifying which items can be accessed and/or changed by each user.
  • Allocating passwords to each user.
  • Providing training to users in how to access and use the database.

Q. What is data?
Data is a collection of raw facts, figures and statistics related to an object. Data can be processed to create useful information. Data is a valuable asset for an organization. Data can be use by the managers to perform effective and successful operations of management. It provides a view of past activities related to the rise and fall of an organization. It also enables the user to make better decisions for future. Data is very useful for generating reports, graphs and statistics etc.
Example
Students fill an admission form when they get admission in college. The form consists of raw facts about the students. These raw facts are student's name, father name, address etc. The purpose of collecting this data is to maintain the records of the students during their study period in the college.

Q. What is information?
The manipulated and processed form of data is called information. It is more meaningful than data. It is used for making decisions. Data is used as input for processing and information is the output of this processing.
Example
Data collected from census is used to generate different types of information. The government can use it to determine the literacy rate in the country. Government can use the information in important decisions to improve literacy rate.

Q. What is difference between data and information?
The difference between data and information is as follows:

Data
v  Data is unprocessed raw facts about a particular entity.
v  Data is used as input in the computer.
v  Data is normally huge in its volume.
v  Data is the asset of organizations and is not available to people for sale.        
v  Data is difficult or even impossible to reproduce. For examples if Government lose the data of census if will be almost impossible to reproduce it.
v  Data is used rarely.
v  Data is an independent entity.

Information
v  Information is processed form of date.
v  Information is the Output of computer.
v  Information is normally       short   in its volume.
v  Information is normally       available to people for sale.
v  Information is easier to reproduce it lost. For example if the list of illiterate citizens is lost it can be reproduced easily because the data is still stored.
v  Information is used frequently.
v  Information depends on data.

Q. What is data processing?
The process of manipulating data to achieve the required objectives and results is called data processing. The software is used to process raw data. The software converts raw data into meaningful information. A series of actions or operations are performed on data to get the required output or result.

Q. What activities are involved in data processing?
Different activities involved in data processing are as follows:

Data Capturing
The process of recording the data in some form is called data capturing. Data is captured before it can be processed. Data may be recorded on source documents. Data can also be given directly to the computer through input devices.

Data Manipulation
The process of applying different operations on data is called data manipulation. The following operations can be performed on data:
  • Classifying: The process of organizing data into classes or groups is called classifying. For example the data in a college can be classified in two groups. The data of students may be in one group and data of teachers may be in second group.
  • Calculations: The process of applying arithmetic operations on data is called calculations. The common calculations are addition, subtraction, multiplication and division etc.
  • Sorting: The process of arranging data in a logical sequence is called sorting. The data can be sorted numerically or alphabetically.
  • Summarizing: The process of reducing a large amount of data in a more concise and usable form is called summarizing. For example people deposit money in banks daily. The data of bank can be summarized to show the total money deposited in a particular month instead of showing all deposits.

Managing Output Result
The following activities can be performed on data after the data has been captured and manipulated.
  • Storage: The process of retaining data for future use is called data storage. Different storage medium are used to store the data such as hard disks and tapes etc.
  • Retrieval: The process of accessing or fetching the stored data is called data retrieval. The data can be retrieved as and when required. The retrieved data can be displayed in different forms such as reports, graphs and charts etc.
  • Communication: The process of transferring data from one location to another is called data communication. The data may be transferred to different locations for further processing. For example the result can be sent to the students via email.
  • Reproduction: The process of copying or duplicating data is called reproduction of data. Data can be reproduced if different users need data at different locations.

Q. What are the types of database?
There are four types of databases.
Type
Description
Individual
Integrated file used by just one person.
Company
Commonly used files.
Distributed
Database spread in geographically & accessed using database serves.
Property
Information utilities or database bank available to user on wide range topics.

Individual Database
Individual database is also called a microcomputer database. It is a collection of integrated file used by just one person. Typically the data & the DBMS are under the direct control of the user. They are stared either on the user's hard-disk or on a LAN file serves. They may be many times in our life when you will find this kind of database valuable. For example, if you are in sales a microcomputer database can be used to keep track of customers. If you are a sales manage you can keep of your sales people & their performance. If you are an advertising account executive you can keep track of charge each client.

The Company or Shared Database
Companies of caused create database for their own use. The company database may be stared on a mainframe & managed by a computer professional known as a database administrator. User thought the company has access to the database through their microcomputers linked to local area network or wide area network. Company database are of two types.
  • The Common Operational Database: It contains details about the operation of the company such as inventory, production & sales. It contains data describing the day to day operation of the organization.
  • The Common User Database: It contains selected information both from the common operational database & from outside private (proprietary) database. Managers can tap into this information on their microcomputer or terminals & use it for decision making. Company database are the foundation for management information systems. For example, a departmental store can record all sales translations in the database. A sales manage can use information to see which sales people are selling the most products. The manger can then determine year end sales bonuses or the store buyers can learn which products are selling well or not selling & make adjustment when recording. A top executive might combine over all store sales trends with information form outside database about consumer & population trends. This information could be uses to change the whole strategy of the store.

The Distributed Database
Many times data in a company is stored not in just one location but in several locations. It is made accessible through a variety of communications networks. The database then is a distributed database that it is located in a place or places other then where users are located. Typically database servers on a client/servers network provide the link between users & the distant data.

The Proprietary Database
A proprietary database is generally a database that an organization developed to cover certain particulars subject. It offers access to this database to the public or outside individuals sometimes proprietary database are called information utilities or data banks.

Q. What is database approach?
A database system is a computer-based system to record and maintain information. The information concerned can be anything of significance to the organization for whose use it is intended. The contents of a database can hold a variety of different things. To make database design more straight-forward databases contents are divided up into two concepts:
*       Schema
*       Data

Q. What is schema?
The Schema is the structure of data whereas the data are the facts. Schema can be complex to understand to begin with but really indicates the rules which the data must obey. Imagine a case where we want to store facts about employees in a company. Such facts could include their name, address, date of birth and salary. In a database all the information on all employees would be held in a single storage container called a table. This table is a tabular object like a spreadsheet page with different employees as the rows and the facts with their names called as columns. Let's call this table SALARY and it could look something like:

Name
Address
Date of Joining
Salary
Maria
Brewery Road
Jan 10, 2008
18,000/-
Hira
Jinnah Road
Mar 15, 2009
15,000/-
Salman
Prince Road
Mar 10, 2009
10,000/-

From this information the schema would define that SALARY has four components NAME, ADDRESS, DOJ and SALARY. As designers we can call the columns what we like but making them meaningful helps. In addition to the name we want to try and make sure that people don't accidentally store a name in the DOJ column or some other silly error. Protecting the database against rubbish data is one of the most important database design steps and is what much of this course is about. From what we know about the facts we can say things like:
  • NAME is a string and needs to hold at least 25 characters.
  • ADDRESS is a string and needs to hold at least 40 characters.
  • DOJ is a date.
  • SALARY is a number. It must be greater than zero.

Such rules can be enforced by a database. During the design phase of a database schema these and more complex rules are identified and where possible implemented. The more rules the harder it is to enter poor quality data.
User Types
When considering users of a Database system, there are three broad classes to consider:
  • The application programmer responsible for writing programs in some high-level language such as COBOL, C etc.
  • The end-user who accesses the database via a query language
  • The database administrator (DBA) who controls all operations on the database.

Q. What is the database architecture?
DBMS don't all conform to the same architecture.
  • The three-level architecture forms the basis of modern database architectures.
  • This is in agreement with the ANSI/SPARC study group on Database Management Systems.
  • ANSI/SPARC is the American National Standards Institute/Standard Planning and Requirement Committee.
  • The architecture for DBMS is divided into three general levels: external, conceptual and internal.

Q. What is field?
A field is a combination of one or more characters. It is the smallest unit of data that can be accessed by the user. A field is identified uniquely by field name. The data type of a field specifies the type of data that can be stored in the field. A field size defines the maximum number of characters that can be stored in a field.

Q. What is record?
A collection of related fields treated as a single unit is known as record. For example a student's record includes a set of fields about the student such as Student Roll No., Student Name, Class and Section etc.

Q. What is file?
A collection of related records treated as a single unit is known as file. Files are stored in disk hard disk, CD-ROM or DVD-ROM etc. A Student file may contain the records of hundreds of students. Each student's record consists of same fields but each field contains different data.

Q. What are the types of files from usage point of view?
The types of files from usage point of view are as follows:

Master File
The master files are the files which are latest updated files. These files are never empty since they are created. Master files are used to store the information that remains constant for a long period of time.

Transaction File
A type of file that is used to store data before processing is called transaction file. It may be temporary file and may exist until the master file is updated. If may also be used to maintain a permanent record of the data about a transaction.

Backup File
A type of file that is used to take backup important data is called backup file. It is a permanent file. It is used to store an additional copy of data. The data can be recovered from this file in case of loss of original file. Backup files are mostly created by using specific software utilities.

Q. What are types of files from function point of view?
The files are given proper names from functional point of view. It consists of file name and file extension. The name and extension of a file is separated by dot. The extension is normally assigned by the software in which the file is created. The types of files from functional point of view are as follows:

Program File
A type of file that contains the software instructions is called program file. The source program files and executable files are examples of program files. The source program file may have an extension of .com. The executable files may have an extension of .exe.

Data File
A type of file that contains data is called data file. Data files are created by software being used. Some examples of data files are as follows:



Software
File Type
File Extension
Notepad
Text File
.txt
Word Processor
Document File
.doc, .rft
Spread Sheet
Worksheet
.xls, .wks
Database
Data File
.dat, .dbf, .mdb
Image
Image File
.jpg, .gif, .tif
Audio Software
Audio File
.wav, .mid
Video Software
Video File
.avi, .mpg

Q. What is database?
A database is a collection of logically related data sets or files. These files are normally of different natures and are used for specific purposes. The files may be organized in different ways to meet different processing and retrieval requirements of the users
Example:
A bank may have separate files for the clients as follows:
  • Saving A/C
  • Automobile  Loan
  • Personal Loan
  • Clients Biographic Information etc.

The client database of bank will consist of the records from all of the above files. The data of any client can be added, retrieved or updated by using series of programs. A database system is a computerized record-keeping system. It can be considered as an electronic file cabinet a warehouse or a repository to collect computerized data files. A database is a tool for collecting and organizing information. Databases can store information about people, products, orders or anything else. Many databases start as a list in a word-processing program or spreadsheet. As the list grows bigger redundancies and inconsistencies begin to appear in the data. The data becomes hard to understand in list form and there are limited ways of searching or pulling subsets of data out for review. Once these problems start to appear it's a good idea to transfer the data to a database created by a database management system (DBMS) such as Office Access. A computerized database is a container of objects. One database can contain more than one table. For example an inventory tracking system that uses three tables is not three databases but one database that contains three tables. Unless it has been specifically designed to use data or code from another source an Access database stores its tables in a single file, along with other objects, such as forms, reports, macros and modules. Databases created in the Access format have the file extension .dbf and databases created in earlier Access formats have the file extension .mdb. Using Access you can:
  • Add new data to a database such as a new item in an inventory
  • Edit existing data in the database such as changing the current location of an item
  • Delete information perhaps if an item is sold or discarded
  • Organize and view the data in different ways
  • Share the data with others via reports e-mail messages, an intranet, or the Internet.

Q. What are facilities of database system?
A database system normally provides the following facilities to the user:
  • Adding new files to database
  • Inserting new data in existing files
  • Retrieving data from existing files
  • Updating data in existing files
  • Deleting data from existing files
  • Removing existing files from database

Q. What are four major components of database systems?
The four major components of database system are as follows:

Data
Data is the most important component of database system. The word data covers the collection of facts stored in the database. The basic purpose of a database system is to store, maintain and process data for the user.

Hardware
The physical components of a computer system are known as hardware. The hardware is used to perform different tasks such as input, output, storage and processing. Some important hardware components are as follows:
  • Secondary Storage
  • I/O Devices
  • Device Controllers
  • I/O Channels
  • Processors
  • Main Memory

Software
Software refers to the collection of programs used by computer within a database system. The most important software is DBMS itself. It takes three types of software to enables the database system function fully. These are as follows:
  • Operating System Software: It manages all hardware components. It also enables all other software to run on the computer.
  • DBMS Software: It manages the database in the database system.
  • Application Programs and Utilities: These are used to access and manipulate the data stored in the database.

Personnel
The people related to the database system are called personnel. Different types of persons in a database system are as follows:
  • Database Administrators: They manage DBMS's use and ensure that database is functioning properly.
  • Analysts and Programmers: They design and implement the application programs, data entry screens and reports etc.
  • End Users: They are the people who use application programs to run daily operations of the organization. They include clerks, managers and directors etc.

Q. What are different objectives of the databases?
The main objectives of using databases

Data Integration
The information in a database is coordinated from different files and operated on a single file. The data may be located at different devices. Data may be scattered over different locations physically but it is connected through data communication links. It makes the information is centralized logically.

Data Integrity
Data integrity means the reliability and accuracy of data. Integrity rules are designed to keep the data consistent and correct. These rules act like a heck on the incoming data. It is very important that a database maintains the quality of the data stored in it. DBMS provides several mechanisms to enforce integrity of the data in a database. Enforcing data integrity ensures the quality of data in the database. For example, if a STUDENT Roll Number is entered as "0639", this value should not be entered again. The Roll number should not be assigned to two or more students.

Data Independence
Database approach provides the facility of data independence. It means that the data and the application programs are separate from each other. The user can change data storage structures and operations without changing the application programs. The user can also modify programs without reorganization of data.

Q. What are the different types of databases models?
There are three types of logical database models. These models are as follows:
Hierarchical Model
The hierarchical model has the general shape of an organizational chart. A node on the chart represents a particular entity. Each node is a subordinate of the node that is at the next highest level. This kind of structure is often called inverted tree. The top-most node is called root.
Network Model
The network model is similar to hierarchical mode. The major difference is that subordinate entities may participate in as many subordinate relationships as required. The subordinate entities are depicted by arrows in network mode. It requires more complex diagram to represent a database. It also provides more flexibility than simple hierarchical Mode.
Relational Model
The relational model consists of simple relations. The relations have no structural or physical connection like the connection in hierarchical or network models. Various entities have interrelationships as depicted by diagram that resembles with network diagram. These relationships are based on the data content of the entities not by pointer chains or other structural connection techniques.

Q. What is database management system (DBMS)?
A database management system (DBMS) is a collection of programs that are used to create, maintain and access database in convenient and efficient manner. DBMS is an improvement over the traditional file management system. DBMS uses database manager software to control the overall structure of a database. The DBMS is normally used for large or medium organizations that use different types of files.

Q. What are the objectives of DBMS?
Some important objectives of database management system are as follows:

Shareability
Shareability means that the actual data must be shared among different people and different processes at the same time.

Availability
Availability means that the users must be able to access data and DBMS easily.

Evolvability
Evolvability means that DBMS must be able to change due to increase in user requirements and advancement in the technology.

Database Integrity
Data is normally shared among different users. Some adequate control measures must be maintained to ensure data integrity.

Q. What are the different features of DBMS?
Some important features of database management system are as follows:

Data Dictionary
Some databases have data dictionary procedures document or disk file. It is used to store, data definitions or description of the structure of data used in database. It may also monitor the data that is entered. It ensures that data is according to the data definition rules. The rules include field mimes, field sizes and data types etc. Data dictionary can also be used for data access authorization for database users:

Utilities
DBMS utilities are small software programs. They are used to maintain the database by manipulating data, records and files. Some utilities are used for backup and recovery procedures of databases.

Query Language
A query language is used to interact with databases. The most popular query language is SQL. It stands for Structure Query Language. The statements of SQL are written in simple English-like sentences. Some important commands of SQL are SELECT, DELETE, CREATE, MODIFY, UPDATE and INSERT etc.

Report Generator
A report generator is a program that is used to produce reports. It retrieves data from database and displays it in different formats. The report format can be specified in advance such as row heading, column heading and page heading etc. The non-expert users can also produce useful and attractive reports by using report generator.

Access Security
Access security refers to the protection of database from unauthorized access. It may include password and access restrictions. Database management system provides the facility of access security. The database administrator can assign specific access privileges to different users of database.

Backup and Recovery
Database management system provides sophisticated mechanisms for backup and recovery. This facility is an important difference between true DBMS and a software package. A DBMS contains a logging or recording mechanism. This mechanism captures information when the data in a database is changed. A utility in DBMS is used to recover data. The utility rebuilds the data by using the backup copy of the data.

Q. What are the advantages of DBMS?
Some important advantages of database management system are as follows:

Data Independence
Database approach provides the facility of data independence. It means that the data and the application programs are separate from each other. The user can change data storage structures and operations without changing the application programs. The user can also modify programs without reorganization of data.

Support Complex Data Relationships
Database management system allows the user to design complex data structures. It enables the user to logically view and access data in different ways. The complexity of data structures greatly enhances the ability of a designer to put data where it belongs. It also provides a path to that data whenever required.

Sophisticated Data Security Features
Database management system provides enhanced Security mechanisms for access to data. The security mechanisms allow the user to add extensive security features in the database. For example, a user can see the records in a file and data in the records only if he has Read access to a file. The access rights of each application program can be specified explicitly. The rights include read, write, update and delete. The security measures can be applied to field level.

Database Backup & Recovery
Database management system provides sophisticated mechanisms for backup and recovery. This facility is an important difference between true DBMS and a software package. A DBMS contains a logging or recording mechanism. This mechanism captures information when the data in a database is changed. A utility in DBMS is used to recover data. The utility rebuilds the data by using the backup copy of the data.

Advanced Capabilities
Database management also provides advance access capabilities for online and ad hoc reporting.

Q. What are the disadvantages of DBMS?
Some important disadvantages of database management system are as follows:

Additional System Overhead
Database management system requires additional overhead to access data. The overhead is required even in simple jobs like reading and processing a file.

Additional Training
The application programmers require additional training to develop really efficient, programs. The untrained and less-experienced developers may develop inefficient database system. An inefficient system may createinany problems for the users and the organization.

Problems in Case of Wrong Database Environment
A database system may be changed later due to change in requirements. The change can be costly in terms of conversion and testing of existing programs. Hierarchical system is particularly more sensitive than other systems in such situation. It requires a lot of cost to implement changes. The changes in relational databases are easier to implement. It means that problems may increase later if wrong type of database environment is selected.

Need of Data Dictionary
Another overhead on DBMS is the need of a data dictionary. Data dictionary is used to share data across application systems. It also enables the users to identify the location of required information. It is also used to store the internal data of a company in a consistent manner.

Q. What is a key?
A key is a single or combination of multiple fields. Its purpose is to access or retrieve data rows from tables according to the requirement. The keys are defined in tables to access or sequence the stored data quickly and smoothly. They are also used to create links between different tables.

Q. What are the types of keys?
Different types of keys used in databases are as follows:

Q. What is Primary Key?
The attribute or combination of attributes that uniquely identifies a row or record in a relation is known-as primary key. The attribute Roll No uniquely identifies each student. It can be used as primary key for this table. The attribute Student Name cannot uniquely identify each row because two students can have same name. It cannot be used as primary key.

Q. What is Secondary Key?
A field or combination of fields that is basis for retrieval is known as secondary key. Secondary key is a non-unique field. One secondary key value may refer to many records. For example, an attribute class in student table can be used to display all students who are studying a particular class. In this case, CLASS will be used as secondary key.

Q. What is Candidate Key/Alternate Key?
A relation can have only one primary key. It may contain many fields or combination of fields that can be used as primary key. One field or combination of fields is used a primary key. The fields or combination of fields that are not used as primary key are known as candidate key or alternate key. The user can also access data by using an alternate key. For example if Student relation contains a field Roll No, it can be used as primary key because one Registration No can be assigned to only one student. Suppose the relation contains another field Roll No that has been used as primary key. In this situation, Registration No becomes an alternate key.

Q. What is Composite Key/Concatenate Key?
A primary key that consists of two or more attributes is known as composite key. For example the following relation uses two fields Registration No and Subject to identify each tuple. This is an example of composite key.

Q. What is Sort/Control Key?
A field or combination of fields that is used to physically sequence the stored data called sort key. It is also known as control key. The stored data can be sorted in differ ways according to the user requirement.

Q. What is Foreign Key?
A foreign key is an attribute or combination of attributes in a relation whose value matches a primary key in another relation. The table in which foreign key is created is known as dependent table. The table to which the foreign key refers is known as parent table. The key connects to another relation when a relationship is established between two relations. A relation may contain many foreign keys.

Q. What is User/Ender User?
A user or end user is a person who uses computers for his specific needs. He might have a moderate knowledge of computers computer science and information technology. He does not need to know in-depth knowledge of computer system. But he must be aware of the installed software which he wants to Use. The general requirements of a common user are as follows:
  • Entertainment
  • Education
  • Professional tasks etc,

Q. What is Data Administrator?
A data administrator is a person who is responsible for entire data of an organization. He normally develops the overall functional requirements for the database being used in the office. He controls and manages the whole database system. He establishes data standards and supervises the data distribution within the organization. He also communicates with l he user when necessary. He should also participate in developing the data dictionary prepare documentation and conduct user training. Normally the data administrator serves as a bridge between users and data processing staff. He authorizes access to the database as well as coordinates and monitors the use of database.

Q. What is Database Administrator?
A database administrator is an important person in development of any database system. He is responsible for the design, implementation, operation, management and maintenance of database. He must be technically competent good manager and skilled diplomat. He should have good communication skills. Managerial skills are important in planning, coordinating and carrying out different tasks. Technical skills are required to understand the complex hardware and software issues. Diplomatic skills are important in communicating with users, determining their needs and negotiating agreements etc. Database administrator is responsible to ensure proper database access and security. He is also responsible to maintain and fine-pine the functionality of database.

Q. What are the responsibilities of Database Administrator?
The database administrator (DBA) is the person responsible for overall control of the database system. The DBA's responsibilities include the following:
  • Deciding the information content of the database i.e. identifying the entities of interest to the enterprise and the information to be recorded about those entities. This is defined by writing the conceptual schema using the DDL.
  • Deciding the storage structure and access strategy i.e. how the data is to be represented by writing the storage structure definition. The associated internal/conceptual schema must also be specified using the DDL.
  • Liaising with users i.e. to ensure that the data they require is available and to write the necessary external schemas and conceptual/external mapping.
  • Defining authorization checks and validation procedures. Authorization checks and validation procedures are extensions to the conceptual schema and can be specified using the DDL.
  • Defining a strategy for backup and recovery. For example: periodic dumping of the database to a backup tape and procedures for reloading the database for backup. Use of a log file where each log record contains the values for database items before and after a change and can be used for recovery purposes.
  • Monitoring performance and responding to changes in requirements i.e. changing details of storage and access thereby organizing the system so as to get the performance that is 'best for the enterprise.

Q. What is data analysis?
Data analysis is an important aspect of analysis while designing a database. It involves the following activities:
  • Data Flow Diagram's (DM)
  • Decision Tables
  • Decision Trees

Q. What is data modeling?
A representation of real world objects, events and their associations is called a model. The model helps the user to understand the complexities of the real world environment. The data modeling is a process of identifying data objects and the relationships between them.

Q. What are the ingredients of data modeling?
The ingredients of data modeling are as follows:-
  • Entity / Object
  • Attribute
§  Relationship

Entity / Object
Anything that is participating in the system is known as data entity or object. Some examples of entities are TEACHER, STUDENT, CLASS etc.
Attribute
The characteristics of an entity are called attributes or properties. Some examples of attributes of TEACHER are Name, Gender and Telephone No. etc.
Relationship

A logical connection between different entities is called relationship. For example a relationship exists between a STUDENT and TEACHER because teacher teaches student.


No comments:

Post a Comment