Data Base Management System

ADVANTAGES AND DISADVANTAGES OF DATABASE SYSTEMS

Posted on Updated on

ADVANTAGES AND DISADVANTAGES OF DATABASE SYSTEMS

Advantages of Database Systems –

The DBMS (Database Management System) is preferred ever the conventional file processing system due to the following

Advantages:

1. Controlling Data Redundancy

In the conventional file processing system, every user group maintains its own files for handling its data files. This may lead to

• Duplication of same data in different files.

• Wastage of storage space, since duplicated data is stored.

• Errors may be generated due to updation of the same data in different files.

• Time in entering data again and again is wasted.

• Computer Resources are needlessly used.

• It is very difficult to combine information.

2. Elimination of Inconsistency

In the file processing system information is duplicated throughout the system. So changes made in one file may be necessary be carried over to another file. This may lead to inconsistent data. So we need to remove this duplication of data in multiple file to eliminate inconsistency.

To avoid the above problem, there is a need to have a centralize database in order to have this conflicting information.

On centralizing the data base the duplication will be controlled and hence inconsistency will be removed.

3. Better service to the users

A DBMS is often used to provide better services to the users. In conventional system, availability of information is often poor, since it normally difficult to obtain information in a timely manner because our existing systems are not capable to produce the same.

Once several conventional systems are combined to form one centralized database, the availability of information and its updateness is likely to improve since the data can now be shared and DBMS makes it easy to respond to anticipated information requests.

Centralizing the data in the database also means that user can obtain new and combined information easily that would have been impossible to obtain otherwise.

Also use of DBMS should allow users that don’t know programming to interact with the data more easily, unlike file processing system where the programmer may need to write new programs to meet every new demand.

4. Flexibility of the System is Improved

Since changes are often necessary to the contents of the data stored in any system, these changes are made more easily in a centralized database than in a conventional system.

Applications programs need not to be changed on changing the data in the database.

5. Integrity can be improved

Since data of the organization using database approach is centralized and would be used by a number of users at a time, it is essential to enforce integrity-constraints.

In the conventional systems because the data is duplicated in multiple files so updating or changes may sometimes lead to entry of incorrect data in some files wherever it is applicable.

Even if we centralized the database it may still contain incorrect data. For example: -• Salary of full time clerk may be entered as Rs. 1500 rather than Rs. 4500.

A student may be shown to have borrowed library books but has no enrollment.

The above problems can be avoided by defining the validation procedures whenever any update operation is attempted.

6. Standards can be enforced

Standards are easier to enforce in database systems because all the data in database is access through centralized DBMS.

Here standards may relate to the naming of data, structure of data, format of the data etc.

Standardizing stored data formats is usually desirable for the purpose of data interchange or migration between systems.

7. Security can be improved

In conventional systems, applications are developed in an adhoc manner.

Often different system of an organization would access different components of the operational data, in such an environment enforcing security can be quiet difficult.

Setting up of a database makes it easier to enforce security restrictions since data is now centralized.

It is easier to control who has access to what parts of the database. Different checks can be established for each type of access (retrieve, modify, delete etc.) to each piece of information in the database.

8. Organization’s requirement can be easily identified

All organizations have sections and departments and each of these units often consider the work of their unit as the most important and therefore consider their need as the most important.

Once a database has been setup with centralized control, it will be necessary to identify organization’s requirement and to balance the needs of the competition units.

So it may become necessary to ignore some requests for information if they conflict with higher priority need of the organization.

9. Data Model must be developed

Perhaps the most important advantage of setting up of database system is the requirement that an overall data model for an organization be build. In conventional systems, it is more likely that files will be designed as per need of particular applications demand.

The overall view is often not considered. Building an overall view of an organization’s data is usual cost effective in the long terms.

10. Provides backup and Recovery

Centralizing a database provides the schemes such as recovery and backups from the failures including disk crash, power failures, software errors which may help the database

to recover from the inconsistent state to the state that existed prior to the occurrence of the failure, though methods are very complex.

Disadvantages of Database Systems

The following are the disadvantages of Database Systems

1. Database Complexity

The design of the database system is complex, difficult and is very time consuming task to perform.

2. Substantial hardware and software start-up costs Huge amount of investment is needed to setup the required hardware and the softwares needed to run those applications.

3. Damage to database affects virtually all applications programs If one part of the database is corrupted or damaged because of the hardware or software failure, since we don’t have many versions of the file, all the application programs which are dependent on this database are implicitly affected.

