Oracle Academy - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Oracle Academy

Description:

Prof. Carmen Popescu Oracle Academy Lead Adjunct Forma generala a comenzii SELECT SELECT expresii FROM tabele WHERE conditii In clauza select pot aparea coloane, sau ... – PowerPoint PPT presentation

Number of Views:180
Avg rating:3.0/5.0
Slides: 13
Provided by: kom127
Category:
Tags: academy | oracle | select

less

Transcript and Presenter's Notes

Title: Oracle Academy


1
Oracle Academy
Prof. Carmen Popescu Oracle Academy Lead Adjunct
2
Forma generala a comenzii SELECT
  • SELECT expresii
  • FROM tabele
  • WHERE conditii
  • In clauza select pot aparea coloane, sau expresii
  • Ordinea operatorilor / -
  • Operatorii logici AND, OR (in aceasta ordine)

3
BETWEEN
  • SELECT from employees
  • WHERE
  • department_id BETWEEN 10 AND 30
  • ?
  • SELECT from employees
  • WHERE
  • department_id gt10 AND
  • department_idlt30
  • Departamentul 20 ESTE afisat

4
IN
  • SELECT from employees
  • WHERE
  • department_id IN (10,30)
  • ?
  • SELECT from employees
  • WHERE
  • department_id10 OR
  • department_id30
  • Departamentul 20 NU ESTE afisat

5
NULL
  • 5NULL gt NULL
  • La ordonare crescatoare valorile NULL sunt puse
    la sfarsit
  • La ordonare descrescatoare NULL apare la inceput

6
ALIAS DE COLOANA (AS)
  • SELECT salary0.25salary
  • FROM employees
  • SELECT salary0.25salary
  • AS New Salary
  • FROM employees
  • SELECT salary0.25salary
  • AS New Salary
  • FROM employees
  • gt EROARE

7
ALIAS DE COLOANA (AS)
  • SELECT first_name last_name
  • AS Numele
  • FROM employees
  • SELECT first_name last_name
  • AS Numele
  • FROM employees

8
ALIAS DE COLOANA (AS)
  • Ghilimelele la alias sunt obligatorii cand
  • Aliasul e compus din doua sau mai multe cuvinte
  • Dorim ca aliasul sa fie scriscu litere mici

9
DESCRIBE
10
LIKE
  • SELECT from employees
  • WHERE first_name LIKE a
  • afiseaza toate persoanele cu un a oriunde in
    prenume
  • SELECT from employees
  • WHERE first_name LIKE _ _a
  • afiseaza persoanele cu un a pe a treia pozitie
    din nume
  • - oricate caractere (inclusiv nici unul)
  • _ - un singur caracter

11
LIKE
  • SELECT from employees
  • WHERE job_title LIKE \_ _ _
  • ESCAPE \
  • afiseaza persoanele pt. care in job_title, dupa
    caracterul _ mai exista exact doua caractere
  • Cu clauza ESCAPE am precizat ca sau _ precedate
    de \ vor
  • fi tratate ca si caractere
  • normale ce trebuie sa
  • apara in text nu ca
  • wildchar.

12
ORDER BY
  • SELECT FROM employees
  • ORDER BY last_name ASC,
  • salary DESC
  • SELECT first_name,salary,
  • department_id
  • FROM employees
  • ORDER BY 2
  • Se sorteaza dupa a doua
  • expresie din clauza SELECT,
  • adica dupa salary
Write a Comment
User Comments (0)
About PowerShow.com