Custom Search

Monday, 18 June 2012

What are types of attributes ?, What is the domain of attribute?, What is composite attribute?




What are types of attributes ?, What is the domain of attribute?, What is composite attribute?




An entity is represented by a set of attributes, that is descriptive
properties possessed by all members of an entity set.
Domain – the set of permitted values for each attribute
Attribute types:

  • Simple and composite attributes.
  • Single-valued and multi-valued attributes
  • E.g. multivalued attribute: phone-numbers
  • Derived attributes
  • Can be computed from other attributes
  • E.g. age, given date of birth

Example:
customer = (customer-id, customer-name,
customer-street, customer-city)
loan = (loan-number, amount)


Composite Attribute

Define Entity & Entity set in database Management System(DBMS) with example




Define Entity & Entity set in database Management System(DBMS) with example

A database can be modeled as a collection of entities, relationship among entities.


An entity is an object that exists and is distinguishable from other
objects.
Example: specific person, company, event, plant


Entities have attributes
Example: people have names and addresses


An Entity set is a set of entities of the same type that share the same properties.
Example: set of all persons, companies, trees, holidays

What is Database Administrator?, Responsibilities of Database Administrator(DBA), Application Architecture, System Structure

What is Database Administrator?, Responsibilities of Database Administrator(DBA), Application Architecture, System Structure

Database Administrator(DBA)

Database Administrator is one which Coordinates all the activities of the database system; the database administrator has a good understanding of the enterprise’s information resources and needs.


Responsibilities of Database Administratior(DBA)
Database administrator's duties include:

  • Schema definition
  • Storage structure and access method definition
  • Schema and physical organization modification
  • Granting user authority to access the database
  • Specifying integrity constraints
  • Acting as liaison with users
  • Monitoring performance and responding to changes in requirements

Overall System Structure
1.) The different types of users interact with Database system through application interfaces, application programs, query tools and administrative tools.
2.) The query processor & storage manager interact with Database
3.) The database on disk storage is categorized into Data,
indices, data dictionary and statistical data.


Overall System Structure



Application Architecture


Two-tier architecture: E.g. client programs using ODBC/JDBC to
communicate with a database
Three-tier architecture: E.g. web-based applications, and
applications built using ―middleware‖



Different Types of Database users in Database management system(DBMS), Application programmers, Sophisticated users, Specialized users, Naive users




Different Types of Database users in Database management system(DBMS), Application programmers, Sophisticated users, Specialized users, Naive users


Users are differentiated by the way they expect to interact with
the system
1.) Application programmers – interact with system through DML calls


2.) Sophisticated users – form requests in a database query language


3.) Specialized users – write specialized database applications that
do not fit into the traditional data processing framework


4.) Naive users – invoke one of the permanent application programs that have been written previously
E.g. people accessing database over the web, bank tellers, clerical
staff

Data Definition Language (DDL) & Data Manipulation Language (DML), What is Metadata?


Data Definition Language (DDL) & Data Manipulation Language (DML), What is Metadata?

Data Definition Language (DDL)
It is the specification notation for defining the database schema
E.g.
create table account (
account-number char(10),
balance integer)
DDL compiler generates a set of tables stored in a data dictionary


Data dictionary contains metadata (i.e data about the data)
1.)database schema
2.)Data storage and definition language
  • language in which the storage structure and access methods used by the database system are specified
  • Usually an extension of the data definition language
Data Manipulation Language (DML)
It is the Language for accessing and manipulating the data organized by the appropriate data model
DML also known as query language

Two classes of languages
Procedural – user specifies what data is required and how to get those data
Non-procedural – user specifies what data is required without
specifying how to get those data
SQL is the most widely used query language

What is the data model?, What are the different types of data model ?, Entity-Relationship model, Relational model



What is the data model?, What are the different types of data model ?, Entity-Relationship model, Relational model



Data model Definition

Data model is a collection of tools for describing data, data relationships, data semantics, data constraints


