Вы находитесь на странице: 1из 19

Oracle Data

Warehousing
CSIS 4320 Data Warehousing
Lab 1

Oracle APEX and SQL Workshop

Oracle APEX workspace and login


SQL workshop
Oracle schema
Database integrity

Introduction to Oracle APEX


What is Oracle APEX (Application Express)
Browser based application development environment
Full service: application building, SQL workshop, and utilities
In this class, students will only use SQL workshop to perform
Oracle SQL activities

APEX Workspace
A workspace is a virtual private database that enables multiple
users to work within the same Oracle APEX installation while
keeping their objects, data, and applications private

Oracle APEX Documentation


Oracle Application Express documentation and tutorials can
be found and downloaded from here:
https://apex.oracle.com/i/index.html
http://mercury.webster.edu/wang/APEX/index.html

Access Oracle APEX Workspace


The APEX address on ICARUS server is:
http://daedalusweb.webster.edu/pls/apex

Enter APEX workspace with following parameters:


Workspace = {workspace name created by administrator}
Username = {username for the workspace}
Password = {password for the workspace}

Case insensitive
Case sensitive

Access Oracle APEX Workspace


Your Webster email address can be used
To find out workspace name and username
To reset login password

APEX Workspace Home


The workspace home after youve successfully logged in
Then you can click SQL Workshop big button

Using SQL Workshop


Object browser
View and browse database objects

SQL commands
Run SQL commands

Object Browser
Click Object Browser to browse database objects

Oracle Schema
A schema is a collection of database objects
A schema is owned by a database user and has the same
name as that user
For example, user name JPWANG owns schema JPWANG
Schema objects include structures like tables, views, and
indexes

Object Views
Switch object views, such as
Table table structure
Data table records
Constraints table constraints such as primary key and foreign
keys

SQL Commands
Click SQL Commands to enter SQL statements and commands

SQL Commands
The SQL Commands window can only execute one SQL
statement at a time
If you have more than one SQL statements in the window,
highlight one and run

Database Integrity
Database integrity ensures that data in the database is
accurate, valid, and consistent
Entity integrity, primary key constraint
Primary key attribute value is unique
And, no primary key value can be NULL

Referential integrity, foreign key constraint


Foreign key value must match the primary key value in the related
table
Or, be NULL

Domain integrity, domain constraint


Governs the possible values of an attribute
Using data type, data format, range, length, nullable, etc.

Entity and Referential Integrity


Showing table EMPs primary key and foreign keys constraints

Entity and Referential Integrity


Primary key column is EMPNO
Foreign key columns are MGR and DEPT

Integrity Enforcement
Primary key (EMPNO) value is unique and not NULL
Foreign key (MGR) value either matches primary key value or
is NULL

ERD and Business Rules


ERD (entity relationship diagram) based on primary key and
foreign key definitions (reverse engineering)
Relationship to business rules
A department employs many employees and an employee is
employed by one department
A employee manager manages many employees and an
employee is managed by only one manager

Вам также может понравиться