• SQL – Where Clause

    SQL – Where Clause

    SQL – Where Clause Table Of Contents: What Is SQL Where Clause? Syntax Of Where Clause. Examples Of Where Clause. Where Clause Operations. (1) What Is SQL Where Clause ? Where clause is used to select the specific records for you. It will only display the records you want to see. (2) Syntax Of Where Clause ? SELECT column1, column2, … FROM table_name WHERE condition; (3) Examples Of Where Clause ? Demo Data: Example-1: SELECT * FROM Customers WHERE Country=’Mexico’; Example-2: SELECT * FROM Customers WHERE CustomerID=1; (4) Where Clause Operations? Example-3: SELECT * FROM Products WHERE Price = 18;

    Read More

  • SQL – Select Distinct Statement

    SQL – Select Distinct Statement

    SQL – Select Distinct Statement Table Of Contents: What Is Select Distinct Statement? Syntax Of Select Distinct. Examples Of Select Distinct. (1) What Is Select Distinct Statement ? The SELECT DISTINCT  the statement is used to return only distinct (different) values. Inside a table, a column often contains many duplicate values; sometimes you only want to list the different (distinct) values. (2) Syntax Of Select Distinct. SELECT DISTINCT column1, column2, … FROM table_name; (3) Examples Of Select Distinct. Demo Data Example-1: Select Only Different Country Names SELECT DISTINCT Country FROM Customers; Example-2: Select a Different City and Country Combination. SELECT DISTINCT

    Read More

  • SQL – Select Statement

    SQL – Select Statement

    SQL Select Statement Table Of Contents: What Is SQL SELECT? SELECT Syntax. SELECT Examples. (1) What Is SQL Select We use the “SELECT” statement to retrieve data from the database. The data returned is stored in a result table, called the result set. (2) SELECT Syntax SELECT column1, column2, … FROM table_name; (3) SELECT Examples Demo Dataset: Example-1: SELECT CustomerName, City FROM Customers; Example-2: SELECT CustomerName, City FROM Customers; Example-3: SELECT PostalCode FROM Customers;

    Read More

  • SQL – Syntax Rules

    SQL – Syntax Rules

    SQL Syntax Rules Rules To Follow: SQL keywords are NOT case sensitive: select is the same as SELECT SQL statement cannot be followed by another statement on the same line.  Place a semicolon (;) at the end of the last clause. Example-1: SQL Select Statement SELECT column1, column2….columnN FROM table_name; Example-2: SQL CREATE TABLE Statement CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, ….. columnN datatype, PRIMARY KEY( one or more columns ) );

    Read More