Tag sql joins

SQL NULL Values

What is a NULL Value? A field with a NULL value is a field with no value. If a field in a table is optional, it is possible to insert a new record or update a record without adding a…

SQL INSERT INTO Statement

The SQL INSERT INTO Statement The INSERT INTO statement is used to insert new records in a table. INSERT INTO Syntax It is possible to write the INSERT INTO statement in two ways: 1. Specify both the column names and…

SQL NOT Operator

The NOT Operator The NOT operator is used in combination with other operators to give the opposite result, also called the negative result. In the select statement below we want to return all customers that are NOT from Spain: Example…

SQL AND Operator

The SQL AND Operator The WHERE clause can contain one or many AND operators. The AND operator is used to filter records based on more than one condition, like if you want to return all customers from Spain that starts…

SQL ORDER BY Keyword

The SQL ORDER BY The ORDER BY keyword is used to sort the result-set in ascending or descending order. Example Sort the products by price: SELECT * FROM Products ORDER BY Price; Syntax SELECT column1, column2, … FROM table_name ORDER…

SQL WHERE Clause

The SQL WHERE Clause The WHERE clause is used to filter records. It is used to extract only those records that fulfill a specified condition. Example Select all customers from Mexico: SELECT * FROM Customers WHERE Country=’Mexico’;

SQL SELECT DISTINCT Statement

The SQL SELECT DISTINCT Statement The SELECT DISTINCT statement is used to return only distinct (different) values. Example Select all the different countries from the “Customers” table : SELECT DISTINCT Country FROM Customers; Inside a table, a column often contains…

SQL SELECT Statement

The SQL SELECT Statement The SELECT statement is used to select data from a database. Example Return data from the Customers table : SELECT CustomerName, City FROM Customers;