Translate

Friday, 27 October 2017

ER Diagram Representation


ER Diagram Representation

Let us now learn how the ER Model is represented by means of an ER diagram. Any object, for example, entities, attributes of an entity, relationship sets, and attributes of relationship sets, can be represented with the help of an ER diagram.

Entity

Entities are represented by means of rectangles. Rectangles are named with the entity set they represent.

Entities in a school database

Attributes

Attributes are the properties of entities. Attributes are represented by means of ellipses. Every ellipse represents one attribute and is directly connected to its entity (rectangle).

Simple Attributes

If the attributes are composite, they are further divided in a tree like structure. Every node is then connected to its attribute. That is, composite attributes are represented by ellipses that are connected with an ellipse.

Composite Attributes

Multivalued attributes are depicted by double ellipse.

Multivalued Attributes

Derived attributes are depicted by dashed ellipse.

Derived Attributes

Relationship

Relationships are represented by diamond-shaped box. Name of the relationship is written inside the diamond-box. All the entities (rectangles) participating in a relationship, are connected to it by a line.

Binary Relationship and Cardinality

A relationship where two entities are participating is called a binary relationship. Cardinality is the number of instance of an entity from a relation that can be associated with the relation.

One-to-one − When only one instance of an entity is associated with the relationship, it is marked as '1:1'. The following image reflects that only one instance of each entity should be associated with the relationship. It depicts one-to-one relationship.

One-to-one

One-to-many − When more than one instance of an entity is associated with a relationship, it is marked as '1:N'. The following image reflects that only one instance of entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts one-to-many relationship.

One-to-many

Many-to-one − When more than one instance of entity is associated with the relationship, it is marked as 'N:1'. The following image reflects that more than one instance of an entity on the left and only one instance of an entity on the right can be associated with the relationship. It depicts many-to-one relationship.

Many-to-one

Many-to-many − The following image reflects that more than one instance of an entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts many-to-many relationship.

Many-to-many

Participation Constraints

Total Participation − Each entity is involved in the relationship. Total participation is represented by double lines.

Partial participation − Not all entities are involved in the relationship. Partial participation is represented by single lines.

Participation Constraints


ER Model - Basic Concepts


ER Model - Basic Concepts

The ER model defines the conceptual view of a database. It works around real-world entities and the associations among them. At view level, the ER model is considered a good option for designing databases.

Entity

An entity can be a real-world object, either animate or inanimate, that can be easily identifiable. For example, in a school database, students, teachers, classes, and courses offered can be considered as entities. All these entities have some attributes or properties that give them their identity.

An entity set is a collection of similar types of entities. An entity set may contain entities with attribute sharing similar values. For example, a Students set may contain all the students of a school; likewise a Teachers set may contain all the teachers of a school from all faculties. Entity sets need not be disjoint.

Attributes

Entities are represented by means of their properties, called attributes. All attributes have values. For example, a student entity may have name, class, and age as attributes.

There exists a domain or range of values that can be assigned to attributes. For example, a student's name cannot be a numeric value. It has to be alphabetic. A student's age cannot be negative, etc.

Types of Attributes

Simple attribute − Simple attributes are atomic values, which cannot be divided further. For example, a student's phone number is an atomic value of 10 digits.

Composite attribute − Composite attributes are made of more than one simple attribute. For example, a student's complete name may have first_name and last_name.

Derived attribute − Derived attributes are the attributes that do not exist in the physical database, but their values are derived from other attributes present in the database. For example, average_salary in a department should not be saved directly in the database, instead it can be derived. For another example, age can be derived from data_of_birth.

Single-value attribute − Single-value attributes contain single value. For example − Social_Security_Number.

Multi-value attribute − Multi-value attributes may contain more than one values. For example, a person can have more than one phone number, email_address, etc.

These attribute types can come together in a way like −

simple single-valued attributes
simple multi-valued attributes
composite single-valued attributes
composite multi-valued attributes
Entity-Set and Keys

Key is an attribute or collection of attributes that uniquely identifies an entity among entity set.

For example, the roll_number of a student makes him/her identifiable among students.

Super Key − A set of attributes (one or more) that collectively identifies an entity in an entity set.

Candidate Key − A minimal super key is called a candidate key. An entity set may have more than one candidate key.

Primary Key − A primary key is one of the candidate keys chosen by the database designer to uniquely identify the entity set.

Relationship

The association among entities is called a relationship. For example, an employee works_at a department, a student enrolls in a course. Here, Works_at and Enrolls are called relationships.

Relationship Set

A set of relationships of similar type is called a relationship set. Like entities, a relationship too can have attributes. These attributes are called descriptive attributes.

