WGU C170 FJ01 TIPS 100% CORRECT!!
CREATE TABLE statements and data type assignments
create table employee
(first varchar(15),
last varchar(20),
age number(3),
address varchar(30),
city varchar(20),
state varchar(20));
CREATE TABLE. LIKE
CREATE TABLE new_tbl_name LIKE tbl_name;
CREATE TABLE. SELECT
Creates a new table from the result of an arbitrary SELECT statement
- Does not include Auto Increment columns
- Can specify which columns from an existing table
CREATE TABLE new_tbl [AS] SELECT * FROM orig_tbl;
ALTER TABLE (what is it used for)
, Modifies the structure of a table-adds, alters, or removes attributes, constraints,
columns
- ADD column_name
- DROP/MODIFY COLUMN column_name;
DROP TABLE
deletes a table
CREATE VIEW
CREATE VIEW view_name AS
SELECT column1, column2,.
FROM table_name
WHERE condition;
ALTER VIEW
ALTER VIEW view_name AS select_statement
DROP VIEW
DROP VIEW view_name;
CREATE INDEX
CREATE (UNIQUE)INDEX index_name
ON table_name (column1, column2,.);
CREATE INDEX idx_pname
ON Persons (LastName, FirstName);
CREATE TABLE statements and data type assignments
create table employee
(first varchar(15),
last varchar(20),
age number(3),
address varchar(30),
city varchar(20),
state varchar(20));
CREATE TABLE. LIKE
CREATE TABLE new_tbl_name LIKE tbl_name;
CREATE TABLE. SELECT
Creates a new table from the result of an arbitrary SELECT statement
- Does not include Auto Increment columns
- Can specify which columns from an existing table
CREATE TABLE new_tbl [AS] SELECT * FROM orig_tbl;
ALTER TABLE (what is it used for)
, Modifies the structure of a table-adds, alters, or removes attributes, constraints,
columns
- ADD column_name
- DROP/MODIFY COLUMN column_name;
DROP TABLE
deletes a table
CREATE VIEW
CREATE VIEW view_name AS
SELECT column1, column2,.
FROM table_name
WHERE condition;
ALTER VIEW
ALTER VIEW view_name AS select_statement
DROP VIEW
DROP VIEW view_name;
CREATE INDEX
CREATE (UNIQUE)INDEX index_name
ON table_name (column1, column2,.);
CREATE INDEX idx_pname
ON Persons (LastName, FirstName);