Tuesday, 24 May 2016

DU BA PROGRAMME COMPUTER APPLICATION - 2ND SEMESTER NOTES

Computer tutor  - 9910-174-184 ( A.K.SINGH )



Q1. What is a Database Management System?

A Database Management System or DBMS is a single or set of computer programs that are responsible for creating, editing, deleting and generally maintaining a database or collection of data records. They type of database management system is determined by the database model. A database model is the manner in which the data collection is stored, managed and administered. The various database management systems based on these data models are:


Q2. What is different type of Database ?

Different Types of Databases


1. Relational Databases -

A relational database (RDB) is a collective set of multiple data sets organized by tables, records and columns. RDBs establish a well-defined relationship between database tables. Tables communicate and share information, which facilitates data search ability, organization and reporting.

RDBs use Structured Query Language (SQL), which is a standard user application that provides an easy programming interface for database interaction.

RDB is derived from the mathematical function concept of mapping data sets and was developed by Edgar F. Codd.

Data must be stored and presented as relations, i.e., tables that have relationships with each other, e.g., primary/foreign keys.

2.  Network data model

In the network data model, the database consists of a collection of set-type occurrences.

Each set-type occurrence has one occurrence of OWNER RECORD, with zero or more occurrences of MEMBER RECORDS.

The member sets belonging to different owners are disjoint.

To define a network database one needs to define:
(a) the database record types which consist of data items, and
(b) the set-types. 

The Network model replaces the hierarchical tree with a graph thus allowing more general connections among the nodes. The main difference of the network model from the hierarchical model, is its ability to handle many to many (N:N) relations. In other words, it allows a record to have more than one parent. Suppose an employee works for two departments. The strict hierarchical arrangement is not possible here and the tree becomes a more generalized graph - a network. The network model was evolved to specifically handle non-hierarchical relationships. As shown below data can belong to more than one parent. Note that there are lateral connections as well as top-down connections. A network structure thus allows 1:1 (one: one), l: M (one: many), M: M (many: many) relationships among entities.

3.  Hierarchical Model

Data models that are hierarchical organize data items into structures that look like trees, where items of data at higher levels exist over items that are a level lower. Items that are related exist on the same level. Items that are a level higher than the current level are items called ‘parents.’ In the same way, ‘children’ is the term used for items on a lower level. ‘Root’ is the term used in the upper most regions. When you traverse a hierarchical model in DBMS, you can begin at the root and branch downwards. You can quickly update the structure of a hierarchical DBMS because of how the items are organized and defined.

In this model each entity has only one parent but can have several children . At the top of hierarchy there is only one entity which is called Root.

Object Oriented Data Models in DBMS

Compared to other DBMS data models, a database that is object-oriented can hold different data types, such as video, audio or graphics files. These objects consist of the data piece itself and methods, which are the DBMS instructions giving you the details of how an object should be handled. Because of the amount of structure and storage space they require, DBMS of this types tend to cost more to implement. On the other hand, these offer a big advantage over other DBMS types due to the allowable data flexibility. This type of DBMS is able many new types of data including video, audio, photographs and graphics. This type of data represents a significant advance over their other cousins in the database. Network and hierarchical database are all made to handle data that is structured, which is data the nicely fits into columns, rows and fields. These come in handy for handles information in smaller snippets such as zip codes, product numbers, addresses, names and any other number or statistic you can think of. On the other hand, this DBMS can also be utilized for storing data from various sources of media such as text and photographs and produce output work in a format of multimedia.

Q4. What is component of DBMS ?

Components of DBMS
DBMS have several components, each performing very significant tasks in the database management system environment. Below is a list of components within the database and its environment.
1. Software
The main component of a DBMS is the software. It is the set of programs used to handle the database and to control and manage the overall computerized database
  1. DBMS software itself, is the most important software component in the overall system
  2. Operating system including network software being used in network, to share the data of database among multiple users.
  3. Application programs developed in programming languages such as C++, Visual Basic that are used to to access database in database management system. Each program contains statements that request the DBMS to perform operation on database. The operations may include retrieving, updating, deleting data etc . The application program may be conventional or online  workstations or terminals.
Q5. What is Data Dictionary ?

In database management systems, a file that defines the basic organization of a database. A data dictionary contains a list of all files in the database, the number of records in each file, and the names and types of eachfield. Most database management systems keep the data dictionary hidden from users to prevent them from accidentally destroying its contents.
Data dictionaries do not contain any actual data from the database, only bookkeeping information for managing it. Without a data dictionary, however, a database management system cannot access data from the database.



Computer tutor  - 9910-174-184 ( A.K.SINGH )


SQL Commands:

SQL commands are instructions, coded into SQL statements, which are used to communicate with the database to perform specific tasks, work, functions and queries with data.

