24
DATA, INFORMATION AND KNOWLEDGE Data: • Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. • It can be defined as a set of isolated and unrelated raw facts, represented by values, which have little or no meaning because they lack a context for evaluation. • Values are represented in the form of characters, numbers or any symbol Ex: Kamal,24, Scientist,1000$

DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Embed Size (px)

Citation preview

Page 1: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

DATA, INFORMATION AND KNOWLEDGE

Data: • Data can be anything such as a number, a person’s

name, images, crops name, sounds and so on.• It can be defined as a set of isolated and unrelated raw

facts, represented by values, which have little or no meaning because they lack a context for evaluation.

• Values are represented in the form of characters, numbers or any symbol

Ex: Kamal, 24, Scientist, 1000$

Page 2: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Information:• When the data is processed and converted into a meaningful

and useful form, it is known as information.• Information can be defined as a set of organised and validated

collection of data.Ex: Kamal is 24 years old, he is a Scientist and his salary is

1000$.Knowledge:• It is the act of understanding the context in which the

information is used• It can be based on learning through information, experience.• Based on the knowledge , the information can be used in a

particular context. Ex: if a former uses the information about Kamal(He is scientist)

then the former is using his knowledge.

Page 3: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Data processing:

- means the process of collecting all items of data together to produce meaningful information. It can be done either manually or by the use of computers. If data processing is done with the help of computers, it is known as EDP (Electronic Data Processing)

Data InformationKnowledgeMeaningful

form

Conclusion

made

Page 4: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Need for Information• Information is an important part of our day-to-day life.• Almost all activities of our life are affected by the quantity as well as

the quality of information. Usage of Information:• Information and Decision-Making:

- Decision-making is the process of identifying, selecting and implementing the best possible alternative.

- The right information , in the right form, and at the right time, is essential to make correct decisions.

Ex: Cell Phone (Aircel, Hutch etc)• Information and Communication:

- Information is vital / Important for communication and a critical resource for performing work in organisations.- Business manager spend most of their day in communicating with other managers, customers , vendors etc, which involves collecting, processing and distributing information.

Page 5: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

• Information and Knowledge:

- Information plays a vital role in the accumulation of knowledge.

- The future is shaped by our actions today, and our actions today are based

upon our knowledge.

- Therefore, for achieving higher levels of success, one must be well

informed and should have clarity of knowledge.• Information and Productivity:

- Information helps in making sense of our environment, which assists in

achieving the performance objectives .

- Productivity is directly related to the availability and value of the information – The necessary information is being supplied to the right people at the right

time in the organistion.(Ex: Question paper)

Page 6: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Database FundamentalsDatabase :• In the modern management system ( Organizations) , data are necessary for

taking valuable decisions and they become the backbone of any organization.

• This set of interrelated data is known as a database.

• That is organised collection of related data

• Keeping this data up-to-date,

• In order to carry out operations like insertion, deletion, and retrieval , the database needs to be managed by a Software Package. This Software is called Database Management System or DBMS.

A database management system is a software system that allows access to

data contained in a database

• A database system is an integrated collection of related Tables (files)

• Table is a collection of records. ie the data is organised into storage containers called Table.

• Record is nothing but collection of interrelated fields, field is data. Table/File is stored in second memory (Ex. Hark disk, floppy,CD) .

Page 7: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Eno Ename Dept post basic

111 Kumar Sales Manager 6000

222 Umar Purchase Accountant 5000

333 Vino Sales Clerk 2500

444 Raj Marketing Manager 6000

Table / File (Ex: Employee)

Field 1 or Column 1

Field 2 or Column 2 -------

Field 5 or Column 5

Record 1 or row 1

----

--

Record 4 or row 4

Page 8: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

RDBMS : • RDBMS is Relational Data Base Management System where all the data visible to

the user is organized strictly as tables and all database operations work on these tables. Each table relation in a database has a unique table name that identifies its contents.

• The row or record in the table is called tuple.• The column or field is called attribute.RDBMS Software (Product):1. ACCESS2. SQL server3. ORACLE4. MySql5. SYBASE6. INGRES7. DATABASE 28. DBC/10129. INFORMIX10. SQLBASE11. UNIFY

SQL: Structured Query Language• It is used to communicate with the relational database.• It is a non-procedural language because it processes sets of records rather than just one

data at a time.• The SQL command allows a set of rows as input and a set of rows as output.

Page 9: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Overview of ORACLE Architecture

SQL

Data Dictionary

Kernel

Page 10: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

• Kernel : It provides communication with the database and the connection with other kernels in a distributed database environment.

• Data Dictionary : It is made up of tables and views. It provides the details of the database object such as tables, columns, views, oracle users and rights privileges of the object.

