• SQL – Joins

    SQL – Joins

    SQL – Joins Table Of Contents: What Are SQL Joins? Types Of SQL Joins. (1) What Are SQL Joins? SQL Joins allow us to work on multiple tables by joining them together based on a related column. By bringing tables together you can have more information about the item. (2) Types Of SQL Joins? (INNER) JOIN: Returns records that have matching values in both tables LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records from the right table RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records from the left

    Read More

  • SQL – Aliases

    SQL – Aliases

    SQL – Aliases Table Of Contents: What Is SQL Aliases? Syntax Of SQL Aliases. Examples Of SQL Aliases. (1) What Is SQL Aliases? SQL aliases are used to give a table, or a column in a table, a temporary name. Aliases are often used to make column names more readable. An alias only exists for the duration of that query. An alias is created with the AS keyword. (2) Syntax Of SQL Aliases. Syntax: Alias Column Syntax SELECT column_name AS alias_name FROM table_name; Syntax: Alias Table Syntax SELECT column_name(s) FROM table_name AS alias_name; (3) Examples Of SQL Aliases. Demo Dataset: Example-1: SELECT

    Read More

  • SQL – Between Operator

    SQL – Between Operator

    SQL – Between Operator Table Of Contents: What Is SQL Between Operator? Syntax Of SQL Between Operator. Examples Of SQL Between Operator. (1) What Is SQL Between Operator? The BETWEEN operator selects values within a given range. The values can be numbers, text, or dates. The BETWEEN operator is inclusive: begin and end values are included.  (2) Syntax Of SQL Between Operator? Syntax: SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2; (3) Examples Of SQL Between Operator? Demo Data: Example-1: Between Example SELECT * FROM Products WHERE Price BETWEEN 10 AND 20; Example-2: Not Between Example SELECT * FROM Products WHERE Price

    Read More

  • SQL – In Operator

    SQL – In Operator

    SQL – In Operator Table Of Contents: What Is An “In” Operator? Syntax Of “In” Operator. Examples Of “In” Operator. (1) What Is An “In” Operator ? The IN operator allows you to specify multiple values in a WHERE clause. The IN operator is a shorthand for multiple OR conditions. (2) Syntax Of “In” Operator ? Syntax: SELECT column_name(s) FROM table_name WHERE column_name IN (value1, value2, …); (3) Examples Of “In” Operator ? Demo Data: Example-1: Country in “Germany”, “France” or “UK” SELECT * FROM Customers WHERE Country IN (‘Germany’, ‘France’, ‘UK’); Example-2: Country Not in “Germany”, “France” or “UK” SELECT * FROM Customers WHERE Country NOT IN

    Read More

  • SQL – Wild Card Characters.

    SQL – Wild Card Characters.

    SQL – Wild Card Characters. Table Of Contents: What Is A Wild Card Character? Syntax Of Wild Card Characters. Examples Of Wild CardCharacters. (1) What Is A Wild Card Character? Wild card characters are special characters used for placeholder purposes. You can place one or more characters as per their nature in place of the wild card character. (2) Syntax Of Wild Card Character. Wildcard Characters in MS Access Wildcard Characters in SQL Server Some Examples: (3) Examples Of Wild Card Character. Demo DataSet: Example-1: Using the % Wildcard: City starting with “ber”. SELECT * FROM Customers WHERE City LIKE

    Read More

  • SQL – Count(), Avg() and Sum() Function

    SQL – Count(), Avg() and Sum() Function

    SQL – Count(), Avg() and Sum() Function Table Of Contents: What Is Count(), Avg() and Sum() Function? Syntax Of Count(), Avg() and Sum() Function. Examples Of Count(), Avg() and Sum() Function. (1) What Is Count(), Avg() and Sum() Function? The COUNT() function returns the number of rows that matches a specified criterion. The AVG() function returns the average value of a numeric column. The SUM() function returns the total sum of a numeric column.  (2) Syntax Of Count(), Avg() and Sum() Function? Syntax: Count() SELECT COUNT(column_name) FROM table_name WHERE condition; Syntax: Avg() SELECT AVG(column_name) FROM table_name WHERE condition; Syntax: Sum() SELECT SUM(column_name) FROM table_name WHERE condition;

    Read More