SQL commands can be used not only for searching the database but also to perform various other functions like, for example, you can create tables, add data to tables, or modify data, drop the table, set permissions for users. SQL commands are grouped into four major categories depending on their functionality:

  • Data Definition Language (DDL) - These SQL commands are used for creating, modifying, and dropping the structure of database objects. The commands are CREATE, ALTER, DROP, RENAME, and TRUNCATE.
  • Data Manipulation Language (DML) - These SQL commands are used for storing, retrieving, modifying, and deleting data. 
    These Data Manipulation Language commands are: SELECTINSERTUPDATE, and DELETE.
  • Transaction Control Language (TCL) - These SQL commands are used for managing changes affecting the data. These commands are COMMIT, ROLLBACK, and SAVEPOINT.
  • Data Control Language (DCL) - These SQL commands are used for providing security to database objects. These commands are GRANT and REVOKE.

System catalog in DBMS:




System catalog is a collection of tables in a database which are used by the DBMS for describing the structure of the database. System catalog is created automatically whenever a database is created. System catalogs can also be accessed by the users of the database. A user can access the system catalog to get more info about the structure of a database. However, a user can only read the system catalog and he can’t modify it. Since modifying the system catalog will result in the modification of the structure of the entire database. System catalog can also be used to access query tools where a user can select different tables easily.
System catalog tracks the details of the following database objects:
1) Columns: System catalog maintains all the necessary information related to every column in a database. For Example, name of a column, associated table, size, data type, etc.
2) Tables: A system catalog maintains all the necessary information related to every table in a database. For Example: name of a table, owner, size, number of columns, etc.
3) Views: System catalog maintains all the necessary information related to every view in a database. For Example: name, owner, query which defines the view, etc.
4) Users: System catalog maintains all the necessary information related to every user in a database. For Example: user name, password, etc.
5) Privileges: It maintains all the necessary information related to every set of privileges in a database. For Example: name of grantor, name of grantee, privileges granted, object on which privileges are granted, etc.

Multivalued Attribute

A multivalued attribute can have more than one value at a time for an attribute. For ex., skills of a surgeon is a multivalued attribute since a surgeon can have more than one skill.

Problem with multi-valued attributes


Multi-valued attributes make sorting data in a database extremely difficult, if not impossible. They must be resolved, and there are two ways to do so: create additional attributes for an entity, or create an entirely new entity. 

Now consider the same Customer entity with a Phone attribute. If two telephone numbers are entered as data values (perhaps a business phone number and a home phone number) for the Phone attribute, this constitutes a multi-valued attribute.


Ques 1. Define dbms and file management system ?
Ans- Database management system (DBMS) is a collection of interrelated data and a set of programs to access those data. Some of the very well known DBMS are Microsoft Access, Microsoft SQL Server, Oracle, SAP, dBASE, FoxPro, IBM dB2, SQLite etc.
A file management system is an abstraction to store, retrieve, management and update a set of files. A File Management System keep track on the files and also manage them. Let’s take an example of hierarchical Management System using its directories manage the different files in a tree structure.
File Management Systems and DBMS
DBMS and File Management
Ques 2. What are the disadvantages of file management system over DBMS ?
Ans- The disadvantages of file management systems over DBMS are:
a) Data redundancy and inconsistency
b) Difficulty in accessing data
c) Data isolation
d) Integrity problems
e) Atomicity problems
f) Concurrent access anomalies
Ques 3.  Which have more quick response DBMS or file management system ? how ?
Ans- Fast response to information requests: Because data are integrated into a single database,
complex requests can be handled much more rapidly if the data were located in separate,
non-integrated files. In many businesses, faster response means better customer service.
Ques 4. How DBMS provide program data insulation and data abstraction?
Ans- DBMS provide following levels of data abstraction
a) Physical level
b) logical level
c) view level
Ques 5. Is there any difference between DBMS and file management system in terms of ACID properties?
Ans- DBMS ensures data integrity by managing transactions through ACID test = atomicity, consistency, isolation, durability. While such integrity is absent in file management system.
Ques 6. What are the advantages of DBMS over file management system ?
Ans- The advantages of DBMS over file management system are:
a) Control redundancy
b) Restrict unauthorized access
c) Provide multiple user interfaces
d) Enforce integrity constraints.
e) Provide backup and recover
Ques 7. What are basic differences between DBMS and file management system ?
Ans- These are basic differences between DBMS and file management
1) Flexibility
2) Fast response to information requests
3) Multiple access
4) Lower user training costs
5) Less storage
Ques 8. Is there any goal differences in file management system and DBMS ?
Ans- Following are the goal differences between File Management System and DBMS-
1) Data Management- An FMS should provide data management services to the application. Generality with respect to storage devices. The FMS data abstractions and access methods should remain unchanged irrespective of the devices involved in data storage.
2) Validity- An FMS should guarantee that at any given moment the stored data reflect the operations performed on them.
3) Protection- Illegal or potentially dangerous operations on the data should be controlled by the FMS.
4) Concurrency- In multiprogramming systems, concurrent access to the data should be allowed with minimal differences.
5) Performance- Compromise data access speed and data transfer rate with functionality.
Ques 9. Which one take utilization of resources DBMS or file management system and how ?
Ans- Database is multi user and provides utilization of resources whereas in file management there is no utilization of resources.

Ques 10. How data redundancy is controlled in DBMS while not in file management system ?
Ans- It reduces data redundancy (duplication of data) and maximizes database integrity (data without errors). So DBMS is less redundant than file management system.