• SQL (Structured Query Language): Tables and views of data dictionary are manipulated through SQL by the database.

Introduction to SQL • It is used to communicate with the relational database.• It is non procedural language because it processes sets of records

rather than just one data at a time also it allows a set of rows as input and a set of rows as output.

Page 11: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Data types• CHAR

- Character string. It specifies a fixed length character string. - The default length is 1 byte.- The maximum length is 255 bytes- Syntax : CHAR(N)

N – is the size of variableEx: create table emp(name char(15));

• VARCHAR2- Character string. It specifies variable length character string.- The default length is 1 byte.- The maximum length is 2000 bytes- Syntax : VARCHAR2(N)

N – is the size of variableEx: create table emp(name varchar(15));

• NUMBER- Used to store zero, Positive and negative fixed and floating point

numbers with 38 digits precision. - Syntax 1 NUMBER (p,s)

p – is the precision or the total number of digits.s – is the scale or number of digits to the right of the decimal point.

ex: create table emp (salary number(8,2);

Page 12: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

- Syntax 2 NUMBER (p)

is the fixed point number with precision p and scale 0digits.

ex: create table emp (age number(2));- Syntax 3 NUMBER

here s is the fixed point number with precision 38

ex: create table emp (age number)

• Long- It stores variable length character strings containing upto 2 GB.- The length of the LONG values may be limited by the memory available on

the computer.- A table cannot contain more than one LONG column. - Syntax : LONG- Ex: create table emp( activities LONG);

Page 13: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

• DATE- Used to store date and time information.- For each DATE value the following information is stored

Century, Year, Month, Minute and Second.- Syntax : DATE- Ex: create table emp(dob DATE);

• RAW and LONG RAW- These types are used to store floating point data, binary data such as

graphics, images and digitized sound.- We can’t perform string manipulation on RAW data.- Syntax : RAW

LONG RAW- Ex: Create table emp (photo raw);

• ROWID- Each row in the database has an address.- We can examine a row’s address by querying the pseudo column ROWID.

Page 14: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Components of SQLSQL components as falling in three categories,

1. DDL (Data Definition Language)2. DML (Data Manipulation Language)3. DCL (Data Control Language)

DDL :The study of DDL deals with creation, modification and deletion of table.

Create Table:The command CREATE TABLE is used to create a new table.

Syntax:CREATE TABLE < table name > ( column1 datatype,

column2 datatype, ----- -----

column N datatype);Ex:

CREATE TABLE emp (eno number(3), ename char(10), dept char(15), post char(15), basic number(6));

Page 15: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Alter Table:The command ALTER TABLE is used to modify existing column name, data type,

and width as well as adding new column in the existing table.

Syntax :

ALTER TABLE <table name>

ADD ( col1 datatype, col2 datatype, ---- colN datatype);

MODIFY (col1 datatype, col2 datatype, ---- colN datatype);

Example:

ALTER TABLE emp

ADD ( sex char(6));

MODIFY ( dept char(20),

basic numeric(8));

Drop Table:It removes the specified table and all its data (records) from the database.

Syntax:

DROP TABLE <table_name>;

Ex:

DROP TABLE emp;

Page 16: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

DML - Data Manipulation LanguageIt allows you to add, modify or delete data ( record) from the database.

INSERTThe INSERT command inserts one or more rows into a table.

a) Direct Method:

Syntax: 1

INSERT INTO <table_name> VALUES (list of values);

Ex:1

INSERT INTO emp VALUES (111,’Ram’,’Sales’,’Manager’,8000,’Male’);

Ex:2

INSERT INTO emp VALUES( 222,’Muniya’,’Purchase’,’Asst.Manager’,7000,’Female’);

Ex:3

INSERT INTO emp VALUES (333,’Bosco’,’Marketing’,’Manager’,8000,’Male’);

Ex:4

INSERT INTO emp VALUES (444,’Vinothini’,’Sales’,’Clerk’,5000,’Female’);

Page 17: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

b) Inserting specific columns:

Syntax: 2

INSERT INTO <table_name> [column-name1, column-name2…]

VALUES (column-value1, column-value2,….);

Ex: Inserts only number, name, department and sex

SQL> INSERT INTO emp(eno,ename,dept,sex) VALUES(555,’Rajive’,’Sales’,’Male’);

c) Insertion with Macros

Syntax: 3

INSERT INTO <table_name> [column-name1, column-name2…]

VALUES (&MacroName1, &MacroName2…...);

Ex:

SQL> INSERT INTO emp

VALUES (&eno,’&ename’,’&dept’,’&post’,&basic,’&sex’);

d) Insertion with query

Syntax: 1

INSERT INTO <table_name> [column-name1, column-name2…]

