Hits: 14 (SQL Tutorials for Citizen Data Scientist) SQL Functions SQL has many built-in functions that enable you to perform calculations on data. SQL Aggregate Functions SQL aggregate functions perform calculation on a set of values and return a single value. The following table summarizes some useful aggregate functions: Function Description AVG() Returns the average of …
Hits: 17 (SQL Tutorials for Citizen Data Scientist) SQL Subqueries In this tutorial you will learn how to embed a query within another query in SQL. What Is a Subquery? A subquery, also known as a nested query or subselect, is a SELECT query embedded within the WHERE or HAVING clause of another SQL query. The data returned by the subquery is …
Hits: 21 (SQL Tutorials for Citizen Data Scientist) SQL Temporary Tables In this tutorial you will learn how to create temporary tables using SQL. Creating Temporary Tables A temporary table is a table that is visible only to the current session, and is dropped automatically when the session in which it was created is closed. Since …
Hits: 9 (SQL Tutorials for Citizen Data Scientist) SQL Cloning Tables In this tutorial you will learn how to create a duplicate copy of an existing table. Cloning or Copying a Table There may be a situation when you just want to create an exact copy or clone of an existing table to test or perform something …
Hits: 6 (SQL Tutorials for Citizen Data Scientist) SQL Dates and Times In this tutorial you will learn how to work with dates and times in SQL. Date and Time Manipulation Along with strings and numbers, you often need to store date and/or time values in a database, such as an user’s birth date, employee’s hiring date, date …
Hits: 49 (SQL Tutorials for Citizen Data Scientist) SQL CREATE INDEX Statement In this tutorial you will learn how to create indexes on tables to improve the database performance. What is Index? An index is a data structure associated with a table that provides fast access to rows in a table based on the values in one …
Hits: 9 (SQL Tutorials for Citizen Data Scientist) SQL CREATE VIEW Statement In this tutorial you will learn how to create, update, and delete a view using SQL. Creating Views to Simplify Table Access A view is a virtual table whose definition is stored in the database. But, unlike tables, views do not actually contain any data. …
Hits: 20 (SQL Tutorials for Citizen Data Scientist) SQL HAVING Clause In this tutorial you will learn how to filter the groups returned by a GROUP BY clause. Filtering the Groups Based on Condition The HAVING clause is typically used with the GROUP BY clause to specify a filter condition for a group or an aggregate. The HAVING clause can only be used with the SELECT statement. …
Hits: 8 (SQL Tutorials for Citizen Data Scientist) SQL GROUP BY Clause In this tutorial you will learn how to group rows based on column values. Grouping Rows The GROUP BY clause is used in conjunction with the SELECT statement and aggregate functions to group rows together by common column values To understand this easily, let’s look at the following employees and departments tables. +——–+————–+————+———+ | emp_id …
Hits: 8 (SQL Tutorials for Citizen Data Scientist) SQL Aliases In this tutorial you will learn how to specify a short alias name for a table or a table column within an SQL statement. Defining Table Aliases When multiple tables are being joined in a single query, you need to prefix each column name with the …
Hits: 3 (SQL Tutorials for Citizen Data Scientist) SQL ALTER TABLE Statement In this tutorial you will learn how to alter or modify an existing table using SQL. Modifying Existing Tables It is quite possible that after creating a table, as you start using it, you may discover you’ve forgot to mention any column or constraint or …
Hits: 10 (SQL Tutorials for Citizen Data Scientist) SQL LIKE Operator In this tutorial you will learn how to retrieve the data based on a partial match. Pattern Matching So far, you’ve seen the conditions that identify an exact string, e.g. WHERE name=’Lois Lane’. But in SQL you can perform partial or pattern matching too using the LIKE operator. The LIKE operator …
Hits: 41 (SQL Tutorials for Citizen Data Scientist) SQL UNION Operation In this tutorial you will learn how to combine the results of two or more SQL queries. The UNION Operator The UNION operator is used to combine the results of two or more SELECT queries into a single result set. The union operation is different from using joins that combine …
Hits: 5 (SQL Tutorials for Citizen Data Scientist) SQL CROSS JOIN Operation In this tutorial you will learn how to fetch data from two tables using SQL cross join. Using Cross Joins If you don’t specify a join condition when joining two tables, database system combines each row from the first table with each row from the …
Hits: 11 (SQL Tutorials for Citizen Data Scientist) SQL FULL JOIN Statement In this tutorial you will learn how to retrieve data from two tables using SQL full join. Using Full Joins A FULL JOIN returns all the rows from the joined tables, whether they are matched or not i.e. you can say a full join combines the functions …
Hits: 6 (SQL Tutorials for Citizen Data Scientist) SQL RIGHT JOIN Operation In this tutorial you will learn how to fetch data from two tables using SQL right join. Using Right Joins The RIGHT JOIN is the exact opposite of the LEFT JOIN. It returns all rows from the right table along with the rows from the left table for …