{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

sql07 - 7 Creating and Managing Tables Objectives Describe...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
7 7 Creating and Managing Tables
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
7-2 Objectives Describe the main database objects Create tables Describe the datatypes that can be used when specifying column definition Alter table definitions Drop, rename, and truncate tables
Background image of page 2
7-3 Database Objects Object Description Table Basic unit of storage; composed of rows and columns View Logically represents subsets of data from one or more tables Sequence Generates primary key values Index Improves the performance of some queries Synonym Gives alternative names to objects
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
7-4 Naming Conventions Must begin with a letter Can be 1–30 characters long Must contain only A–Z, a–z, 0–9, _, $, and # Must not duplicate the name of another object owned by the same user Must not be an Oracle Server reserved word
Background image of page 4
7-5 The CREATE TABLE Statement You must have : CREATE TABLE privilege A storage area You specify: Table name Column name, column datatype, and column size CREATE TABLE [ schema .] table ( column datatype [DEFAULT expr ];
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
7-6 Referencing Another User’s Tables Tables belonging to other users are not in the user’s schema. You should use the owner’s name as a prefix to the table.
Background image of page 6
7-7 The DEFAULT Option Specify a default value for a column during an insert. … hiredate DATE DEFAULT SYSDATE, … Legal values are literal value, expression, or SQL function.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}