Tuesday 26 July 2016

UPDATE OPERATIONS ON RELATIONS


There are three basic update operations on relations. They are ;


1.Insert Operation


2.Delete Operation


3.Modify Operation


Insert operation is used to insert a new tuple or tuples in a relation.Delete operation is used to delete tuples. Modify operation is used to change the value of some attributes. The integrity constraints specified on the relational database schema should not be violated whenever update operations are applied.


Insert Operation



The insert operation provides a list of attributes values for a new tuple t that is to be inserted into a relation R. Insert can violate any of the following constraints.


1. Domain constraints can be violated if an attribute value is given that does not appear in the corresponding domain.


2. Key constraints can be violated if a key value in the new tuple t already exists in another tuple in the relation r(R).


3. Entity integrity can be violated if the primary key of the new tuple t is null.


4. Referential integrity can be violated if the value of any foreign key in t refers to a tuple that does not exist in the referenced relation.



Delete Operation



The delete operation can violate only referential integrity, if the tuple being deleted is referenced by the foreign keys from other tuples in the database. To specify deletion, a condition on the attributes of the relation selects the tuple to be deleted.


Three options are available if a deletion operations causes a violation.


1. Reject the deletion.


2. The second option is to attempt to cascade or propagate the deletion by deleting tuples that reference the tuple that is being deleted.


3. A third option is to modify the referencing attribute values that cause the violation; each such values is either set to null or changed to reference another valid tuple. If referencing attribute that causes a violation is part of the primary key, it cannot be set to null; otherwise, it would violate entity integrity.



Modify Operation



The modify operation is used to change the values of one or more attributes in a tuple or tuples of same relation R. It is necessary to specify a condition on the attributes of the relation R to select the tuple or tuples to be modified.

Assertions and Triggers

Assertion

An assertion is a predicate expressing a condition we wish the database to always satisfy.

Domain constraints, functional dependency and referential integrity are special forms of assertion.

Triggers

A trigger is a special type of stored procedure that's automatically invoked when the user try to modify data that it's designed to protect.

Saturday 23 July 2016

Tables



All data in relational database is stored in tables. Every tables has a table name and a set of columns and rows in which the data is stored. each column is given a column name, a data type(defining characteristics of the data to be entered in the column). Usually in a relational database, some of the columns in different tables contain the same information. In this way, the tables can refer to one another.

Views (virtual Tables) in SQL



Views (virtual Tables) in SQL: The SQL DDL includes commands for defining views.A views is customized presentation of the data from one or more tables. views derive their data from the tables on which they are based, which are known as base ables of the view.


Non procedural Language :SQL is a non procedural language because it:


·         Processess sets of records rather than just one at a time

·         provides automatics navigation to the data

·        system administrators

·         Database administrators

·         Securiuty administrators

·         Application programmers

 



SQL Data Manipulation Language(DML)



SQL (Structured Query Language) is a syntax for executing queries . But the SQL language also includes a syntax to update,insert and delete records.

These query and update commands together  form the Data Manipulation Language (DML) part of SQL:

·SELECT: extracts data from a database table

·UPDATE: updates data in a database  table

·DELETE :deletes data from a database table


Transaction Control Commands:


Transaction Control Commands manage changes made by Data Manipulation Language commands. These commands are listed in the following table.


Command
Purpose
COMMIT
To make permanent the changed made by statements issued at the beginning of transaction
ROLLBACK
To undo all changes since the beginning of a transaction or since a savepoint.
SAVEPOINT
To establish a point back to which you ma y roll.
SET TRANSACTION
To establish properties for the current transaction.

SQL Data Definition Language (DDL)



The Data Definition Language (DDL) part of SQL permits database tables to be created or deleted. We can also define indexes (keys), specify links between tables, and impose constraints between database tables.


The most important DDL statements in SQL are:


·         CREATE TABLE: create a new database table

·         ALTER TABLE: alters(change ) a database table

·         DROP TABLE: delete a database table

·         CREATE  INDEX: create an index(search key)

·         DROP INDEX: delete an intex






FEATURES OF SQL



SQL is the set of commands that programs and users may use to access data within the database that supports it.  Application programs and database tools often allow users to access the database without directly using SQL, however, these applications also translate the actions into SQL under the hood.


SQL has its root in the paper, “A Relational model of data for Large Shared Data Banks” ,published by DR E. F. Codd in june 1970 in the association of computer machinery (ACM) journal, Communications of the ACM. incidentally , the paper is also contained Codd’s model, which is now accepted as the definitive model for relational database management systems(RDBMS).


