DBMS (2) Flashcards
facilitate data manipulation tasks by accepting parameters, executing computations, and delivering results.
SQL FUNCTIONS
operate on sets of values, producing a single result from multiple rows. Common aggregate functions include SUM(), AVG(), COUNT(), MIN(), and MAX(). They are instrumental in performing calculations across groups of data, often in conjunction with the GROUP BY clause.
AGGREGATE FUNCTION
operate on individual values, transforming or manipulating them in various ways. ________ functions find wide application in formatting, validation, and manipulation of data within SQL queries.
SCALAR FUNCTIONS
also known as string functions, are a subset of scalar functions in SQL that specifically operate on character or string data.
CHARACTER FUNCTION
function is a type of SQL function that operates on numeric data types, such as integers or floating-point numbers. These functions perform various mathematical operations or transformations on numeric values and return a single numeric result.
NUMERIC SCALAR
This is used to perform operations on a set of values and return a single result.
AGGREGATE FUNCTION
is a mathematical function that takes a single value as in input and produces a single value as output. Scalar functions can operate on scalar inputs using various mathematical operations like addition, subtraction, multiplication, division and etc. By using select, where and having.
SCALAR FUNCTIONS
OTHER NUMERICAL FUNCTIONS
SQRT(attribute):
CEILING(attribute):
ABS(attribute):
FLOOR(attribute)
SQUARE(attribute)
generates a date by incrementing a designated portion of a
given date by a specified value.
DATEADD
returns the difference between two parts of a date
DATEDIFF
returns the specified part of the date requested
DATEPART
returns the specified part of the date requested.
GETDATE()
emerge as versatile tools for conditional logic. These statements enable us to execute different actions based on varying conditions within our database queries.
CASE
Then for a single condition you can write the keyword WHEN followed by the condition that has to be satisfied. After that comes the keyword THEN and the value for that condition, like WHEN <condition> THEN <stuff></stuff></condition>
CASE
is a special type of stored procedure that automatically runs when an event occurs in the database server. In SQL, a ______is like a special set of instructions that automatically gets executed when certain events happen in your database. These events could be things like inserting a new row into a table, updating an existing row, or deleting a row.
TRIGGERS