SubQuery;

Page 18: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Ex:

SQL>INSERT INTO SALES-EMP SELECT * FROM EMP WHERE

DEPT = ‘Sales’;

UPDATE

It allows you to update one or more columns and one or more rows in a table.

Syntax:

UPDATE <table_name> SET column = value | exp | Subquery

WHERE condition;

Page 19: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Ex 1: To increase the basic pay with Rs. 500 only for Managers.

UPDATE emp SET basic = basic + 500 WHERE post = ‘Manager’;

Ex 2: To add 5 % basic as commission with salary only for whose belongs to marketing

department.

UPDATE emp SET basic = basic + ( basic * 5/100) WHERE dept = ‘Marketing’;

SELECT

It is used to retrieve data (record) from one or more tables.

Syntax:

SELECT *|field1,field2,…field n FROM <table_name> WHERE condition;

Ex :1 To list all employee from EMP table.

SELECT * FROM emp;

Ex: 2. To display only female employee

SELECT * FROM emp WHERE sex = ‘Female’;

Ex: 3 To list all employees whose salary is less than 10000

SELECT * FROM emp WHERE basic <= 10000;

Page 20: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

DELETE:It allows you to delete data ( record) from a table.

Syntax:DELETE FROM <table_name> WHERE condition;

Ex: To remove only female employees DELETE FROM emp WHERE sex = ‘Female’;

DCL – Data Control Language( Transaction Control Language)

COMMITInsertions and other changes to tables normally are not committed until we exit from SQL or until we execute an any DDL command. But if we want to make a permanent changes manually then we use COMMIT command.

Syntax: COMMIT;

ROLLBACKIt throws away all changes made to data since the last COMMIT.

Syntax:ROLLBACK;

Page 21: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Ex: SQL>select * from emp;ENO ENAME DEPT POST BASIC--- ---------- --------------- --------------- ---------111 kumar sales manager 16000222 umar purchase account 7000333 vino sales clerk 5000444 raj marketing manager 15000555 muniya purchase manager 15000666 omna sales asst.manager 12000

SQL> update emp1 set basic = basic + 500 where ename = 'kumar';SQL> update emp1 set basic = basic + 600 where ename = 'raj';

NowSQL>select * from emp;ENO ENAME DEPT POST BASIC--- ---------- --------------- --------------- ---------111 kumar sales manager 16500222 umar purchase account 7000333 vino sales clerk 5000444 raj marketing manager 15600555 muniya purchase manager 15000666 omna sales asst.manager 12000

Page 22: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Suppose if we are apply ROLLBACK

Ex:

SQL>ROLLBACK;

It cancel all previous action (DML) up to last COMMIT or any DDL commands or exit from ORACLE

SQL>select * from emp;

ENO ENAME DEPT POST BASIC

--- ---------- --------------- --------------- ---------

111 kumar sales manager 16000

222 umar purchase account 7000

333 vino sales clerk 5000

444 raj marketing manager 15000

555 muniya purchase manager 15000

666 omna sales asst.manager 12000

Page 23: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

Note: - A transaction is a sequence of SQL statements that ORACLE treats as a

single unit.

- A transaction begins with the first executable SQL statement after a

COMMIT, ROLLBACK or connection to ORACLE.

- A transaction ends with COMMIT, ROLLBACK or disconnection from

ORACLE.

SAVEPOINT:- These are used to identify a point in a transaction to which one can later rollback.- They are used in conjunction with the ROLLBACK command to rollback portions of the current

transaction.- Syntax : SAVEPOINT <name>;

Ex:

SQL>select * from emp;

ENO ENAME DEPT POST BASIC

--- ---------- --------------- --------------- ---------

111 kumar sales manager 16000

222 umar purchase account 7000

333 vino sales clerk 5000

444 raj marketing manager 15000

555 muniya purchase manager 15000

666 omna sales asst.manager 12000

Page 24: DATA, INFORMATION AND KNOWLEDGE Data: Data can be anything such as a number, a person’s name, images, crops name, sounds and so on. It can be defined as

SQL> update emp1 set basic = basic + 500 where ename = 'kumar';SQL> SAVEPOINT k_salary;

SQL> update emp1 set basic = basic + 600 where ename = 'raj';SQL>SAVEPOINT r_salary;

Now: To cancel only raj record changes but retains kumar changes

SQL> ROLLBACK TO SAVEPOINT k_salary;

NowSQL> select * from emp;

ENO ENAME DEPT POST BASIC--- ---------- --------------- --------------- ---------111 kumar sales manager 16500222 umar purchase account 7000333 vino sales clerk 5000444 raj marketing manager 15000555 muniya purchase manager 15000666 omna sales asst.manager 12000