📢 Day 33 — Scalar Subqueries: One Value Inside Another Query A scalar subquery returns a single value. It is often used inside SELECT or WHERE clauses. 📌 Syntax SELECT column FROM table WHERE column = (subquery); 📌 Example SELECT employee_name FROM employees WHERE salary = ( SELECT MAX(salary) FROM employees ); #SQL #DataAnalytics #DataEngineering #Database #Programming #Tech #Developers #Learning #DataScience #DataAnalyst #MachineLearning #BigData #BusinessIntelligence #ETL #DataVisualization #DataWarehouse #CareerGrowth #SQLDeveloper #DatabaseDeveloper #DatabaseAdministrator #DataEngineer #BIDeveloper #SQLServer #PostgreSQL #MySQL #Oracle #Snowflake #BigQuery #SparkSQL #TechCommunity #ITProfessionals #ProfessionalGrowth #Networking #LinkedInLearningData
Scalar Subqueries: Single Value Inside SQL Query
More Relevant Posts
-
📢 Day 34 — Correlated Subqueries: Queries That Depend on Outer Query A correlated subquery runs once for each row of the outer query. It references columns from the outer query. 📌 Syntax SELECT columns FROM table1 WHERE column = ( SELECT value FROM table2 WHERE table1.column = table2.column ); 📌 Example SELECT e.employee_name FROM employees e WHERE salary > ( SELECT AVG(salary) FROM employees WHERE department_id = e.department_id ); 🛠 Practical Uses ✔️ Above-average employees ✔️ Department comparisons #SQL #DataAnalytics #DataEngineering #Database #Programming #Tech #Developers #Learning #DataScience #DataAnalyst #MachineLearning #BigData #BusinessIntelligence #ETL #DataVisualization #DataWarehouse #CareerGrowth #SQLDeveloper #DatabaseDeveloper #DatabaseAdministrator #DataEngineer #BIDeveloper #SQLServer #PostgreSQL #MySQL #Oracle #Snowflake #BigQuery #SparkSQL #TechCommunity #ITProfessionals #ProfessionalGrowth #Networking #LinkedInLearningData
To view or add a comment, sign in
-
📢 Day 31 — ROLLUP: Hierarchical Aggregation ROLLUP creates multiple levels of totals. It is useful for hierarchical summaries. 📌 Syntax SELECT column1, column2, SUM(value) FROM table GROUP BY ROLLUP(column1, column2); 📌 Example SELECT department, job_title, SUM(salary) FROM employees GROUP BY ROLLUP(department, job_title); 🛠 Practical Uses ✔️ Department totals ✔️ Subtotals in reports #SQL #DataAnalytics #DataEngineering #Database #Programming #Tech #Developers #Learning #DataScience #DataAnalyst #MachineLearning #BigData #BusinessIntelligence #ETL #DataVisualization #DataWarehouse #CareerGrowth #SQLDeveloper #DatabaseDeveloper #DatabaseAdministrator #DataEngineer #BIDeveloper #SQLServer #PostgreSQL #MySQL #Oracle #Snowflake #BigQuery #SparkSQL #TechCommunity #ITProfessionals #ProfessionalGrowth #Networking #LinkedInLearningData
To view or add a comment, sign in
-
📢 Day 30 — HAVING: Filtering Aggregated Results HAVING filters grouped data after aggregation. Unlike WHERE, it works with aggregate functions. 📌 Syntax SELECT column, aggregate_function FROM table GROUP BY column HAVING condition; 📌 Example SELECT department_id, COUNT(*) FROM employees GROUP BY department_id HAVING COUNT(*) > 5; 🛠 Practical Uses ✔️ Departments with many employees ✔️ High-sales regions #SQL #DataAnalytics #DataEngineering #Database #Programming #Tech #Developers #Learning #DataScience #DataAnalyst #MachineLearning #BigData #BusinessIntelligence #ETL #DataVisualization #DataWarehouse #CareerGrowth #SQLDeveloper #DatabaseDeveloper #DatabaseAdministrator #DataEngineer #BIDeveloper #SQLServer #PostgreSQL #MySQL #Oracle #Snowflake #BigQuery #SparkSQL #TechCommunity #ITProfessionals #ProfessionalGrowth #Networking #LinkedInLearningData
To view or add a comment, sign in
-
🚀 SQL Cheat Sheet – Quick Topics Master these core SQL concepts 👇 ✔ Introduction ✔ SQL Database ✔ Constraints ✔ Operators ✔ SQL Tables ✔ SQL Clauses ✔ SQL Conditions ✔ SQL Joins ✔ Aggregate Functions ✔ SQL Functions ✔ SQL Views ✔ SQL Indexes ✔ Stored Procedures ✔ Functions (User Defined) ✔ Triggers ✔ Miscellaneous Follow JACOB JEYAKUMAR S For more updates #SQL #DataEngineering #DataAnalytics #Database #LearnSQL #TechCareers #Developers
To view or add a comment, sign in
-
-
📢 Day 28 — Semi Join: Checking Data Existence Semi Join returns rows from the first table where matching records exist in another table. Implemented using EXISTS. 📌 Syntax SELECT columns FROM table1 WHERE EXISTS (subquery); 📌 Example SELECT customer_name FROM customers c WHERE EXISTS ( SELECT 1 FROM orders o WHERE c.customer_id = o.customer_id ); 🛠 Practical Uses ✔️ Customers who placed orders ✔️ Product availability checks #SQL #DataAnalytics #DataEngineering #Database #Programming #Tech #Developers #Learning #DataScience #DataAnalyst #MachineLearning #BigData #BusinessIntelligence #ETL #DataVisualization #DataWarehouse #CareerGrowth #SQLDeveloper #DatabaseDeveloper #DatabaseAdministrator #DataEngineer #BIDeveloper #SQLServer #PostgreSQL #MySQL #Oracle #Snowflake #BigQuery #SparkSQL #TechCommunity #ITProfessionals #ProfessionalGrowth #Networking #LinkedInLearningData
To view or add a comment, sign in
-
Structured Query language (SQL) https://lnkd.in/d9UV6Rqt #SQL #StructuredQueryLanguage #Database #DBMS #DataAnalytics #DataScience #DataEngineering #DatabaseManagement #SQLQueries #LearnSQL #SQLDeveloper #DataAnalysis #BigData #ETL #DataWarehouse #MySQL #PostgreSQL #OracleSQL #MicrosoftSQLServer #TechSkills
To view or add a comment, sign in
-
I once reviewed a stored procedure with 6 levels of nested subqueries. It took 45 minutes to understand what it was doing. The developer who wrote it had left the company. Day 18 of 60 — SQL Server from Scratch to Master. Today: Common Table Expressions — the single feature that makes complex SQL readable. A CTE does the same job as a subquery in FROM. But it has a name. And that name changes everything. Instead of reading nested parentheses from inside out, you read named steps from top to bottom — exactly how you think about a problem. Three things that make CTEs irreplaceable: they can be referenced multiple times in one query (derived tables cannot), they support recursion (subqueries cannot), and they make code reviews possible (nested subqueries do not). The rule I follow without exception: name your CTEs like nouns. ActiveEmployees. DeptSalaryStats. NewHiresThisMonth. If you cannot name it clearly in 2–3 words, you do not yet understand what it represents. Do you use CTEs in production — or are you still writing nested subqueries? ♻ Repost to help your team write SQL that humans can actually read and maintain. #SQLServer #TSQL #SQLDeveloper #LearnSQL #SQLServerFromScratch #SQLServer2019 #DatabaseDeveloper #OpenToWork #TechIndia #ITJobsIndia #HiringIndia #IndianDeveloper #LinkedInIndia #ImmediateJoiner #SQLJobs #100DaysOfCode #SQLTips #QueryOptimization #BackendDeveloper #MicrosoftSQL #CTE #CommonTableExpression #DataEngineering #SQLTutorial
To view or add a comment, sign in
-
📢 Day 29 — GROUP BY: Summarizing Data GROUP BY groups rows that have the same values. It is used with aggregate functions like SUM, COUNT, AVG. 📌 Syntax SELECT column, aggregate_function FROM table GROUP BY column; 📌 Example SELECT department_id, COUNT(*) FROM employees GROUP BY department_id; 🛠 Practical Uses ✔️ Sales per region ✔️ Employees per department #SQL #DataAnalytics #DataEngineering #Database #Programming #Tech #Developers #Learning #DataScience #DataAnalyst #MachineLearning #BigData #BusinessIntelligence #ETL #DataVisualization #DataWarehouse #CareerGrowth #SQLDeveloper #DatabaseDeveloper #DatabaseAdministrator #DataEngineer #BIDeveloper #SQLServer #PostgreSQL #MySQL #Oracle #Snowflake #BigQuery #SparkSQL #TechCommunity #ITProfessionals #ProfessionalGrowth #Networking #LinkedInLearningData
To view or add a comment, sign in
-
🚀 PL/SQL: From Queries to Code! Week 2 moving beyond "just SQL" and into the world of procedural logic. This week was all about building bulletproof database programs. 🛠️ 1. The SELECT INTO Rule 🎯 Fetch exactly one row. No more, no less. Fail Safe: Handles NO_DATA_FOUND or TOO_MANY_ROWS like a pro. 2. Smart Anchoring (%TYPE & %ROWTYPE) ⚓ Stop hardcoding data types! %TYPE: Links to a column. %ROWTYPE: Grabs the whole row. The Win: If the table changes, your code doesn't break. 🔄 3. The Logic Brain (IF/ELSIF) ⚖️ Moving from simple checks to complex business rules—calculating bonuses, classifying salaries, and handling real-world production logic. 4. The Master Build 💎 I combined everything into a single program: Fetching data ➡️ Applying logic ➡️ Calculating results ➡️ Handling exceptions. The Goal: Write code that isn't just "working," but is maintainable and exception-proof. Big shoutout to my mentor Praveen Kalimuthu and the #TechDataCommunity for pushing me toward that top 1% goal! 📈 #PLSQL #DataAnalytics #Oracle #SQL #TechDataCommunity #CareerGrowth #DataEngineering #CodingJourney #MONGODB #POWERBI #PYTHONFORDATAANALYSIS #SDLC #STLC #JIRA #DATAANALYTICS #LEARNINGJOURNEY #techdatacommunity #tdc
To view or add a comment, sign in
-
WHERE and HAVING, NOT IN and NOT EXISTS do similar things in SQL, but when should you use which? WHERE and HAVING: The main difference WHERE → works on individual rows. It is applied before GROUP BY — it filters the ‘raw’ data. HAVING → works with the results of aggregate functions (COUNT, SUM, AVG, …), in simpler terms, with groups. It is applied after GROUP BY — filtering already aggregated groups. When to use: WHERE → whenever possible (faster, reduces the volume of data in advance) HAVING → only when filtering by aggregates or by GROUP BY results is required Together, when WHERE comes before GROUP BY and HAVING comes after. NOT IN and NOT EXISTS: The main difference NOT IN → comparison with a list. Checks that the value is not in the list. But there is a critical nuance: if there is at least one NULL in the subquery, the result may be empty. The reason is the peculiarities of SQL’s three-valued logic (TRUE / FALSE / UNKNOWN). May be less efficient on large datasets. NOT EXISTS → checking for the existence of rows Checks that no row exists that satisfies the condition. Not affected by NULL values. Often optimises better (especially with indexes). When to use: Use NOT EXISTS by default if there is a subquery, NULL values are possible, and reliability is important. You can use NOT IN if you are 100% certain there are no NULL values and the list of values is simple. #Java #Backend #Developer #JavaDevelompent #Software #Programming #SQL #Relational #Database #DB #PostgreSQL #Oracle #MySQL #MariaDB
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