Database Modeling: Querying Flashcards
What does DML stand for and what keywords are associated with it?
Data Manipulation Language: SELECT, INSERT, UPDATE, DELETE. Used to work with data.
What does DDL stand for and what keywords are associated with it?
Data Definition Language: CREATE, ALTER, DROP. Used to change the structure of the database.
What does DCL stand for and what keywords are associated with it?
Data Control Language: GRANT, REVOKE. Used to grant or revoke permissions for people.
Name five common SQL keywords.
- SELECT
- FROM
- WHERE
- ORDER BY
- GROUP BY (only used with aggregate functions)
Write a common SQL statement with Select, From, Where keywords.
SELECT * (columns)
FROM Employee (database.table if you want to specify the database)
WHERE Salary > 50000; (condition)
What is the default keyword for the ORDER BY?
asc not desc (ascending not descending)
What are aggregate keywords (functions)? Name five.
Perform something on a set of data but only return a single value. Used with the SELECT keyword (columns).
- COUNT
- MAX
- MIN
- AVG
- SUM
What keywords are used to join tables?
JOIN, INNER JOIN (default), OUTER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN
What are the three SQL statement types?
- Data manipulation language (DML)
- Data definition language (DDL)
- Data control language (DCL)