Cahpter :- Data Base Management System

advertisement
Chapter
Database Management
Q1. Define data, data base and information
Data:Data are the raw materials for information which are processed to get desired result. Data
can be text, audio, video, images or any combination of these. Data describes the
attributes of any real world object, which explains the feature behavior of that object.
There are many ways to collect data including surveys, interviews, questionnaire, reading
documents etc. In its raw form, data may or may not be useful to the decision maker.
Quite frequently data must be processed to become useful
Database:A collection of data stored in a standardized format designed to be processed, shared by
different users is called database
It is also defined as a collection of inter-related relevant data stored together to serve
multiple applications .A data may have single table or multiple table .The data in a
database are organized in rows and columns
- Rows are called records
- -Columns are called field or attributes
Information:Information is the output of data processing operation. When we process data
and convert it into a form that is useful to the decision-maker, it becomes information
Human beings apply facts, principles, knowledge, experience and intuition to convert
data into information .Information is time dependent since its values and usefulness often
decrease with time
Q2. Defines database management system? What are the objectives of database
management system (DBMS?)
It is software that defines a database, stores the data supports a query language, produce
reports and creates data entry form. It provides the data to the users which they ask for
In other words DBMS is an application programs that provides an interface between the
operating system and the user in order to make access to the data as simple as possible
Objectives of DBMS
a. To provide huge storage or space for relevant data
b. To allow easy access to the data for the user.
c. To provide quick response to user request for any information or data.
d. To allow updating with the latest modification in the database.
e. To remove duplicate data.
f. To allow multiple users to be active at one time.
g. To allow the growth of database system.
h. To provide maximum protection to data from any physical damage and
unauthorized access
Database Management System
Page 1
Q3. Define the term field or record with example in term of database management
system (HSEB 2058)
Field: - A field is piece of information of an individual or an object such as person,
client, employee, book etc. this is the unit title of data record. Each unique type of
information is stored in its own field
For example: - In student_record Rollno, name, class address are called field
Record: - A record is complete information of an individual or an object such as person,
client, employee, book etc. A record can have much information under separate headings
called fields
For example: - In student _record all the information or complete information of one
student is called one record
Q4.Write short notes on:Table: - A complete collection of records is called table. A table contains rows and
columns. Each column of a table is called field and each row is called record
For example: - Table: Student_record
Rollno
Name
Class
Address
Telephone
Gender
1
2
3
4
Ram
Sita
Suman
Sunita
XI
XI
XI
XI
Baneshwor
Maitidevi
Banasthali
Sanepa
9856454416
014478493
014356789
9851045678
Male
Female
Male
female
In the above table Rollno, names are the field
And 1, ram, XI, baneshwor, 9856454416, male are completely called record
Q5. What is key? Define primary key and foreign key
Ans:-A key is field or column in a table that is used to uniquely identify records
In other words a key is an attribute whose values uniquely identify
each entity instance
For example: - An entity student can be uniquely identified by a roll no
An entity person can be uniquely identified by citizenship number
Primary key:Primary key is a field or column that uniquely identify records in a table
In other words primary key is that candidate key which will most
commonly be used uniquely to identify a single entity instance
Database Management System
Page 2
For example: - In student record Roll no is the primary key
Alternate Key: An alternate key is any candidate key that is not the part of
primary key. Alternate keys are sometimes referred as secondary
keys
Candidate Key: A candidate key is a key that uniquely identifies record in a table.
Any of the identified candidate keys can be used as the table's
primary key.
Foreign key: - A field or column in one table that refers to the primary key field
in another table is called foreign key In other words foreign key
is a primary key of one entity that is contributed to another entity
to identify instances of a relationship
Define the following term: Domain: - Domain is a range of values from which the actual values appearing in
a given column are drawn. A domain describes the set of possible
values for a given attribute and can be considered a constraint on the
value of the attribute.
 Schema: - A database schema is a logical description of each piece of data and its
relationship with other data elements.
 Entity: - An entity is a class of a person place or an object
 Attributes: - The characteristics of an entity is called attributes
 Example: - roll, name address total etc
 Tuple: A row in a relation (table) is called tuple.


