Database Modeling: Querying Flashcards

1
Q

What does DML stand for and what keywords are associated with it?

A

Data Manipulation Language: SELECT, INSERT, UPDATE, DELETE. Used to work with data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does DDL stand for and what keywords are associated with it?

A

Data Definition Language: CREATE, ALTER, DROP. Used to change the structure of the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does DCL stand for and what keywords are associated with it?

A

Data Control Language: GRANT, REVOKE. Used to grant or revoke permissions for people.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Name five common SQL keywords.

A
  1. SELECT
  2. FROM
  3. WHERE
  4. ORDER BY
  5. GROUP BY (only used with aggregate functions)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Write a common SQL statement with Select, From, Where keywords.

A

SELECT * (columns)
FROM Employee (database.table if you want to specify the database)
WHERE Salary > 50000; (condition)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the default keyword for the ORDER BY?

A

asc not desc (ascending not descending)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are aggregate keywords (functions)? Name five.

A

Perform something on a set of data but only return a single value. Used with the SELECT keyword (columns).

  1. COUNT
  2. MAX
  3. MIN
  4. AVG
  5. SUM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What keywords are used to join tables?

A

JOIN, INNER JOIN (default), OUTER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the three SQL statement types?

A
  1. Data manipulation language (DML)
  2. Data definition language (DDL)
  3. Data control language (DCL)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly