SQL Flashcards

1
Q

How should you differentiate text, number and date values in a query?

A

Text should use quotation marks (“ … “)

Number must not use quotation marks ( 92 )

Data must use hashtags (#6/14/2004#)

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

What are and how would you use wildcard operators in SELECT queries?

A

Asterisk () can be used to represent any number of characters. I.e. any number starting with 519 is [ LIKE “519

Question marks (?) are like asterisks but represent single value placeholders. I.e. 4 numbers in between 1 and 9 would is [ LIKE “1????9”]

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

How would you order a query by say, first name?

A

end statement with ORDER BY Firstname;

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

What are 5 built-in functions with SELECT queries?

A
  1. Max
  2. Min
  3. Avg
  4. Count
  5. Sum
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When are semi-colons needed at the end of an SQL statement?

A

In MS-Access SQL: OPTIONAL

In MS SQL Server: MANDATORY

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

What are the four types of SQL Action queries?

A
  1. INSERT INTO
  2. DELETE
  3. UPDATE
  4. CREATE TABLE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Write the syntax for UPDATE actions.

A

UPDATE
SET =
WHERE
;

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

Write the syntax for INSERT actions.

A

INSERT INTO
(, )
VALUES
(, );

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

Write syntax for DELETE actions.

A

DELETE *
FROM

WHERE

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

Write syntax for CREATE TABLE actions.

A

CREATE TABLE

( , etc.)

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