Tutorial DDL SQL
DDL Part 1 Objectives After completing this lesson, you should be able to do the following: • Create tables • Alter table definitions • Drop, rename, and truncate tables *Lesson Aim In this lesson, you learn about tables, the main database objects, and their relationships to each other. You also learn how to create , alter, and drop tables.* Outline • Naming Rules • DDL Syntax – Creating Table – Altering Table – Dropping Table Naming Rules Table names and column names: • Must begin with a letter • Must 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 The CREATE TABLE Statement You must have: – CREATE TABLE privilege – A storage area Ex. CREATE TABLE [ schema .] table ( column datatype [DEFAULT expr ][, ...]); The CREATE TABLE Statement – schema is the same as the owner’s name – table is the name of the table – D...