Degree of Relationship

The number of participating entities in a relationship defines the degree of the relationship.

Binary = degree 2
Ternary = degree 3
n-ary = degree

Mapping Cardinalities

Cardinality defines the number of entities in one entity set, which can be associated with the number of entities of other set via relationship set.

One-to-one − One entity from entity set A can be associated with at most one entity of entity set B and vice versa.

One-to-one relation

One-to-many − One entity from entity set A can be associated with more than one entities of entity set B however an entity from entity set B, ca

DBMS - Data Independence


DBMS - Data Independence

If a database system is not multi-layered, then it becomes difficult to make any changes in the database system. Database systems are designed in multi-layers as we learnt earlier.

Data Independence

A database system normally contains a lot of data in addition to users’ data. For example, it stores data about data, known as metadata, to locate and retrieve data easily. It is rather difficult to modify or update a set of metadata once it is stored in the database. But as a DBMS expands, it needs to change over time to satisfy the requirements of the users. If the entire data is dependent, it would become a tedious and highly complex job.

Data independence

Metadata itself follows a layered architecture, so that when we change data at one layer, it does not affect the data at another level. This data is independent but mapped to each other.

Logical Data Independence

Logical data is data about database, that is, it stores information about how data is managed inside. For example, a table (relation) stored in the database and all its constraints, applied on that relation.

Logical data independence is a kind of mechanism, which liberalizes itself from actual data stored on the disk. If we do some changes on table format, it should not change the data residing on the disk.

Physical Data Independence

All the schemas are logical, and the actual data is stored in bit format on the disk. Physical data independence is the power to change the physical data without impacting the schema or logical data.

For example, in case we want to change or upgrade the storage system itself − suppose we want to replace hard-disks with SSD − it should not have any impact on the logical data or schemas.

DBMS - Data Schemas


DBMS - Data Schemas

Database Schema

A database schema is the skeleton structure that represents the logical view of the entire database. It defines how the data is organized and how the relations among them are associated. It formulates all the constraints that are to be applied on the data.

A database schema defines its entities and the relationship among them. It contains a descriptive detail of the database, which can be depicted by means of schema diagrams. It’s the database designers who design the schema to help programmers understand the database and make it useful.



A database schema can be divided broadly into two categories −

Physical Database Schema − This schema pertains to the actual storage of data and its form of storage like files, indices, etc. It defines how the data will be stored in a secondary storage.

Logical Database Schema − This schema defines all the logical constraints that need to be applied on the data stored. It defines tables, views, and integrity constraints.

Database Instance

It is important that we distinguish these two terms individually. Database schema is the skeleton of database. It is designed when the database doesn't exist at all. Once the database is operational, it is very difficult to make any changes to it. A database schema does not contain any data or information.

A database instance is a state of operational database with data at any given time. It contains a snapshot of the database. Database instances tend to change with time. A DBMS ensures that its every instance (state) is in a valid state, by diligently following all the validations, constraints, and conditions that the database designers have imposed.

DBMS - Data Models


DBMS - Data Models

Data models define how the logical structure of a database is modeled. Data Models are fundamental entities to introduce abstraction in a DBMS. Data models define how data is connected to each other and how they are processed and stored inside the system.

The very first data model could be flat data-models, where all the data used are to be kept in the same plane. Earlier data models were not so scientific, hence they were prone to introduce lots of duplication and update anomalies.

Entity-Relationship Model

Entity-Relationship (ER) Model is based on the notion of real-world entities and relationships among them. While formulating real-world scenario into the database model, the ER Model creates entity set, relationship set, general attributes and constraints.

ER Model is best used for the conceptual design of a database.

ER Model is based on −

Entities and their attributes.

Relationships among entities.

These concepts are explained below.



Entity − An entity in an ER Model is a real-world entity having properties called attributes. Every attribute is defined by its set of values called domain. For example, in a school database, a student is considered as an entity. Student has various attributes like name, age, class, etc.

Relationship − The logical association among entities is calledrelationship. Relationships are mapped with entities in various ways. Mapping cardinalities define the number of association between two entities.

Mapping cardinalities −

one to one
one to many
many to one
many to many
Relational Model

The most popular data model in DBMS is the Relational Model. It is more scientific a model than others. This model is based on first-order predicate logic and defines a table as an n-ary relation.

Relational Model Table

The main highlights of this model are −

Data is stored in tables called relations.
Relations can be normalized.
In normalized relations, values saved are atomic values.
Each row in a relation contains a unique value.
Each column in a relation contains values from a same domain.

DBMS


Data bases and database systems have become an essential component of everyday life in modern society.

Examples for database Applications:

