SQL Commands (BASIC) Flashcards
Creates a database schema
CREATE SCHEMA AUTHORIZATION
Creates a new table in the user’s database schema
CREATE TABLE
Ensures that a column will not have null values
NOT NULL
Ensures that a column will not have duplicate values
UNIQUE
Defines a primary key for a table
PRIMARY KEY
Defines a foreign key for a table
FOREIGN KEY
Defines a default value for a column (when no value is given)
DEFAULT
Validates data in an attribute
CHECK
Creates an index for a table
CREATE INDEX
Creates a dynamic subset of rows and columns from one or more tables (see Lesson 4, Advanced SQL)
CREATE VIEW
Modifies a table’s definition (adds, modifies, or deletes attributes or constraints)
ALTER TABLE
Creates a new table based on a query in the user’s database schema
CREATE TABLE AS
Creates a new table based on a query in the user’s database schema
CREATE TABLE AS
Permanently deletes a table (and its data)
DROP TABLE
Permanently deletes an index
DROP INDEX