SlideShare a Scribd company logo
1 of 244
Download to read offline
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.                       SQL Star International Limited




                                                                                                                                                                        a
                                                                                                                                                                ) has
                                                                                                                                                            c om ฺ
                                                                                                                                                        ailฺ uide
                                                                                                                                                   gm 10g:
                                                                                                                                  Oracle Database nt G SQL
                                                                                                                                                @
                                                                                                                                            rale tude
                                                                                                                                  Fundamentals I
                                                                                                                                          a
                                                                                                                                     hlk his S
                                                                                                                                   (r Guide
                                                                                                                               A OStudente t • Volume 2
                                                                                                                                      s
                                                                                                                          N  KR to u
                                                                                                                            I e
                                                                                                                     L  MA icens
                                                                                                                A HU ble l
                                                                                                           L E R nsfera
                                                                                                         RA -tra
                                                                                                       KA non



                                                                                                        D17108GC30
                                                                                                        Edition 3.0
                                                                                                        January 2009
                                                                                                        D57871
SQL Star International Limited

                                                                                                          Authors                    Copyright © 2009, Oracle. All rights reserved.

                                                                                                                                     Disclaimer
                                                                                                          Salome Clement
                                                                                                          Chaitanya Koratamaddi      This document contains proprietary information and is protected by copyright and
                                                                                                          Nancy Greenberg            other intellectual property laws. You may copy and print this document solely for your
                                                                                                                                     own use in an Oracle training course. The document may not be modified or altered in
                                                                                                                                     any way. Except where your use constitutes "fair use" under copyright law, you may
                                                                                                          Technical Contributors     not use, share, download, upload, copy, print, display, perform, reproduce, publish,
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                          and Reviewers              license, post, transmit, or distribute this document in whole or in part without the
                                                                                                                                     express authorization of Oracle.
                                                                                                          Wayne Abbott
                                                                                                          Christian Bauwens          The information contained in this document is subject to change without notice. If you
                                                                                                                                     find any problems in the document, please report them in writing to: Oracle University,
                                                                                                          Claire Bennett             500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
                                                                                                          Perry Benson               warranted to be error-free.
                                                                                                          Brian Boxx
                                                                                                                                     Restricted Rights Notice
                                                                                                          Zarko Cesljas
                                                                                                          Dairy Chan                 If this documentation is delivered to the United States Government or anyone using
                                                                                                                                     the documentation on behalf of the United States Government, the following notice is
                                                                                                          Laszlo Czinkoczki
                                                                                                                                     applicable:                                                                              a
                                                                                                                                                                has
                                                                                                          Joel Goodman
                                                                                                          Matthew Gregory            U.S. GOVERNMENT RIGHTS
                                                                                                                                                              )
                                                                                                          Sushma Jagannath
                                                                                                                                                          c om ฺ
                                                                                                                                     The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or

                                                                                                                                                      ailฺ uide
                                                                                                                                     disclose these training materials are restricted by the terms of the applicable Oracle
                                                                                                          Yash Jain                  license agreement and/or the applicable U.S. Government contract.
                                                                                                          Angelika Krupp                           gm t G
                                                                                                                                                 @ n
                                                                                                                                     Trademark Notice

                                                                                                                                             rale tude
                                                                                                          Isabelle Marchand
                                                                                                          Malika Marghadi                  a
                                                                                                                                     Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other
                                                                                                          Valli Pataballa             r hlk his S
                                                                                                                                     names may be trademarks of their respective owners.

                                                                                                          Narayanan Radhakrishnan
                                                                                                                                 A O ( se t
                                                                                                          Bryan Roberts
                                                                                                                             I KR to u
                                                                                                          Helen Robertson
                                                                                                                          AN nse
                                                                                                                     U
                                                                                                          John Soltani L M lice
                                                                                                          Lata Shivaprasad

                                                                                                                   AH rable
                                                                                                          James Spiller
                                                                                                                 R
                                                                                                              LE ansfe
                                                                                                          Priya Vennapusa
                                                                                                           A
                                                                                                        AR on-tr
                                                                                                       K Editors
                                                                                                          n
                                                                                                          Arijit Ghosh
                                                                                                          Raj Kumar

                                                                                                          Graphic Designer
                                                                                                          Rajiv Chandrabhanu

                                                                                                          Publisher
                                                                                                          Giri Venugopal
SQL Star International Limited



                                                                                                             Contents
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                             Preface

                                                                                                             I   Introduction
                                                                                                                 Lesson Objectives I-2
                                                                                                                 Goals of the Course I-3
                                                                                                                 Oracle10g I-4
                                                                                                                 Oracle Database 10g I-6                                            a
                                                                                                                 Oracle Application Server 10g I-7
                                                                                                                                                            ) has
                                                                                                                                                          om ฺ
                                                                                                                 Oracle Enterprise Manager 10g Grid Control I-8
                                                                                                                                                        c
                                                                                                                                                    ailฺ uide
                                                                                                                 Relational and Object Relational Database Management Systems I-9
                                                                                                                 Oracle Internet Platform I-10   gm t G
                                                                                                                                               @ n
                                                                                                                                           rale tude
                                                                                                                 System Development Life Cycle I-11
                                                                                                                                         a
                                                                                                                                      hlk his S
                                                                                                                 Data Storage on Different Media I-13
                                                                                                                                    r
                                                                                                                                 O ( se t
                                                                                                                 Relational Database Concept I-14
                                                                                                                               A
                                                                                                                             KR to u
                                                                                                                 Definition of a Relational Database I-15
                                                                                                                           I
                                                                                                                        AN nse
                                                                                                                 Data Models I-16
                                                                                                                     L M lice
                                                                                                                 Entity Relationship Model I-17
                                                                                                                   U
                                                                                                               R AH rable
                                                                                                                 Entity Relationship Modeling Conventions I-19

                                                                                                          A LE ansfe
                                                                                                                 Relating Multiple Tables I-21
                                                                                                                 Relational Database Terminology I-23
                                                                                                        AR on-tr
                                                                                                       K n       Relational Database Properties I-25
                                                                                                                 Communicating with an RDBMS Using SQL I-26
                                                                                                                 Oracle’s Relational Database Management System I-27
                                                                                                                 SQL Statements I-28
                                                                                                                 Tables Used in the Course I-29
                                                                                                                 Summary I-30

                                                                                                             1   Retrieving Data Using the SQL SELECT Statement
                                                                                                                 Objectives 1-2
                                                                                                                 Capabilities of SQL SELECT Statements 1-3
                                                                                                                 Basic SELECT Statement 1-4
                                                                                                                 Selecting All Columns 1-5
                                                                                                                 Selecting Specific Columns 1-6
                                                                                                                 Writing SQL Statements 1-7
                                                                                                                 Column Heading Defaults 1-8



                                                                                                                                                     iii
SQL Star International Limited



                                                                                                            Arithmetic Expressions 1-9
                                                                                                            Using Arithmetic Operators 1-10
                                                                                                            Operator Precedence 1-11
                                                                                                            Defining a Null Value 1-12
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                            Null Values in Arithmetic Expressions 1-13
                                                                                                            Defining a Column Alias 1-14
                                                                                                            Using Column Aliases 1-15
                                                                                                            Concatenation Operator 1-16
                                                                                                            Literal Character Strings 1-17
                                                                                                            Using Literal Character Strings 1-18
                                                                                                            Alternative Quote (q) Operator 1-19
                                                                                                            Duplicate Rows 1-20
                                                                                                                                                                    a
                                                                                                            Development Environments for SQL 1-21
                                                                                                                                                            ) has
                                                                                                            What Is Oracle SQL Developer? 1-22
                                                                                                                                                        c om ฺ
                                                                                                            Oracle SQL Developer Interface 1-23
                                                                                                                                                    ailฺ uide
                                                                                                            Creating a Database Connection 1-24  gm t G
                                                                                                                                               @ n
                                                                                                                                           rale tude
                                                                                                            Browsing Database Objects 1-27
                                                                                                                                         a
                                                                                                                                      hlk his S
                                                                                                            Using the SQL Worksheet 1-28
                                                                                                                                    r
                                                                                                                               A O ( se t
                                                                                                            Executing SQL Statements 1-31
                                                                                                            Formatting the SQL Code 1-32
                                                                                                                           I KR to u
                                                                                                                        AN nse
                                                                                                            Saving SQL Statements 1-33

                                                                                                                     L M lice
                                                                                                            Running Script Files 1-34
                                                                                                                   U
                                                                                                               R AH rable
                                                                                                            Displaying the Table Structure 1-35
                                                                                                            Using the DESCRIBE Command 1-36
                                                                                                          A LE ansfe
                                                                                                            Summary 1-37
                                                                                                        AR on-tr
                                                                                                       K n  Practice 1: Overview 1-38

                                                                                                        2   Restricting and Sorting Data
                                                                                                            Objectives 2-2
                                                                                                            Limiting Rows Using a Selection 2-3
                                                                                                            Limiting the Rows That Are Selected 2-4
                                                                                                            Using the WHERE Clause 2-5
                                                                                                            Character Strings and Dates 2-6
                                                                                                            Comparison Conditions 2-7
                                                                                                            Using Comparison Conditions 2-8
                                                                                                            Using the BETWEEN Condition 2-9
                                                                                                            Using the IN Condition 2-10
                                                                                                            Using the LIKE Condition 2-11
                                                                                                            Using the NULL Conditions 2-13
                                                                                                            Logical Conditions 2-14



                                                                                                                                                  iv
SQL Star International Limited



                                                                                                                 Using the AND Operator 2-15
                                                                                                                 Using the OR Operator 2-16
                                                                                                                 Using the NOT Operator 2-17
                                                                                                                 Rules of Precedence 2-18
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                                 Using the ORDER BY Clause 2-20
                                                                                                                 Sorting 2-21
                                                                                                                 Substitution Variables 2-22
                                                                                                                 Using the & Substitution Variable 2-24
                                                                                                                 Character and Date Values with Substitution Variables 2-26
                                                                                                                 Specifying Column Names, Expressions, and Text 2-27
                                                                                                                 Using the && Substitution Variable 2-28
                                                                                                                 Using the DEFINE Command 2-29                                   a
                                                                                                                 Using the VERIFY Command 2-30
                                                                                                                                                                         ) has
                                                                                                                 Summary 2-31
                                                                                                                                                                     c om ฺ
                                                                                                                 Practice 2: Overview 2-32                       ailฺ uide
                                                                                                                                                               gm t G
                                                                                                           3 Using Single-Row Functions to Customize ral
                                                                                                                                                          e@ den
                                                                                                                                                       Output
                                                                                                                                                     a        tu
                                                                                                             Objectives 3-2
                                                                                                                                               r hlk his S
                                                                                                             SQL Functions 3-3
                                                                                                                                         A O ( se t
                                                                                                                                      KR to u
                                                                                                             Two Types of SQL Functions 3-4
                                                                                                                                    I
                                                                                                                               AN n
                                                                                                             Single-Row Functions 3-5 se
                                                                                                                         L M ic
                                                                                                             Character Functions l3-7e
                                                                                                                      U
                                                                                                             Case-Manipulatione
                                                                                                                 AH rabl Functions 3-9
                                                                                                               R
                                                                                                           LE ansfe
                                                                                                             Using Case-Manipulation Functions 3-10
                                                                                                          A Character-Manipulation Functions 3-11
                                                                                                        AR on-tr the Character-Manipulation Functions 3-12
                                                                                                       K n Using
                                                                                                                 Number Functions 3-13
                                                                                                                 Using the ROUND Function 3-14
                                                                                                                 Using the TRUNC Function 3-15
                                                                                                                 Using the MOD Function 3-16
                                                                                                                 Working with Dates 3-17
                                                                                                                 Arithmetic with Dates 3-20
                                                                                                                 Using Arithmetic Operators with Dates 3-21
                                                                                                                 Date Functions 3-22
                                                                                                                 Using Date Functions 3-23
                                                                                                                 Practice 3: Overview of Part 1 3-25
                                                                                                                 Conversion Functions 3-26
                                                                                                                 Implicit Data Type Conversion 3-27
                                                                                                                 Explicit Data Type Conversion 3-29
                                                                                                                 Using the TO_CHAR Function with Dates 3-32


                                                                                                                                                       v
SQL Star International Limited



                                                                                                           Elements of the Date Format Model 3-33
                                                                                                           Using the TO_CHAR Function with Dates 3-37
                                                                                                           Using the TO_CHAR Function with Numbers 3-38
                                                                                                           Using the TO_NUMBER and TO_DATE Functions 3-41
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                           RR Date Format 3-43
                                                                                                           RR Date Format: Example 3-44
                                                                                                           Nesting Functions 3-45
                                                                                                           General Functions 3-47
                                                                                                           NVL Function 3-48
                                                                                                           Using the NVL Function 3-49
                                                                                                           Using the NVL2 Function 3-50
                                                                                                           Using the NULLIF Function 3-51                                           a
                                                                                                          Using the COALESCE Function 3-52                                  ) has
                                                                                                          Conditional Expressions 3-54                                  c om ฺ
                                                                                                          CASE Expression 3-55                                      ailฺ uide
                                                                                                          Using the CASE Expression 3-56
                                                                                                                                                                 gm t G
                                                                                                                                                               @ n
                                                                                                          DECODE Function 3-57                           a rale tude
                                                                                                                                                    r hlk his S
                                                                                                                                                 O ( se t
                                                                                                          Using the DECODE Function 3-58
                                                                                                          Summary 3-60                         A
                                                                                                          Practice 3: Overview of Part 2 I KR to u
                                                                                                                                          3-61
                                                                                                                                    AN nse
                                                                                                                              L M Using the Group Functions
                                                                                                                           U le e
                                                                                                        4 Reporting Aggregated Datalic
                                                                                                          Objectives A
                                                                                                                        H
                                                                                                                E  R 4-2 ferab
                                                                                                           AL trans
                                                                                                          What Are Group Functions? 4-3
                                                                                                         R -
                                                                                                       KA Types of Group Functions 4-5
                                                                                                           n onFunctions: Syntax
                                                                                                          Group
                                                                                                                                      4-4

                                                                                                           Using the AVG and SUM Functions 4-6
                                                                                                           Using the MIN and MAX Functions 4-7
                                                                                                           Using the COUNT Function 4-8
                                                                                                           Using the DISTINCT Keyword 4-9
                                                                                                           Group Functions and Null Values 4-10
                                                                                                           Creating Groups of Data 4-11
                                                                                                           Creating Groups of Data: GROUP BY Clause Syntax 4-12
                                                                                                           Using the GROUP BY Clause 4-13
                                                                                                           Grouping by More Than One Column 4-15
                                                                                                           Using the GROUP BY Clause on Multiple Columns 4-16
                                                                                                           Illegal Queries Using Group Functions 4-17
                                                                                                           Restricting Group Results 4-19
                                                                                                           Restricting Group Results with the HAVING Clause 4-20



                                                                                                                                                 vi
SQL Star International Limited



                                                                                                                  Using the HAVING Clause 4-21
                                                                                                                  Nesting Group Functions 4-23
                                                                                                                  Summary 4-24
                                                                                                                  Practice 4: Overview 4-25
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                              5   Displaying Data from Multiple Tables
                                                                                                                  Objectives 5-2
                                                                                                                  Obtaining Data from Multiple Tables 5-3
                                                                                                                  Types of Joins 5-4
                                                                                                                  Joining Tables Using SQL:1999 Syntax 5-5
                                                                                                                  Creating Natural Joins 5-6
                                                                                                                  Retrieving Records with Natural Joins 5-7
                                                                                                                                                                                  a
                                                                                                                  Creating Joins with the USING Clause 5-8
                                                                                                                                                                          ) has
                                                                                                                  Joining Column Names 5-9
                                                                                                                                                                      c om ฺ
                                                                                                                  Retrieving Records with the USING Clause 5-10
                                                                                                                                                                  ailฺ uide
                                                                                                                  Qualifying Ambiguous Column Names 5-11       gm t G
                                                                                                                                                              @ n
                                                                                                                  Using Table Aliases 5-12
                                                                                                                                                         rale tude
                                                                                                                                                    lka
                                                                                                                                                   h5-14 his S
                                                                                                                  Creating Joins with the ON Clause 5-13
                                                                                                                                                 r
                                                                                                                                             O ( se t
                                                                                                             Retrieving Records with the ON Clause
                                                                                                                                           A
                                                                                                                                       KR to ato 5-17
                                                                                                             Self-Joins Using the ON Clause 5-15 u
                                                                                                                                     I
                                                                                                                                AN ns
                                                                                                             Applying Additional Conditions e Join
                                                                                                                         L M lice
                                                                                                             Creating Three-Way Joins with the ON Clause 5-18
                                                                                                                       U
                                                                                                                  AH rable
                                                                                                             Nonequijoins 5-19
                                                                                                               R
                                                                                                           LE ansfe 5-21 with Nonequijoins 5-20
                                                                                                             Retrieving Records
                                                                                                          A Outer
                                                                                                        AR on-tr Joins OUTER Joins 5-22
                                                                                                       K n INNER Versus
                                                                                                                  LEFT OUTER JOIN 5-23
                                                                                                                  RIGHT OUTER JOIN 5-24
                                                                                                                  FULL OUTER JOIN 5-25
                                                                                                                  Cartesian Products 5-26
                                                                                                                  Generating a Cartesian Product 5-27
                                                                                                                  Creating Cross Joins 5-28
                                                                                                                  Summary 5-29
                                                                                                                  Practice 5: Overview 5-30

                                                                                                              6   Using Subqueries to Solve Queries
                                                                                                                  Objectives 6-2
                                                                                                                  Using a Subquery to Solve a Problem 6-3
                                                                                                                  Subquery Syntax 6-4
                                                                                                                  Using a Subquery 6-5


                                                                                                                                                        vii
SQL Star International Limited



                                                                                                            Guidelines for Using Subqueries 6-6
                                                                                                            Types of Subqueries 6-7
                                                                                                            Single-Row Subqueries 6-8
                                                                                                            Executing Single-Row Subqueries 6-9
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                            Using Group Functions in a Subquery 6-10
                                                                                                            The HAVING Clause with Subqueries 6-11
                                                                                                            What Is Wrong with This Statement? 6-12
                                                                                                            Will This Statement Return Rows? 6-13
                                                                                                            Multiple-Row Subqueries 6-14
                                                                                                            Using the ANY Operator in Multiple-Row Subqueries 6-15
                                                                                                            Using the ALL Operator in Multiple-Row Subqueries 6-16
                                                                                                            Null Values in a Subquery 6-17
                                                                                                                                                                                 a
                                                                                                            Summary 6-19
                                                                                                                                                                         ) has
                                                                                                            Practice 6: Overview 6-20
                                                                                                                                                                     c om ฺ
                                                                                                                                                                 ailฺ uide
                                                                                                        7 Using the Set Operators                             gm t G
                                                                                                                                                            @ n
                                                                                                          Objectives 7-2
                                                                                                                                                      a rale tude
                                                                                                          Set Operators 7-3
                                                                                                                                                 r hlk his S
                                                                                                          Tables Used in This Lesson 7-4
                                                                                                                                            A O ( se t
                                                                                                          UNION Operator 7-8
                                                                                                                                        I KR to u
                                                                                                                                   AN nse
                                                                                                          Using the UNION Operator 7-9
                                                                                                          UNION ALL Operator M
                                                                                                                          UL Operator e7-12
                                                                                                                                7-11 c
                                                                                                          Using the UNION ALL ble
                                                                                                                        H            li
                                                                                                                     A
                                                                                                                E R nsfera
                                                                                                          INTERSECT Operator 7-13
                                                                                                              L
                                                                                                         RA therINTERSECT Operator 7-14
                                                                                                          Using t a
                                                                                                       KA MINUS -
                                                                                                           non Operator 7-15
                                                                                                            Set Operator Guidelines 7-17
                                                                                                            The Oracle Server and Set Operators 7-18
                                                                                                            Matching the SELECT Statements 7-19
                                                                                                            Matching the SELECT Statement: Example 7-20
                                                                                                            Controlling the Order of Rows 7-21
                                                                                                            Summary 7-22
                                                                                                            Practice 7: Overview 7-23

                                                                                                        8   Manipulating Data
                                                                                                            Objectives 8-2
                                                                                                            Data Manipulation Language 8-3
                                                                                                            Adding a New Row to a Table 8-4
                                                                                                            INSERT Statement Syntax 8-5
                                                                                                            Inserting New Rows 8-6


                                                                                                                                                viii
SQL Star International Limited



                                                                                                                  Inserting Rows with Null Values 8-7
                                                                                                                  Inserting Special Values 8-8
                                                                                                                  Inserting Specific Date Values 8-9
                                                                                                                  Creating a Script 8-10
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                                  Copying Rows from Another Table 8-11
                                                                                                                  Changing Data in a Table 8-12
                                                                                                                  UPDATE Statement Syntax 8-13
                                                                                                                  Updating Rows in a Table 8-14
                                                                                                                  Updating Two Columns with a Subquery 8-15
                                                                                                                  Updating Rows Based on Another Table 8-16
                                                                                                                  Removing a Row from a Table 8-17
                                                                                                                  DELETE Statement 8-18
                                                                                                                                                                                    a
                                                                                                                  Deleting Rows from a Table 8-19
                                                                                                                                                                            ) has
                                                                                                                  Deleting Rows Based on Another Table 8-20
                                                                                                                                                                        c om ฺ
                                                                                                             TRUNCATE Statement 8-21                                ailฺ uide
                                                                                                             Using a Subquery in an INSERT Statement 8-22
                                                                                                                                                            @ n gm t G
                                                                                                             Database Transactions 8-24
                                                                                                                                                        rale 8-26 de
                                                                                                             Advantages of COMMIT and ROLLBACK Statements Stu
                                                                                                                                                      a
                                                                                                                                                (r hlk his
                                                                                                             Controlling Transactions 8-27
                                                                                                                                           A O 8-28se t
                                                                                                                                        KR 8-29 u
                                                                                                             Rolling Back Changes to a Marker
                                                                                                             Implicit Transaction Processinge to
                                                                                                                                      I
                                                                                                                                AN COMMIT or ROLLBACK 8-31
                                                                                                             State of the Data Before en
                                                                                                                                          s
                                                                                                                        U L M lic
                                                                                                                  AH rable
                                                                                                             State of the Data After COMMIT 8-32
                                                                                                               R fe
                                                                                                           LE ansthe Data After ROLLBACK 8-34
                                                                                                             Committing
                                                                                                          A State
                                                                                                                                8-33

                                                                                                        AR on-tr of Data Rollback 8-36
                                                                                                       K n Statement-Level
                                                                                                                  Read Consistency 8-37
                                                                                                                  Implementation of Read Consistency 8-38
                                                                                                                  Summary 8-39
                                                                                                                  Practice 8: Overview 8-40

                                                                                                              9   Using DDL Statements to Create and Manage Tables
                                                                                                                  Objectives 9-2
                                                                                                                  Database Objects 9-3
                                                                                                                  Naming Rules 9-4
                                                                                                                  CREATE TABLE Statement 9-5
                                                                                                                  Referencing Another User’s Tables 9-6
                                                                                                                  DEFAULT Option 9-7
                                                                                                                  Creating Tables 9-8
                                                                                                                  Data Types 9-9



                                                                                                                                                     ix
SQL Star International Limited



                                                                                                           Datetime Data Types 9-11
                                                                                                           Including Constraints 9-17
                                                                                                           Constraint Guidelines 9-18
                                                                                                           Defining Constraints 9-19
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                           NOT NULL Constraint 9-21
                                                                                                           UNIQUE Constraint 9-22
                                                                                                           PRIMARY KEY Constraint 9-24
                                                                                                           FOREIGN KEY Constraint 9-25
                                                                                                           FOREIGN KEY Constraint: Keywords 9-27
                                                                                                           CHECK Constraint 9-28
                                                                                                           CREATE TABLE: Example 9-29
                                                                                                           Violating Constraints 9-30                                            a
                                                                                                           Creating a Table by Using a Subquery 9-32
                                                                                                                                                                         ) has
                                                                                                           ALTER TABLE Statement 9-34
                                                                                                                                                                     c om ฺ
                                                                                                           Dropping a Table 9-35                                 ailฺ uide
                                                                                                           Summary 9-36                                       gm t G
                                                                                                                                                            @ n
                                                                                                           Practice 9: Overview 9-37
                                                                                                                                                      a rale tude
                                                                                                                                                 r hlk his S
                                                                                                        10 Creating Other Schema Objects
                                                                                                                                            A O ( se t
                                                                                                           Objectives 10-2              KR to u
                                                                                                                                       I e
                                                                                                           Database Objects 10-3 AN         s
                                                                                                                              L M licen
                                                                                                           What Is a View? 10-4
                                                                                                                            U le
                                                                                                           Advantages AH
                                                                                                                              rab
                                                                                                                       of Views 10-5
                                                                                                                 E R nsf Complex Views 10-6
                                                                                                           Simple Views ande
                                                                                                              L
                                                                                                          RA -ta a 10-7
                                                                                                           Creating r View
                                                                                                       KA Retrieving Data from a View 10-10
                                                                                                            non
                                                                                                           Modifying a View 10-11
                                                                                                           Creating a Complex View 10-12
                                                                                                           Rules for Performing DML Operations on a View 10-13
                                                                                                           Using the WITH CHECK OPTION Clause 10-16
                                                                                                           Denying DML Operations 10-18
                                                                                                           Removing a View 10-20
                                                                                                           Practice 10: Overview of Part 1 10-21
                                                                                                           Sequences 10-22
                                                                                                           CREATE SEQUENCE Statement: Syntax 10-24
                                                                                                           Creating a Sequence 10-25
                                                                                                           NEXTVAL and CURRVAL Pseudocolumns 10-26
                                                                                                           Using a Sequence 10-28
                                                                                                           Caching Sequence Values 10-29
                                                                                                           Modifying a Sequence 10-30


                                                                                                                                               x
SQL Star International Limited



                                                                                                                  Guidelines for Modifying a Sequence 10-31
                                                                                                                  Indexes 10-33
                                                                                                                  How Are Indexes Created? 10-35
                                                                                                                  Creating an Index 10-36
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                                  Index Creation Guidelines 10-37
                                                                                                                  Removing an Index 10-38
                                                                                                                  Synonyms 10-39
                                                                                                                  Creating and Removing Synonyms 10-41
                                                                                                                  Summary 10-42
                                                                                                                  Practice 10: Overview of Part 2 10-43

                                                                                                              11 Managing Objects with Data Dictionary Views
                                                                                                                                                                               a
                                                                                                                 Objectives 11-2
                                                                                                                 The Data Dictionary 11-3                              ) has
                                                                                                                                                                   c om ฺ
                                                                                                                 Data Dictionary Structure 11-4
                                                                                                                                                               ailฺ uide
                                                                                                                 How to Use the Dictionary Views 11-6       gm t G
                                                                                                                                                          @ n
                                                                                                                                                      rale tude
                                                                                                                 USER_OBJECTS and ALL_OBJECTS Views 11-7
                                                                                                                                                    a
                                                                                                                                                 hlk his S
                                                                                                             USER_OBJECTS View 11-8
                                                                                                                                               r
                                                                                                             Table Information 11-9
                                                                                                             Column Information 11-10 RA
                                                                                                                                           O ( se t
                                                                                                                                      K        u
                                                                                                                                  N 11-12se to
                                                                                                             Constraint Information I
                                                                                                                               A
                                                                                                             View Information 11-15 en
                                                                                                             SequenceU
                                                                                                                          L M lic
                                                                                                                              le
                                                                                                                    H Information 11-16
                                                                                                                RA ferab
                                                                                                             Synonym Information 11-18
                                                                                                            E n Comments to a Table 11-19
                                                                                                          AL Adding s
                                                                                                                ra
                                                                                                         R Summary 11-20
                                                                                                       KA non-t
                                                                                                                  Practice 11: Overview 11-21

                                                                                                              A   Practice Solutions

                                                                                                              B Table Descriptions and Data

                                                                                                              C Oracle Join Syntax

                                                                                                              D Using SQL*Plus

                                                                                                              E Using SQL Developer

                                                                                                              Index




                                                                                                                                                      xi
SQL Star International Limited




                                                                                                        Additional Practices

                                                                                                        Additional Practices: Table Descriptions and Data
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                        Additional Practices: Solutions




                                                                                                                                                                    a
                                                                                                                                                            ) has
                                                                                                                                                        c om ฺ
                                                                                                                                                    ailฺ uide
                                                                                                                                                 gm t G
                                                                                                                                               @ n
                                                                                                                                         a rale tude
                                                                                                                                    r hlk his S
                                                                                                                               A O ( se t
                                                                                                                           I KR to u
                                                                                                                        AN nse
                                                                                                                   U L M lice
                                                                                                               R AH rable
                                                                                                          A LE ansfe
                                                                                                        AR on-tr
                                                                                                       K n




                                                                                                                                               xii
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.                             SQL Star International Limited




                                                                                                                              Using DDL Statements
                                                                                                                           to Create and Manage Tables
                                                                                                                                                                                          a
                                                                                                                                                                                  ) has
                                                                                                                                                                              c om ฺ
                                                                                                                                                                          ailฺ uide
                                                                                                                                                                    @ n gm t G
                                                                                                                                                         a  rale tude
                                                                                                                                               r hlk his S
                                                                                                                                      A  O ( se t
                                                                                                                              I KR to u
                                                                                                                        AN nse
                                                                                                                     L M Copyright © 2009, Oracle. All rights reserved.
                                                                                                                    U le lice
                                                                                                                  H
                                                                                                             E RA ferab
                                                                                                         R AL trans
                                                                                                       KA non-
SQL Star International Limited



                                                                                                                                             Objectives

                                                                                                             After completing this lesson, you should be able to do the
Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates.




                                                                                                             following:
                                                                                                              • Categorize the main database objects
                                                                                                              • Review the table structure
                                                                                                              • List the data types that are available for columns
                                                                                                              • Create a simple table
                                                                                                              • Explain how constraints are created at the time of table as                    a
                                                                                                                                                                          h
                                                                                                                  creation
                                                                                                                                                                     o m)
                                                                                                              • Describe how schema objects work               a ilฺc ideฺ
                                                                                                                                                                              @ n gm t Gu
                                                                                                                                                                   a  rale tude
                                                                                                                                                         r hlk his S
                                                                                                                                                A  O ( se t
                                                                                                                                         I KR to u
                                                                                                                                    AN nse
                                                                                                                               L M Copyright © 2009, Oracle. All rights reserved.
                                                                                                                             U le lice
                                                                                                                           H
                                                                                                                       RA ferab
                                                                                                       Objectives E
                                                                                                               AL ra s
                                                                                                        In A
                                                                                                             Rlesson, tyoun introduced to the data definition language (DDL) statements. You are
                                                                                                        Kthis non- are
                                                                                                        taught the basics of how to create simple tables, alter them, and remove them. The data types
                                                                                                        available in DDL are shown, and schema concepts are introduced. Constraints are tied into this
                                                                                                        lesson. Exception messages that are generated from violating constraints during DML are shown
                                                                                                        and explained.




                                                                                                                             Oracle Database 10g: SQL Fundamentals I 9 - 2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2
D17108 gc30 sg2

More Related Content

Recently uploaded

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

D17108 gc30 sg2

  • 1. Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. SQL Star International Limited a ) has c om ฺ ailฺ uide gm 10g: Oracle Database nt G SQL @ rale tude Fundamentals I a hlk his S (r Guide A OStudente t • Volume 2 s N KR to u I e L MA icens A HU ble l L E R nsfera RA -tra KA non D17108GC30 Edition 3.0 January 2009 D57871
  • 2. SQL Star International Limited Authors Copyright © 2009, Oracle. All rights reserved. Disclaimer Salome Clement Chaitanya Koratamaddi This document contains proprietary information and is protected by copyright and Nancy Greenberg other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except where your use constitutes "fair use" under copyright law, you may Technical Contributors not use, share, download, upload, copy, print, display, perform, reproduce, publish, Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. and Reviewers license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. Wayne Abbott Christian Bauwens The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, Claire Bennett 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not Perry Benson warranted to be error-free. Brian Boxx Restricted Rights Notice Zarko Cesljas Dairy Chan If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is Laszlo Czinkoczki applicable: a has Joel Goodman Matthew Gregory U.S. GOVERNMENT RIGHTS ) Sushma Jagannath c om ฺ The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or ailฺ uide disclose these training materials are restricted by the terms of the applicable Oracle Yash Jain license agreement and/or the applicable U.S. Government contract. Angelika Krupp gm t G @ n Trademark Notice rale tude Isabelle Marchand Malika Marghadi a Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other Valli Pataballa r hlk his S names may be trademarks of their respective owners. Narayanan Radhakrishnan A O ( se t Bryan Roberts I KR to u Helen Robertson AN nse U John Soltani L M lice Lata Shivaprasad AH rable James Spiller R LE ansfe Priya Vennapusa A AR on-tr K Editors n Arijit Ghosh Raj Kumar Graphic Designer Rajiv Chandrabhanu Publisher Giri Venugopal
  • 3. SQL Star International Limited Contents Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. Preface I Introduction Lesson Objectives I-2 Goals of the Course I-3 Oracle10g I-4 Oracle Database 10g I-6 a Oracle Application Server 10g I-7 ) has om ฺ Oracle Enterprise Manager 10g Grid Control I-8 c ailฺ uide Relational and Object Relational Database Management Systems I-9 Oracle Internet Platform I-10 gm t G @ n rale tude System Development Life Cycle I-11 a hlk his S Data Storage on Different Media I-13 r O ( se t Relational Database Concept I-14 A KR to u Definition of a Relational Database I-15 I AN nse Data Models I-16 L M lice Entity Relationship Model I-17 U R AH rable Entity Relationship Modeling Conventions I-19 A LE ansfe Relating Multiple Tables I-21 Relational Database Terminology I-23 AR on-tr K n Relational Database Properties I-25 Communicating with an RDBMS Using SQL I-26 Oracle’s Relational Database Management System I-27 SQL Statements I-28 Tables Used in the Course I-29 Summary I-30 1 Retrieving Data Using the SQL SELECT Statement Objectives 1-2 Capabilities of SQL SELECT Statements 1-3 Basic SELECT Statement 1-4 Selecting All Columns 1-5 Selecting Specific Columns 1-6 Writing SQL Statements 1-7 Column Heading Defaults 1-8 iii
  • 4. SQL Star International Limited Arithmetic Expressions 1-9 Using Arithmetic Operators 1-10 Operator Precedence 1-11 Defining a Null Value 1-12 Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. Null Values in Arithmetic Expressions 1-13 Defining a Column Alias 1-14 Using Column Aliases 1-15 Concatenation Operator 1-16 Literal Character Strings 1-17 Using Literal Character Strings 1-18 Alternative Quote (q) Operator 1-19 Duplicate Rows 1-20 a Development Environments for SQL 1-21 ) has What Is Oracle SQL Developer? 1-22 c om ฺ Oracle SQL Developer Interface 1-23 ailฺ uide Creating a Database Connection 1-24 gm t G @ n rale tude Browsing Database Objects 1-27 a hlk his S Using the SQL Worksheet 1-28 r A O ( se t Executing SQL Statements 1-31 Formatting the SQL Code 1-32 I KR to u AN nse Saving SQL Statements 1-33 L M lice Running Script Files 1-34 U R AH rable Displaying the Table Structure 1-35 Using the DESCRIBE Command 1-36 A LE ansfe Summary 1-37 AR on-tr K n Practice 1: Overview 1-38 2 Restricting and Sorting Data Objectives 2-2 Limiting Rows Using a Selection 2-3 Limiting the Rows That Are Selected 2-4 Using the WHERE Clause 2-5 Character Strings and Dates 2-6 Comparison Conditions 2-7 Using Comparison Conditions 2-8 Using the BETWEEN Condition 2-9 Using the IN Condition 2-10 Using the LIKE Condition 2-11 Using the NULL Conditions 2-13 Logical Conditions 2-14 iv
  • 5. SQL Star International Limited Using the AND Operator 2-15 Using the OR Operator 2-16 Using the NOT Operator 2-17 Rules of Precedence 2-18 Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. Using the ORDER BY Clause 2-20 Sorting 2-21 Substitution Variables 2-22 Using the & Substitution Variable 2-24 Character and Date Values with Substitution Variables 2-26 Specifying Column Names, Expressions, and Text 2-27 Using the && Substitution Variable 2-28 Using the DEFINE Command 2-29 a Using the VERIFY Command 2-30 ) has Summary 2-31 c om ฺ Practice 2: Overview 2-32 ailฺ uide gm t G 3 Using Single-Row Functions to Customize ral e@ den Output a tu Objectives 3-2 r hlk his S SQL Functions 3-3 A O ( se t KR to u Two Types of SQL Functions 3-4 I AN n Single-Row Functions 3-5 se L M ic Character Functions l3-7e U Case-Manipulatione AH rabl Functions 3-9 R LE ansfe Using Case-Manipulation Functions 3-10 A Character-Manipulation Functions 3-11 AR on-tr the Character-Manipulation Functions 3-12 K n Using Number Functions 3-13 Using the ROUND Function 3-14 Using the TRUNC Function 3-15 Using the MOD Function 3-16 Working with Dates 3-17 Arithmetic with Dates 3-20 Using Arithmetic Operators with Dates 3-21 Date Functions 3-22 Using Date Functions 3-23 Practice 3: Overview of Part 1 3-25 Conversion Functions 3-26 Implicit Data Type Conversion 3-27 Explicit Data Type Conversion 3-29 Using the TO_CHAR Function with Dates 3-32 v
  • 6. SQL Star International Limited Elements of the Date Format Model 3-33 Using the TO_CHAR Function with Dates 3-37 Using the TO_CHAR Function with Numbers 3-38 Using the TO_NUMBER and TO_DATE Functions 3-41 Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. RR Date Format 3-43 RR Date Format: Example 3-44 Nesting Functions 3-45 General Functions 3-47 NVL Function 3-48 Using the NVL Function 3-49 Using the NVL2 Function 3-50 Using the NULLIF Function 3-51 a Using the COALESCE Function 3-52 ) has Conditional Expressions 3-54 c om ฺ CASE Expression 3-55 ailฺ uide Using the CASE Expression 3-56 gm t G @ n DECODE Function 3-57 a rale tude r hlk his S O ( se t Using the DECODE Function 3-58 Summary 3-60 A Practice 3: Overview of Part 2 I KR to u 3-61 AN nse L M Using the Group Functions U le e 4 Reporting Aggregated Datalic Objectives A H E R 4-2 ferab AL trans What Are Group Functions? 4-3 R - KA Types of Group Functions 4-5 n onFunctions: Syntax Group 4-4 Using the AVG and SUM Functions 4-6 Using the MIN and MAX Functions 4-7 Using the COUNT Function 4-8 Using the DISTINCT Keyword 4-9 Group Functions and Null Values 4-10 Creating Groups of Data 4-11 Creating Groups of Data: GROUP BY Clause Syntax 4-12 Using the GROUP BY Clause 4-13 Grouping by More Than One Column 4-15 Using the GROUP BY Clause on Multiple Columns 4-16 Illegal Queries Using Group Functions 4-17 Restricting Group Results 4-19 Restricting Group Results with the HAVING Clause 4-20 vi
  • 7. SQL Star International Limited Using the HAVING Clause 4-21 Nesting Group Functions 4-23 Summary 4-24 Practice 4: Overview 4-25 Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. 5 Displaying Data from Multiple Tables Objectives 5-2 Obtaining Data from Multiple Tables 5-3 Types of Joins 5-4 Joining Tables Using SQL:1999 Syntax 5-5 Creating Natural Joins 5-6 Retrieving Records with Natural Joins 5-7 a Creating Joins with the USING Clause 5-8 ) has Joining Column Names 5-9 c om ฺ Retrieving Records with the USING Clause 5-10 ailฺ uide Qualifying Ambiguous Column Names 5-11 gm t G @ n Using Table Aliases 5-12 rale tude lka h5-14 his S Creating Joins with the ON Clause 5-13 r O ( se t Retrieving Records with the ON Clause A KR to ato 5-17 Self-Joins Using the ON Clause 5-15 u I AN ns Applying Additional Conditions e Join L M lice Creating Three-Way Joins with the ON Clause 5-18 U AH rable Nonequijoins 5-19 R LE ansfe 5-21 with Nonequijoins 5-20 Retrieving Records A Outer AR on-tr Joins OUTER Joins 5-22 K n INNER Versus LEFT OUTER JOIN 5-23 RIGHT OUTER JOIN 5-24 FULL OUTER JOIN 5-25 Cartesian Products 5-26 Generating a Cartesian Product 5-27 Creating Cross Joins 5-28 Summary 5-29 Practice 5: Overview 5-30 6 Using Subqueries to Solve Queries Objectives 6-2 Using a Subquery to Solve a Problem 6-3 Subquery Syntax 6-4 Using a Subquery 6-5 vii
  • 8. SQL Star International Limited Guidelines for Using Subqueries 6-6 Types of Subqueries 6-7 Single-Row Subqueries 6-8 Executing Single-Row Subqueries 6-9 Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. Using Group Functions in a Subquery 6-10 The HAVING Clause with Subqueries 6-11 What Is Wrong with This Statement? 6-12 Will This Statement Return Rows? 6-13 Multiple-Row Subqueries 6-14 Using the ANY Operator in Multiple-Row Subqueries 6-15 Using the ALL Operator in Multiple-Row Subqueries 6-16 Null Values in a Subquery 6-17 a Summary 6-19 ) has Practice 6: Overview 6-20 c om ฺ ailฺ uide 7 Using the Set Operators gm t G @ n Objectives 7-2 a rale tude Set Operators 7-3 r hlk his S Tables Used in This Lesson 7-4 A O ( se t UNION Operator 7-8 I KR to u AN nse Using the UNION Operator 7-9 UNION ALL Operator M UL Operator e7-12 7-11 c Using the UNION ALL ble H li A E R nsfera INTERSECT Operator 7-13 L RA therINTERSECT Operator 7-14 Using t a KA MINUS - non Operator 7-15 Set Operator Guidelines 7-17 The Oracle Server and Set Operators 7-18 Matching the SELECT Statements 7-19 Matching the SELECT Statement: Example 7-20 Controlling the Order of Rows 7-21 Summary 7-22 Practice 7: Overview 7-23 8 Manipulating Data Objectives 8-2 Data Manipulation Language 8-3 Adding a New Row to a Table 8-4 INSERT Statement Syntax 8-5 Inserting New Rows 8-6 viii
  • 9. SQL Star International Limited Inserting Rows with Null Values 8-7 Inserting Special Values 8-8 Inserting Specific Date Values 8-9 Creating a Script 8-10 Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. Copying Rows from Another Table 8-11 Changing Data in a Table 8-12 UPDATE Statement Syntax 8-13 Updating Rows in a Table 8-14 Updating Two Columns with a Subquery 8-15 Updating Rows Based on Another Table 8-16 Removing a Row from a Table 8-17 DELETE Statement 8-18 a Deleting Rows from a Table 8-19 ) has Deleting Rows Based on Another Table 8-20 c om ฺ TRUNCATE Statement 8-21 ailฺ uide Using a Subquery in an INSERT Statement 8-22 @ n gm t G Database Transactions 8-24 rale 8-26 de Advantages of COMMIT and ROLLBACK Statements Stu a (r hlk his Controlling Transactions 8-27 A O 8-28se t KR 8-29 u Rolling Back Changes to a Marker Implicit Transaction Processinge to I AN COMMIT or ROLLBACK 8-31 State of the Data Before en s U L M lic AH rable State of the Data After COMMIT 8-32 R fe LE ansthe Data After ROLLBACK 8-34 Committing A State 8-33 AR on-tr of Data Rollback 8-36 K n Statement-Level Read Consistency 8-37 Implementation of Read Consistency 8-38 Summary 8-39 Practice 8: Overview 8-40 9 Using DDL Statements to Create and Manage Tables Objectives 9-2 Database Objects 9-3 Naming Rules 9-4 CREATE TABLE Statement 9-5 Referencing Another User’s Tables 9-6 DEFAULT Option 9-7 Creating Tables 9-8 Data Types 9-9 ix
  • 10. SQL Star International Limited Datetime Data Types 9-11 Including Constraints 9-17 Constraint Guidelines 9-18 Defining Constraints 9-19 Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. NOT NULL Constraint 9-21 UNIQUE Constraint 9-22 PRIMARY KEY Constraint 9-24 FOREIGN KEY Constraint 9-25 FOREIGN KEY Constraint: Keywords 9-27 CHECK Constraint 9-28 CREATE TABLE: Example 9-29 Violating Constraints 9-30 a Creating a Table by Using a Subquery 9-32 ) has ALTER TABLE Statement 9-34 c om ฺ Dropping a Table 9-35 ailฺ uide Summary 9-36 gm t G @ n Practice 9: Overview 9-37 a rale tude r hlk his S 10 Creating Other Schema Objects A O ( se t Objectives 10-2 KR to u I e Database Objects 10-3 AN s L M licen What Is a View? 10-4 U le Advantages AH rab of Views 10-5 E R nsf Complex Views 10-6 Simple Views ande L RA -ta a 10-7 Creating r View KA Retrieving Data from a View 10-10 non Modifying a View 10-11 Creating a Complex View 10-12 Rules for Performing DML Operations on a View 10-13 Using the WITH CHECK OPTION Clause 10-16 Denying DML Operations 10-18 Removing a View 10-20 Practice 10: Overview of Part 1 10-21 Sequences 10-22 CREATE SEQUENCE Statement: Syntax 10-24 Creating a Sequence 10-25 NEXTVAL and CURRVAL Pseudocolumns 10-26 Using a Sequence 10-28 Caching Sequence Values 10-29 Modifying a Sequence 10-30 x
  • 11. SQL Star International Limited Guidelines for Modifying a Sequence 10-31 Indexes 10-33 How Are Indexes Created? 10-35 Creating an Index 10-36 Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. Index Creation Guidelines 10-37 Removing an Index 10-38 Synonyms 10-39 Creating and Removing Synonyms 10-41 Summary 10-42 Practice 10: Overview of Part 2 10-43 11 Managing Objects with Data Dictionary Views a Objectives 11-2 The Data Dictionary 11-3 ) has c om ฺ Data Dictionary Structure 11-4 ailฺ uide How to Use the Dictionary Views 11-6 gm t G @ n rale tude USER_OBJECTS and ALL_OBJECTS Views 11-7 a hlk his S USER_OBJECTS View 11-8 r Table Information 11-9 Column Information 11-10 RA O ( se t K u N 11-12se to Constraint Information I A View Information 11-15 en SequenceU L M lic le H Information 11-16 RA ferab Synonym Information 11-18 E n Comments to a Table 11-19 AL Adding s ra R Summary 11-20 KA non-t Practice 11: Overview 11-21 A Practice Solutions B Table Descriptions and Data C Oracle Join Syntax D Using SQL*Plus E Using SQL Developer Index xi
  • 12. SQL Star International Limited Additional Practices Additional Practices: Table Descriptions and Data Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. Additional Practices: Solutions a ) has c om ฺ ailฺ uide gm t G @ n a rale tude r hlk his S A O ( se t I KR to u AN nse U L M lice R AH rable A LE ansfe AR on-tr K n xii
  • 13. Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. SQL Star International Limited Using DDL Statements to Create and Manage Tables a ) has c om ฺ ailฺ uide @ n gm t G a rale tude r hlk his S A O ( se t I KR to u AN nse L M Copyright © 2009, Oracle. All rights reserved. U le lice H E RA ferab R AL trans KA non-
  • 14. SQL Star International Limited Objectives After completing this lesson, you should be able to do the Unauthorized reproduction or distribution prohibited. Copyright© 2011, Oracle and/or its affiliates. following: • Categorize the main database objects • Review the table structure • List the data types that are available for columns • Create a simple table • Explain how constraints are created at the time of table as a h creation o m) • Describe how schema objects work a ilฺc ideฺ @ n gm t Gu a rale tude r hlk his S A O ( se t I KR to u AN nse L M Copyright © 2009, Oracle. All rights reserved. U le lice H RA ferab Objectives E AL ra s In A Rlesson, tyoun introduced to the data definition language (DDL) statements. You are Kthis non- are taught the basics of how to create simple tables, alter them, and remove them. The data types available in DDL are shown, and schema concepts are introduced. Constraints are tied into this lesson. Exception messages that are generated from violating constraints during DML are shown and explained. Oracle Database 10g: SQL Fundamentals I 9 - 2