In SQL, the MAX()
function is an aggregate function that returns the maximum value in a given expression.
Below are some basic examples to demonstrate how it works.
Continue readingIn SQL, the MAX()
function is an aggregate function that returns the maximum value in a given expression.
Below are some basic examples to demonstrate how it works.
Continue readingIn SQL, the MIN()
function is an aggregate function that returns the minimum value in a given expression.
Below are some basic examples to demonstrate how it works.
Continue readingIn SQL, the COUNT()
function is an aggregate function that returns the number of items found in a group.
You can use COUNT()
in multiple parts of a query. For example, you can use it in the SELECT
list, or the HAVING
clause when filtering groups.
In SQL, the HAVING
clause can be used to specify a search condition for a group or an aggregate.
The HAVING
clause is typically used with the GROUP BY
clause. In cases where it’s not, there is an implicit single, aggregated group.
The SELECT
statement is almost without doubt, the most commonly used statement in SQL.
The SELECT
statement is used for retrieving data from the database. You can specify which rows you want returned, and which columns.
In SQL, the GROUP BY
clause can be used to divide the results of a query into groups of rows.
This is usually done in order to perform one or more aggregations on each group.
Continue readingThe ORDER BY
clause is commonly used in SQL to sort the results of a query.
It allows you to specify the order in which the results are returned.
You can specify whether the results are sorted in ascending order or descending order. You can also specify multiple columns for sorting.
Continue readingThere are four transaction modes in SQL Server. One of these is implicit mode.
In SQL Server, an implicit transaction is when a new transaction is implicitly started when the prior transaction completes, but each transaction is explicitly completed with a COMMIT
or ROLLBACK
statement.
This is not to be confused with autocommit mode, where the transaction is started and ended implicitly.
Continue readingIn SQL, transactions are used to maintain data integrity by ensuring that a sequence of SQL statements execute completely or not at all.
Transactions manage sequences of SQL statements that must be executed as a single unit of work, so that the database never contains the results of partial operations.
When a transaction makes multiple changes to the database, either all the changes succeed when the transaction is committed, or all the changes are undone when the transaction is rolled back.
Continue readingIn SQL, the greater than operator (>
) compares two expressions and returns TRUE
if the left operand has a value higher than the right operand; otherwise, it returns FALSE
.