SELECT keywords/syntax Flashcards

(32 cards)

1
Q

Represents any sequence of zero or more characters

A

%

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

Represents any single character

A

_

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

Match any from a list of values. If characters or dates are used in the list, they must be

enclosed in single quotation marks (‘ ‘)

A

IN

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

Year with 4 digits

A

%Y

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

Year with 2 digits

A

%y

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

Abbreviated month name in the current locale
(Jan, Feb, …)

A

%b

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

Full month name in current locale

A

%M

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

Month with 2 digits

A

%m

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

Hour with 2 digits between 00-23

A

%H

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

Hour with 2 digits (01-12)

A

%h

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

Abbreviated weekday name in the current

locale

A

%a

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

Minute with 2 digits.

A

%i

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

Seconds with 2 digits

A

%s

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

Day with English suffix (1st, 2nd, …)

A

%D

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

Day with 2 digits

A

%d

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

Day of the year (001-366)

17
Q

Day of the week (0 = Sunday)

18
Q

Time in 12-hour format, followed by AM/PM;

Short for ‘%I:%i:%S %p’

18
Q

AM/PM according to the current locale

19
Q

Time in 24-hour format. Short for

‘%H:%i:%S’.

20
Q

A literal % character.

21
Q

formats the date value using the specified format

A

DATE_FORMAT(date, format)

22
Q

returns a date based on the given string and format; the format
of the string should be the same as the indicated format

A

STR_TO_DATE(string, format)

23
Q

gets the difference of date1 and date2

A

DATEDIFF(date1, date2)

24
adds k days or j units to the given date
ADDDATE(date, k | INTERVAL j units)
25
concatenates the left side of str with pad until the length is equal to len
LPAD(str, len, pad)
26
concatenates the right side of str with pad until the length is equal to len
RPAD(str, len, pad)
27
returns the substring of str starting at index position (or start) up to the end of str (or up to len characters); indexing starts with one
SUBSTRING(str, [position | start, len])
28
returns the standard deviation of the values in the column col
STDDEV([DISTINCT] col)
29
returns true if all of the subquery values meet the condition
ALL
30
returns true if any of the subquery values meet the condition
ANY
31