4. Extensive conversion costs in moving form a file-based system to a database system If you are currently working on file based system and need to upgrade it to database system, then large amount of cost is incurred in purchasing different tools, adopting different techniques as per the requirement.

5. Initial training required for all programmers and user. Large amount of human efforts, the time and cost is needed to train the end users and application programmers in order to get used to the database systems.

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Advertisements

INTERVIEW QUESTIONS ON DBMS

Posted on Updated on

 

Questions : 1

What is database or database management systems (DBMS)? and – What’s the difference between file and database? Can files qualify as a database?

Answers :

Database provides a systematic and organized way of storing, managing and retrieving from collection of logically related information. Secondly the information has to be persistent, that means even after the application is closed the information should be persisted. Finally it should provide an independent way of accessing data and should not be dependent on the application to access the information. Main difference between a simple file and database that database has independent way (SQL) of accessing information while simple files do not File meets the storing, managing and retrieving part of a database but not the independent way of accessing data. Many experienced programmers think that the main difference is that file cannot provide multi-user capabilities which a DBMS provides. But if we look at some old COBOL and C programs where file where the only means of storing data, we can see functionalities like locking, multi-user etc provided very efficiently.

Questions : 2

What is SQL ?

Answers : 2

SQL stands for Structured Query Language.SQL is an ANSI (American National Standards Institute) standard computer language for accessing and manipulating database systems. SQL statements are used to retrieve and update data in a database.

   

Questions : 3

What’s difference between DBMS and RDBMS ?

Answers : 3

DBMS provides a systematic and organized way of storing, managing and retrieving from collection of logically related information. RDBMS also provides what DBMS provides but above that it provides relationship integrity. So in short we can say
RDBMS = DBMS + REFERENTIAL INTEGRITY
These relations are defined by using “Foreign Keys” in any RDBMS.Many DBMS companies claimed there DBMS product was a RDBMS compliant, but according to industry rules and regulations if the DBMS fulfills the twelve CODD rules it’s truly a RDBMS. Almost all DBMS (SQL SERVER, ORACLE etc) fulfills all the twelve CODD rules and are considered as truly RDBMS.

   

Questions : 4

What are CODD rules?

In 1969 Dr. E. F. Codd laid down some 12 rules which a DBMS should adhere in order to get the logo of a true RDBMS.

Rule 1: Information Rule.
“All information in a relational data base is represented explicitly at the logical level and in exactly one way – by values in tables.”
Rule 2: Guaranteed access Rule.
“Each and every datum (atomic value) in a relational data base is guaranteed to be logically accessible by resorting to a combination of table name, primary key value and column name.”
In flat files we have to parse and know exact location of field values. But if a DBMS is truly RDBMS you can access the value by specifying the table name, field name, for instance Customers.Fields [‘Customer Name’].
Rule 3: Systematic treatment of null values.
“Null values (distinct from the empty character string or a string of blank characters and distinct from zero or any other number) are supported in fully relational DBMS for representing missing information and inapplicable information in a systematic way, independent of data type.”.
Rule 4: Dynamic on-line catalog based on the relational model.
“The data base description is represented at the logical level in the same way as ordinary data, so that authorized users can apply the same relational language to its interrogation as they apply to the regular data.”The Data Dictionary is held within the RDBMS, thus there is no-need for off-line volumes to tell you the structure of the database.
Rule 5: Comprehensive data sub-language Rule.
“A relational system may support several languages and various modes of terminal use (for example, the fill-in-the-blanks mode). However, there must be at least one language whose statements are expressible, per some well-defined syntax, as character strings and that is comprehensive in supporting all the following items
Data Definition
View Definition
Data Manipulation (Interactive and by program).
Integrity Constraints
Authorization.
Transaction boundaries ( Begin , commit and rollback)
Rule 6: .View updating Rule
“All views that are theoretically updatable are also updatable by the system.”
Rule 7: High-level insert, update and delete.
“The capability of handling a base relation or a derived relation as a single operand applies not only to the retrieval of data but also to the insertion, update and deletion of data.”
Rule 8: Physical data independence.
“Application programs and terminal activities remain logically unimpaired whenever any changes are made in either storage representations or access methods.”
Rule 9: Logical data independence.
“Application programs and terminal activities remain logically unimpaired when information-preserving changes of any kind that theoretically permit un-impairment are made to the base tables.”
Rule 10: Integrity independence.
“Integrity constraints specific to a particular relational data base must be definable in the relational data sub-language and storable in the catalog, not in the application programs.”Rule 11: Distribution independence.
“A relational DBMS has distribution independence.”
Rule 12: Non-subversion Rule.
“If a relational system has a low-level (single-record-at-a-time) language, that low level cannot be used to subvert or bypass the integrity Rules and constraints expressed in the higher level relational language (multiple-records-at-a-time).”

 
     