·         SQL stands for Structured Query Language

·         SQL allows you to access a data base

·         SQL is an ANSI standard computer language

·         SQL can execute queries against database

·         SQL can retrieve data from a database

·         SQL can insert new records in a database

·         SQL can delete records from a database

·         SQL can update records in a database

·         SQL is easy to learn



The SQL commands can be categorised in different groups for convenience. They are;


·         Basic Queries in SQL

·         More complex SQL Queries

Wednesday 20 July 2016

TYPES OF COMMUNICATION (BASED ON LEVEL)



Intrapersonal Communication:


It is the language used or thought internal to the communicator. Intrapersonal communication is the active internal involvement of the individual in symbolic processing of messages. Both the roles of the sender and receiver, is assumed by the individual himself and he also provides feedback to herself in an ongoing internal process.


Interpersonal Communication:


It is the level in which communication channels are the medium chosen to convey the message from sender to receiver. Communication channels can be either direct or indirect.


  • Direct channels are those that are obvious and can be easily recognized by the receiver. They are also under direct control of the sender.
  • Indirect channels are those channels that are usually recognized subliminally or subconsciously by the receiver, and not under direct control of the sender.

Group Communication:


Group Communication refers to the nature of communication that occurs in groups that are between 3 to 12 individuals. Small group communication generally takes place in a context that mixes interpersonal communication interations with social clustering.


Public Communication:


It's at the heart of our economy, society, and politics.Studios use it to promote their films. Politicians use it to get elected. Businesses use it to burnish their image. It's a field built on ideas and images, persuasion and information, strategy and tactics. No policy or product can succeed without a smart message targeted to the right audience in creative and innovative ways.

BARRIERS & BREAKDOWNS IN COMMUNICATION



The managers frequently cite communication breakdowns as one of their most important problems. However, communication problems are often symptoms of more deeply rooted problems. For example, poor planning may be cause of uncertainty about the direction of the firm, Similarly, a poorly designed organisation structure may not clearly communicate organisational relationships. Vague performance standards may leave people uncertain about what is expected of them. Thus the perceptive manager will look for the causes of communication problems instead of just dealing with the symptoms. Barriers can exist in the sender, in the transmission of the message, in the receiver, or in the feedback. Specific communication barriers are discussed below :


(i) Lack of Planning: Good communication seldom happens by chance. Too often people start talking and writing without first thinking, planning and stating the purpose of the message. Giving the reasons for a directive, selecting the most appropriate channel, and choosing proper timing can greatly improve understanding and reduce resistance to change.


(ii) Unclarified Assumptions: Often overlooked, yet very important, are the uncommunicated assumptions that underlie messages. A customer may send a note stating that he will visit a vendor’s plant. Then he may assumethat the vendor will meet him at the airport, reserve a hotel room, arrange for transportation, and set up a fullscale review of the programme at the plant. But the vendor may assume that the customer is coming to town mainly to attend a wedding and will make a routine call at the plant. These unclarified assumptions in both instances may result in confusion and the loss of goodwill.


(iii) Poorly Expressed Message: No matter how clear the idea in the mind of the sender of communication, it may still be marked by poorly chosen words, omissions, lack of coherence, poor organisation of ideas, awkward sentence structure, unnecessary jargons and a failure to clarify the implications of the message. This lack of clarity and precision, which can be costly, can be avoided through greater care in encoding the message.



(iv) Loss of Transmission and Poor Retention: In a series of transmissions from one person to next, the message becomes less and less accurate. Poor retention of information is another serious problem. Thus the necessity of repeating the message and using more than one channel is rather obvious. The loss may also be due to long distance, distracting noises and similar interferences.


(v) Poor Listening and Premature Evaluation: There are many talkers but few listeners. Everyone probably has observed people entering a discussion with comments that have no relation to the topic. One reason may be that these persons are pondering over their own problems - such as preserving their own egos or making a good impression on other group members instead of listening to the conversation. Listening demands full attention and self-discipline. It also requires that the listener avoid premature evaluation of what another person has to say. A common tendency is to judge to approve or disapprove what is being said- rather than trying to understand the speakers frame of reference. Yet listening without making hasty judgements can make the whole enterprise more effective and efficient. For example, sympathetic listening can result in better labour management relations and greater understanding among managers. Specially sales personnel may better understand the problems of production people, and the credit manager may realize that an over-restrict credit policy may lead to adisproportionate loss in sales. In short, listening with empathy can reduce some of the daily frustrations in organised lies and result in better communication.


