Introduction to Oracle SQLI was a teaching assistant for a series of Oracle-based database courses at Temple University, so I had to prepare SQL scripts to illustrate the concepts I was explaining. They eventually grew into lab notes, so here they are:But before we start:
|
|
DDL scripts:students_create.sqlstudents_populate.sql students_drop Snapshot:Database snapshot |
Lab notes: |
|
| Introduction to Oracle SQL |
Create and drop table Data types Insert, update, delete Operators Precedence of operators Alter table |
| Oracle SQL*Plus |
Common SQL*Plus commands TAB |
| first.sql |
A very simple SQL script (download it and execute by typing @first in your SQL*Plus window). |
| Select statement and the like |
SELECT LIKE ... ... JOIN ... Set operations INTERSECT UNION MINUS |
| Aggregate functions |
ORDER BY, ASC, DESC Aggregate functions COUNT SUM MIN MAX AVG GROUP BY and HAVING |
| Nested statements |
Nested statements, subqueries Indentation More joins All |
| Views |
Views COLUMN ... FORMAT ... Oracle system views: USER_TABLES USER_VIEWS USER_OBJECTS |
| Joins and outer joins |
JOIN, OUTER JOIN (LEFT, RIGHT, FULL) Oracle's join syntax |
| Variables and built-in functions |
SQL*Plus string functions UPPER() LOWER() SUBSTR() SYSDATE() function Variables in SQL*Plus PROMPT ... ACCEPT ... TTITLE, BTITLE BREAK |
| command_line.sql |
Command line argument passing for SQL scripts |
| Past errors and future strategies |
Common errors I discovered while grading homeworks and lab reports for database courses. |
| Normalization lecture |
Normalization 1NF 2NF 3NF BCNF |
| Indexes |
Indexes in Oracle Create, alter, drop Function-based indexes USER_INDEXES Indexes and primary keys |
| Oracle PL/SQL Language |
Structure of a PL/SQL program Exceptions 3-valued logic Loops (unconditional, while, for) Cursors Procedures Functions Triggers |