Welcome to our SQL with Tableau tutorial! In this lesson, we'll guide you through the process of using SQL (Structured Query Language) with Tableau, a powerful data visualization tool. By the end of this tutorial, you'll be able to retrieve, manipulate, and visualize data using both SQL and Tableau. šÆ
SQL is a standard language used for communicating with databases. It allows us to retrieve, manipulate, and update data stored in various types of databases.
To follow along with this tutorial, you'll need:
Connect to Data.SQL Server, MySQL, or PostgreSQL (depending on your database) and follow the prompts to connect.Run to see the results.The SELECT statement is used to retrieve data from a database.
SELECT column1, column2, ... FROM table_name;š” Pro Tip: Use the DISTINCT keyword to retrieve unique values.
The WHERE clause is used to filter data based on conditions.
SELECT column1, column2, ... FROM table_name WHERE condition;The ORDER BY clause is used to sort the data.
SELECT column1, column2, ... FROM table_name ORDER BY column1;Joins are used to combine rows from two or more tables based on a related column between them.
SELECT A.column1, B.column1 FROM table_A INNER JOIN table_B ON table_A.common_column = table_B.common_column;SELECT A.column1, B.column1 FROM table_A LEFT JOIN table_B ON table_A.common_column = table_B.common_column;A LEFT JOIN returns all rows from the left table (table_A), and the matched rows from the right table (table_B). If there is no match, NULL values will be returned for the right table.
SELECT sepal_length, petal_width FROM iris;SELECT sepal_length, petal_width FROM iris WHERE sepal_width > 5;Rows, Columns, and Measures areas.What is the purpose of the SELECT statement in SQL?
We hope you enjoyed learning SQL with Tableau! Keep practicing, and soon you'll be able to retrieve, manipulate, and visualize data like a pro. š Happy learning!