(vi) Semantic Distortion: Semantic is the science of the meaning of words and symbols. Another barrier to effective communication is semantic distortion, which can be deliberate or accidental. An advertisement that states ‘we sell for less’ is deliberately ambiguous; it raises the question - less than what? Words may evoke different responses. To some people the ‘Government’ may mean interference or deficit spending; to others, the same word may mean help, equalization, and justice.

COMMUNICATION PROCESS


Communication process involves sender, transmission of message through a selected channel, receiver and the feedback. The specific steps in communication process are described below :


(a) The Sender of the Message :


Communication begins with the sender, who has a thought or an idea which is then encoded in a way that can be understood by both the sender and the receiver. While it is usual to think of encoding a message into the English language, there are many other ways of encoding, such as translating the thought into computer language.


(b) Channel for Transmission of Message :


The information is transmitted over a channel that links the sender with the receiver. The message may be oral or written, and it may be transmitted through a memorandum, a computer, the telephone, the telegram or television. Television of course, also facilitates the transmission of gestures and visual clues. At all times two or more channels are used. In a telephonic conversation, for instance, two people may reach a basic agreement that they later confirm by a letter. Since many choices are available, each with advantages and disadvantages, the proper selection of the channel is vital for effective communication.


(c) The Receiver of the Message :


The receiver has to be ready for the message so that it can be decoded into the idea. A person thinking about an exciting cricket match may pay insufficient attention to what is being said about an inventory report, thus increasing the probability of a communication breakdown. The next process is the decoding, in which the receiver converts the message into thoughts. Accurate communication can occur only when both the sender and the receiver attach the same or atleast similar meanings to the symbols that compose the message. Thus, it is obvious that a message encoded into German requires a receiver who understands German. Less obvious, and frequently overlooked, is the fact that a message intechnical or professional jargons requires a recipient who understands such language. So communication is not complete unless it is understood. Understanding is in the mind of both the sender and the receiver. Persons with closed minds will normally not completely understand messages, especially if the information is contrary to their value system.


(d) The Feedback :


To ensure that the message has reached the intended receiver correctly, the communicator has to get feedback from the receiver about the message. Feedback ensures that the process of communication has intact taken place. The feedback provides learning opportunities to the sender and the receiver because it mirrors the consequences of the behaviour. In addition, if the behaviour has been found to be incongruous with the message it opens avenues to make corrections wherever necessary. Without feedback it would be difficult to ascertain whether communication has been received as indicated or not. In organisational settings feedback is essential. Each employee needs to know where he stands vis-a-vis the organisational expectations, so that he can adjust his behaviour. Similarly, all organisations need some feedback from employees on their policies and practices in order to make improvements whenever necessary. All organisations have mechanisms to seek and receive feedbacks because the overall viability depends to a large extent on the sharing of information. However, it is often noticed that the efforts of a management to plan and establish reliable and formalized systems of feedback are often defeated because of the widespread tendency of people to establish informal channels and also because of various sources of distortions. Since most of the feedback in organisations is work related, the system should be improved and made more effective.

IMPORTANCE OF COMMUNICATION


Communication is an indispensable part of the process of management. The success of an enterprise depends upon the effective of communication. Every manager must communicate in order to get things done through others. A good communication system offers the following benefits :


1. Basis of Decision-Making and Planning: Communication is essential for decision-making and planning. It enables the management to secure information without which it may be possible to take any decision. The quality of managerial decisions depends upon the quality of communication. Further, the decisions and plans of the management need to be communicated to the subordinates. Without effective communication, it may not be possible to issue instructions and orders. Effective communication helps in proper implementation of plans and policies of the management.

2. Smooth and Efficient Working: Communication makes possible the smooth and efficient working of an enterprise. It is only through communication that the management changes and regulates the actions of the subordinates in the desired direction.

3. Facilitates Co-ordination: Management is the art of getting things done through others and this objective of management cannot be achieved unless there is unity of purpose and harmony of effort. Communication through exchange of ideas and information helps to bring about unity of action in the pursuit of common purpose. It binds the people together and facilitates co-ordination.

