{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

sql07 - 7 7 Creating and Managing Tables 7-2 Objectives •...

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: 7 7 Creating and Managing Tables 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 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 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 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 ]; 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. 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....
View Full Document

{[ snackBarMessage ]}

Page1 / 21

sql07 - 7 7 Creating and Managing Tables 7-2 Objectives •...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online