Types of Data model

  • Entity-Relationship model
  • Relational model
  • Other models:


  1. object-oriented model
  2. semi-structured data models
  3. Older models: network model and hierarchical model
Entity-Relationship model

Relational model



What is instances & schemas in Database Managment System(DBMS)?, Physical Schema & Logical Schema in DBMS, What is Physical Data Independence ?


What is instances & schemas in Database Managment System(DBMS)?, Physical Schema & Logical Schema in DBMS, What is Physical Data Independence ?

Schema definition
It is the logical structure of the database e.g., the database consists of information about a set of customers and accounts and the relationship between them)


Analogous to type information of a variable in a program


Physical schema: database design at the physical level is called physical schema


Logical schema: database design at the logical level is called logical schema


Instance – It is the actual content of the database at a particular point in time
Analogous to the value of a variable


What is Physical Data Independence ?

 It is the ability to modify the physical schema without changing the logical schema
 Applications depend on the logical schema
 In general, the interfaces between the various levels and components should be well defined so that changes in some parts do not seriously influence others.

Levels of Abstraction in Database Management System(DBMS) with example, Physical level, Logical level, View level


Levels of Abstraction in Database Management System(DBMS) with example, Physical level, Logical level, View level



Levels of Abstraction

Levels of Abstraction
1.) Physical level describes how a record (e.g., customer) is stored.


2.) Logical level describes data stored in database, and the
relationships among the data.
type customer = record
name : string;
street : string;
city : integer;
end;


3.) View level application programs hide details of data types.
Views can also hide information (e.g., salary) for security
purposes.

What is Database Management System (DBMS)?, What is the Purpose of Database System?, Examples of Database Management System


What is Database Management System (DBMS)?, What is the Purpose of Database System?, Examples of Database Management System


What is Database Management System (DBMS)?
Database management system is a Collection of interrelated data
And Set of programs to access the data .
 DBMS contains information about a particular enterprise
 DBMS provides an environment that is both convenient and
efficient to use.
 Database Applications:
 Banking: all transactions
 Airlines: reservations, schedules
 Universities: registration, grades
 Sales: customers, products, purchases
 Manufacturing: production, inventory, orders, supply chain
 Human resources: employee records, salaries, tax deductions


What is the Purpose of Database System?
Using Database solves this problems

  • Data redundancy and inconsistency
  • Multiple file formats, duplication of information in different files
  • Difficulty in accessing data
  • Need to write a new program to carry out each new task
  • Data isolation — multiple files and formats
  • Integrity problems
  • Integrity constraints (e.g. account balance > 0) become part
  • of program code
  • Hard to add new constraints or change existing ones
  • Atomicity of updates
  • Failures may leave database in an inconsistent state with partial
  • updates carried out
  • E.g. transfer of funds from one account to another should either
  • complete or not happen at all
  • Concurrent access by multiple users
  • Concurrent accessed needed for performance
  • Uncontrolled concurrent accesses can lead to inconsistencies
  • – E.g. two people reading a balance and updating it at the same
  • time
  • Security problems


C/C++ program to calculate simple interest, Program to find Simple interest by entering rate, principle amount & number of year


C/C++ program to calculate simple interest, Program to find Simple interest by entering rate, principle amount & number of year

Program
#include<stdio.h>
#include<conio.h>
main( )
{
int p, n ;
float r, si ;
Printf("Enter the principle amount");
scanf("%d", &p)
Printf("Enter the number of years");
scanf("%d", &n)
printf("Enter the rate of interest");
scanf("%f", &r)
si = p * n * r / 100 ;/* formula for simple interest */
printf ( "%f" , si ) ;

Changes for C++
If you want to write the same program in c++ apply the following changes to the program.
1.) change the header file from "#include<stdio.h>" to "#include<iostream>.h" 
2.)  for input & output use "cout<<" & "cin>>" instead of "printf" & "scanf".
3.) don't use "% "symbol and "&" sign in "cin>>" statement.


Click here to check Output

Laptops