Beginner SQL Commands Flashcards

1
Q

SELECT

A

is the clause we use every time we want to query information from a DB.

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

AS

A

renames a column or table

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

DISTINCT

A

return unique values

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

WHERE

A

is a popular command that lets you filter the results of the query based on conditions that you specify

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

LIKE AND BETWEEN

A

Special operators

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

AND & OR

A

combines multiple conditions

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

ORDER BY

A

Sorts the results

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

LIMIT

A

Specifies the maximum number of rows that query will return

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

CASE

A

creates different outputs

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

What are aggregates?

A

Calculations performed on multiple rows of a table.

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

COUNT()

A

Returns the total count of whatever the argument was in

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

SUM()

A

Returns the sum of whatever argument was added

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

MAX()/MIN()

A

Returns the maximum or minimum value in the column that you specified

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

AVG()

A

Returns the avg of the column

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

ROUND()

A

ROUND(Column Name, number of decimal places)

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

HAVING

A

Used when we want to limit the results of a query based on an aggregate property (Group)
Always comes after GROUP BY but before ORDER BY and LIMIT statements

17
Q

What does the .forEach() array method do?

A

Executes a callback function on each of the elements in an array in order.

18
Q

What does the.map() array method do?

A

Executes a callback function on each element in an array. It returns a new array made up of the return values from the callback function REVIEW

19
Q

What does the .filter() array method do?

A

Executes a callback function on each element in an array. THe callback function for eac of the elements must return either TRUE or FALSE. The returned array is a new array with any elements for which the callback funciton returns TRUE.

20
Q

What does the .findindex() method do?

A

Returns the index of the first element that evaluates to TRUE in the callback function

21
Q

What does the .reduce() method do?

A

Returns a single value after iterating through the elements of an array. Thereby reducing the array.
Study iterators/the types of iterators that there are.

22
Q

What are the two ways to access an object’s properties?

A

dot notation and bracket notation

23
Q

When do you have to use bracket notation to access object properties?

A

When accessing keys that have numbers, spaces, or special characters in them.

24
Q

What does it mean when you say objects are mutable?

A

It means that objects can be updated after they are created.

25
Q

What are the two things that can happen with property assignment?

A
  1. If a property already existed then that value will be replaced with the new value
  2. If there was no property with that name, a new property will be added.