what is DDL?
Data Definition Language
done at the table level
what is DML?
Data Manipulation Language
done at the data level
what does CREATE do?
creates a table
what does ALTER do?
changes a table
what does DROP do?
deletes an entire table
what does INSERT do?
inserts data into a table
what does UPDATE do?
makes changes to tuples
what does DELETE do?
deletes tuples
what does SELECT do?
retrieves data from one or more tables
what does the NOT NULL constraint do?
No entries in that column can be null
what does the UNIQUE constraint do?
each entry in that specific column must have a unique value, can be NULL
what does the PRIMARY KEY do?
ensures that a column (or combination of two or more columns) have a unique identity which helps to find a particular record in a table more quickly and easily
what does a FOREIGN KEY do?
ensures the referential integrity of the data in one table to match values in another table
cannot be NULL
what does a CHECK do?
ensures that a value in a column meets a specific condition
what constraints make it so no entry in the column can be NULL?
PRIMARY KEY
FOREIGN KEY
NOT NULL
does a modification command in DML return a result?
NO
what happens if you do not specify a WHERE clause in your DELETE FROM statement?
it will delete EVERY entry from the table, but NOT the table. Basically, you will get an empty table.
what does an underline indicate in a database schema?
a PRIMARY KEY
what does SELECT * FROM table do?
prints the entire table
how do you rename attributes in a SELECT FROM WHERE statement?
SELECT name1 AS name2
FROM table
WHERE condition
what is the not equal to operator in SQL?
<>
how would you find the entries that begin with Bee?
attributeName LIKE ‘Bee%’
how would you find the entries that end with Bee?
attributeName LIKE ‘%Bee’
how do you compare a value with NULL?
columnName IS NULL
columnName IS NOT NULL