Day 58–61 of #100DaysOfCode | SQL Quick Revision Over the past few days, I focused on revising core SQL concepts and strengthening my understanding through hands-on practice. I worked on table creation, data insertion, functions, aggregation, and joins using MySQL. What I worked on: Designed and created the Classes & Students tables Established relationships using FOREIGN KEY Inserted structured sample data Practised SQL functions and string operations Implemented GROUP BY and aggregate functions Worked with JOIN queries for multi-table operations Key Concepts Revised: SQL functions: UPPER(), LENGTH(), SUBSTRING() Aggregate functions: COUNT(), AVG(), SUM(), MAX(), MIN() Data grouping using GROUP BY Table relationships using Primary Key & Foreign Key Combining data using INNER JOIN Writing clean and structured SQL queries Practice Highlights: Retrieved class names in uppercase and substring formats Calculated the total number of students and the average marks per class Found the highest and lowest marks Computed total marks per class Used JOINs to combine student and class data Displayed insights like: Student names with class names Class-wise student count Average marks per class Hands-on Implementation: Worked on a structured SQL script that includes: Table creation (classes, students) Data insertion Query-based problem solving (Basic → Aggregation → Joins) This helped me understand how real-world relational databases are designed and queried. GitHub Repository: https://lnkd.in/gGF7zmAz #100DaysOfCode #SQL #MySQL #DatabaseDesign #Joins #Subqueries #BackendDevelopment #CodingJourney #LearnSQL
SQL Revision: MySQL Practice & Hands-on Implementation
More Relevant Posts
-
💡 From Writing Queries to Building Insights: My SQL Learning Journey A few days ago, writing SQL queries was just about syntax for me. But today, I worked on something more meaningful — building a **Customer Summary Report using CTEs**. 🎯 The Challenge: Create a report that shows: • Customer name • First order date • Most recent order date • Total number of orders • Even include customers with NO orders 🧠 My Approach: Instead of writing one big query, I broke it down step by step using **Common Table Expressions (CTEs)**: ✔ Extract customer data ✔ Prepare order data ✔ Calculate first & last order dates ✔ Count total orders ✔ Combine everything using LEFT JOIN 💡 Biggest Learning: Handling edge cases matters! Customers with no orders don’t just disappear — Using **LEFT JOIN + COALESCE**, I made sure they show up with 0 orders. That’s when I realized: 👉 SQL is not just about queries 👉 It’s about thinking like a problem solver 📸 Sharing my MySQL Workbench query screenshot below 👇 Every small step like this is helping me move from **beginner to confident SQL developer** 🚀 #SQL #DataAnalytics #LearningJourney #MySQL #CTE #LinkedInLearning #DataScience #CareerGrowth
To view or add a comment, sign in
-
-
SQL remains one of the most in-demand and timeless skills in tech, and for good reason. Nearly every application that stores data relies on it. This beginner-friendly Introduction to SQL covers everything needed to get started working with databases: → What SQL is and why it matters (ANSI standard, RDBMS basics) → Core statements: SELECT, INSERT INTO, UPDATE and DELETE → Filtering data with WHERE, AND, OR and NOT → Sorting and grouping with ORDER BY and GROUP BY → Joining tables using INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN → Aggregate functions: COUNT, SUM, AVG, MIN and MAX → Constraints: PRIMARY KEY, FOREIGN KEY, NOT NULL, UNIQUE and CHECK → Creating and modifying databases and tables with CREATE, ALTER and DROP → Advanced topics: UNION, HAVING, EXISTS, ANY, ALL and subqueries → Built-in functions for dates, text formatting and rounding → A full SQL statement syntax reference Whether starting from zero or filling in knowledge gaps, this is a solid foundation for anyone working with data. Save this post and share it with a teammate or student who is just getting started with databases. #SQL #Database #DataEngineering #LearnSQL #DataAnalysis #MySQL #PostgreSQL #TechSkills #CodingForBeginners #DataScience #BackendDevelopment #RDBMS #TechEducation #SoftwareDevelopment #100DaysOfCode #Programming #DataManagement #TechCommunity #LearnToCode #DatabaseManagement
To view or add a comment, sign in
-
Many people struggle with SQL not because it is difficult, but because they focus on writing queries without understanding how data is structured and connected. You might learn syntax, joins, and functions, but when queries grow complex, things start breaking. Not because SQL is hard, but because the underlying logic is unclear. That is the gap Master SQL with MySQL by Mani Ratnam is designed to address. In this course, you will learn to: • Understand how data is organized and how different tables relate • Build queries step by step instead of memorizing syntax • Work with joins, subqueries, and optimize queries using real datasets With 60+ lessons and hands-on practice, the focus is on thinking in SQL and applying it in real scenarios. Explore the course here: https://lnkd.in/gNah-JtY #SQL #MySQL #DataAnalytics #LearnSQL #Upskilling
To view or add a comment, sign in
-
-
I was stuck on a simple SQL problem today… 😵💫 This is the problem from Ankit Bansal 100 days of sql course "Find the nth Sunday after a given date” I completely could not understand the problem at all Then I realized — 👉 The problem wasn’t SQL 👉 It was my understanding of how dates actually work 💡 The Breakthrough In MySQL: Sunday = 1 Monday = 2 Tuesday = 3 Wednesday = 4 Thursday = 5 Friday = 6 Saturday = 7 So the real question becomes: “How many days should I add to reach the next Sunday?” 🔥 The formula that changed everything: (8 - DAYOFWEEK(date)) % 7 🧠 Why this works? We are basically doing: 👉 (Target Day + 7 - Current Day) % 7 For Sunday: Target = 1 So: 👉 (1 + 7 - current_day) % 7 👉 = (8 - current_day) % 7 📊 Example: Date = Saturday (7) (8 - 7) % 7 = 1 → Next day is Sunday ✅ ⚠️ One Important Catch: If the date itself is Sunday: (8 - 1) % 7 = 0 ❌ But the question says: 👉 “STRICTLY AFTER” So we fix it: CASE WHEN DAYOFWEEK(date) = 1 THEN 7 ELSE (8 - DAYOFWEEK(date)) END 🚀 Final Insight: 👉 “Next Sunday + (n-1) weeks” That’s it. That’s the entire problem. 💭 What I learned today: Most SQL problems are not about syntax… They’re about thinking clearly. If you're learning SQL: Don’t memorize queries. Understand the logic. That’s where the real power is 💥 #SQL #DataEngineering #LearningInPublic #MySQL #ProblemSolving #AIEngineering
To view or add a comment, sign in
-
I started learning SQL and instead of waiting to be perfect, I created my own notes while practicing on SQL Workbench. They’re simple, not perfect—but they cover almost everything a beginner needs. Here’s a quick gist of what I learned: • Database – A structured collection of data stored electronically • Table Structure – Data organized in rows (records) and columns (fields) • Creating Database/Table – Using SQL queries to define and store data • SQL Commands – DDL (structure), DML (data), DCL (access), TCL (transactions) • Insert Data – Adding records into tables using "INSERT" • Keys – Primary Key (unique identifier) Foreign Key (connects tables) • Constraints – Rules like NOT NULL, UNIQUE to maintain data accuracy • Operators – Arithmetic, comparison, logical operations in queries • Clauses – WHERE (filter data) GROUP BY (group data) HAVING (filter groups) ORDER BY (sort results) • Aggregate Functions – COUNT, SUM, AVG → used for analysis • Foreign Key Cascading – Automatically updates/deletes related data • Joins – Combine data from multiple tables (INNER, LEFT, etc.) • UNION – Merge results of multiple queries • Subqueries – Query inside another query for complex logic • Views (MySQL) – Virtual tables created from queries • SQL vs NoSQL – SQL = structured, relational NoSQL = flexible, non-relational ⚠️ These notes are not perfect, but they helped me build clarity. You don’t need perfect notes—you just need to start and stay consistent. I’ll also share the resources/videos I used. video link 1:-https://lnkd.in/gS4kAqmg video link 2:-https://lnkd.in/gTCU9nR2 If you're learning SQL, this might help you revise quickly. Let’s keep growing 🚀 #SQL #DataAnalytics #LearnSQL #Upskilling #MySQL #Students #LearningInPublic #TechSkills #Consistency #CareerGrowth
To view or add a comment, sign in
-
💡 SQL Learning Moment: Why removing a column fixed my GROUP BY error Today I ran into a classic MySQL error: Error Code: 1055 – Expression not in GROUP BY clause… Here’s what happened 👇 I wrote a query like this: Grouped data by date Selected gross_price Calculated total using SUM() And boom 💥error. 🔍 The issue When using GROUP BY, SQL combines multiple rows into one. So if a single date has multiple gross_price values, the database gets confused: 👉 Which gross_price should I show? ✅ The fix When I removed gross_price from the SELECT, the query worked perfectly. Why? Because now every column was either: Part of GROUP BY, OR Aggregated using SUM() 🧠 Key takeaway Whenever you use GROUP BY: ✔ Every column in SELECT must be: in the GROUP BY, or wrapped in an aggregate function like SUM(), MAX(), etc. 🚀 Lesson learned GROUP BY turns many rows into one so every selected value must also resolve to one. #SQL #DataAnalytics #Learning #MySQL #Beginners #TechJourney
To view or add a comment, sign in
-
Day 14 of learning SQL 🚀 Today I explored Stored Procedures in MySQL and learned how to store and reuse SQL logic inside the database. Instead of writing the same queries again and again, I can now create procedures and call them whenever needed. Topics I covered: ✔ Creating basic stored procedures ✔ Using DELIMITER to define multi-line procedures ✔ Writing procedures with multiple queries ✔ Using parameters to make procedures dynamic ✔ Filtering and retrieving specific results using procedures Example I practiced: DELIMITER $$ CREATE PROCEDURE large_salaries4(employee INT) BEGIN SELECT salary FROM employee_salary WHERE employee_id = employee ORDER BY salary DESC LIMIT 1; END $$ DELIMITER ; CALL large_salaries4(1); Key learning today 💡 Stored procedures help avoid repetition Parameters make queries dynamic and reusable Multiple queries can be executed in a single procedure Useful for automation and backend logic Slowly moving from writing queries to building reusable SQL systems. Goal: Become job-ready in SQL & Data Analysis 💪 #SQL #DataAnalytics #LearningInPublic #100DaysOfCode #Consistency
To view or add a comment, sign in
-
-
#Day_29 of learning SQL in 60 days Topic I covered: Mastering INNER JOIN in MySQL Today, I explored one of the most important concepts in SQL — INNER JOIN. What is INNER JOIN? INNER JOIN is used to combine rows from two tables based on a matching condition. It returns only the records that have matching values in both tables. Why is it useful? It helps in retrieving meaningful data by connecting related tables — something that’s very common in real-world databases. Syntax: SELECT COLUMN_NAME(S) FROM TABLE1 JOIN TABLE2 ON TABLE1.COMMON_COLUMN=TABLE2.COMMON_COLUMN; Example: SELECT STUDENTS.S_ID, STUDENTS.S_NAME, STUDENTS.S_ADDRESS, DEPARTMENTS.DEPT_NAME FROM STUDENTS JOIN DEPARTMENTS ON STUDENTS.DEPT=DEPARTMENTS.DEPT_ID; If we have a student table and departments table, we can use INNER JOIN to fetch student names along with their enrolled department names. This returns the students names and their department names. Key Takeaway: INNER JOIN filters out unmatched data and gives only the relevant, connected information. Learning SQL step by step and building a strong foundation in data handling! #SQL #MySQL #DataAnalytics #LearningJourney #Database #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
-
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
Explore related topics
- How to Solve Real-World SQL Problems
- SQL Learning Resources and Tips
- Tips for Applying SQL Concepts
- How to Understand SQL Query Execution Order
- SQL Learning Strategies That Work
- How to Master SQL Techniques
- How to Use SQL QUALIFY to Simplify Queries
- How to Use SQL Window Functions
- SQL Learning Roadmap for Beginners
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