DBMS (1) Flashcards
LESSON 2
a fundamental aspect that plays a crucial role in data analysis
These functions summarize and provide valuable insights into your data
Aggregate Functions
Aggregate Functions sample
count,sum, min, max, avg
Data can be grouped using SQL (Structured Query
Language) queries. Here are some common SQL clauses
and functions used for grouping data:
GROUPING DATa
clause is used to group rows that have the
same values into summary rows, such as aggregations.
group by
clause is used to filter groups based
on aggregate conditions
having
is a feature in SQL that allows you to generate subtotals
and grand totals in your query result sets. It’ s particularly useful when you want to compute multiple levels of aggregation in a single query.
ROLL UP
operation is similar to ROLLUP but generates all possible combinations of grouping sets.
similar to GROUP BY ROLLUP but more powerful, as it
generates not only subtotal rows but also all possible
combinations of subtotals for the specified columns.
CUBE
clause allows you to specify multiple grouping sets explicitly.
Unlike ROLLUP and CUBE, which generate subtotal rows
according to hierarchical or combinatorial patterns,
_________ lets you define separate
groupings independently.
GROUPING SETS
is a virtual table generated by a
query. It’s essentially a saved SQL query
that acts as a table, allowing users to
retrieve and manipulate data as if it were
a regular table.
VIEWS
is an SQL clause used to query and access data from multiple tables, based on logical relationships between those tables. indicate how SQL Server should use data from one table to select the rows from another table.
JOINS
Joins allow you to retrieve data from multiple tables in a single query. This is essential when dealing with relational databases where data is distributed across multiple tables to minimize redundancy and maintain data integrity
DATA RETRIEVAL
is a type of SQL join operation used to combine rows from two tables based on a related column between them. It returns all rows from the left table (referred to as the “left” or “first” table) and the matched rows from the right table (referred to as the “ right” or “ second” table).
LEFT JOIN
is like LEFT JOIN but retrieves all likes with all matching users or NULL if it doesn ‘t have any matching user
RIGHT JOIN
or just JOIN retrieves all users and likes that match each
other ( where the id field in users matches a user_id in the likes table
and vice versa )
INNER JOIN
When applying an SQL INNER JOIN, the output returns only matching rows from the stated tables. In contrast, if you use an SQL _______________, it will retrieve not only the matching rows but also the unmatched rows as well.
OUTER JOIN