#Day_35 of learning SQL in 60 days Topic I covered: Exploring Multiple Table Joins in SQL As I continue learning SQL, I recently explored an important concept — joining multiple tables to extract meaningful insights from relational data. In real-world databases, data is often distributed across multiple tables. To analyze such data effectively, we use multiple joins. What are Multiple Table Joins? They allow us to combine data from more than two tables using relationships between columns (usually keys). Example Scenario: Suppose we have three tables: departemts staff students Syntax: SELECT COLUMN_NAME(S) FROM TABLE1 JOIN TABLE2 ON TABLE1.COMMON_COLUMN=TABLE2.COMMON_COLUMN JOIN TABLE3 ON TABLE2.COMMON_COLUMN=TABLE3.COMMON_COLUMN; Sample Query: SELECT DEPARTMENTS.DEPT_NAME, STUDENTS.S_NAME, SUBJECTS.SUBJECT_NAME FROM DEPARTMENTS JOIN STUDENTS ON DEPARTMENTS.DEPT_ID=STUDENTS.DEPT JOIN SUBJECTS ON STUDENTS.DEPT=SUBJECTS.DEPT; Key Takeaways: ✔ Helps in combining related data from multiple tables ✔ Improves data analysis and reporting ✔ Commonly used in real-world applications 🚀 Learning SQL step by step and building a strong foundation in data handling! #SQL #Database #LearningJourney #DataAnalytics #MySQL #TechSkills
Learning Multiple Table Joins in SQL
More Relevant Posts
-
My SQL learning Journal Day 32: SQLComments 📝 Today, I explored the SQL comments, and it's the smallest SQL feature with the biggest impact on teamwork. What is a SQL comment? Comments are used to explain SQL code or to temporarily prevent execution of SQL code (for debugging). Comments are ignored by the database engine. It simply means: Text in your code that the database ignores. It is just for you and anyone else reading your query. Two types I learned today: 1. Single-line comment: Single-line comments start with -- and continue to the end of the line. Any text after -- and to the end of the line will be ignored. sql syntax -- This query finds active customers SELECT * FROM customers WHERE status = 'active'; 2. Multi-line comment Multi-line comments start with /* and end with */. Any text between /* and */ will be ignored. sql syntax /* This query calculates monthly sales. Last updated: Day 32. */ SELECT SUM(amount) FROM sales WHERE month = 'APR'; Why this is important: Code runs for machines. Comments explain for humans. Note: Comments are not supported in Microsoft Access databases. #SQL #Data Analytics#Women in Tech #LearningInPublic #BeginnerSQL
To view or add a comment, sign in
-
#Day_20 of learning SQL in 60 days Topic I covered: SQL Learning: GROUP BY with Multiple Columns Today I explored how the GROUP BY clause can be used with multiple columns in SQL — a powerful way to organize and analyze data Normally, GROUP BY is used to group rows based on a single column. But when we use multiple columns, SQL groups data based on the unique combination of those columns. 🔹 Syntax: SELECT column1, column2, AGGREGATE_function(column3) FROM table_name GROUP BY column1, column2; 🔹 Example: SELECT dept_id, subject, COUNT(*) AS total_staff FROM staff GROUP BY dept_id, subject; This query groups STAFF on the columns dept_id and subject. 🔹 Key Points: ✔️ Groups are formed using combinations of multiple columns ✔️ All selected columns must be either in GROUP BY or used with aggregate functions ✔️ Helps in detailed data analysis and reporting 🚀 Learning how to use GROUP BY with multiple columns really improves how we analyze structured data in SQL! #SQL #Database #DataAnalytics #Learning #GroupBy #SQLBasics
To view or add a comment, sign in
-
-
Learning in Progress: MySQL & Data Querying Today I worked on a hands-on SQL problem focused on retrieving specific customer data using filtering conditions. The task was to extract CustomerKey, AnnualIncome, and EducationLevel for customers with the occupation Clerical. 💡 What I practiced: Writing efficient SELECT queries Using WHERE clause for filtering data Understanding real-world dataset structures Interpreting query outputs for insights 📊 Small exercises like this are helping me build a strong foundation in data analytics and database management. Consistency over perfection — improving one query at a time. #MySQL #SQL #DataAnalytics #LearningJourney #Database #TechSkills
To view or add a comment, sign in
-
-
#Day_18 of learning SQL in 60 days Topic I covered: Mastering the GROUP BY Clause in SQL Recently, I explored the GROUP BY clause in SQL, and it’s a powerful tool when working with data! What is GROUP BY? The GROUP BY clause is used to group rows that have the same values in specified columns into summary rows. It is commonly used with aggregate functions like: COUNT() SUM() AVG() MIN() MAX() Why is it useful? It helps in analyzing data by categorizing it into groups and performing calculations on each group instead of the entire dataset. Syntax: SELECT COLUMN1, AGGREGATE_FUNCTION(COLUMN2) FROM TABLE_TABLE GROUP BY COLUMN2; Example: SELECT S_GENDER AS GENDER, COUNT(S_GENDER) AS COUNT FROM STUDENTS GROUP BY S_GENDER; This query groups students by gender and shows the total number of students of each gender. Key Points to Remember: ✔ GROUP BY comes after the FROM clause ✔ It is often used with aggregate functions ✔ Columns in SELECT must either be in GROUP BY or used with aggregate functions Learning SQL step by step is helping me understand how data is structured and analyzed in real-world scenarios. Excited to keep learning more! #SQL #DataAnalytics #LearningJourney #Database #TechSkills
To view or add a comment, sign in
-
-
#Day_31 of learning SQL in 60 days Topic I covered: SQL Concept I Learned: LEFT JOIN Today I explored LEFT JOIN in SQL, and it really helped me understand how to work with incomplete or missing data. A LEFT JOIN in SQL is used to retrieve all records from the left table and the matching records from the right table. If there is no match, the result will still include the left table’s row, but the right table’s columns will contain NULL values. Syntax: SELECT COLUMN_NAME(S) FROM TABLE1 LEFT JOIN TABLE2 ON TABLE1.COMMON_COLUMN=TABLE2.COMMON_COLUMN; A LEFT JOIN returns: ✔️ All records from the left table ✔️ Matching records from the right table ✔️ NULL values if there is no match Example: SELECT STAFF.EMP_NAME, DEPARTMENTS.DEPT_NAME FROM STAFF LEFT JOIN DEPARTMENTS ON STAFF.DEPT_ID=DEPARTMENTS.DEPT_ID; This query shows all EMPLOYEE NAMES along with their department names. If the EMPLOYEE is not assigned to any department, the department column will show NULL. Use Cases: 🔹 Finding missing or unmatched data 🔹 Displaying complete lists with optional details 🔹 Data analysis where not all records have relationships Learning SQL step by step and building a strong foundation in joins! #SQL #Database #Learning #Tech #DataAnalytics
To view or add a comment, sign in
-
-
🚀 Day 1 of 30 Days SQL Challenge – What is SQL? Starting my 30 Days SQL Challenge with the very first and most important question: What is SQL? 💻 SQL stands for Structured Query Language. It is a powerful language used to communicate with databases. In simple terms, SQL helps us store, retrieve, update, and manage data efficiently. In today’s data-driven world, almost every organization works with huge amounts of data. Whether it’s a bank, an e-commerce platform, or a social media app—data is everywhere. And SQL is the tool that helps us make sense of that data. 💡 Why is SQL Important? ✔ It helps in managing large datasets ✔ Used by data analysts, data scientists, and developers ✔ Essential for decision-making in businesses ✔ Works with popular databases like MySQL, Oracle, SQL Server 📊 What can you do with SQL? • Fetch data using queries • Filter and sort information • Perform calculations • Join multiple tables • Analyze trends and patterns Learning SQL is not just about writing queries—it’s about understanding data and turning it into meaningful insights 📈 This is just the beginning… Stay tuned for Day 2! 🚀 #SQL #DataAnalytics #30DaysChallenge #LearningJourney #DataScience #Upskilling #CareerGrowth #Consistency #TechSkills
To view or add a comment, sign in
-
What I Learned in My SQL Class Yesterday Yesterday’s class was all about SQL (Structured Query Language), and it was a really insightful session for me as I continued my journey into data analysis. 🔍 What is SQL? SQL is a language used to interact with databases—it allows us to store, retrieve, and manage data efficiently. 💡 Key Things I Learned: ✔️ Uses of SQL Managing and organizing data Retrieving specific information from databases Updating and deleting records Supporting data-driven decisions 🔑 Understanding Keys (Very Important!) Primary Key: A unique identifier for each record in a table (no duplicates, no null values) Foreign Key: A field that connects one table to another, helping to maintain relationships between tables 🗂️ Database Schema I also learned about schema, which is basically the structure or blueprint of a database. It defines how tables, fields, and relationships are organized. This class helped me better understand how databases are structured and how data is connected behind the scenes. I’m excited to keep building my SQL skills and apply them in real-world scenarios! 🚀 #SQL #DataAnalytics #LearningJourney #TechSkills #Database #CareerGrowth Omolola Okebiorun TechCrush
To view or add a comment, sign in
-
-
Hello Everyone!😊 Excited to share my latest project: MySQL Query Presentation Video 📊This project focuses on strengthening SQL fundamentals by demonstrating how powerful queries can be used to extract, analyze, and transform data efficiently from relational databases. 📌 Project Objective: To showcase practical MySQL queries that solve real-world data problems, improve data retrieval efficiency, and support better decision-making through structured data analysis. ⚡ Key Highlights: ‣ Basic to Advanced Queries: Covers SELECT, WHERE, ORDER BY, GROUP BY, HAVING, JOINs, and subqueries ‣ Data Filtering & Analysis: Demonstrates how to extract meaningful insights from raw datasets ‣ Joins in Action: Practical examples of INNER, LEFT, RIGHT, and FULL joins ‣ Aggregation Functions: Use of COUNT, SUM, AVG, MIN, MAX for analytical insights ‣ Real-World Scenarios: Query-based problem solving using structured datasets 🎯 Learning Outcome: ‣ Stronger understanding of relational database concepts ‣ Improved SQL query writing and optimization skills ‣ Better grasp of how data is retrieved and analyzed in real systems #MySQL #SQL #DataAnalytics #DataScience #BusinessIntelligence #DataAnalysis #SQLQueries #DataSkills #TechLearning #Programming #DataDriven #Analytics #LearnSQL #DataProject
To view or add a comment, sign in
-
#Day_34 of learning SQL in 60 days Topic I covered: A SELF JOIN is when a table is joined with itself. It might sound confusing at first, but it’s extremely useful when working with hierarchical data. When do we use SELF JOIN? When a table contains related data within itself. Example: Employees and their Managers are stored in the same table. How it works: We use table aliases to treat the same table as two different tables. Syntax: SELECT A.COLUMN_NAME, B.COLUMN_NAME FROM TABLE_NAME A JOIN TABLE_NAME B ON A.COMMON_COLUMN = B.COMMON_COLUMN; Example: select e.emp_name as employe,m.emp_name as manager from employees e join employees m on e.manager_id=m.emp_id; Here: E represents Employees M represents Managers (same table!) Key Takeaways: ✔ SELF JOIN joins a table to itself ✔ Requires aliases to differentiate roles ✔ Useful for hierarchical relationships This concept really helped me understand how relational databases handle real-world relationships within the same dataset. #SQL #MySQL #Database #LearningJourney #TechSkills
To view or add a comment, sign in
-
-
#Day_30 of learning SQL in 60 days Topic I covered: What I Practiced Today in MySQL: INNER JOIN Today I spent time strengthening my understanding of INNER JOIN in MySQL by solving multiple practice questions. INNER JOIN helps combine data from two tables by returning only the matching records based on a common column. What I worked on: ✔️ Practiced 10+ INNER JOIN queries ✔️ Combined data from multiple tables using common keys ✔️ Understood how non-matching records are excluded Syntax: SELECT COLUMN_NAME(S) FROM TABLE1 INNER JOIN TABLE2 ON TABLE1.COMMON_COLUMN=TABLE2.COMMON_COLUMN; 📂 I’ve also documented all the practice questions and solutions as part of my learning process. Key Insight: INNER JOIN returns only the intersection of both tables, which makes it essential for accurate data analysis. Consistent practice is helping me build confidence in SQL and understand real-world data relationships better. #SQL #MySQL #InnerJoin #LearningByDoing #DataAnalytics #TechJourney
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development