Chapter 6: Fundamentals of SQL 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
create view
modifies a table’s definition (adds, modifies, or deletes attributes or consrtraints)
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
insert row(s) into a table
insert
selects attributes from rows in one or more tables or views
select
restricts the selection of rows based on a conditional expression
where
groups the selected rows based on one or more attributes
group by
restricts the selection of grouped rows based on a condition
having
orders the selected rows based on one or more attributes
order by
modifies an attribute’s value in one or more table’s rows
update
deletes one or more rows from a table
delete
permanently saves data changes
commit
restores data to its original values
rollback
checks whether an attribute value is within a range
between
checks whether an attribute value is null
is null
checks whether an attribute value matches a given string pattern
like
checks whether a subquery returns any rows
exists
limits values to unique values
distinct
returns the number of rows with non=null values for a given column
count
returns the minimum attribute value found in a given column
MIN
returns the maximum attribute value found in a given column
max
returns the sum of all values for a given column
sum
returns the average of all values for a given column
avg
an alternate name given to a column or table in any SQL statement
alias