Questions : 5

What are E-R diagrams?

 

Answers : 5

E-R diagram also termed as Entity-Relationship diagram shows relationship between various tables in the database. .

 
     

Questions : 6

How many types of relationship exist in database designing?

 

Answers : 6

There are three major relationship models:-
One-to-one
One-to-many
Many-to-many

 
     

Questions : 7

7.What is normalization? What are different type of normalization?

 

Answers : 7

There is set of rules that has been established to aid in the design of tables that are meant to be connected through relationships. This set of rules is known as Normalization.
Benefits of Normalizing your database include:
=>Avoiding repetitive entries
=>Reducing required storage space
=>Preventing the need to restructure existing tables to accommodate new data.
=>Increased speed and flexibility of queries, sorts, and summaries.
Following are the three normal forms :-
First Normal Form
For a table to be in first normal form, data must be broken up into the smallest un possible.In addition to breaking data up into the smallest meaningful values, tables first normal form should not contain repetitions groups of fields.
Second Normal form
The second normal form states that each field in a multiple field primary keytable must be directly related to the entire primary key. Or in other words,each non-key field should be a fact about all the fields in the primary key.
Third normal form
A non-key field should not depend on other Non-key field.

 
     

Questions : 8

What is denormalization ?

 

Answers : 8

Denormalization is the process of putting one fact in numerous places (its vice-versa of normalization).Only one valid reason exists for denormalizing a relational design – to enhance performance.The sacrifice to performance is that you increase redundancy in database.

 
     

Questions : 9

Can you explain Fourth Normal Form and Fifth Normal Form ?

Ads by InfoAd Options

 

Answers : 9

In fourth normal form it should not contain two or more independent multi-v about an entity and it should satisfy “Third Normal form”.
Fifth normal form deals with reconstructing information from smaller pieces of information. These smaller pieces of information can be maintained with less redundancy.

 
     

Questions : 10

Have you heard about sixth normal form?

 

Answers : 10

If we want relational system in conjunction with time we use sixth normal form. At this moment SQL Server does not supports it directly.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Operator in SQL

Posted on Updated on

What is an Operator in SQL?

An operator is a reserved word or a character used primarily in an SQL statement’s WHERE clause to perform operation(s), such as comparisons and arithmetic operations.

Operators are used to specify conditions in an SQL statement and to serve as conjunctions for multiple conditions in a statement.

· Arithmetic operators

· Comparison operators

· Logical operators

· Operators used to negate conditions

SQL Arithmetic Operators:

Assume variable a holds 10 and variable b holds 20, then:

Operator

Description

Example

+

Addition – Adds values on either side of the operator

a + b will give 30

Subtraction – Subtracts right hand operand from left hand operand

a – b will give -10

*

Multiplication – Multiplies values on either side of the operator

a * b will give 200

/

Division – Divides left hand operand by right hand operand

b / a will give 2

%

Modulus – Divides left hand operand by right hand operand and returns remainder

b % a will give 0

SQL Comparison Operators:

Assume variable a holds 10 and variable b holds 20, then:

Operator

Description

Example

=

Checks if the values of two operands are equal or not, if yes then condition becomes true.

(a = b) is not true.

!=

Checks if the values of two operands are equal or not, if values are not equal then condition becomes true.

(a != b) is true.

<>

Checks if the values of two operands are equal or not, if values are not equal then condition becomes true.

(a <> b) is true.

>

Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true.

(a > b) is not true.

<

Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true.

(a < b) is true.

>=

Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true.

(a >= b) is not true.

<=

Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true.

(a <= b) is true.

!<

Checks if the value of left operand is not less than the value of right operand, if yes then condition becomes true.

(a !< b) is false.

!>

Checks if the value of left operand is not greater than the value of right operand, if yes then condition becomes true.

(a !> b) is true.

SQL Logical Operators:

Here is a list of all the logical operators available in SQL.

Show Examples

Ads by InfoAd Options

Operator

Description

ALL

