1. Oracle9i: An Overview
Dr R.Khanchana
Assistant Professor
Department of Computer Science
Sri Ramakrishna College of Arts and Science for Women
2. Personal Databases
⢠Personal database management systems
Data is collected and stored on personal computers which is small
and easily manageable. The data is generally used by the same
department of an organization and is accessed by a small group of
people.
ďź Microsoft Access and Visual fox Pro are usually stored on a users desktop computer
system or client computer.
ďź These database packages are developed primarily for single âuser application.
3. Client/ Server database
⢠Client/ Server database management systems
â The data are stored on a server which are transmitter to the
client computers over the network.
⢠Servers resources
â servers hard âdisk drive space, application programs on a
servers hard drive ,data stored on the servers drive, or
printers
4. Network
⢠Network - A network is an infrastructure of
hardware and software that enables computer
to communicate with each other
6. A Personal database system in a multiuser environment
File server
(Database file)
Gets file requests from clients
Sends files to clients
Receive files back
Client computer #1
(DBMS, Client Applications)
Sends file request
Receive files
Adds Deletes Updates Data
Sends files back
Client Computer #2
(DBMS, Client Applications)
Sends file request
Receive files
Adds Deletes Updates Data
Sends files back
NETWORK
7. Demand on Client and Network
ďźLoad entire Db application to Memory
â Network environment with the personal DBMS, the
Client computer must load the entire database
application along with the client database application
in its memory.
â If the client requires a small piece of data form the
server large database, the server has to transmit the
entire database/ part of the database to the client over
the network.
ďźHeavy Traffic
â The system response to various client request depends
on the speed of the network and the amount of traffic
over it.
8. Table Locking
⢠The personal database system assumes that no
two transaction will happen at the same time on
one table, which is known as optimistic locking.
⢠The tables are not locked by the database system.
⢠Personal database software does not lock tables
automatically.
9. Client Failure
⢠A client is performing record insertion, deletion
or updates, those records are locked by that client
and are not available to other clients.
⢠The transaction in progress at the time of failure
are lost.
⢠Repair Database
â If database can get corrupted needs to be repaired. To
repair database all users have to log off. It will takes
few minutes or few hours
â If the database is not reparable, data can be restored
from the last backup, but the transactions since the
backup are lost and have to be reentered.
10. Transaction Processing
⢠Personal databases, such as Microsoft Access, do
not have file-based transaction logging.
⢠Instead, transaction are logged in the clientâs
memory.
⢠If the client fails in the middle of batch
transactions, some transactions are written to the
database and some are not.
⢠The transaction log is lost, because it is not stored
in a file.
⢠Eg: Money Transaction
12. CLIENT/SERVER DATABASE
⢠Client/databases
â Oracle, run the DBMS as a process and a server and run a
client database application on each client.
⢠The client application sends a request for data over the
network to the server.
⢠The server receives the client request, the DBMS
retrieves data from the database, performance the
required processing on the data, and sends only the
requested data(or query result) back to the client over
the network.
13. A Client/Server database system in a multiuser environment
Database server
(DBMS process)
Gets file requests from clients
Adds Deletes Updates, filters
data
Client computer #1
( Client Applications)
Sends file request
Receive results
Sends new data
Client computer #2
(Client Applications)
Sends data request
Receive results
Sends new data
NETWORK
14. Demand on Client and Network
⢠The Client computer does not run the the
entire DBMS, only the client application that
request data from the server.
⢠The client does not store any database on its
local drive; it requested data from the server.
⢠Data processing is performed on the serverâs
side.
⢠The demand at the clientâs end is minimal.
15. Table Locking
⢠In a Client/server system, such as Oracle,
when an agent reads a table to sell a seat for a
basketball game, for example, it is locked
totally or partly by the DBMS.
⢠The second agent cannot read the part of the
table with available seats.
⢠The DBMS takes care of the locking
automatically, and it involves no extra effort
on an application programmer's part.
16. Client Failure
⢠In case of a client failure, the client/server
database is not affected.
⢠The other clients are not affected either.
⢠Only the failed clientâs transaction in progress
are lost. Is the server fails, a central
transaction log, a log of all current database
changes, allows the database Administrator
(DBA) or DBMS to complete or roll back
unfinished transactions.
17. Transaction Processing
⢠If a grouped transaction or batch transaction
fails in the middle, all transactions are rolled
back.
⢠The DBMS will enable the bank, for example,
to make sure that both account balances are
changed if the batch transaction goes through.
20. Oracle 9i Introduction
⢠It is a client/server DBMS that is based on
Relational Data Model
⢠qualities, failure handling, recovery management,
administrative tool to manage user.
⢠It is widely used by corporations of all sizes to
develop mission-critical applications.
⢠It is also used as a teaching tool by educational
institution to teach object- relation database
technology, SQL, PL/SQL and interfacing with
oracle database.
21. Oracle Software Environments
⢠Stand-alone Environment
â Laptop / Desktop that is not on a network
⢠Client/ Sever Environment
â Twoâtier Architecture
â Threeâtier Architecture
22. Oracle 9i Tools
ďź SQL*plus- writing commandâline SQL queries to work with database objects.
ďź PL/SQL: SQL for creating procedural.
ďź Developer suite: Developing database application.
Jdeveloper- Java development tool.
Designer â Business process and generate enterprise application.
Forms Developer- Internet and client/server based environment.
Oracle reports- A report generation tool.
ďź Enterprise manager: managing users and database.
Store manager â to create and manage âtablespacesâ.
Instance manager- to,start,stop,or tune database.
Security manager â create and manage users,profiles and roles.
Warehouse manager- manage data warehousing applications.
Xml database manager-render traditional database as XML.
SQL worksheet â enter, edit and execute SQL*pluse code.
iSQL*plus- web-based environment to execute SQL*pluse code.
23. SQL *plus Environment
⢠SQL*plus provides the user
with the SQL > prompt.
ďź Accepts ad hoc entry of
statements at the command
line prompt.
ďź Accepts SQL statements from
files.
ďź Provides a line editor for
modifying SQL queries.
ďź Provides environment, editor,
format, execution.
ďź Format query results, and
displays reports on the screen
ďź Control environmental
settings.
ďź Access local and remote
database.
ďśQuery typed at SQL >Prompt
ďśQUERY excedds one line SQL * plus
displays in the next line
ďśEach query end by semicolon (;)
ďśA query sent to server by using a
forward slash (/)
24. SQL (Structured Query Language)
⢠The standard query language for relational
database is SQL.
⢠It is standardized and accepted by ANSI and
ISO.
⢠SQL is a 4th generation ,high-level, non
procedural language.
⢠SQL is standardized and its syntax is the same
across most RDBMS packages.
⢠Oracleâs SQL is different from the ANSI SQL.
25. Types of SQL Statements
⢠Data retrieval - retrieves data from the database.
â SELECT
⢠Data manipulation language â Changes the existing rows.
â INSERT, UPDATE, DELETE
⢠Data Definition Language (DDL) â removes a tableâs
structure.
â CREATE, DROP, ALTER, RENAME, TRUNCATE
⢠Transaction Control Language (TCL) â manages and
changes the logical transaction.
â COMMIT, SAVEPOINT, ROLLBACK
⢠Data Control Language (DCL)â gives and removes rights
to Oracle objects.
â GRANT, REVOKE
26. LOGGING INTO SQL*PLUS
⢠In windows environment,
click
â Start/ Programs / Oracle â
Orahome92/ Application
Development / SQL*Plus.
⢠Enter
â User name, Password and
Host string as provided by
your database administrator.
27. LOGGING INTO SQL*PLUS
Command Line Environment
⢠In a commandâline
environment such as DOS.
â Type Sqlplus [user
name[/password[@host/
database]]].
Command Line Environment
29. SQL*PLUS COMMANDS
⢠The command word are in both letters and
user-supplied filenames and extensions are in
lower case.
⢠SQL*plus commands are underlined.
⢠Optional parameters are enclosed within a pair
of brackets ([]).
⢠The filename in the field-related commands
requires entire file path.
30. ORACLE ERRORS AND ONLINE
HELP
⢠Write and execute SQL statements and queries at
the SQL*plus prompt.
⢠Oracle places an Asterisk(*) at the location of the
error and also displays an error code.
⢠Some queries take up a few lines.
⢠Errors are easy to find.
⢠Check for common mistakes like misspelled key
words.
⢠Each Oracle product has its own specific help
file.
31. ALTERNATIVE TEXT EDITOR
⢠The SQL*plus editor is a line editor similar to EDLIN in
MS-DOS .
⢠Its not fun working with line editor.
⢠The user does not have control over the screen.
⢠Its use an alternate text editor such as Notepad or any
other text editor in Windows to type your SQL queries.
⢠The query typed in a full âscreen text editor has to be
saved in a file with an sql extension or copied to the
clipboard.
⢠The EDIT (or ED) command can be used to invoke an
alternate text editor from the SQL * plus command
prompt.
32. SQL*PLUS WORKSHEET
⢠The SQL*plus worksheet is another environment available
with Oracleâs Enterprise Manager.
⢠The SQL*plus worksheet enables you to enter, edit, and
execute SQL*plus code.
⢠Its also run client-side script.
The following from the window START button:
START | [All] programs | OracleâOraHome92 |
Application Development | SQLplus Worksheet
⢠An enterprise Manager login screen is the Displayed.
33. SQL*PLUS WORKSHEET
⢠The sql plus system variable SQLPROMPT is disabled by
default.
⢠SQLNUMBER is set to OFF by default.
⢠PAGESIZE is set to its maximum by default.
⢠TAB is set to OFF by default.
⢠It there are any prompt characters â&â in a script, SQL*plus
treats it as a âdefineâ prompt.
⢠The HOST command is not supported in SQL *plus
Worksheet.
⢠EDITOR is disabled by default.
⢠Remote execution is not supported.
⢠Remote load and save of script files is not supported.
34. iSQL*plus
⢠The third environment is web based and is called
iSQL *plus .
⢠To access it through web browser, enter a URL as
follow:
http://machinename.domainname:port /isqlplus
⢠In this URL, machinename is your machine ,but
port number is not required in all version
http://nshah-monroe/isqlplus
⢠The domain name is not used, because
iSQL*plus is located in the local machine .
38. ORACLE TABLES
DATA DEFINITION LANGUAGES
⢠In Oracle9i database tables are objects stored
under a userâs account in an allocated table space
on the Oracle Server disk.
⢠In the classroom environment ,each student is a
user with a unique login/username.
⢠To create tables using SQL statements at the
SQL*plus prompt.
⢠Its also learn to use alternate editors from easier
editing of erroneous statement.
39. NAMING RULES AND CONVENTIONS
⢠A Table is an object that can store data in Oracle
Database.
â Specify the table name, the name of the each column, the
data type of each column, and the size of each column
⢠Oracle provides the different constraints to specify a
primary and the composite key for the table
⢠To define the foreign key in a table that references a
primary in another table , to set data validation rules
for each column should have unique values only.
40. NAMING RULES AND CONVENTIONS
⢠The table and the column names can be up to 30 characters long
⢠It is possible to have a table name that is only one character long.
⢠In Naming tables and the column letters(A-Z, a-z),numbers(0,9) and
the special characters-$(dollar sign),-(underscore),and (pound or
number sign)are allowed.
⢠The table or the column name should begin with the letter
⢠The name are not case sensitive, Oracle stores all name in
uppercase.
⢠Space and hyphens are not allowed in a table or column name
41. Naming - Examples
Vaild Names Invaild Names
STUDENT
MAJOR_CODE
X
PROJECT 2000
STUDENT#REG#TABLE
STUDENT_COURSE_REGISTERATION_TABLE
(more than 30 character long)
MAJOR CODE(spaces not allowed)
CREATE (reversed word not allowed)
PROJECT***2000(special character * not
allowed)
#STUDENT (must start with a letter)
42. Data Types
Data Types
⢠Table is created with each column is assigned as the data type.
⢠Data type that specifies the type of data that will be stored in the
column.
⢠By providing the data type for the column , the wrong kinds of
data are prevented from being stored in the column.
For Example:
Smith cannot be stored in the NUMBER data type.
Job title such as Manager cannot be stored in the NUMBER data type
44. Varchar2
⢠VARCHAR2 type is a character data type to store variable
length alphanumeric data in column
⢠VARCHAR is a synonymous with VARCHAR2 but it could
be a separate data type with different semantics in a future.
⢠Users are advised to use varchar only. A maximum size must
be specified for this type.
⢠Default and the minimum size is the one characters.
⢠Maximum allowable size is 4000 characters in Oracle9i.
Maximum size was 2000 in previous version
⢠If longer than the specific values is entered error is generated.
In Oracle9i, VARCHAR2 data type can also take CHAR or
BYTE parameters
Example: NAME, ADDRESS
45. Char
⢠The CHAR type is a character data type to store fixed
length alphanumeric data in a column.
⢠The default and the minimum size is the one characters.
⢠Maximum allowable size is 2000 characters. 255
characters in previous version
⢠If the value is smaller than the specified size is entered ,
trailing space is added to make its length equal to the
specified length. If it is longer , the error occurs
⢠The CHAR type is approximate for the fixed length
values.
Example: PHONE_ NO and PINCODE
46. Number
⢠The Number data type is used to store negative, positive,
integer, fixed-decimal and floating point numbers.
⢠The number data type can use to any column that is going to
be employed in mathematic calculation for
⢠When a number type is used for a column its precision and
scale can be specified.
⢠Precision is the total number of significant digits in the
number, both left and right of the decimal point
⢠Scale is the total number of digits to the right of the decimal
point.
⢠Precision range 1 to 38 , Scale range -84 to 127, An integer is a
whole number without decimal part
⢠Example: SALARY,COMMISSION or PRICE.
47. Date
⢠The DATE data type is used for storing date and time values.
⢠The range of allowable date is between January 1,4712 B.C
and December 31,999 A.D
⢠The day month,century,hour,minute,and second are stored
in the Date-TYPE COUMN
⢠No need to specify size for date data type
⢠DD-MON-YYYY format also works as default in Oracle9i
⢠Default time format is HH:MM:SS A.M, representing hours,
minutes and seconds in a 12 hour time format.
⢠In a table it is not advisable to use column like AGE, because
age not only change for all entities but also changes at
different times.
49. Advanced data types for our
information
LONG: The LONG type is used for variable length character data up to 2
gigabytes.
NCHAR: The NCHAR type is similar to char but uses 2 byte binary encoding
for each characters.
CLOB :The character large object data type is used to store single byte
character data up to 4 gigabytes
BLOB: The Binary large object data type is used to store binary data up to 4
gigabytes.
NCLOB: The character large object type uses 2 byte characters code
BFILE: The binary file type stores references to a binary file that is external to
the database and is maintained by the operating system file system
RAW(size) or LONG _RAW: These are used for raw binary data
ROWID: For unique row address in hexadecimal format
50. CONSTRAINTS
⢠Constraints enforce rules on table
⢠An oracle table can be created with the column names,
datatype and column size
⢠The constraints are used in oracle to implement integrity rules
of a relational database and to implement data integrity at the
individual column level.
⢠When a row record is inserted, updated or deleted from the
table, constraints must satisfy for the operation to succeed.
51. Types of constraints
⢠There are two type of constraints:
ď Integrity constraints:
Define both the primary key and the foreign
key with the table and primary key it
reference.
ďValue constraints:
Define if NULL values are disallowed, if
UNIQUE values are required , and if only
certain set of value are allowed in a column.
52. Naming a constraints
⢠Oracle identifies constraints with an internal or user-created
name.
⢠A user cannot create constraints in two different tables with
the same name.
The general convention used in naming constraints is given
below
Syntax <table name>_<column name>_<constraints type>
53. Constraints & its Abbrevations
Constraints Abbreviation
PRIMARY KEY pk
FOREIGN KEY fk
UNIQUE uk
CHECK ck or cc
NOT NULL nn
54. Naming a constraint
A constraints can be created at the same time the table is
created, or it can be added to the table afterward.
There are two levels where a constraint is defined:
Table
Level
Column
Level
55. Defining constraints
Column level:
⢠A column level constraints a single column and is defined along with the definition of column
⢠Any constraints can be defined at the column level except FOREIGN KEY and composite primary key constraints
Syntax Column data type[CONSTRAINT constraint _name]constraint_type,
⢠Each column may have zero, one or more constraints defined at the column level.
Example :
CREATE TABLE mytable(name CHAR(10) NOT NULL,
id INTEGER REFERENCES idtable(id),
age INTEGER CHECK (age > 0));
Table level:
⢠A Table level constraints reference one or more column and is defined seperately from the definitions of the column
⢠All constraints can be defined at the table level except for the NOT NULL constraint
Syntax: [CONSTRAINT constraint _name]constraint_type(column,âŚ),
The table level constraints are normally declared after all column definitions.
CREATE TABLE yourtable(firstname CHAR(20) NOT NULL,
lastname CHAR(20) NOT NULL,
UNIQUE(firstname, lastname));
56. The PRIMARY KEY Constraints
⢠The primary key constraint is an known also the
entity integrity constraint.
⢠It creates a primary key for the table.
⢠A table can have only one primary key constraint.
⢠A column or combination of columns used as a
primary key cannot have a null value and its can
only have unique values.
Deptid NUMBER(2) CONSTRAINT dept
_deptid_pk PRIMARY KEY.
57. The FOREIGN KEY Constraint
⢠The foreign key constraint is also known as
the reference integrity constraint.
⢠If uses a column or column as a foreign key,
and it establishes a relationship with the
primary key of the same or another tables.
CONSTRAINT student_facultyid_fk FOREIGN
KEY(facultyid)REFERENCES faculty(facultyid)
58. The NOT NULL constraints
⢠The NOT NULL constraints ensures that the
column has a value is not a null value.
⢠A space or a numeric zero is not a null
value.
⢠There is no need to use the not null
constraint for the primary key column,
because it automatically gets the not null
constraint.
Name VARCHAR(15) CONSTRAINT
faculty_name_nn NOT NULL
59. The UNIQUE Constraint
⢠The UNIQUE constraint requires that every value in
a column or set of column be unique.
⢠If it is applied to a single column, the column has
unique values only.
⢠Primary key will not accept NULL values
whereas Unique key can accept one NULL value.
⢠If it is applied to a set of columns, the group of
column has a unique value together.
⢠The unique constraint allows null value unless NOT
NULL is also applied to the column.
CONSTRAINT dept_nmae_uk UNIQUE(DeptName)
60. The CHECK Constraint
⢠The CHECK constraint defines a condition that
every row must satisfy.
⢠There can be more than one CHECK constraint
on a column, and the CHECK constraint can be
define at the column as well as the table level.
Deptid NUMBER (2) CONSTRAINT dept_deptid_cc
CHECK((Deptid >= 10)and (Deptid <= 99))
61. The NOT NULL CHECK constraint
⢠A NOT NULL constraint can be declared
as a CHECK constraint.
⢠It can be defined at column or table level.
⢠Name VARCHAR2(15) CONSTRAINT
faculty_name_ck_CHECK (Name IS NOT NULL)
62. The DEFAULT Value(Itâs NOT A
Constraint)
⢠The default value ensure that a particular column
will always have a value when a new row is
inserted.
⢠The default value gets over written if a user
enters another value.
⢠The default value is used if a null value is
inserted.
State CHAR(2) DEFAULT âNJâ
67. CREATE DATABASE
⢠The SQL CREATE
DATABASE statement is used
to create a new SQL database.
⢠Syntax
â CREATE DATABASE
DatabaseName;
⢠Example
68. DROP DATABASE
⢠The SQL DROP
DATABASE statement is used
to drop an existing database
in SQL schema.
⢠Syntax
â DROP DATABASE
DatabaseName;
⢠Example
69. Creating on Oracle table
⢠Create Table Query is used for Table creation
⢠A table is created as soon as the CREATE
statement is executed by the ORACLE server.
⢠Create TABLE tablename (column1 datatype,
column2 datatype);
⢠A user creates an Oracle table in the SQL*plus
environment/
⢠An Oracle table is created from the SQL > prompt
in the SQL*plus environment.
⢠A data definition language SQL statement,
CREATE TABLE is used for table creation.
70. Create Table -Syntax
CREATE TABLE [schema.] tablename
(column 1 datatype[CONSTRAINT constraint_name]constraint_type,
Column 2 datatype[CONSTRAINT constraint_name]constraint_type,
[CONSTRAINT constraint_name] constraint_type(column,âŚ),âŚ);
⢠Schema is Optional
⢠Table name is the name of the table given by user
⢠Column is the name of a single column
⢠Data type is the columnâs data type and size
⢠Constraint name is the name of constraint provided by the user
⢠Constraint type is the integrity or value constraint
71. Error in a Query
⢠C/CONSRAINT/CONSTRAINT to change the correct
spelling.
⢠To load on erroneous statement in Notepad and modify
it.
1. At the SQL > prompt, type ED in invoke Notepad.
2. Required correction to the script.
3. A:CREATE.Notepad adds the extensions.txt to the
file name
4. Notepad to go back to the SQL*plus environment.
5. Run the saved statement with @ or the RUN
command.
72. STORAGE Clause in CREATE TABLE
STORAGE Clause in CREATE TABLE
This clause is used to allocate initial disk space for the table at the time
of creation with the INITIAL parameter and also to allocate additional
space with the NEXT parameter in case the table runs out of allocated
initial space.
Create table sample (id NUMBER(3), Name VARCHAR2(25))
TABLESPACE CIS_DATA
STORAGE (INITIAL 1M NEXT 100K)
PCTFREE 20;
The STORAGE clause allocates 1 MB initially on tablespace
CIS_DATA & 100KB as additional space on the same tablespace.
The PCTFREE(percentage-free) clause is used to allow for future
increment in row size.
74. Displaying table information
⢠User create a table or many tables in his or her
database.
⢠Oracle tracks them all using its own Data Dictionary.
⢠User to view that information from Oracles Data
Dictionary tables.
1. Viewing a userâs table names
2. Viewing a tableâs structure
3. Viewing constraint information
4. Viewing tablespace information
5. COMMENT on Tables and Columns
75. DISPLAYING TABLE INFORMATION
⢠Viewing a Userâs Table Names
SELECT TABLE_NAME FROM USER_TABLES;
Example
SELECT * FROM USER_TABLES;
76. Assignment âCreate Table
Create 10 different tables with minimum 5 attributes and different constraints
âEmployee
âCustomer
âSales
âStudent
âDepartment
âEmployee
âInvoice
âItem
âProject
âFaculty
80. Altering an existing table
Modifications allowed without any restrictions:
⢠Adding a new column to the table
⢠Deleting a foreign key constraint from a table
⢠Renaming columns
⢠Renaming constraints
81. Altering an existing table
Modifications allowed with restrictions
⢠Adding a foreign key is allowed
⢠Adding a primary key is allowed
⢠Adding a unique constraint is possible
⢠Adding a check constraint is possible
⢠Adding a default value is possible
⢠Checking a columnâs name
⢠Checking a constraintâs name
⢠Removing a column
82. Altering an existing table
Modifications not allowed include
⢠Changing a columnâs name (oracle 8i and
earlier)
⢠Changing a constraintâs name (oracle 8i and
earlier)
⢠Removing a column (oracle 8i and earlier)
83. Adding a New Column to an Existing Table
⢠Syntax
â ALTER TABLE tablename
ADD Columnname datatype;
84. Modifying an Existing Column
Syntax:
⢠ALTER TABLE tablename
MODIFY columnname newdatatype;
85. Dropping a table
⢠The existing table structure has so many flaws
it is advisable to drop it and recreate it.
⢠A table is dropped, all data and the table
structure are permanently deleted.
⢠All associated indexes are removed.
⢠DROP TABLE table name[CASCADE CONSTRAINTS];
86. Renaming the table
⢠Rename a table provided are the owner of the table.
⢠RENAME oldtablename TO newtablename;.
⢠Oracle will display a âtable renamedâ. Message statement is
executed.
87. Truncating the table
⢠A table is removing all records/rows from the table.
⢠The structure of the table stays intact.
⢠The table with the DELETE TABLE privilege to
truncate the table
⢠The SQL language is a DELETE statement the can be
used to remove one or more rows from a table, and its
reversible as long as it is not committed.
⢠Syntax :TRUNCATE TABLE tablename;
88. Table types
Permanent
tables
Temporary
tables
Index organized
tables
External tables
⢠Permanent tables are used for
storing the data.
⢠Temporary tables are used during
a session or a transaction tables.
⢠Index organized tables are used
for tables with primary key values
that are looked up frequently.
⢠External tables are stored
âoutsideâ the database with
CREATE TABLE.
89. Spooling
⢠Handy feature.
⢠A user can redirect all statements, quires,
command and results to a file for later review or
print out.
⢠The method creates a text file of all actions and
their results.
⢠To start spooling go to the file menu in the
SQL*plus window.
⢠Click on spool and spool file in subsequent
menus.
⢠To stop spooling at any point, use the same menu
to click on spool.
91. Error codes
⢠It able to get it by clicking on START-ORACLE-ORACLE
HOME92.
⢠The error help the screen is displayed, click on the index tab.
⢠The type error code received from oracle in the space provided.
⢠The typing click on the display button to get on explanation of
the error code is straight forward.
92. Assignments
⢠Exercise 1
â Write the correct SQL statement to create a new database
called testDB
⢠Exercise 2
â Write the correct SQL statement to delete a database
named testDB
⢠Exercise 3
â Write the correct SQL statement to create a new table
called Persons
⢠Exercise 4
â Write the correct SQL statement to delete a table
called Persons.
93. Assignments - Answers
⢠Exercise 1
â Write the correct SQL statement to create a new database
called testDB
⢠CREATE DATABASE testDB;
⢠Exercise 2
â Write the correct SQL statement to delete a database named testDB
⢠DROP DATABASE testDB;
⢠Exercise 3
â Write the correct SQL statement to create a new table called Persons
⢠CREATE TABLE Persons (PersonID int, LastName varchar(255), FirstName
varchar(255), Address varchar(255), City varchar(255) );
⢠Exercise 4
â Write the correct SQL statement to delete a table called Persons.
⢠DROP TABLE Persons;