#Day_14 of Learning SQL . Today I explored SQL Functions and learned how to create and use them: ✔️ What is a Function in SQL ✔️ Creating custom functions ✔️ Using functions inside SELECT statements - What I understood: SQL functions act like reusable formulas that take input and return a value. They help simplify calculations and make queries more efficient and readable. For example, I created a function to calculate annual salary from monthly salary, which made the query cleaner and reusable. Learning how to write smarter queries step by step . #SQL #DataAnalytics #LearningJourney #Database #Consistency
SQL Functions: Creating Reusable Formulas for Efficient Queries
More Relevant Posts
-
📊 Day 66/90 — SQL Learning: PARTITION BY Today I learned a key concept in window functions: 👉 PARTITION BY This makes analysis much more meaningful 🔥 --- 🔹 What I learned: ✅ "PARTITION BY" divides data into groups ✅ Window functions run within each group ✅ Similar to GROUP BY, but does NOT reduce rows ✅ Used with ranking, averages, totals --- 🔹 Example: 👉 Rank employees within each department SELECT name, department, salary, RANK() OVER(PARTITION BY department ORDER BY salary DESC) AS dept_rank FROM employees; --- 💡 Big lesson: PARTITION BY lets you analyze data within categories Because: Without partition → overall ranking ❌ With partition → group-wise insights ✅ --- From today, I’m learning how to do category-based analysis like a pro 📊 💬 Have you used PARTITION BY in SQL? #SQL #DataAnalytics #LearningInPublic #DataAnalystJourney #90DaysChallenge
To view or add a comment, sign in
-
-
💡 SQL Learning Moment! Today I came across an interesting query: `SELECT 5 FROM employees;` At first glance, it looks a bit confusing—but here’s what it actually does 👇 👉 It returns the value **5 for every row** in the `employees` table. So if the table has 3 rows, the output will be: 5 5 5 🔍 Key takeaway: In SQL, you can select **constant values**, not just columns. The database will repeat that value for each row in the result set. 📚 Small concepts like these help build a strong foundation in SQL! #SQL #Learning #Database #TechSkills #DataAnalytics #Beginners #CareerGrowth
To view or add a comment, sign in
-
-> SQL Tip That Helped Me Analyze Data Faster One of the most useful SQL techniques I use daily: Window Functions Example: Ranking customers Running totals Trend analysis Instead of complex joins, window functions make analysis cleaner and faster. If you're learning SQL, don’t skip this! #SQL #DataAnalytics #Learning
To view or add a comment, sign in
-
📊 Day 64/90 — SQL Learning: Window Functions (Introduction) Today I started learning one of the most powerful SQL concepts: 👉 Window Functions At first it looked complex… but it’s actually very useful 🔥 Here’s what I learned: ✅ Window functions perform calculations across rows ✅ Unlike GROUP BY, they don’t reduce rows ✅ Use "OVER()" clause ✅ Helps analyze data without losing details --- 🔹 Example: 👉 Show salary + average salary (without grouping) SELECT name, salary, AVG(salary) OVER() AS avg_salary FROM employees; --- 💡 Big lesson: Window functions give insights without collapsing data Because: GROUP BY → reduces rows ❌ Window Function → keeps all rows ✅ --- From today, I’m learning how to do advanced analysis without losing data 📊 💬 Have you tried window functions in SQL? #SQL #DataAnalytics #LearningInPublic #DataAnalystJourney #90DaysChallenge
To view or add a comment, sign in
-
-
Today’s SQL Learning: Functions + Wrapping Queries I spent time understanding SQL Functions deeply — not just writing them, but actually knowing where and how to use them in real queries Here’s what I explored 👇 🔹 Learned how to create reusable functions 🔹 Used functions inside different clauses: ✔ SELECT → for calculated columns ✔ WHERE → for filtering ✔ ORDER BY → for sorting ✔ GROUP BY & HAVING → for grouping & filtering data ✔ CASE → for adding logic But the most important realization today was 👇 ❌ Functions have limitations * Cannot return multiple rows * Cannot directly use INSERT / UPDATE inside them * Cannot behave like full queries 👉 That means we can’t wrap every query inside a function 👉 We must convert logic into single-value outputs 🔥 Today I feel: * More confident with SQL functions * Better understanding of when to use functions vs queries * More comfortable writing clean, reusable logic #SQL #DataAnalytics #LearningJourney #Functions #SQLPractice #Growth
To view or add a comment, sign in
-
SQL Journey — Learning ALTER Today I explored how to modify existing tables using ALTER TABLE in SQL. This is one of the most powerful commands for managing and updating database structures. Here’s what I learned: ✔️ Dropping a column ALTER TABLE employees DROP COLUMN email; ✔️ Modifying a column’s data type ALTER TABLE employees MODIFY COLUMN email VARCHAR(100); ✔️ Renaming a column ALTER TABLE employees RENAME COLUMN mail TO email_id; ✔️ Renaming a table ALTER TABLE employees RENAME TO employees_details; These operations help keep the database clean, flexible, and aligned with changing requirements. Small steps, but building strong fundamentals every day! 💡 #SQL #SQLLearning #Database #DataAnalytics #LearningJourney #100DaysOfCode #TechSkills #Beginner #KeepLearningFrontlinesFrontlines EduTech (FLM)
To view or add a comment, sign in
-
-
#Day_19 of learning SQL in 60 days Topic I covered: Understanding the HAVING Clause in SQL Recently, I learned about the HAVING clause in SQL, and it’s a great addition when working with grouped data! What is HAVING? The HAVING clause is used to filter grouped data after applying the GROUP BY clause. While WHERE filters rows before grouping, HAVING filters after grouping. Syntax: SELECT column1, aggregate_function(column2) FROM table_name WHERE condition GROUP BY column1 HAVING condition; 🔹 Example: SELECT DEPT_ID, COUNT (*) AS TOTAL FROM STAFF GROUP BY DEPT_ID HAVING COUNT (*)>2; 👉 This query returns only those departments that have more than 2 employees. 🔹 Key Points: ✔ Used with GROUP BY ✔ Works with aggregate functions like COUNT(), SUM(), AVG() ✔ Filters grouped results, not individual rows 💡 Learning how to use HAVING helps in performing advanced data analysis and extracting meaningful insights from datasets. #SQL #Database #LearningSQL #DataAnalytics #TechSkills
To view or add a comment, sign in
-
-
📊 Day 59/90 — SQL Learning: RIGHT JOIN Today I learned the opposite of LEFT JOIN: 👉 RIGHT JOIN It works similarly… but from the other side 👇 Here’s what I learned: ✅ Returns all records from right table ✅ Includes matching records from left table ✅ Non-matching data from left table → NULL ✅ Useful when right table is more important Example: 👉 Get all orders + customer details 👉 Find orders without customer info 💡 Big lesson: RIGHT JOIN focuses on right table completeness Because: Left match missing → NULL ❌ Right data always included ✅ Example Query: SELECT c.name, o.amount FROM customers c RIGHT JOIN orders o ON c.id = o.customer_id; From today, I understand how to analyze data from both sides of tables 🔄 💬 Do you use LEFT JOIN more or RIGHT JOIN? #SQL #DataAnalytics #LearningInPublic #DataAnalystJourney #90DaysChallenge
To view or add a comment, sign in
-
-
Day 13 of learning SQL 🚀 Today I learned how to use Temporary Tables in MySQL to store and reuse data during a session. This concept helped me understand how to break down complex queries and work with intermediate results more efficiently. Topics I covered: ✔ Creating temporary tables manually ✔ Inserting data into temp tables ✔ Creating temp tables directly from SELECT queries ✔ Using temp tables for filtering and analysis Example I practiced: CREATE TEMPORARY TABLE salary_over_50k AS SELECT * FROM employee_salary WHERE salary >= 50000; Key learning today 💡 Temporary tables exist only during the session They help simplify complex queries Useful when the same filtered data is needed multiple times Make SQL workflows more structured and efficient Step by step, moving towards writing cleaner and more practical SQL queries. Goal: Become job-ready in SQL & Data Analysis 💪 #SQL #DataAnalytics #LearningInPublic #100DaysOfCode #Consistency
To view or add a comment, sign in
-
-
🚀 Day 1 of My SQL Learning Journey Today I learned the basics of the SELECT statement in SQL. 👉 SELECT is used to retrieve data from a database. Basic syntax: SELECT column_name FROM table_name; ✔ SELECT * → used to get all columns ✔ SELECT column_name → used to get specific data 💡 This is the first step to working with data and understanding databases. Excited to learn more! 🔥 Next: WHERE clause 👀 #SQL #LearningJourney #Beginner #DataAnalytics #Day1 #LearnInPublic
To view or add a comment, sign in
-
Explore related topics
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