Chapter 2 Basic SQL SELECT Statements - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Chapter 2 Basic SQL SELECT Statements

Description:

Same as an RDBMS except it can be used to reference objects such as maps and object fields ... If it contains blank space(s) If it contains special symbol(s) To ... – PowerPoint PPT presentation

Number of Views:378
Avg rating:3.0/5.0
Slides: 18
Provided by: lm555
Category:

less

Transcript and Presenter's Notes

Title: Chapter 2 Basic SQL SELECT Statements


1
Chapter 2Basic SQL SELECT Statements
2
Relational Database Management System (RDBMS)
  • An RDBMS is the software program used to create
    the database and it allows you to enter,
    manipulate, and retrieve data

3
Object Relational Database Management System
(ORDBMS)
  • Same as an RDBMS except it can be used to
    reference objects such as maps and object fields

4
SELECT Statement Syntax
  • SELECT statements are used to retrieve data from
    the database
  • Syntax gives the basic structure, or rules, for a
    command

5
SELECT Statement Syntax
  • Optional clauses and keywords are shown in
    brackets

6
SELECT Statement Syntax
  • SELECT and FROM clauses are required
  • SELECT clause identifies column(s)
  • FROM clause identifies table(s)
  • Each clause begins with a keyword

7
Selecting All Data in a Table
  • Substitute an asterisk for the column names in a
    SELECT clause

8
Selecting One Column from a Table
  • Enter column name in SELECT clause

9
Selecting Multiple Columns from a Table
  • Separate column names with a comma

10
Operations Within the SELECT Statement
  • Column alias can be used for column headings
  • Perform arithmetic operations
  • Suppress duplicates
  • Concatenate data

11
Column Alias
  • List after column heading
  • AS keyword is optional
  • Enclose in double quotation marks
  • If it contains blank space(s)
  • If it contains special symbol(s)
  • To retain case

12
Column Alias Example
13
Precedence of Arithmetic Operations
  • Executed left to right
  • Multiplication and division are solved first
  • Addition and subtraction are solved last
  • Override order with parentheses

14
Example Arithmetic Operation with Column Alias
15
Suppressing Duplicates
  • Enter DISTINCT or UNIQUE after SELECT keyword

16
Concatenation
  • Can combine data with string literal
  • Use concatenation operator,
  • Allows use of column alias

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