Baseball+DDL+Assignment+-ALTER,+TRUNCATE,+DROP+-+11+Apr

Make copies of your baseball tables
code format="oracle8" CREATE TABLE AS (SELECT * FROM ) code > code format="oracle8" CREATE TABLE copy_stadiums AS (SELECT * FROM stadiums) code
 * 1) First we will look at making a copy of our baseball tables, so we don't mess up the originals. The basic syntax is
 * 1) The second line is a subquery, we will talk more about these later.
 * 2) Here is the statement to copy the stadium table.
 * 1) If you SELECT * FROM copy_stadiums, you will see that the data was copied into the new table
 * 2) Repeat with the other three columns of the baseball tables, check each copy with a SELECT *

ALTER TABLE - Remember, ALTER lets you change the properties of column
code format="oracle8" ALTER TABLE ADD code
 * 1) ADD a //stadium_name// column to the //teams// table, then use the UPDATE command (from the CRUD lesson) to populate the new column //**NOTE: This is the only time this lesson you should change the base table and not the copy**//
 * 2) MODFY the //copy_teams// table's mascot column to be VARCHAR2(50)
 * 3) DROP the the //stadiums// column from the //copy_game// table

DROP TABLE
code format="oracle8" DROP TABLE code
 * 1) Remember you can't always undo a drop, so use this carefully
 * 2) DROP the //copy//_//sections// table

TRUNCATE TABLE
 * 1) Truncate is for removing all the data from a table, a leaving just the table structure
 * 2) TRUNCATE //copy_stadium// table