SQL Tutorials for Business Analyst

Learn to Code SQL Example – SQL | Distinct Clause

(SQL Example for Citizen Data Scientist & Business Analyst) SQL | Distinct Clause The distinct keyword is used in conjunction with select keyword. It is helpful when there is need of avoiding the duplicate values present in any specific columns/table. When we use distinct keyword only the unique values are fetched. Basic Syntax: SELECT DISTINCT column1,column2 …

Learn to Code SQL Example – SQL | Case Statement

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | Case Statement Control statements form the heart of most languages since they control the execution of other sets of statements. These are found in SQL too, and should be exploited for uses such as query filtering and query optimization through careful selection of …

Learn to Code SQL Example – SQL | WHERE Clause

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | WHERE Clause WHERE keyword is used for fetching filtered data in a result set. It is used to fetch data according to a particular criteria. WHERE keyword can also be used to filter data by matching patterns.   Basic Syntax: SELECT column1,column2 FROM table_name WHERE …

Learn to Code SQL Example – SQL | AND and OR operators

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | AND and OR operators In SQL, the AND & OR operators are used for filtering the data and getting precise result based on conditions. The AND and OR operators are used with the WHERE clause. These two operators are called conjunctive operators. AND Operator …

Learn to Code SQL Example – SQL | INSERT INTO Statement

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | INSERT INTO Statement The INSERT INTO statement of SQL is used to insert a new row in a table. There are two ways of using INSERT INTO statement for inserting rows: Only values: First method is to specify only the value of data to …

Learn to Code SQL Example – SQL | DELETE Statement

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | DELETE Statement The DELETE Statement in SQL is used to delete existing records from a table. We can delete a single record or multiple records depending on the condition we specify in the WHERE clause. Basic Syntax: DELETE FROM table_name WHERE some_condition; table_name: …

Learn to Code SQL Example – SQL | UPDATE Statement

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | UPDATE Statement The UPDATE statement in SQL is used to update the data of an existing table in database. We can update single columns as well as multiple columns using UPDATE statement as per our requirement. Basic Syntax UPDATE table_name SET column1 = …

Learn to Code SQL Example – SQL | SELECT TOP Clause

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | SELECT TOP Clause SELECT TOP clause is used to fetch limited number of rows from a database. This clause is very useful while dealing with large databases. Basic Syntax: SELECT TOP value column1,column2 FROM table_name; value: number of rows to return from top …

Learn to Code SQL Example – SQL | ORDER BY

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | ORDER BY The ORDER BY statement in sql is used to sort the fetched data in either ascending or descending according to one or more columns. By default ORDER BY sorts the data in ascending order. We can use the keyword DESC to sort …

Learn to Code SQL Example – SQL | Aliases

(SQL Example for Citizen Data Scientist & Business Analyst)   SQL | Aliases Aliases are the temporary names given to table or column for the purpose of a particular SQL query. It is used when name of column or table is used other than their original names, but the modified name is only temporary. Aliases …