sql online Training|100%Practical&Live Training


Published on

This Course is designed by iTeknowledge.com experts to provide concrete and indepth knowledge of sql and pl/sql.More details : http://www.iteknowledge.com/oracle/sqlsql-pl-sql/

Published in: Education, Technology
  • More details: http://www.iteknowledge.com/oracle/sqlsql-pl-sql/
    Are you sure you want to  Yes  No
    Your message goes here

sql online Training|100%Practical&Live Training

  1. 1. Database/SQL Overview
  2. 2. Outline • What is Database • What is DBMS • What is Schema • What is SQL • SQL Queries • Database Objects • DataModelling/ ERD
  3. 3. Database • A database is an organized collection of data. The data are typically organized in appropriate manner which allows to process the data in a easy way. • Database management systems (DBMSs) are specially designed applications that interact with the user, other applications, and the database itself to capture and analyze data. A general-purpose database management system (DBMS) is a software system designed to allow the definition, creation, querying, update, and administration of databases.
  4. 4. What is Schema • A schema is collection of database objects, including logical structures such as tables, views, sequences, stored procedures, synonyms, indexes, clusters, and database links, triggers, packages etc. • A user owns a schema. • A user and a schema have the same name.
  5. 5. SQL • SQL : Structured Query Language • SQL is a special purpose programming language designed for managing data held in RDBMS • SQL Consists of : DDL(Data Definition Language) , DML (Data Manipulation Language) and DCL(Data Control Language)
  6. 6. SQL Queries • The Most important functionality of SQL query is to retrieve the data which is achieved using SELECT statement. • Any SQL query will have : SELECT and FROM clause. SELECT [column, ] group_function(column), …. FROM table [WHERE condition] [GROUP BY column] [HAVING group_condition] [ORDER BY column] ;
  7. 7. SQL Clause’s • SELECT clause indicates which columns to be shown in the output. • FROM clause which indicates the tables from which data is to be retrieved. • WHERE clause includes a comparison operator, which restricts the rows returned by the query. • GROUP BY clause is used to project rows having common values into a smaller set of rows. GROUP BY is often used in conjunction with SQL aggregation functions or to eliminate duplicate rows from a result set. The WHERE clause is applied before the GROUP BY clause. • HAVING clause includes a predicate used to filter rows resulting from the GROUP BY clause. • ORDER BY clause identifies which columns are used to sort the resulting data, and in which direction they should be sorted (options are ascending or descending). Without an ORDER BY clause, the order of rows returned by an SQL query is undefined.
  8. 8. DDL • Data Definition Language (DDL) statements are used to define the database structure or schema. 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 • RENAME - rename an object… • FLASHBACK ... (All statements beginning with FLASHBACK) • GRANT • NOAUDIT • PURGE • RENAME • REVOKE
  9. 9. DML Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples: • SELECT - retrieve data from the a database The SELECT statement is a limited form of DML statement in that it can only access data in the database. It cannot manipulate data stored in the database, although it can manipulate the accessed data before returning the results of the query. • 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 • MERGE - UPSERT operation (insert or update) • CALL - call a PL/SQL or Java subprogram • EXPLAIN PLAN - explain access path to data • LOCK TABLE - control concurrency
  10. 10. DCL • The Data Control Language (DCL) authorizes users to access and manipulate data. Its two main statements are • GRANT authorizes one or more users to perform an operation or a set of operations on an object. • REVOKE eliminates a grant, which may be the default grant
  11. 11. TCL • Transaction control statements manage changes made by DML statements. The transaction control statements are: • COMMIT • ROLLBACK • SAVEPOINT • SET TRANSACTION • SET CONSTRAINT
  12. 12. What is a Join? • A join is a query that combines rows from two or more tables, views, or materialized views. • Oracle performs a join whenever multiple tables appear in the query's FROM clause. The query's select list can select any columns from any of these tables. • If any two of these tables have a column name in common, you must qualify all references to these columns throughout the query with table names to avoid ambiguity.
  13. 13. Joins (Cont) • Inner Join • Equi join • Natural Join • Cross Join • Outer Join • Left Outer Join • Right Outer Join • Full Outer Join • Self Join • Cross Join • Join using MULTIPLE TABLES
  14. 14. SingleRow/MultiRow(Group) Function • Single row functions : Operate on single rows only and return one result per row . • Different Types of Single row functions are – Character : UPPER, LOWER – Number : MOD – Date Conversion : TO_DATE – General :NVL, NVL2, NULLIF • Multiple row functions: Manipulates groups of rows to give one result per group of rows. • Also called as group functions • Ex: COUNT, MAX, MIN
  15. 15. Hierarchical Queries • Hierarchical queries retrieve data based on a natural hierarchical relationship between rows in a table. • Use tree walking to construct a hierarchy • Syntax : SELECT [LEVEL], column, expr … FROM table [WHERE condition(s) ] [START WITH conditions(s) ] [CONNECT BY PRIOR condition(s) ] ;
  16. 16. Database Objects • Tables (Normal), Global Temporary Table • Views(Simple, Complex), Materialized View • Indexes, Constraints, Sequence • Synonym • Procedure, Function, Package • Triggers • Schema
  17. 17. Data Modelling / ERD
  18. 18. 1 Basic SQL Statement, SELECT,FROM Clause 2 Sorting : ORDER BY , WHERE Clause 3 Single Row Function 4 Multiple Tables Data - Joins 5 Group Functions - GROUP BY Clause 6 Sub Queries 7 Manipulating data 8 Create tables 9 Constraints (PK,FK, UK) 10 Views , Materialized Views 11 Indexes 12 User Access 13 Datetime 14 SET Operators 15 Hierarchial Table Design, Query 16 Database Architecture 17 ERD Concepts & Data Modelling Using SQL Data Modeller 18 Tables Vs Global Temporary Table 19 DBMS Scheduller 20 WRAPPER Utility