• 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

  • SQL – Min() and Max() Function

    SQL – Min() and Max() Function

    SQL – Min() and Max() Function Table Of Contents: What Is Min() and Max() Function? Syntax Of Min() and Max() Function. Examples Of Min() and Max() Functions. (1) What Is Min() and Max() Function ? The MIN() function returns the smallest value of the selected column. The MAX() function returns the largest value of the selected column. (2) Syntax Of Min() and Max() Function. Syntax: Min() SELECT MIN(column_name) FROM table_name WHERE condition; Syntax: Max() SELECT MAX(column_name) FROM table_name WHERE condition; (3) Examples Of Min() and Max() Function. Demo Data: Example-1: SELECT MIN(Price) AS SmallestPrice FROM Products; Example-2: SELECT MAX(Price) AS LargestPrice FROM Products;

    Read More

  • SQL – Select Top Clause

    SQL – Select Top Clause

    SQL – Select Top Records Table Of Contents: What Is Select Top Records? Syntax Of Select Top Records. Examples Of Select Top Records. (1) What Is Select Top Records ? Sometimes you want to see only the top records. You can use the “SELECT TOP” clause to select top ‘n’ records. (2) Syntax Of Select Top Records ? Syntax: SQL Server / MS Access Syntax: SELECT TOP number|percent column_name(s) FROM table_name WHERE condition; Syntax: MySQL Syntax: SELECT column_name(s) FROM table_name WHERE condition LIMIT number; (3) Examples Of Select Top Records ? Demo Data: Example-1: SQL Server/MS Access SELECT TOP 3

    Read More

  • SQL – Delete Statement

    SQL – Delete Statement

    SQL – Delete Statement Table Of Contents: What Is Delete Statement? Syntax Of Delete Statement. Examples Of Delete Statement. (1) What Is Delete Statement? The DELETE statement is used to delete existing records in a table. (2) Syntax Of Delete Statement? Syntax: DELETE FROM table_name WHERE condition; (3) Examples Of Delete Statement? Demo Data: Example-1: Delete A Single Record DELETE FROM Customers WHERE CustomerName=’Alfreds Futterkiste’; Example-2: Delete All Record DELETE FROM Customers;

    Read More

  • SQL – Update Statement

    SQL – Update Statement

    SQL Update Statement Table Of Contents: What Is SQL Update Statement? Syntax Of Update Statment. Examples Of Update Statement. (1) What Is SQL Update Statement ? The UPDATE statement is used to modify the existing records in a table. If the user wants to update their records at a later point in time they can do that using the “UPDATE” statement. (2) Syntax Of SQL Update Statement. Syntax: UPDATE table_name SET column1 = value1, column2 = value2, … WHERE condition; (3) Examples Of SQL Update Statement. Demo Data: Example-1: Updating A Single Record UPDATE Customers SET ContactName=’Alfred Schmidt’, City=’Frankfurt’ WHERE CustomerID=1;

    Read More