4. Increases Managerial Efficiency: Effective communication increases managerial efficiency. It is rightly said that nothing happens in management until communication takes place. The efficiency of a manager depends upon his ability to communicate effectively with the members of his organisation. It is only through communication that management conveys its goals and desires, issues instructions and orders, allocates jobs and responsibility and evaluates performance of subordinates.

5. Sound Industrial Relations: Effective communication creates mutual understanding and trust among the members of the organisation. It promotes co-operation between the employer and the employees. Without communication, there cannot be sound industrial relations and industrial peace. It is only through communication that workers can put in their grievances, problems and suggestions to the management.

6. Helps in Establishing Effective Leadership: Communication is the basis of effective leadership. There cannot be any leadership action without the effective communication between the leader and the led. Communication is absolutely necessary for maintaining man to man relationship in leadership. It brings the manager (leader) and the subordinates (led) in close contact with each other and helps in establishing effective leadership.

7. Motivation and Morale: Communication is the means by which the behaviour of the subordinates is modified and change is effected in their actions. Through communication workers are motivated to achieve the goals of the enterprise and their morale is boosted. Although motivation comes from within yet the manager can also motivate people by effective communication, e.g., proper drafting of message, proper timing of communication and the way of communication, etc.

8. Effective Control: Communication acts as a tool of effective control. The plans have to be communicated to the subordinates, the actual performance has to be measured and communicated to the top management and a corrective action has to be taken or communicated so as to achieve the desired goals. All this may not be possible without an efficient system of communication.

9. Job Satisfaction: Effective communication creates job satisfaction among employees as it increased mutual trust and confidence between management and the employees. The gap between management and the employees is reduced through the efficient means of communication and a sense of belongingness is created among employees. They work with zeal and enthusiasm.

10. Democratic Management: Communication is also essential for democratic management. It helps to achieve workers’ participation in management by involving workers in the process of decision-making. In the absence of an efficient system of communication, there cannot be any delegation an decentralization of authority.

11. Public Relations: In the present business world, every business enterprise has to create and maintain a good corporate image in the society. It is only through communication that management can present a good corporate image to the outside world. Effective communication helps management in maintaining good relations with workers, customers, suppliers, shareholders, government and community at large.

COMMUNICATION FUNCTION IN ORGANISATIONS


The communication function as the means by which the activities in the organisation are coordinated to achieve the organisational goals. It is also the means by the which behaviour is modified, change is effected, information is made productive & goals are achieved. Whether it is with a business enterprise, a family, educational institution or trade exhibition, the transfer of information from individual to another is absolutely essential.


There are two main types of communication in every organisation – formal & informal communication.


1.Formal Communication

Formal communication refers to official communication which takes place through a chain of commands. It flows in formally established channels & is concerned with work related matters. Members of the enterprise and expected to communication with one another strictly as per channels laid down in the structure.


The formal communication may be divided into three categories which are given as follows:


a) Downward Communication:


Under this system, the flow of communication from the top management downward to be operating level. It may also be called a communication from a superior to a subordinate. It follows the line of authority from the top to the bottom of the organisation hierarchy. Downward communication consists of plans & policies, orders and instructions, procedures & rules etc.


b) Upward Communication:


It means the flow of information from the lower levels of the organisation to the higher level of authority. It passes from subordinate to superior as that from worker to foreman, foreman to manager. From manager to general manager & so on. This communication includes opinions, ideas, suggestions,complaints, grievances, appeals, reports etc. It is very important as it serves as the feedback on the effectiveness of downward communication. Management is able to know how well its policies, plans & objectives are followed by those working at lower levels of the organisation. It keeps the management informed about the progress of the work & difficulties faced in performance. On the basis of upward communication, the management revises its plans & policies & makes further planning.


c) Horizontal Communication:


The transmission of information and understanding between people on the same level of organisation hierarchy is called the horizontal communication. This type of communication is also known as lateral or side-ward or crosswise communication. Usually, it pertains to inter departmental managers working at the same level of organisation or among subordinates working under one boss. Horizontal communication speeds up information and promotes mutual understanding. It enables the managers working at the same level to exchange information and co-ordinate their activities without referring all matters to the higher level of management.The horizontal communication is generally of an informal nature. Whenever a departmental head requires some information from another departmental head, he tends to contact him directly. However, this type of communication can be oral or written.


2.Informal Communication


