Chapter 1 : Introduction - PowerPoint PPT Presentation

About This Presentation
Title:

Chapter 1 : Introduction

Description:

In Oracle, you must end each individual SQL statement (irrespective of whether ... connection to an Oracle database stored on a Sun Microsystems server running the ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 19
Provided by: academicc5
Learn more at: https://www.siue.edu
Category:

less

Transcript and Presenter's Notes

Title: Chapter 1 : Introduction


1
Chapter 1 Introduction
  • BORDOLOI BOCK

2
SQL
  • SQL, pronounced Sequel or simply S-Q-L, is a
    computer programming language that was developed
    especially for querying relational databases
    using a non-procedural approach.
  • The term non-procedural means that you can
    extract information by simply telling the system
    what information is needed without telling how to
    perform the data retrieval. The RDBMS parses
    (converts) the SQL commands and completes the
    task.

3
SQL
  • Extracting information from the database by using
    SQL is termed querying the database.
  • SQL is a language that is fairly simple to learn,
    in terms of writing queries but it has
    considerable complexity because it is a very
    powerful language.

4
DATA AND INFORMATION
  • Information is derived from raw facts known as
    data.
  • Data has little meaning or usefulness to managers
    unless it is organized in some logical manner.
  • One of the most efficient ways to organize and
    manage data is through the use of database
    management system (DBMS).

5
DATA
  • Two types of data are stored within a database
  • User data Data that must de stored by an
    organization.
  • System data Data the database needs to manage
    user data to manage itself. This is also termed
    metadata, or the data about data.

6
SQL
  • Data is manipulated by RDBMS users through the
    use of special data manipulation language.
  • Database structures can also be defined by the
    use of data definition language.
  • SQL is the most popular database language and
    has commands that enable it to be used for both
    manipulation and definition of databases.




7
SQL
  • SQL is used by Oracle for all interaction with
    the database. SQL statements fall into the two
    major categories
  • Data Definition Language(DDL) Set of SQL
    commands that create and define objects in a
    database
  • Data Manipulation Language(DML) Set of SQL
    commands that allow users to manipulate the data
    in a database.




8
SQL
  • SQL is basically a free format language. This
    means that there are no particular spacing rules
    that must be followed when typing SQL commands.
  • In Oracle, you must end each individual SQL
    statement (irrespective of whether it is composed
    as a single or multiple lines of code) with a
    semi-colon (). It is the which ends an SQL
    statement and tellls Oracle to Execute it.




9
RELATIONAL OPERATIONS
  • SQL operations for creating new tables, inserting
    table rows , updating table rows, deleting table
    rows, and querying databases are the primary
    means of interfacing with relational databases.
  • The SELECT statement is used primarily to write
    queries that extract information from the
    database which is a collection of related tables.




10
Starting Oracle SQLPLUS
  • The most common types used are either the
    standard Oracle SQLPLUS available for a
    Windows-type interface or by connecting to an
    Oracle database via a telnet session.
  • The following Log On session is a connection to
    an Oracle database stored on a Sun Microsystems
    server running the Unix O/S.
  • A SQLPLUS session is begun by typing the command
    sqlplus at the command prompt() and entering
    the username and password information .
  • contd




11
Log On Screen



12
Exiting SQLPLUS
  • The SQLPLUS session can be ended by typing a
    command at the SQL prompt to terminate the
    session.
  • Two commands are available exit or quit. Either
    one of these can be used to terminate a SQLPLUS
    session.




13
Running (Executing) a Command File
  • The command to run (execute) a command file is
  • SQLgt START filename.sql
  • A form of shorthand for the word start can be
    used when executing a command file by replacing
    start with the _at_ (at symbol).




14
Syntax Conventions
  • Each select statement must follow precise
    syntactical and structural rules.
  • The following is the minimum structure and syntax
    required for an SQL SELECT statement.
  • SELECT DISTINCT ALL select_list
  • FROM table_name alias view_name




15
SQL Keywords
  • Keywords are words that have a predefined meaning
    in SQL.
  • In practice, keywords may be entered in upper or
    lower case letters.
  • SELECT
  • FROM employee
  • select
  • from employee




16
SQL Keywords
  • In some cases keywords can be abbreviated.
  • The allowed abbreviation is shown in upper case
    letters with the remainder shown in lower case,
    which means either the full word or only the
    upper case part can be used.
  • DESCribe can be entered as either DESC or
    DESCRIBE.




17
SQL Naming Conventions
  • Identifiers are the names given by information
    system developers or system users to database
    objects such as tables , columns, indexes, and
    other objects as well as the database itself.
  • There are several rules for naming database
    objects that must be followed.
  • Identifiers should contain between 1 and 30
    characters.
  • The first character must be either alphabetic
    (a-z, A-Z) or the _at_ symbol or _ (underscore).




18
SQL Naming Conventions
  • After the first character, digits, letters, or
    the symbols ,, or _(underscore) must be used.
  • No embedded spaces are allowed in identifiers.
  • SQL keywords cannot be used as an identifier.



Write a Comment
User Comments (0)
About PowerShow.com