The ALL operator is used to compare a value to all values in another value set.

AND

The AND operator allows the existence of multiple conditions in an SQL statement’s WHERE clause.

ANY

The ANY operator is used to compare a value to any applicable value in the list according to the condition.

BETWEEN

The BETWEEN operator is used to search for values that are within a set of values, given the minimum value and the maximum value.

EXISTS

The EXISTS operator is used to search for the presence of a row in a specified table that meets certain criteria.

IN

The IN operator is used to compare a value to a list of literal values that have been specified.

LIKE

The LIKE operator is used to compare a value to similar values using wildcard operators.

NOT

The NOT operator reverses the meaning of the logical operator with which it is used. Eg: NOT EXISTS, NOT BETWEEN, NOT IN, etc. This is a negate operator.

OR

The OR operator is used to combine multiple conditions in an SQL statement’s WHERE clause.

IS NULL

The NULL operator is used to compare a value with a NULL value.

UNIQUE

The UNIQUE operator searches every row of a specified table for uniqueness (no duplicates).

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Operator in SQL

Posted on Updated on

What is an Operator in SQL?

An operator is a reserved word or a character used primarily in an SQL statement’s WHERE clause to perform operation(s), such as comparisons and arithmetic operations.

Operators are used to specify conditions in an SQL statement and to serve as conjunctions for multiple conditions in a statement.

  • Arithmetic operators
  • Comparison operators
  • Logical operators
  • Operators used to negate conditions

SQL Arithmetic Operators:

Assume variable a holds 10 and variable b holds 20, then:

Operator Description Example
+ Addition – Adds values on either side of the operator a + b will give 30
Subtraction – Subtracts right hand operand from left hand operand a – b will give -10
* Multiplication – Multiplies values on either side of the operator a * b will give 200
/ Division – Divides left hand operand by right hand operand b / a will give 2
% Modulus – Divides left hand operand by right hand operand and returns remainder b % a will give 0

SQL Comparison Operators:

Assume variable a holds 10 and variable b holds 20, then:

Operator Description Example
= Checks if the values of two operands are equal or not, if yes then condition becomes true. (a = b) is not true.
!= Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. (a != b) is true.
<> Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. (a <> b) is true.
> Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true. (a > b) is not true.
< Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true. (a < b) is true.
>= Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true. (a >= b) is not true.
<= Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true. (a <= b) is true.
!< Checks if the value of left operand is not less than the value of right operand, if yes then condition becomes true. (a !< b) is false.
!> Checks if the value of left operand is not greater than the value of right operand, if yes then condition becomes true. (a !> b) is true.

SQL Logical Operators:

Here is a list of all the logical operators available in SQL.

Show Examples

Ads by InfoAd Options

Operator Description
ALL The ALL operator is used to compare a value to all values in another value set.
AND The AND operator allows the existence of multiple conditions in an SQL statement’s WHERE clause.
ANY The ANY operator is used to compare a value to any applicable value in the list according to the condition.
BETWEEN The BETWEEN operator is used to search for values that are within a set of values, given the minimum value and the maximum value.
EXISTS The EXISTS operator is used to search for the presence of a row in a specified table that meets certain criteria.
IN The IN operator is used to compare a value to a list of literal values that have been specified.
LIKE The LIKE operator is used to compare a value to similar values using wildcard operators.
NOT The NOT operator reverses the meaning of the logical operator with which it is used. Eg: NOT EXISTS, NOT BETWEEN, NOT IN, etc. This is a negate operator.
OR The OR operator is used to combine multiple conditions in an SQL statement’s WHERE clause.
IS NULL The NULL operator is used to compare a value with a NULL value.
UNIQUE The UNIQUE operator searches every row of a specified table for uniqueness (no duplicates).

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Normalization

Posted on Updated on

Boyce-Code Normal Form (BCNF)

  • A relationship is said to be in BCNF if it is already in 3NF and the left hand side of every dependency is a candidate key.
  • A relation which is in 3NF is almost always in BCNF. These could be same situation when a 3NF relation may not be in BCNF the following conditions are found true.
  1. The candidate keys are composite.
  2. There are more than one candidate keys in the relation.
  3. There are some common attributes in the relation
Professor Code Department Head of Dept. Percent Time
P1 Physics Ghosh 50
P1 Mathematics Krishnan 50
P2 Chemistry Rao 25
P2 Physics Ghosh 75
P3 Mathematics Krishnan 100

