SQL Tutorials for Business Analyst

SQL with Examples : SQL BETWEEN Operator

SQL BETWEEN Operator In addition to checking whether an expression is equal to another expression, you can build conditions that check whether an expression falls within a certain range. This type of condition is used when working with numerical or temporal data (data related to date and time), for example, to check for all products …

SQL with Examples : SQL WHERE Clause

SQL WHERE Clause Database tables usually contain large amounts of data, and you rarely need to retrieve all the rows in a table. More often than not, you will want to retrieve the subset of the table’s data as needed for specific operations or reports. Retrieving the desired data involves specifying search criteria, also known …

SQL with Examples : SQL SELECT Statement

SQL SELECT Statement The SQL statement that you will probably use most often is the SELECT statement. Its purpose is to retrieve data from one or more tables of the database (or even several databases) and display it. The result of a SELECT statement is another table, also known as a result set. Syntax The …

Learn to Code SQL Example – SQL | Numeric Functions

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | Numeric Functions Numeric Functions are used to perform operations on numbers and return numbers. Following are the numeric functions defined in SQL: ABS(): It returns the absolute value of a number. Syntax: SELECT ABS(-243.5); Output: 243.5 SQL> SELECT ABS(-10); +————————————–+ | ABS(10) +————————————–+ | 10 +————————————–+ …

Learn to Code SQL Example – SQL | Date functions

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | Date functions In SQL, dates are complicated for newbies, since while working with database, the format of the date in table must be matched with the input date in order to insert. In various scenarios instead of date, datetime (time is also involved …

Learn to Code SQL Example – SQL Server Mathematical functions (SQRT, PI, SQUARE, ROUND, CEILING & FLOOR)

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL Server Mathematical functions (SQRT, PI, SQUARE, ROUND, CEILING & FLOOR) Mathematical functions are present in SQL server which can be used to perform mathematical calculations. Some commonly used mathematical functions are given below: 1. SQRT(): SQRT() function is the most commonly used function. It …

Learn to Code SQL Example – SQL | Join (Inner, Left, Right and Full Joins)

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | Join (Inner, Left, Right and Full Joins) A SQL Join statement is used to combine data or rows from two or more tables based on a common field between them. Different types of Joins are: INNER JOIN LEFT JOIN RIGHT JOIN FULL JOIN   …

Learn to Code SQL Example – SQL | BETWEEN & IN Operator

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | BETWEEN & IN Operator BETWEEN The SQL BETWEEN condition allows you to easily test if an expression is within a range of values (inclusive). The values can be text, date, or numbers. It can be used in a SELECT, INSERT, UPDATE, or DELETE …

Learn to Code SQL Example – SQL | Except Clause

(SQL Example for Citizen Data Scientist & Business Analyst) SQL | Except Clause In SQL, EXCEPT returns those tuples that are returned by the first SELECT operation, and not returned by the second SELECT operation. This is the same as using a subtract operator in relational algebra. Example: Say we have two relations, Students and …

Learn to Code SQL Example – SQL | MINUS Operator

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | MINUS Operator The Minus Operator in SQL is used with two SELECT statements. The MINUS operator is used to subtract the result set obtained by first SELECT query from the result set obtained by second SELECT query. In simple words, we can say …