Menu
CORR – CREATE DATABASE dbName; GO

CORR – CREATE DATABASE dbName; GO

This function returns the coefficient of correlation when passed a pair of numbers. CORR will determine if a relationship exists between the pair of values it receives. The result is a range from −1 to 1 where either ±1 means there is a correlation between the two numbers, and a 0 means there is no […]

OPENJSON – CREATE DATABASE dbName; GO

OPENJSON – CREATE DATABASE dbName; GO

This function is used in combination with OPENROWSET and instructs the runtime about the format of the content being retrieved. In addition to OPENJSON, we can use OPENXML and OPENQUERY, which are used in the same context but on different file formats or to run SQL queries directly against a database. The following query illustrates […]

Stored Procedures – CREATE DATABASE dbName; GO

Stored Procedures – CREATE DATABASE dbName; GO

When you write code or a query, you typically do so on a workstation on your desk or via a browser. If the code needs to make a connection to a database to retrieve and parse some data, it is important to decide where the parsing should take place. There are two places where the […]

AVG, MAX, MIN, SUM, COUNT – CREATE DATABASE dbName; GO

AVG, MAX, MIN, SUM, COUNT – CREATE DATABASE dbName; GO

These are some of the most common aggregate SQL functions. You saw them in the previous section. You can use these functions to calculate average, maximum, minimum, and total of numeric column values on one or more tables. The COUNT function returns the number of rows that match the SQL statement criteria. Note that after […]

CONVERT and CAST – CREATE DATABASE dbName; GO

CONVERT and CAST – CREATE DATABASE dbName; GO

CONVERT and CAST are essentially the same—there is no difference between their capabilities or performance. They both exist solely for historical reasons, not for any functional ones. As long as you understand that both of these SQL functions are used to change the data type of data stored in a table, you have this one […]

JOIN – CREATE DATABASE dbName; GO

JOIN – CREATE DATABASE dbName; GO

This is a relational structure‐oriented concept that has to do with querying data that exists in two or more tables using a single query. It is possible to use JOINs on NoSQL data, but the nature of nonstructured or semi‐structured means it won’t be a very performant experience. If the JOIN on non‐ or unstructured […]

Data Manipulation Language – CREATE DATABASE dbName; GO

Data Manipulation Language – CREATE DATABASE dbName; GO

The Data Manipulation Language (DML) category of SQL commands are the ones most used when querying, modifying, and managing data. DML operations are typically executed on rows, columns, and tables. The Data Manipulation Language (DML) consists of the most well‐known SQL commands, like INSERT, UPDATE, DELETE, SELECT, WHERE, SET, and FROM. There are many DML […]