Database Reference
In-Depth Information
SQL*Plus Worksheet. This comes as part of Oracle Enterprise Manager, a Windows-like
user interface created to support the database administrator and simplify many tasks.
iSQL*Plus. This gives you the same interface as SQL*Plus Windows, except it runs in a
Web browser. Use this to run SQL commands and automatically generate a report in HTML
format.
7.3 Data Definition Languages
7.3.1 Creating and Modifying Table Structure
There are generally two ways to create database tables:
 Most DBMSs come with an administration tool that can be used to create and manage
database tables interactively.
 Tables may also be manipulated directly with SQL statements.
A named schema object defined by a table definition in a CREATE TABLE statement. Per-
sistent base tables hold the SQL data that is stored in your database. Syntax of Create
Table:
CREATE TABLE tablename (colunname1 colunname2 datatype(size), datatype(size),
…………………………..
colunnamen datatype(size));
Column Data Types
Whenever you define a column in a CREATE TABLE statement, you must, at the very
least, provide a name for the column and an associated data type or domain. The data type
or domain (discussed in Chapter 4) restricts the values that can be entered into that column.
For example, some data types limit a column's values to numbers, while other data types
allow any character to be entered.
Data Type Description
CHARACTER Specifies the exact number of characters that will be stored for each value.
For example, if we define the number of characters as 15, but the value contains only 10
characters, the remaining five characters will be spaces. The data type can be abbreviated
as CHAR.Example: STUDENT_NAME CHAR(40)
VARYING
CHARACTER
INTEGER
Search WWH ::




Custom Search