SQL - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

SQL

Description:

Define, very precisely, the retrieval of information from relational databases ... Create and define tables. Perform elementary analysis/manipulation of ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 9
Provided by: normfr
Category:
Tags: sql | define

less

Transcript and Presenter's Notes

Title: SQL


1
SQL
  • FIS 1311
  • Nov. 28, 2005

2
Structured Query Language
  • ANSI/ISO standard used with relational databases
  • Is a very simple but powerful computer language
  • Tells the computer/database what to do
  • Sequences of linked commands can perform complex
    tasks
  • Represents a formalized language that utilizes
    datatypes, boolean operators

3
Structured Query Language, Cont
  • What can it do?
  • Define, very precisely, the retrieval of
    information from relational databases
  • Insert and update data in these databases
  • Create and define tables
  • Perform elementary analysis/manipulation of
    retrieved results
  • Viewing/formatting data in different ways

4
Anatomy of a select statment
  • SELECT describe fields you want to see/retrieve
  • FROM table(s) where the fields are found
  • WHERE describe one or more conditions that will
    restrict the number of fields retrieved
  • Display information ORDER BY, Remove duplicates

5
WHERE - Conditions
  • Equal
  • ltgt or !Not Equal
  • lt Less Than
  • gt Greater Than
  • lt Less Than or Equal To
  • gt Greater Than or Equal To

6
WHERE - Conditions, cont
  • IN Allows the user to supply a list of values as
    conditions in a query. (Could be either numeric
    or textual, but are generally textual)
  • BETWEEN Allows the user to select a range of
    values as a query condition. (Tends to be
    numeric.)
  • LIKE Used with the sign, which can stand in for
    any character or set of characters

7
Dataypes
  • Individual fields can/will have different
    datatypes.
  • These are important in SQL syntax in conditional,
    when clauses
  • If its text, use single quotes WHEN
    last_namefriesen like norm
  • If its numeric, dont use quotes WHEN ID gt 5
  • Numbers or combinations of numbers and other
    characters can be used and ordered, etc. as text
    datatypes

8
Practice, Practice
  • learningspaces.org/1311/sql/select-1.cfm
  • Use this, and see what happens!
Write a Comment
User Comments (0)
About PowerShow.com