RDBMS_Day3 - RDBMS-Day3 SQL – Basic DDL statements –...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: RDBMS-Day3 SQL – Basic DDL statements – DML statements – Aggregate functions 2 • SQL is used to make a request to retrieve data from a Database. • The DBMS processes the SQL request, retrieves the requested data from the Database, and returns it. • This process of requesting data from a Database and receiving back the results is called a Database Query and hence the name Structured Query Language. SQL 3 SQL • SQL is a language that all commercial RDBMS implementations understand. • SQL is a non-procedural language • We would be discussing SQL with respect to oracle syntax You can’t write programs like the ones you would have done using C language You can only write questions in English like language called queries which will fetch some data rows from the database. 4 Structured Query Language (SQL) 5 • 1979 Oracle Corporation introduces the first commercial RDBMS • 1982 ANSI (American National Standards Institute) forms SQL Standards Committee • 1983 IBM (International Business Machine) announces DB2 (a Database) • 1986 ANSI (American National Standards Institute) SQL1 standard is approved • 1987 ISO (International Organization for Standardization) SQL1 standard is approved • 1992 ANSI (American National Standards Institute) SQL2 standard is approved • 2000 Microsoft Corporation introduces SQL Server 2000, aimed at enterprise applications • 2004 SQL: 2003 standard is published Structured Query Language (SQL) 6 Statements • DDL (Data Definition Language) – Create – Alter – Drop – Truncate • DML (Data Manipulation Language) – Insert – Update – Delete – Select • DCL (Data Control Language) – Grant – Revoke – Commit – Rollback SQL has three flavours of statements. The DDL, DML and DCL. DDL is Data Definition Language statements. Some examples: CREATE - to create objects 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 COMMENT - add comments to the data dictionary GRANT - gives user's access privileges to database REVOKE - withdraw access privileges given with the GRANT command DML is Data Manipulation Language statements. Some examples: SELECT - retrieve data from the a database 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 CALL - call a PL/SQL or Java subprogram EXPLAIN PLAN - explain access path to data LOCK TABLE - control concurrency DCL is Data Control Language statements. Some examples: COMMIT - save work done SAVEPOINT - identify a point in a transaction to which you can later roll back ROLLBACK - restore database to original since the last COMMIT SET TRANSACTION - Change transaction options like what rollback segment to use 7 Data types • Number • Char • Varchar2 • Long • date SQL supports various data types Integers...
View Full Document

This note was uploaded on 12/29/2011 for the course COMPUTER Day3 taught by Professor Animesh during the Spring '11 term at Abraham Baldwin Agricultural College.

Page1 / 61

RDBMS_Day3 - RDBMS-Day3 SQL – Basic DDL statements –...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online