Category SQL

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;

SQL Syntax

SQL Statements Most of the actions you need to perform on a database are done with SQL statements. SQL statements consist of keywords that are easy to understand. The following SQL statement returns all records from a table named “Customers”:…