SQL LEFT JOIN Keyword The LEFT JOIN keyword returns all rows from the left table (table1), with the matching rows in the right table (table2). The result is NULL in the right side when there is no match. SQL LEFT JOIN Syntax or: <b>PS!</b> In some databases LEFT JOIN is called LEFT OUTER JOIN. Note:…


SQL INNER JOIN Keyword The INNER JOIN keyword selects all rows from both tables as long as there is a match between the columns in both tables. SQL INNER JOIN Syntax or: PS! INNER JOIN is the same as JOIN. Demo Database In this tutorial we will use the well-known Northwind sample database. Below is…


SQL joins are used to combine rows from two or more tables. SQL JOIN An SQL JOIN clause is used to combine rows from two or more tables, based on a common field between them. The most common type of join is: SQL INNER JOIN (simple join). An SQL INNER JOIN returns all rows from…


SQL aliases are used to temporarily rename a table or a column heading. SQL Aliases SQL aliases are used to give a database table, or a column in a table, a temporary name. Basically aliases are created to make column names more readable. SQL Alias Syntax for Columns SQL Alias Syntax for Tables Demo Database…


The BETWEEN operator is used to select values within a range. The SQL BETWEEN Operator The BETWEEN operator selects values within a range. The values can be numbers, text, or dates. SQL BETWEEN Syntax Demo Database In this tutorial we will use the well-known Northwind sample database. Below is a selection from the “Products” table:…


The IN Operator The IN operator allows you to specify multiple values in a WHERE clause. SQL IN Syntax Demo Database In this tutorial we will use the well-known Northwind sample database. Below is a selection from the “Customers” table: CustomerID CustomerName ContactName Address City PostalCode Country 1 Alfreds Futterkiste Maria Anders Obere Str. 57…


A wildcard character can be used to substitute for any other character(s) in a string. SQL Wildcard Characters In SQL, wildcard characters are used with the SQL LIKE operator. SQL wildcards are used to search for data within a table. With SQL, the wildcards are: Wildcard Description % A substitute for zero or more characters…


The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. The SQL LIKE Operator The LIKE operator is used to search for a specified pattern in a column. SQL LIKE Syntax Demo Database In this tutorial we will use the well-known Northwind sample database. Below is a…


The SQL SELECT TOP Clause The SELECT TOP clause is used to specify the number of records to return. The SELECT TOP clause can be very useful on large tables with thousands of records. Returning a large number of records can impact on performance. Note: Not all database systems support the SELECT TOP clause. SQL…