# Oracle SQL Fundamentals/Introduction

This lesson introduces Oracle SQL database concepts, the SQL language, client tools, and sample schemas.

## Objectives and Skills

Objectives and skills for Oracle SQL Fundamentals I certification are covered in detail in other lessons. This lesson helps you:
* Understand Oracle server technologies
* Understand relational database concepts
* Summarize the SQL language
* Use Oracle client tools
* Create example schemas for use in the course

## Readings

* Read Wikipedia: Oracle Database.
* Read Wikipedia: Relational database.
* Read Wikipedia: Database normalization.
* Read Wikipedia: SQL.
* Read Wikipedia: SQL*Plus.
* Read Wikipedia: Oracle SQL Developer.

## Multimedia

* YouTube: Oracle 11g SQL Tutorial & Exam 1Z0-051 : Introduction
* YouTube: How To Prepare For Your Oracle Certification Exam

## Activities

* Install Oracle Express.
** Review Oracle: Oracle Database Express Edition Documentation and the the installation guide for your platform (Linux or Windows).
** On the system you plan to use as your database server, download and install Oracle Database Express.
* Use SQL*PLUS to verify the installation.
** Review Oracle: Identifying Your Oracle Database Software Release.
** At a command prompt on the database server, enter sqlplus system.
** At the prompt, enter the password specified during installation.
** To display current version information, run the query SELECT * FROM PRODUCT_COMPONENT_VERSION;
** Enter exit to exit SQL*PLUS.
* Use SQL*PLUS to create the HR and OE sample schemas.
** Review Oracle: Installing the Sample Schemas.
** Download and extract the sample schemas from Oracle:sample-schem-scripts.zip.
** At a command prompt, navigate to the schema/hr folder you just extracted.
** In the schema/hr folder, enter sqlplus / as sysdba to start SQL*PLUS.
** Run the command @hr_main.sql.
** Enter the system password. When the script finishes, if necessary enter exit to exit SQL*PLUS and return to the command prompt.
** Navigate to the schema/oe folder you extracted.
** In the schema/oe folder, enter sqlplus / as sysdba to start SQL*PLUS.
** Run the command @oe_main.sql.
** Enter the system password. When the script finishes, if necessary enter exit to exit SQL*PLUS and return to the command prompt.
* Use SQL*PLUS to verify sample schema installation.
** At a command prompt, enter sqlplus hr/hr.
** Run the query show user; to show that you are currently connected as hr.
** Run the query SELECT table_name FROM user_tables; to see the tables that were created.
** Run the command connect OE/OE to connect as OE.
** Run the query show user; to show that you are currently connected as OE.
** Run the query SELECT table_name FROM user_tables; to see the tables that were created.
** Enter exit to exit SQL*PLUS.
* Enable network connections to the server.
** Review Oracle: Database Postinstallation Tasks (Linux) or Oracle: Postinstallation Configuration Tasks on Windows.
** Configure the server firewall to allow access to the Oracle Listener on TCP port 1521.
* Install and test SQL*PLUS on a client computer.
** Review Oracle: SQL*Plus Instant Client.
** Download and install the Instant Client package for your system.
** Download and install the SQL*PLUS package for your system.
** At a command prompt, navigate to the folder where you installed the Instant Client and SQL*PLUS.
** Enter either sqlplus system@hostname or sqlplus system@ip address, replacing hostname or ip address with the hostname or address of your server. If you are unable to connect, check the firewall settings on the server.
** At the prompt, enter the password specified during installation.
** To display current version information, run the query SELECT * FROM PRODUCT_COMPONENT_VERSION;
** Enter exit to exit SQL*PLUS.
* Install and test Oracle SQL Developer on a client computer.
** Review Oracle: Installing Oracle SQL Developer.
** Download and install Java SE Development Kit.
** Download and install Oracle SQL Developer.
** Run SQL Developer.
** Add a connection to your server. Include username, password, hostname or ip address, and port number. Test and save the connection.
** Double-click on the connection to connect.
** In the connection worksheet, enter SELECT * FROM PRODUCT_COMPONENT_VERSION;
** Run the query.
** Close SQL Developer.
* Review HR and OE schema diagrams.
** Review the Oracle: HR and OE schema diagrams.

## Lesson Summary

* Oracle Database (commonly referred to as Oracle RDBMS or simply as Oracle) is an object-relational database management system produced and marketed by Oracle Corporation.
* A relational database is a digital database whose organization is based on the relational model of data.
* The various software systems used to maintain relational databases are known as a relational database management system (RDBMS).
* The relational model organizes data into one or more tables (or "relations") of columns and rows, with a unique key identifying each row. Rows are also called records or tuples.
* Each table/relation represents one "entity type". The rows represent instances of that type of entity and the columns representing values attributed to that instance.
* Database normalization, or simply normalization, is the process of organizing the columns (attributes) and tables (relations) of a relational database to minimize data redundancy.
* Normalization involves decomposing a table into less redundant (and smaller) tables without losing information, and then linking the data back together by defining foreign keys in the old table referencing the primary keys of the new ones.
* The objective of normalization is to isolate data so that additions, deletions, and modifications of an attribute can be made in just one table and then propagated through the rest of the database using the defined foreign keys.
* Virtually all relational database systems use SQL (Structured Query Language) as the language for querying and maintaining the database.
* SQL (Structured Query Language) is a special-purpose programming language designed for managing data held in a relational database management system (RDBMS), or for stream processing in a relational data stream management system (RDSMS).
* SQL was originally based upon relational algebra and tuple relational calculus and consists of a data definition language, data manipulation language, and data control language.
* Data Definition Language (DDL) commands include CREATE, ALTER, DROP, and RENAME.
* Data Manipulation Language (DML) commands include SELECT, INSERT, UPDATE, and DELETE.
* Data Control Language (DCL) commands include GRANT and REVOKE.
* Transaction Control Language (TCL) commands include COMMIT, ROLLBACK, and SAVEPOINT.
* Tools available for managing Oracle databases include SQL*Plus, Oracle SQL Developer, and Oracle Enterprise Manager.

## Key Terms
### entity relationship diagram

    A diagram that demonstrates the relationships between entities in a relational database.

### foreign key

    A field in a relational table that matches the primary key column of another table.

### grid computing

    The collection of computer resources from multiple locations to reach a common goal.

### instance

    Refers to any running process.

### Oracle Enterprise Manager (OEM or EM)

    A set of web-based tools aimed at managing software and hardware produced by Oracle Corporation as well as by some non-Oracle entities.

### Oracle SQL Developer (SQLDeveloper)

    An Integrated development environment (IDE) for working with SQL in Oracle databases using the Java Development Kit.

### PGA (Program Global Area)

    Memory-area of an Oracle instance that contains data and control-information for Oracle's server-processes.

### PL/SQL (Procedural Language/Structured Query Language)

    Oracle Corporation's procedural extension for SQL and the Oracle relational database.

### primary key

    A field or fields that uniquely specifies a record or tuple within a table.

### schema

    The structure of a database described in a formal language supported by the database management system (DBMS). An Oracle database associates a separate schema with each database user.

### SGA (System Global Area)

    Forms the part of the system memory (RAM) shared by all the processes belonging to a single Oracle database instance.

### SQL*Plus

    An Oracle Database utility, with a basic command-line interface, commonly used by users, administrators, and programmers.

## Assessments

* Flashcards: Quizlet: Oracle 1Z0-051 Exam - General

## See Also

* Oracle: Database 2 Day Developers Guide - Introduction