Purchases from the supermarket
Purchases using your credit card
Booking a holiday at the travel agents
Using the local library
Taking out insurance
Using the Internet
Studying at university
Need to store data :

Data originates at one time and used later(i.e.) Store registrations for grading later, Store for future information needs, Governmental regulations requires access to past data, Data used later for auditing, evaluation purpose, Used more than once : save for future use.

Limitations of manual methods:

Problems of speed, Problems of accuracy, Problems of consistency and reliability, Problems of poor response time, Problems of work-load handling capability, Problems of meeting ad hoc information needs, Problems of cost, Problems due to human frailties: (misplaced) loyalty, inconsistency, irregularity, difficulties in handling big tasks .

Why computerized data processing? Advantage of speed, Advantage of accuracy, Advantage of reliability and consistency, Advantage of storage and retrieval efficiency, Advantage of on-line-access to meet ad-hoc needs, Advantage of cost

Database: Collection of related data. By data, we mean known facts that can be recorded and that have implicit meaning.



Definition of DBMS: A data base management system(DBMS) is a collection of programs that enables users to create and maintain a database. The DBMS is hence a general purpose software system that facilitate the process of defining, constructing , manipulating and sharing databases among the various users and applications.

Thursday, 26 October 2017

ER diagram basic


E-R diagram can express the overall logical structure of a database graphically. E-R diagrams are simple and clear—qualities that may well account in large part for the widespread use of the E-R model. Such a diagram consists of the following major components :-

• Rectangles, which represent entity sets
• Ellipses, which represent attributes
• Diamonds, which represent relationship sets
• Lines, which link attributes to entity sets and entity sets to relationship sets
• Double ellipses, which represent multivalued attributes
• Dashed ellipses, which denote derived attributes
• Double lines, which indicate total participation of an entity in a relationship set
• Double rectangles, which represent weak entity sets
Consider the entity-relationship diagram in Figure 2.8, which consists of two entity sets, customer and loan, related through a binary relationship set borrower. The attributes associated with customer are customer-id, customer-name, customer-street, and customer-city. The attributes associated with loan are loan-number and amount. In Figure 2.8, attributes of an entity set that are members of the primary key are underlined.
The relationship set borrower may be many-to-many, one-to-many, many-to-one, or one-to-one. To distinguish among these types, we draw either a directed line (→) or an undirected line (—) between the relationship set and the entity set in question.
• A directed line from the relationship set borrower to the entity set loan specifies that borrower is either a one-to-one or many-to-one relationship set, from customer to loan; borrower cannot be a many-to-many or a one-to-many relationship set from customer to loan.
• An undirected line from the relationship set borrower to the entity set loan specifies that borrower is either a many-to-many or one-to-many relationship set from customer to loan.

E-R diagram can express the overall logical structure of a database graphically. E-R diagrams are simple and clear—qualities that may well account in large part for the widespread use of the E-R model. Such a diagram consists of the following major components :-

• Rectangles, which represent entity sets
• Ellipses, which represent attributes
• Diamonds, which represent relationship sets
• Lines, which link attributes to entity sets and entity sets to relationship sets
• Double ellipses, which represent multivalued attributes
• Dashed ellipses, which denote derived attributes
• Double lines, which indicate total participation of an entity in a relationship set
• Double rectangles, which represent weak entity sets
Consider the entity-relationship diagram in Figure 2.8, which consists of two entity sets, customer and loan, related through a binary relationship set borrower. The attributes associated with customer are customer-id, customer-name, customer-street, and customer-city. The attributes associated with loan are loan-number and amount. In Figure 2.8, attributes of an entity set that are members of the primary key are underlined.
The relationship set borrower may be many-to-many, one-to-many, many-to-one, or one-to-one. To distinguish among these types, we draw either a directed line (→) or an undirected line (—) between the relationship set and the entity set in question.
• A directed line from the relationship set borrower to the entity set loan specifies that borrower is either a one-to-one or many-to-one relationship set, from customer to loan; borrower cannot be a many-to-many or a one-to-many relationship set from customer to loan.
• An undirected line from the relationship set borrower to the entity set loan specifies that borrower is either a many-to-many or one-to-many relationship set from customer to loan.


presentation introduction


                                   presentation


                                   introduction 


power point is a presentation and graphics package that enables you to present ideas on proposal in a highly propositional way,using a variety of formats-on screen,via overheads, white boards, etcetera,or in printed format

              screen layout

title bar: * identifies the application and the name of your current presentation

menu bar : * pull down menus list the commands and option available

standard toolbar : * provide buttons for the most frequently used options
 formatting toolbar : * contains buttons to change the look of the document text