Consider, as an example, the above relation. It is assumed that:

  1. A professor can work in more than one department
  2. The percentage of the time he spends in each department is given.
  3. Each department has only one Head of Department.
  4. The relation diagram for the above relation is given as the following:

 

Untitled

The given relation is in 3NF. Observe, however, that the names of Dept. and Head of Dept. are duplicated. Further, if Professor P2 resigns, rows 3 and 4 are deleted. We lose the information that Rao is the Head of Department of Chemistry.

The normalization of the relation is done by creating a new relation for Dept. and Head of Dept. and deleting Head of Dept. form the given relation. The normalized relations are shown in the following.

Professor Code Department Percent Time
P1 Physics 50
P1 Mathematics 50
P2 Chemistry 25
P2 Physics 75
P3 Mathematics 100

 

Department Head of Dept.
Physics Ghosh
Mathematics Krishnan
Chemistry Rao

See the dependency diagrams for these new relations.

y1

 

 

 

 

 

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Interview questions of Data structures in C

Posted on

USEFUL FOR FYBSC (IT), FYBCA STUDENTS  

 

1.)   What is the difference between a Stack and an Array?

Stack

  • Stack is a dynamic object whose size is constantly changing as items are pushed and popped.
  • Stack may contain different data types.
  • Stack is declared as a structure containing an array to hold the element of the stack, and an integer to indicate the current stack top within the array.
  • Stack is a ordered collection of items.

Array

  • Array is an ordered collection of items.
  • Array is a static object.
  • It contains same data types.
  • Array can be home of a stack i.e. array can be declared large enough for maximum size of the stack.

 

2. What is sequential search?

In sequential search each item in the array is compared with the item being searched until a match occurs. It is applicable to a table organized either as an array or as a linked list.

 

3. What are the disadvantages array implementations of linked list?

The no of nodes needed can’t be predicted when the program is written.
The no of nodes declared must remain allocated throughout its execution.

 

4. Define circular list?

In linear list the next field of the last node contain a null pointer, when a next field in the last node contain a pointer back to the first node it is called circular list.

 

5. What does abstract Data Type Mean?

Data type is a collection of values and a set of operations on these values. Abstract data type refers to the mathematical concept that defines the data type.

 

6. Define double linked list?

  • It is a collection of data elements called nodes, where each node is divided into three parts
  • An info field that contains the information stored in the node.
  • Left field that contain pointer to node on left side.
  • Right field that contain pointer to node on right side.

 

7. What are the methods available in storing sequential files?

  • Straight merging
  • Natural merging
  • Polyphase sort
  • Distribution of Initial runs

 

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

 

 

DBMS and its Advantages

Posted on

  • One of the main advantages of using a database system is that the organization can exert, via the DBA, centralized management and control over the data.
  • The database administrator is the focus of the centralized control. Any application requiring a change in the structure of a data record requires an arrangement with the DBA, who makes the necessary modifications.
  • Such modifications do not affect other applications or users of the record in question.

 

  • Reduction of Redundancies:Centralized control of data by the DBA avoids unnecessary duplication of data and effectively reduces the total amount of data storage required. It also eliminates the extra processing necessary to trace the required data in a large mass of data.
  • Elimination of Inconsistencies: The main advantage of avoiding duplication is the elimination of inconsistencies that tend to be present in redundant data files .Any redundancies that exist in the DBMS are controlled and the system ensures that these multiple copies are consistent

 

  • Shared Data: A database allows the sharing of data under its control by any number of application programs or users. For example, the applications for the public relations and payroll departments can share the same data.
  • Integrity: Centralized control can also ensure that adequate checks are incorporated in the DBMS to provide data integrity .Data integrity means that the data contained in the database is both accurate and consistent. Therefore, data values being entered for the storage could be checked to ensure that they fall within a specified range and are of the correct format.
  • Security: Data is of vital importance to an organization and may be confidential. Such confidential data must not be accessed by unauthorized persons. The DBA who has the Ultimate responsibility for the data in the DBMS can ensure that proper access procedures are followed, including proper authentication schemes for access to the DBMS and additional checks before permitting access to sensitive data. Different levels of security could be implemented for various types of data and operations.
  • Conflict Resolution: Since the database is under the control of the DBA, he/she should resolve the conflicting requirements of various users and applications. In essence, the DBA chooses  the best file structure and access method to get optimal performance for the response critical applications, while permitting less critical applications to continue to use the database, albeit with a relatively slower response

 

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com