Relationship: - A relationship is an association among several entities and
represents meaningful dependencies between them
Query: Query is to ask question about the data present in table. Using
query facility, we can view records or data, modify the content of
table, provide data sources to form and reports and lot more.
Q6. What are the different types of relationship?
Ans: The association among two or more than two entities is called relationship.
There are all together three types of relationship they are fallows:a) One to one relationship:- A single instance of an entity is
associated with a single instance of another entity is known as
one to one relationship . For example:- one teacher teaching one
subject
Database Management System
Page 3
b) One to many relationships:-An instance of an entity is
associated with several instances of another entity is known as
one to many relationships. For example:- teacher and students
c) Many to many relationship :- Many instances of an entity are
associated to many instances of another entity is known as many
to many relationship For example:- student and class ( A class
may contain many students and a student study in many classes)
Q7. Explain the term data dictionary in relation to database?
Ans: - Data dictionary is a sub- system of DBMS to keep track of the definition of
all the data items in the databases and helps the developers and users in finding
the necessary data. In other data dictionary is a master table which contains data
about all the databases in a database system. It is a valuable source of information
for end users and developers to find out what data is available, what the data
means and where and how to get it. The data stored in the data dictionary are also
called metadata or data about data. An example is MSACCESS holds data
dictionary as a set of system table called MSSYS object. Data dictionary contains
information such as:a. What table and column are included in the present structure
b. Name of current table and column
c. The characteristics of each item of data, such as its length and data
type
d. Any restriction on the values of certain columns.
e. The relationships between items of data
f. Which program access which item of data
Q8. What is RDBMS? What is Normalization? Why Normalization is
important is RDBMS?
Ans:- It is the DBMS in which relation between different tables can be formed
using a common field (which we called a key) Relational database implements
data in a series of two dimensional tables (tables having rows and column, rows
means record and column means field). RDBMS allows us to enter, store
manipulate and retrieve information organized into database table and sometime
which we called relation. IT also provides the interface between the user and the
data in the database.
Normalization is the process of presenting the database tables without any
duplication of information and simplification of tables without loss of
information. It can also be said that normalization is the process of organizing
data in a database to reduce the redundancies. The process of normalization
Database Management System
Page 4
include both creating tables and establishing relationship between those tables
using rules designed to protect the data and to make the database more flexible.
Normalization is important in RDBMS because
1) It reduces the size of the database by breaking the table into two or more tables to
reduce the redundancy in the database
2) It simplifies and organize the table
3) It reduce the loss of information
4) It eliminates the repeating and conflicting data related to the same entity
5) It improves the performance of the system
6) It helps RDBMS to provides immediate response to user request of data
Q9. What are the advantage and disadvantage of the Database management system?
Advantage of DBMS
2) It provides file sharing facilities
3) It reduced data redundancies and inconsistencies
4) It provides better service to the user
5) It improved the flexibility of the system
6) It provide and increased data Security
7) It improved data Integrity
8) It saved a great deal of programming time
9) It helps to prepare the report for particular requirement
10) It provides the facilities of obtaining information from the database
Disadvantage of DBMS
1) There is always a threat to confidentiality, privacy and security
2) It is very complex to understand and implement
3) It is always a costly matter to keep and maintain DBMS
4) In this system there are too many rules to follow up and remember
5) It is a fast changing technology and it is difficult to follow the changing
technology
6) It is difficult to maintain the quality of data
7) We need to maintain data integrity- as we have to always update our data
immediately which is very time consuming work
8) Lack of trained Manpower
Q10. Write Short notes on:
SQL:-SQL is a popular query language which is used in querying, updating and
managing relational databases. In other word SQL is a data access language designed for
managing data in relational database management systems (RDBMS).
SQL is a language designed to store data, but the data stored in an SQL database is not
static. It can be modified at any time with the use of several very simple commands. The
SQL syntax is pretty much self explanatory, which makes it much easier to read and
Database Management System
Page 5
understand. It was developed by IBM in 1970 AD. It was first standardized in 1986.There
are about in SQL.
There are two type of SQL language (structured query language) they are:a) DDL language ( Data definition language)
b) DML language( Data manipulation language )
In DDL language there are all together three commands they are:a) Create command ( creating table )
b) Alter command
- Add ( adding column or field in table )
- Modify ( modifying the parameter of column)
- Drop ( dropping column from the table )
c) Drop command (dropping entire table form the database
In DML language there are all together four commands they are:a) Insert command ( This command is used for entering the data into the table)
b) Select command( This command is used for select required record for the
table )
c) Update record ( This command is used for calculating and modifying the
records in the table )
d) Delete command ( This command is used for deleting the record form the
table )
Data definition language (DDL):-It is the language which defines all attributes and
properties of a database, especially record layouts, field definitions, key fields, file
locations and storage capacity. Using this language the logical structure and the file
within the database may be defined. After compiling DDL statements we get a set of
table which is stored in data dictionary. Examples of DDL commands are CREATE,
ALTER and DROP.
Data manipulation language (DML):-It is the language which mainly does processing
and manipulating the data in the database. Actually the DML provides a comprehensive
set of command to allow modification of the data within a database. DML are often
capable of performing mathematical and statistical calculation that facilitates generating
reports. Example of DML commands are INSERT, SELECT, UPDATE and DELETE.
Q11. What is data security? How it can be implemented?
Ans:- Data security refers to the DBMS which can prevent unauthorized users from
viewing or updating the database. The protection of data from unauthorized access,
malicious destruction or by any kind of accidents is called data security. DBMS provides
data security to prevent the data from the losses or misuse.
In other words, data security means keeping data safe from the
various hazards to which it may be subjected. These include:a) Natural hazards such as fire, floods, hurricanes or earthquakes.
b) Illegal access to data by hackers
c) Accidental destruction of data by hardware failure or program or operator errors.
Database Management System
Page 6
Data security can be implemented by adopting and maintaining the
following activities:Keeping data secure from fraudulent (fake) use or malicious (wicked) damage. Data may
be at risk not only from outside hackers but also from employees within the company, so
in order to tackle these risks, suitable measures should be taken.
i) Password protection
ii) User IDs and passwords
iii) Community security
iv) Data encryption
v) Physical
vi) Human
vii) Operating System
viii) Network
i)
ii)
iii)
iv)
v)
vi)
vii)
viii)
Password protection:- Most password schemes use tables to store the current
password for each authorized user.
User IDs and passwords:- Each user in an organization who is permitted to
access a company database is issued with a user ID and a password, which
will normally give them a certain level of access rights set by the database
manager.
Communication Security:- Telecommunication systems are defenseless to
hackers who discover a user Id and password and can gain entry to database
from their own computer. One way of preventing this is to use call-back
procedure so that when a remote user logs in, the computer automatically calls
the back at a pre-arranged telephone no to verify their access request before
allowing them to log in.
Data Encryption:- Data encryption can also be used to scramble highly
sensitive or confidential data before transmission.
Physical:- The site or sits containing the computer systems must physically
secured against unauthorized entry by intruders ( one who enter without right).
Human:- Users must be motivated just not to leak the password to
unauthorized person.
Operating system:- It does not matter how secure the database system is, if
the operating system is weak then hackers can hack the database.
Network: - As we know that almost all database system allow remote access
through terminals or network. Software level security within the network
software is important as physical security.
Q12. What is Data integrity? What are the types of data integrity?
Ans:- Data integrity refers to the validity of the data contained in a database. It is a rule
that must be followed by data in the database.
In other word data integrity means that data is accurate, consistent and
up to date. In DBMS if the data redundancy is reduced it increases the chance of data
Database Management System
Page 7
integrity-the chances that the data is accurate, consistent and up to date. A database has
integrity if the data in it satisfy all established integrity constraints. A good DBMS should
provide an opportunity for users to build in these integrity constraints when they design
the database
There are three types of data integrity. They area) Entity Integrity
b) Referential Integrity
c) Domain Integrity
a) Entity Integrity: - Entity integrity is the rule that no column that is part of the
primary key may accept null values. Entity integrity guaranteed that each record
will indeed have its own identity. The restriction that the primary key cannot
allow null values is called entity integrity.
b) Referential Integrity: - The referential integrity rule states that if table A
contains a foreign key that matches the primary key either must match the value
of the primary key for some row in table B or must be null.
c) Domain Integrity:-It specifies that all columns in relational database must be
declared upon a defined domain.
Q13. Describe or explain about methodologies of Database design
Ans:-There are two types of methodologies. They are:a) Top-down methodologies: - In the top-down methodologies to conceptual
scheme design we start with the major entities of interest, their attributes and
their relationships for database application. We add other attributes and may
decide to split up the entities into a number of specialized entities and add the
relationships among these specialized entities.
b) Bottom-up methodologies:- In the bottom-up methodologies, we start with a
set of attribute. We group these attributes into entities and relationship among
them.
Q14. What are the different types of Normalization? Explain with example.
Ans: - The different types of Normalization are as follows:a. First Normal Form ( 1NF)
b. Second Normal Form (2NF)
c. Third Normal Form (3NF)
a) First Normal Form (1NF):- A table is said to be in First Normal Form if it contains
no repeating attributes or group of attributes.
b) Second Normal Form (2NF):- A table is said to be in Second Normal Form (2NF),
if it is in First Normal Form and no column that is not a part of primary key is
dependent on only a portion of the primary key.
c) Third Normal Form(3NF):- A table is said to be in Third Normal Form if it
contains no non-key dependencies
Database Management System
Page 8
Q15. Define Data Model or Data Modeling. Name the different types of Data Model.
What are the advantage and disadvantage of different types of Data Model?
Ans: - Data Model is a collection of conceptual tools for describing data, data
relationships, data semantics and data constraints. In other word data model is the method
used inside the database management system to organize the structure of the database.
The different types of data model are:a) Hierarchical Model
b) Network Model
c) Relational Model
a) Advantages and Disadvantages of Hierarchical Model
Advantages:i)
It is the easiest model of database.
ii)
A database owner is more secured because nobody else can see and
modify a child without consulting to its parents.
iii) Searching is very fast and easy, if parents is known.
iv) Very efficient in handling one-to-many relationship
Disadvantages:i)
It is old fashioned, outdated database model.
ii)
Modification and addition of child without consulting the parent is
impossible or very hard. So it is non flexible database model.
iii) Cannot handle many-to-many relationship.
iv) Increases redundancy because same is to be written in different places.
b) Advantages and Disadvantages of Network Database Model
Advantages:i)
This model is more flexible than hierarchical model because it accepts
many-to-many relationships.
ii)
It reduces redundancy because data should not be repeated.
iii) Searching is faster because of multidimensional pointers.
Disadvantages:i)
It is very complex type of database model.
ii) It needs long programs to handle the relationship.
iii) Less security in comparison to hierarchical model because it is open to all.
c) Advantages and Disadvantages of Relational Database Model
Advantages:i)
The rules implemented on one table can easily be implemented to another
table as one table is linked with other table with common key.
ii)
It has very less redundancy (Unnecessary or duplicate data)
iii) Normalization of data is possible.
iv) Quick database processing is possible.
Disadvantages:i)
It is complex than other models.
Database Management System
Page 9
ii)
It is confusing as many rules being applied.
Q16. What are the documentation techniques?
Ans:- Documentation refers to keeping records of all project information in the
system development process. The information includes any models of the system
components as well as information such as the organizational structure and user
responsibilities within this structure. In some systems it can include the programs
themselves. The different types of documentation techniques are printed manuals or
guides, reference manuals, technical reference guides, configuration guides,
administration guides, help system etc.
a) User Manuals or guides:-These are designed for end users people who use the
product simply to perform specific tasks. Generally user documentation is tutorial in
nature, providing step by step instructions, lots of illustrations.
b) Reference Manuals:- These manuals may be developed for various user. Instead of
providing step-by step instructions, reference manuals include detailed descriptions
of commands, features and capabilities as well as glossaries of special terms.
c) Technical Reference Guides:- This guides is used for high level users or
developers who will customize the product or develop other applications to work
with the product, this guides are filled with technical details and are generally of
little interest to end users.
Database Management System
Page 10
Download