Explore tens of thousands of sets crafted by our community.
SQL Clauses and Operators
20
Flashcards
0/20
FROM
Specifies the table from which to retrieve data.
EXISTS
Used in a WHERE clause to test for the existence of any record in a subquery.
WHERE
Filters the data returned by a SQL query, based on a specified condition.
JOIN
Combines rows from two or more tables, based on a related column between them.
HAVING
Used instead of WHERE with aggregate functions. Filters the data after the aggregation.
LIKE
Operator used in a WHERE clause to search for a specified pattern in a column.
AS
Used to rename a column or table with an alias. This alias is used to make column names more readable.
LIMIT
Restricts the number of rows returned by a query. Useful in pagination.
DISTINCT
Used with SELECT to remove duplicate rows in the result set. Only distinct (different) values are selected.
AND
Logical operator that combines two or more conditions in a WHERE clause, all conditions must be true.
UNION ALL
Similar to UNION, but includes duplicates. Combines the result-sets of multiple SELECT statements.
BETWEEN
Operator selecting values within a range, used in WHERE clause. The range includes the endpoints.
GROUP BY
Arranges identical data into summary rows. Typically used with aggregate functions (COUNT, MAX, MIN, SUM, AVG).
NOT
Logical operator used to negate a condition in a WHERE clause.
ORDER BY
Sorts the result set in either ascending or descending order.
UNION
Combines the result-set of two or more SELECT statements, only includes distinct values.
OR
Logical operator that combines two or more conditions in a WHERE clause, at least one condition must be true.
CASE
Used to create conditional logic within a SQL query. Functions like an if-then-else statement.
SELECT
Used to retrieve data from a database. It specifies the columns to be returned in the result set.
IN
Allows you to specify multiple values in a WHERE clause. Works like multiple OR conditions.
© Hypatia.Tech. 2024 All rights reserved.