Beginner SQL Commands Flashcards
(25 cards)
SELECT
is the clause we use every time we want to query information from a DB.
AS
renames a column or table
DISTINCT
return unique values
WHERE
is a popular command that lets you filter the results of the query based on conditions that you specify
LIKE AND BETWEEN
Special operators
AND & OR
combines multiple conditions
ORDER BY
Sorts the results
LIMIT
Specifies the maximum number of rows that query will return
CASE
creates different outputs
What are aggregates?
Calculations performed on multiple rows of a table.
COUNT()
Returns the total count of whatever the argument was in
SUM()
Returns the sum of whatever argument was added
MAX()/MIN()
Returns the maximum or minimum value in the column that you specified
AVG()
Returns the avg of the column
ROUND()
ROUND(Column Name, number of decimal places)
HAVING
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
What does the .forEach() array method do?
Executes a callback function on each of the elements in an array in order.
What does the.map() array method do?
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
What does the .filter() array method do?
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.
What does the .findindex() method do?
Returns the index of the first element that evaluates to TRUE in the callback function
What does the .reduce() method do?
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.
What are the two ways to access an object’s properties?
dot notation and bracket notation
When do you have to use bracket notation to access object properties?
When accessing keys that have numbers, spaces, or special characters in them.
What does it mean when you say objects are mutable?
It means that objects can be updated after they are created.