Datasheet

SQL Fundamentals
5
When you install Oracle software, you can choose the Basic Installation
option and select the Create Starter Database check box. This database
will have the sample schemas used in this book. The password you specify
will be applicable to the
SYS and SYSTEM accounts. The account SYS is the
Oracle dictionary owner, and
SYSTEM is a database administrator (DBA)
account. Initially, the sample schemas are locked. You need to log in to the
database using SQL*Plus as the
SYSTEM user and then unlock the account
using the
ALTER USER statement. To unlock the HR schema, use ALTER USER
hr IDENTIFIED BY hrpassword ACCOUNT UNLOCK;
. Now you can log in to
the database using the
hr user with the password hrpassword. Remember,
the password is case sensitive.
For detailed information on installing Oracle 11g software and creating
Oracle Database 11g, please refer to the Oracle Technology Network
at
www.oracle.com/technology/obe/11gr1_db/install/dbinst/
windbinst2.htm
.
To install the sample schemas in an existing Oracle Database 11g, please
follow the instructions in the Oracle document “Oracle Database Sample
Schemas 11g Release 1” at
http://download.oracle.com/docs/cd/
B28359_01/server.111/b28328/toc.htm
.
Chapter 2 of the “Oracle Database Sample Schemas 11g Release 1” man-
ual on the Oracle Technology Network will provide instructions on how
to install the sample schemas using Database Configuration Assistant
(DBCA) as well as running scripts. The same chapter also gives you steps
to reinitialize the sample schema data.
SQL statements are like plain English but with specific syntax. SQL is a simple yet pow-
erful language used to create, access, and manipulate data and structures in the database.
SQL statements can be categorized as listed in Table 1.1.
TABLE 1.1 SQL Statement Categories
SQL Category Description
Data Manipulation
Language (DML)
Used to access, create, modify, or delete data in the existing
structures of the database. DML statements include those to
query information (
SELECT), add new rows (INSERT), modify
existing rows (
UPDATE), delete existing rows (DELETE), perform a
conditional update or insert operation (
MERGE), see an execution
plan of SQL (
EXPLAIN PLAN), and lock a table to restrict access
(
LOCK TABLE). Including the SELECT statement in the DML group
is debatable within the SQL community, since
SELECT does not
modify data.
95127c01.indd 5 2/18/09 6:37:06 AM