Saturday, 4 May 2019

Program for fibonacci numbers

In mathematics, the Fibonacci numbers, commonly denoted Fn form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is,




for n > 1.

The Fibonacci numbers are the numbers in the following integer sequence.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..

In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation

//Fibonacci Series using Recursion 

int fib(int n) 
if (n <= 1) 
 return n; 
return fib(n-1) + fib(n-2); 

int main () 
int n = 9; 
printf("%d", fib(n)); 
return 0; 

Thursday, 2 May 2019

ANSI / SPARK Model or DBMS three schema Architecture

The distinction between the logical and physical representation of data were recognized in 1978 when ANSI / SPARK committee proposed a generalized framework for database systems. This framework provided a three-level architecture, three levels of abstraction at which the database could be viewed.

Need for Abstraction

The main objective of DBMS is to store and retrieve information efficiently; all the users should be able to access same data. The designers use complex data structure to represent the data, so that data can be efficiently stored and retrieved, but it is not necessary for the users to know physical database
storage details. The developers hide the complexity from users through several levels of abstraction.

Data Independence

Data independence means the internal structure of database should be unaffected by changes to physical aspects of storage. Because of data independence, the Database administrator can change the database storage structures without affecting the users view.

The different levels of data abstraction are:

1. Physical level or internal level
2. Logical level or conceptual level
3. View level or external level

Physical Level

It is concerned with the physical storage of the information. It provides the internal view of the actual physical storage of data. The physical level describes complex low-level data structures in detail.

Logical Level

Logical level describes what data are stored in the database and what relationships exist among those data. Logical level describes the entire database in terms of a small number of simple structures. The implementation of simple structure of the logical level may involve complex physical level structures; the user of the logical level does not need to be aware of this complexity. Database administrator use the logical level of abstraction.

View Level

View level is the highest level of abstraction. It is the view that the individual user of the database has. There can be many view level abstractions of the same data.

Database Instances

Database change over time as information is inserted and deleted. The collection of information stored in the database at a particular moment is called an instance of the database.

Database Schema

The overall design of the database is called the database schema. A schema is a collection of named objects. Schemas provide a logical classification of objects in the database. A schema can contain tables, views, triggers, functions, packages, and other objects.

A schema is also an object in the database. It is explicitly created using the CREATE SCHEMA statement with the current user recorded as the schema owner. It can also be implicitly created when another object is created, provided the user has IMPLICIT SCHEMA authority.

Source: springer-fundamentals-of-relational-database-management-systems-apr-2007

Advantages and Disadvantages of DBMS

"A database management system (DBMS) is a collection of programs that manages the database structure and controls access to the data stored in the database".

The DBMS serves as the intermediary between the user and the database. The database structure itself is stored as a collection of files, So, we can access the data in those files through the DBMS.

The DBMS receives all application requests and translates them into the complex operations required to fulfill those requests. The DBMS hides much of the database’s internal complexity from the application programs and users.

Advantage of DBMS

1. Improved data sharing:
  • The DBMS helps create an environment in which end users have better access to more and better-managed data.
  • Such access makes it possible for end users to respond quickly to changes in their environment.
2. Improved data security:
  • The more users access the data, the greater the risks of data security breaches.Corporations invest considerable amounts of time, effort, and money to ensure that corporate data are used properly.
  • A DBMS provides a framework for better enforcement of data privacy and security policies. 

3. Better data integration:
  • Wider access to well-managed data promotes an integrated view of the organization’s operations and a clearer view of the big picture.
  • It becomes much easier to see how actions in one segment of the company affect other segments. 

4. Minimized data inconsistency: 

  • Data inconsistency exists when different versions of the same data appear in different places.
  • For example, data inconsistency exists when a company’s sales department stores a sales representative’s name as “Bill Brown” and the company’s personnel department stores that same person’s name as “William G. Brown,” or when the company’s regional sales office shows the price of a product as $45.95 and its national sales office shows the same product’s price as $43.95.
  • The probability of data inconsistency is greatly reduced in a properly designed database. 

5. Improved data access:
  • The DBMS makes it possible to produce quick answers to ad hoc queries.
  • From a database perspective, a query is a specific request issued to the DBMS for data manipulation—for example, to read or update the data. Simply put, a query is a question, and an ad hoc query is a spur-of-the-moment question.
  • The DBMS sends back an answer (called the query result set) to the application.
  • For example, end users 

6. Improved decision making: 

  • Better-managed data and improved data access make it possible to generate better-quality information, on which better decisions are based.
  • The quality of the information generated depends on the quality of the underlying data.
  • Data quality is a comprehensive approach to promoting the accuracy, validity, and timeliness of the data. While the DBMS does not guarantee data quality, it provides a framework to facilitate data quality initiatives.
  • Increased end-user productivity
  • The availability of data, combined with the tools that transform data into usable information, empowers end users to make quick, informed decisions that can make the difference between success and failure in the global economy.

Disadvantage of DBMS 

1. Increased costs: 

  • Database systems require sophisticated hardware and software and highly skilled personnel.
  • The cost of maintaining the hardware, software, and personnel required to operate and manage a database system can be substantial. Training, licensing, and regulation compliance costs are often overlooked when database systems are implemented. 

2. Management complexity:
  • Database systems interface with many different technologies and have a significant impact on a company’s resources and culture.
  • The changes introduced by the adoption of a database system must be properly managed to ensure that they help advance the company’s objectives. Given the fact that database systems hold crucial company data that are accessed from multiple sources, security issues must be assessed constantly. 

3. Maintaining currency:
  • To maximize the efficiency of the database system, you must keep your system current.
  • Therefore, you must perform frequent updates and apply the latest patches and security measures to all components.
  • Because database technology advances rapidly, personnel training costs tend to be significant. Vendor dependence.
  • Given the heavy investment in technology and personnel training, companies might be reluctant to change database vendors. 
4. Frequent upgrade/replacement cycles: 

  • DBMS vendors frequently upgrade their products by adding new functionality. Such new features often come bundled in new upgrade versions of the software.
  • Some of these versions require hardware upgrades. Not only do the upgrades themselves cost money, but it also costs money to train database users and administrators to properly use and manage the new features. 
Source: Database Systems: Design, Implementation, and Management, 12th edition


Find Us On Facebook

C Programming


C++ Tutorial


Java Tutorial


Computer Basics


MS Office


Database Management