SQL

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/59

encourage image

There's no tags or description

Looks like no tags are added yet.

60 Terms

1
New cards
Numeric
A common SQL data type used for storing numerical values.
2
New cards
Date/Time
A SQL data type for storing dates and times.
3
New cards
String
A SQL data type used for storing text.
4
New cards
Boolean
A data type that can hold one of two values: true or false.
5
New cards
SELECT statement
Used to retrieve data from one or more tables in a database.
6
New cards
FROM
Identifies the table from which to retrieve data.
7
New cards
Primary Key
A unique identifier for each row in a table which ensures no duplicate or NULL values.
8
New cards
Foreign Key
Links a column in one table to the primary key column in another table for data integrity.
9
New cards
FULL OUTER JOIN
Returns all rows from both tables.
10
New cards
INNER JOIN
Returns matching rows from both tables.
11
New cards
LEFT JOIN
Returns all rows from the left table and matching rows from the right table; NULL for non-matching.
12
New cards
RIGHT JOIN
Returns all rows from the right table and matching rows from the left table; NULL for non-matching.
13
New cards
CROSS JOIN
Returns all possible combinations of rows from both tables.
14
New cards
OUTER JOIN
Returns all rows from both tables, filling missing values with NULL.
15
New cards
Self-join
A query where a table is joined with itself, useful for hierarchical data.
16
New cards
UNION
Combines results of two SELECT statements and removes duplicates.
17
New cards
UNION ALL
Combines results of two SELECT statements and includes all rows, even duplicates.
18
New cards
WHERE
Filters rows before aggregation.
19
New cards
GROUP BY
Groups rows into summary rows based on column values.
20
New cards
HAVING
Filters records after aggregation.
21
New cards
ORDER BY
Sorts rows in ascending or descending order.
22
New cards
DISTINCT

Removes duplicate values from the result set and ensures only unique values are returned

23
New cards
Subquery
A nested query inside another query.
24
New cards
LIMIT
Restricts the number of rows returned.
25
New cards
RANK ()
Assigns a unique rank to each row, skipping ranks for duplicates.
26
New cards
DENSE_RANK()
Assigns ranks without skipping numbers for duplicates.
27
New cards
BETWEEN
Filters data within an inclusive range.
28
New cards
NULL
Represents missing data in SQL.
29
New cards
IS NULL
Identifies where a column has missing data.
30
New cards
IS NOT NULL
Filters out rows that do not have missing data.
31
New cards
COALESCE ()
Replaces NULL values in queries to prevent calculation errors.
32
New cards
SUM()
Adds up all values in a column.
33
New cards
AVG()
Calculates the average value of a specified column.
34
New cards
COUNT()
Counts the number of rows in a result set.
35
New cards
MIN()
Returns the smallest value in a column.
36
New cards
MAX()
Returns the largest value in a column.
37
New cards
DELETE
Removes specific rows from a table with rollback capability.
38
New cards
TRUNCATE
Quickly removes all records from a table, keeping the structure, cannot be rolled back.
39
New cards
DROP
Permanently deletes the entire table from the database, cannot be rolled back.
40
New cards

FULL OUTER JOIN

Returns all rows from both tables, including rows with no matches.

41
New cards

INNER JOIN

Retrieves only the rows that have matching values in both tables, filtering out non-matching records.

42
New cards

LEFT JOIN

Returns all records from the left table and matching records from the right table; returns NULL for right table columns with no match.

43
New cards

RIGHT JOIN

Returns all records from the right table and matching records from the left table; returns NULL for left table columns with no match.

44
New cards

CROSS JOIN

Produces a Cartesian product, returning all possible combinations of rows from both tables.

45
New cards

UNION

Combines the results of two or more SELECT statements into a single result set, removing duplicate records.

46
New cards

WHERE

Filters rows before any aggregation occurs, i.e., before applying GROUP BY.

47
New cards

GROUP BY

Groups rows sharing a specified column value into summary rows, useful for aggregation.

48
New cards

HAVING

Filters records after aggregation has been performed.

49
New cards

ORDER BY

Sorts the results set in ascending (default) or descending order based on one or more columns.

50
New cards

DISTINCT

Removes duplicates from the result set, ensuring all returned values are unique.

51
New cards

NULL

Represents absent or missing data in SQL.

52
New cards

COALESCE()

A function that takes a list of values and returns the first non-NULL value, useful for replacing NULL in queries.

53
New cards

SUM()

Calculates the total sum of a numerical column.

54
New cards

AVG()

Computes the average of a numerical column.

55
New cards

COUNT()

Counts the number of rows or non-NULL values in a column.

56
New cards

MIN()

Returns the smallest value in a specified column.

57
New cards

MAX()

Returns the largest value in a specified column.

58
New cards

DELETE

Used to remove specific rows from a table while allowing for rollback if needed.

59
New cards

TRUNCATE

Efficiently removes all records from a table but retains the table structure; cannot be rolled back.

60
New cards

DROP

Permanently deletes an entire table from the database, including its structure and data; cannot be undone.