Stored Routine
Explore the Flashcards:
A set of SQL statements saved and executed as a unit.
Query Flow
The sequence or order in which SQL statements are executed.
IN Parameter
A parameter in a stored procedure that doesn't allow input values to be passed.
OUT Parameter
A parameter in a stored procedure that returns a value to the caller.
Venn Diagram
A diagram representing mathematical or logical sets pictorially as circles.
Aggregated Data (SQL)
A single value (such as an average or a sum) obtained after combining a set of values.
Base Tables
Tables from a database storing data physically (i.e. on the disk).
Invoking a Procedure
The process of executing a stored procedure in the database.
User-Defined Functions
Functions created by the user to perform specific tasks and return values.
Delimiter
A character or sequence of characters used to specify the boundary between elements. The default delimiter in MySQL is ;.
Temporary Delimiter
A delimiter used temporarily to define and specify the boundary between elements when the default delimiter ( ; ) is part of the given SQL statement.
BEGIN – END Block
A block of code in MySQL where global variables are often defined and used.
MySQL Indexes
Database objects that improve the speed of data retrieval operations on a database table.
Inner SELECT Statement (a subquery)
A SELECT statement employed within a larger query or subquery.
DISTINCT keyword
An SQL keyword used for returning unique values from a query result set.
AS Keyword
An SQL keyword used for renaming a column or table in the query result.
ADD
An SQL keyword used for adding new elements, such as columns to a table.
Function
A stored routine that returns a value.
Aggregate Functions
Functions in SQL that perform a calculation on a set of values and return a single value.
COUNT() Function
Returns the number of rows that match a specified criterion.
SUM() Function
An aggregate function in SQL that returns the sum of a set of values or an expression.
MIN() Function
An aggregate function that returns the smallest value in a set of values.
MAX() Function
An aggregate function that returns the largest value in a set of values.
AVG() Function
An aggregate function that returns the average value of a numeric column.
COALESCE() Function
Returns the first non-null value in a list.
ALTER statement
An SQL Statement used to alter existing objects.
DROP statement
An SQL Statement used for deleting a database object.
TRUNCATE statement
An SQL Statement used for removing data from a table without deleting the table.
SELECT statement
Retrieves data from database objects like tables.
Outer SELECT Statement
The main query in which a subquery (inner SELECT) is nested.
INSERT statement
An SQL Statement used to insert data into tables.
UPDATE statement
An SQL Statement used to renew existing data in tables.
DELETE statement
An SQL Statement used for removing specified data from a table.
CREATE statement
An SQL Statement used for creating databases and database objects.
USE
SQL command to select a particular database as a default (current) database to work within your session.
TRUNCATE vs. DELETE
The TRUNCATE Statement is used to remove all the records contained in a table, while with DELETE,
you can specify precisely which records you would like to remove.
Permissions
Rights granted to users or roles in a database that define the level of access
and types of operations they are allowed to perform.
GRANT statement
An SQL Statement used for providing certain permissions to users.
REVOKE statement
An SQL Statement used for revoking permissions and privileges of database users.
COMMIT statement
An SQL Statement used for saving changes made in a database transaction.
ROLLBACK clause
An SQL clause used for reverting changes made in a transaction to the last committed state.
SAVEPOINT
An SQL Statement that sets a point within a transaction to which you can later roll back.
FROM
An SQL clause used in a statement to specify the table (or tables) to retrieve data from.
WHERE
An SQL clause used for filtering the results returned by the SELECT statement.
CASCADE
An SQL keyword used to automatically propagate specific changes through the database.
CASCADE DELETE
A referential action for a foreign key that deletes records in child tables
when the corresponding record in the parent table is deleted.
GROUP BY Clause
An SQL Clause used with aggregate functions (such as COUNT()) to group the result set by one or more columns.
ORDER BY Clause
An SQL clause that allows you to sort the result set of a query by one or more columns.
It can sort the data in ascending or descending order.
ASC or DESC in ORDER BY
By default, the ORDER BY clause sorts the data in ascending order. To specify the sorting order explicitly,
you can use either the ASC or the DESC keyword to ascertain an ascending order of the output values or change it into a descending order, respectively.
HAVING Clause
An SQL clause used with GROUP BY to filter groups based on certain conditions.
WHERE vs. HAVING
The WHERE clause allows us to set conditions referring to subsets of individual rows applied before re-organizing the output into groups, while HAVING is applied after the organization of the output into groups. Also, you cannot have aggregated conditions in the WHERE clause.
LIMIT Clause
An SQL clause used to specify the maximum number of records to return.
SET Clause (in UPDATE)
An SQL clause specifying the columns to be updated, as well as their new values.
Wildcard Characters
Special characters used in SQL for pattern matching.
Star Symbol (*)
A special character in SQL used for selecting all columns in a table.
Join Types
Different methods used in SQL queries to combine rows from two or more tables based on related columns.
Related Column
A table column that is used to establish a relationship with the column of another table through related data. 'Related columns' are fundamental to creating relational databases.
Matching Values
Actual data entries in different tables or columns that are identical or related based on certain conditions.
JOIN
A SQL clause used to combine rows from two or more tables, based on one or more related columns.
JOIN Condition
The condition specified in the JOIN clause to determine how to join the designated tables.
INNER JOIN
An SQL clause returning all relevant rows when there is a match in both tables.
LEFT JOIN
An SQL clause returning all records from the left table and matching records from the right table, or NULL if there is no match.
RIGHT JOIN
An SQL clause returning all records from the right table and matched records from the left table, or NULL if there is no match.
NULL in LEFT JOIN
A returned value indicating no matching records found in the right table for a record in the left table.
NULL in RIGHT JOIN
A returned value indicating no matching records found in the left table for a record in the right table.
Full Join
A JOIN operation that returns all the rows from both designated tables regardless if there is a match in any of the tables.
Self Join
Applied when a table must join itself.
Alias
An alternate name given to a column or table in SQL queries.
IN Operator
An SQL operator used for checking if a value is within a set of values.
LIKE Operator
An SQL operator used for pattern matching in string comparison.
BETWEEN… AND… Operator
An SQL operator used for filtering results within a specified range.
EXISTS
A logical operator used to test for the existence of rows in a subquery.
NOT EXISTS
A logical operator used to test for the absence of rows in a subquery.
UNION Operator
An SQL operator that combines the result set of two or more SELECT statements excluding duplicate records.
SQL UNION ALL Operator
An SQL operator that combines the results of two SELECT statements including duplicate records.
At' Sign (@) in MySQL
Used to define user-defined variables.
SQL Engine (also Database Engine)
The part of a database that executes queries and retrieves data.
Procedure
A stored routine that performs a specific action but does not return a value.