available toolbar  : * many toolbars are available click the right mouse button in toolbar to see a list more than to other areas on your page by clicking and dragging

 insurrection point : * Usually a flashing I cursor shows where the next character will appear

 document window : * main making Area on the screen

 the ruler : * for changing margins, tabs and indents on documents and tables

 status bar : * area at the bottom of the PowerPoint screen gives detail of slide number and design template. it also provides details on the background activities of automatic document saving and printing

scroll bar : * horizontal and vertical bars used for scrolling through a document

other useful terms and explanation
--------------------------------------------------------------
drag and drop :
* a way of moving small amounts of text in a document
• select text, hold down the left mouse button and drag to a new destination
• to take a copy - hold down the [ctrl] key while tragging

spell check :
* PowerPoint automatically check the spelling as you type either
• if a word  has a jagged red underline,click the right mouse button
° this will give a list of alternative spelling or the option to  a add to the dictionary
• click the left mouse button to select the required option
                         or
used spelling and grammar button of the standard toolbar to spell check the whole document

 zoom :
 * a way of changing the page magnification
• click the [zoom] button on the [standard] toolbar (it look like a white box with percentage in it)
                        or
• from the menu bar,select [view] [zoom]           

Monday, 23 October 2017

pseudo code


Pseudo  code: An  informal highlevel  description  of  the operating  principle  of  a  computer  program.  It  uses  the structural  conventions  of  a  programming  language,  but  is intended  for  human  reading  rather  than  machine  reading.

Rules for Pseudocode
  • Write  only  one statement  per  line
  • Capitalize  initial  keyword
  • Indent  to  show  hierarchy
  • End  multiline  structures
  • Keep statements language  independent

flowchart


Algorithm

* Algorithm  is  a detailed  step by step  solution  to  a problem. Characteristics
  • must  be  precise  (exact)
  • must  be  effective  (successful)
  • must  have  a finite  number  of  instructions
  • execution  must  always 

Programming Tools

Tools  used  to  convert  algorithms  into  computer  programs: Pseudo  code: An  informal highlevel  description  of  the operating  principle  of  a  computer  program.  It  uses  the structural  conventions  of  a  programming  language,  but  is intended  for  human  reading  rather  than  machine  reading. Flowcharts:  Graphically  depict  the  logical  steps  to  carry out a task  and  show  how  the  steps  relate  to  each  other.

Flowcharting

  • A flowchart is  a  pictorial  representation  of  an algorithm  or  logical  steps.
  • Each  step is  represented  by  a  symbol  and the  arrows indicate  the  flow and order  of  the  steps.
  • The  shape of  the  symbol indicates  the  type  of operation that  is  to  occur.
Flow  Control  Structures
Flow control  is  the order in  which  statements are executed. There are three  control structures. 

• sequence  Control Selection  :  Control Flow  Control  Structures. FLOW control  is  the order in  which  statements are executed. There are three  control structures.
    Sequence  Control
  1. Selection  Control * Also  referred  to as  b ranching  (if  and  if-else)
  2. Repetition  Control (loops)
  3. what is computer


    What is a  Computer?
    * A  computer  is  an electronic  device  that manipulates information,  or  data. It  has the ability to  store,  retrieve, and  process  data.

    People  use  computers  to make  their  work/  jobs easier.
    1. Communication
    2. Education
    3. Business  purposes
    4. Entertainment
    5. Travel

    Advantages
    ---------------------
    Easy
    Reliable
    Effective  
    Accurate
    Time  saving
    Money  saving
    Connectivity
    More??

    Evolution  of the Computer

    1st  Generation
    * Around1940-1956
    *Relied on  Vacuum Tubes

    2nd  Generation
    *Around1956-1963
    *Used  Transistors

    3rd  Generation
    *Around1964-1971
    *Used  Integrated Circuits  

    4th  Generation
    * 1971-present
    *Uses  Microprocessors

    5th  Generation
    Artificial intelligent

    Classification  of Computers

    Computers  can be classified according to  
    Size
    Technology
    Speed
    Capacity,  etc.

    Classification  According  to  Size
    1. Personal/  Micro Computers Desktop  Computers Workstations
    Notebooks  and  Handheld  Computers
    Smart  Phones
    2. Mini Computers
    3. Mainframe  Computers
    4. Super  Computers

    Classification  According  to  Technology
    1. Analog  Computers
    2. Digital Computers
    3. Hybrid Computers

    Computer  Brands
    acer
    hp
    dell
    Lenovo
    dosiba
    ibm



    Featured post

    check box

    <!DOCTYPE html> <html> <head>   <title>Check Box</title> </head> <body>   <input ty...