SQL Examples

SQL tutorials for Business Analyst – SQL | Using Views

(SQL tutorials for Business Analyst & Beginners) In this end-to-end example, you will learn – SQL Tutorials for Business Analyst: SQL | Using Views.   A view is nothing more than a SQL statement that is stored in the database with an associated name. A view is actually a composition of a table in the …

SQL tutorials for Business Analyst – SQL | TRUNCATE TABLE

(SQL tutorials for Business Analyst & Beginners) In this end-to-end example, you will learn – SQL Tutorials for Business Analyst: SQL | TRUNCATE TABLE.   The SQL TRUNCATE TABLE command is used to delete complete data from an existing table. You can also use DROP TABLE command to delete complete table but it would remove complete table …

SQL tutorials for Business Analyst – SQL | ALTER TABLE

(SQL tutorials for Business Analyst & Beginners) In this end-to-end example, you will learn – SQL Tutorials for Business Analyst: SQL | ALTER TABLE.   The SQL ALTER TABLE command is used to add, delete or modify columns in an existing table. You should also use the ALTER TABLE command to add and drop various constraints on …

SQL tutorials for Business Analyst – SQL | Indexes

(SQL tutorials for Business Analyst & Beginners) In this end-to-end example, you will learn – SQL Tutorials for Business Analyst: SQL | Indexes.   Indexes are special lookup tables that the database search engine can use to speed up data retrieval. Simply put, an index is a pointer to data in a table. An index in a …

SQL tutorials for Business Analyst – SQL | Alias Syntax

(SQL tutorials for Business Analyst & Beginners) In this end-to-end example, you will learn – SQL Tutorials for Business Analyst: SQL | Alias Syntax.   You can rename a table or a column temporarily by giving another name known as Alias. The use of table aliases is to rename a table in a specific SQL statement. …

SQL tutorials for Business Analyst – SQL | EXCEPT Clause

(SQL tutorials for Business Analyst & Beginners) In this end-to-end example, you will learn – SQL Tutorials for Business Analyst: SQL | EXCEPT Clause.   The SQL EXCEPT clause/operator is used to combine two SELECT statements and returns rows from the first SELECT statement that are not returned by the second SELECT statement. This means EXCEPT returns only …

SQL tutorials for Business Analyst – SQL | INTERSECT Clause

(SQL tutorials for Business Analyst & Beginners) In this end-to-end example, you will learn – SQL Tutorials for Business Analyst: SQL | NTERSECT Clause.   The SQL INTERSECT clause/operator is used to combine two SELECT statements, but returns rows only from the first SELECT statement that are identical to a row in the second SELECT statement. This …

SQL tutorials for Business Analyst – SQL | UNIONS CLAUSE

(SQL tutorials for Business Analyst & Beginners) In this end-to-end example, you will learn – SQL Tutorials for Business Analyst: SQL | UNIONS CLAUSE.   The SQL UNION clause/operator is used to combine the results of two or more SELECT statements without returning any duplicate rows. To use this UNION clause, each SELECT statement must …

SQL tutorials for Business Analyst – SQL | CARTESIAN or CROSS JOINS

(SQL tutorials for Business Analyst & Beginners) In this end-to-end example, you will learn – SQL Tutorials for Business Analyst: SQL | CARTESIAN or CROSS JOINS.   The CARTESIAN JOIN or CROSS JOIN returns the Cartesian product of the sets of records from two or more joined tables. Thus, it equates to an inner join …