There is also a great deal of informal communication in an organisation. This communication flows through informal channels and may or may not be work related. Informal communication cuts through the formal organisational structure. Most of us are familiar with the term ‘grapevine’ used to describe a network of informal communication. Grapevines are present in all organisations. In fact, in large organisations, there are many grapevines moving up, down and across departments. Grapevines flourish because communication is a natural human tendency. People who know each other in the organisation talk together informally. One thing they have in common is the organisation they work for, so they talk about the happenings in the organisation. Grapevines carry two types of information : work related and people related. Employees want to know what is going on inthe organisation. When they are not kept informed through formal channels, they seek information from the grapevine. Likewise, they are curious about the people they work with. Grapevine carry the type of personnel information not generally communicated through formal channels. Employees get to know plans, promotions, punishments, etc, much before they are formally announced. Informality however, reduces uniformity of communication and sometimes false or distorted news is circulated. Some employees consider the grapevine their main source of information. It is fast- they get information quickly and more information is given than is normally included in formal downward communications, which are often written and may originate from some one they do not know personally.Manager often become frustrated with grapevines, particularly when they carry incorrect information. But grapevines exist; managers cannot stop them. Managers can, however, increase the accuracy of the grapevine by feeding it correct information. And they can try to reduce the relevance placed on grapevines by making certain that formal communication is complete and timely.

BUSINESS COMMUNICATION


The word 'Business' stands for any economic activity undertaken with a view to earn profit. The communication undertaken in the process of this activity is termed as business communication. From the very inception of the idea of the Business, to run the day to day activities of the Business, communication is involved. It includes oral, written, formal, informal, upward, downward, lateral, diagonal, inward, outward as well as non verbal communication.


Communication is the most vital ingredient of an organisation. In fact, an organisation cannot be conceived of without communication. An organisation is a group of persons constituted to achieve certain specific objectives. The achievement of these objectives largely depends upon a proper co-ordination and integration of human effort in an organisation. The people working in an organisation; their activities are also interrelated because all activities are performed only to active the organisational objectives. Co-ordination and integration of various human activities are possible only if there is an effective system of communication in the organisation which provides for exchange of information and sharing of various ideas. The more effective the system of communication, the better is the relation between workers and the management. It is communication which gives life to the organisation; so, it is rightly known as the life blood of an organisation.

Monday 18 July 2016

INTEGRITY CONSTRAINTS



Integrity constraints provide a way of ensuring that changes made to the database by authorised users do not result in a loss of data consistency. An integrity constraint can be any arbitrary predicate applied to the database. They may be costly to evaluate, so we will only consider integrity constraints that can be tested with minimal overhead.


DOMAIN CONSTRAINTS   

 

Domain constraints specify that the value of each attribute A must be an atomic value from the domain dom (A) for that attribute. Some data types associated with domains are given below;  

  • Standard numeric data types for integers (such as short-integer, integer, long-integer). 

  • Real numbers (float and double-precision float). 
  •         Characters, fixed-length strings, and variable-length strings.


ENTITY INTEGRITY

Entity integrity is a property that ensures that no records are duplicated and that no attributes that make up the primary key are NULL. It is the one of the properties necessary to ensure the consistency of the database.


Entity Integrity ensures that there are no duplicate records within the table and that the field that identifies each record within the table is unique and never null.

The existence of the Primary Key is the core of the entity integrity. Entity integrity specifies that the Primary Keys on every instance of an entity must be kept, must bt unique and must have values other than NULL.


REFERENTIAL INTEGRITY

Referential integrity is usually enforced by the combination of a primary key or candidate key (alternate key) and a foregin key. A foregin value must match an existing value of the parent table.Foregin hey based on data values and are purely logical not physical.

DATA TYPES


The data types available with SQL are given below;


Internal Data type
Description
VARCHAR2 (size)
Variable length character string maximum length size bytes. Maximum size is 2000 and minimum is 1. You must specify size for a VARCHAR2.
NUMBER (p,s)
Number having precision p and scale s. The precision p can range from 1 to 38. The scale s can range from -84 to 127.
LONG
Character data of variable length up to 2 gigabytes, or 231-1 bytes.
DATE
Valid date range from January 1,4712 BC to December 31, 4712 AD.
RAW (size)
Raw binary data of length size bytes. Maximum size is 255 bytes. You must specify size of a RAW value.
LONG RAW
Raw binary data of variable length up to 2 gigabytes.
ROWID
Hexadecimal string representing the unique address of a row in its table. This data type is primarily for values returned by the ROWID pseudo column.
CHAR(size)
Fixed length character data of length size byte. Maximum size is 255. Default and minimum size is 1 byte.