SQL Commands Flashcards
Learn SQL
Creates a database schema
CREATE SCHEMA AUTHORIZATION
Creates a new table
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
DEFAULT
Validates data in an attribute
CHECK
Creates an index for a table
CREATE INDEX
Creates a dynamic subset of rows/columns from one or more
tables
CREATE VIEW
Modifies a tables 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
Permanently deletes a table (and its data)
DROP TABLE
Permanently deletes an index
DROP INDEX
Permanently deletes a view
DROP VIEW