110 likes | 209 Views
Introduction to Oracle. In June 1970,Dr E.F.Codd’s a published
E N D
Introduction to Oracle In June 1970,Dr E.F.Codd’s a published A paper entitled A relational model of Data for large shared data banks. This relational model ,sponsored by IBM,then came to be accepted as the definitive model for RDBMS.The language developed by IBM to manipulate the data stored within Codd’s model was originally called Structured English Query Language(SEQLUEL)with the word English later being dropped in favor Structured Query Language(SQL). In 1979 a company called Relational Software,Inc.released the first commercially available implementation of SQL.Relational Software later came to be known as Oracle Corporation. Oracle Corporation is a company that produces the most widely used, server based ,Multi based,Multi user RDBMS named Oracle.
Introduction to SQL • SQL is a language that provides an interface to relational database systems.SQL was developed by IBM in the 1970s .It has 9 commands which are common to all RDBMS • A)Create,Drop,Alter for tables • B)Insert,Update,Deletefor records • C)Grant,Revokefor permission • D)Select for Query
SQL*plus • SQL*Plus is made up of two distinct parts. • I) Interactive SQL • II) PL/SQL • Interactive SQL is designed to create, access & maintain all data structures like tables, indexes etc.It can also be used for interactive, data manipulation • Programmers can use PL/SQL to create programs for validation & manipulation of table data.PL/SQL adds to the power of interactive SQL & provides the user with all the facilities of a standard, modern day(4GL) programming environment. • SQL is a subset of SQL*Plus.
Features of SQL • 1) SQL can be used by a range of users, including those with little or no programming experience. • 2)It is a non procedural language. • 3)It reduces the amount of time required for creating & maintaining systems.
Features of SQL*Plus • 1)SQL*Plus accepts ad hoc entry of statements. • 2)It accepts SQL input from files. • 3)It provides a line editor for modifying SQL statements. • 4)It controls environmental settings. • 5)It formats query results into basic reports. • 6)It accesses local & remote database.
Rules for SQL • 1)SQL starts with a verb.e.x SELECT statements. This verb may have additional adjectives Ex: FROM • 2) clauses Ex: FROM,WHERE,HAVING • 3) A space separates clauses. EX:DROP TABLE EMP; • 4) A comma(,) separates parameters without a clause • 5)A(;) is used to end SQL statements • 6) Statements may be split across lines but keyword may not • 7)Reserved words cannot be used as identifiers unless enclosed with double quotes. Reserved words are:-AS,ON,HAVING CHECK etc. • 8)Identifiers can contain up to 30 characters & must start with an alphabetic character. • 9)character & date literals must be enclosed within single quotes. • 10) comments may be enclosed between /* and */ symbols & may be multi line. Single line comment may be prefixed a – symbol.
Components of SQL • DDL(Data Definition Language):-Used to create ,modify & delete database • DML(Data Manipulation Language):-It is the area of SQL that allows changing data within the database • DCL(Data Control Language):-control access to data & to the database. • DQL(Data Query Language):-It allows getting data from the database & out of the database perform operation with it.
Examples of DDL,DML,DCL& DQL • DDL:- • CREATE To create object in the database • ALTER Alters the structure of the database • DROP Delete objects from the database • TRUNCATE Remove all records from a table, including all spaces allocated for the records are removed.
DML:-Data Manipulation language • INSERT Insert data into a table • UPDATE Updates existing data within a table • DELETE Deletes all records from a table, the space for the records remain.
DCL : Data control language • COMMIT Save work done • SAVEPOINT Identify a point in a transaction to which u can later roll back • ROLLBACK Restore database to original since the last COMMIT • SET TRANSACTION change transaction options like what rollback segment to use • GRANT/REVOKE Grant or take back permissions to or from the oracle users
DQL : Data Query Language • SELECT Retrieve data from the a database.