惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Exploit Database - CXSecurity.com
G
Google Developers Blog
爱范儿
爱范儿
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 叶小钗
C
Check Point Blog
F
Fortinet All Blogs
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
博客园 - 【当耐特】
Jina AI
Jina AI
T
The Blog of Author Tim Ferriss
P
Palo Alto Networks Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LINUX DO - 热门话题
M
MIT News - Artificial intelligence
Vercel News
Vercel News
博客园 - 司徒正美
Recorded Future
Recorded Future
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Webroot Blog
Webroot Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
云风的 BLOG
云风的 BLOG
D
DataBreaches.Net
Y
Y Combinator Blog
J
Java Code Geeks
B
Blog
A
About on SuperTechFans
O
OpenAI News
aimingoo的专栏
aimingoo的专栏
T
Tor Project blog
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - Franky
AWS News Blog
AWS News Blog
GbyAI
GbyAI
Application and Cybersecurity Blog
Application and Cybersecurity Blog
IT之家
IT之家
V
V2EX
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
大猫的无限游戏
大猫的无限游戏
Help Net Security
Help Net Security
W
WeLiveSecurity
C
Cyber Attacks, Cyber Crime and Cyber Security

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Understanding SQL Joins and SQL Functions, CTEs and Subqueries.
Joseous Ng'a · 2026-05-06 · via DEV Community

As my journey in becoming a competent data analytics, my SQL knowledge continues to deepen and as a result, I also publish few things pick up through the process.
couple of weeks back I published about SQL fundamentals, covering that is DDL, DML and Data Manipulation. Read more about SQL fundamentals from this link Click here to visit dev.to.

Building on SQL skills and data analysis, I have come to know you can work on different tables at the same time through the help of SQL joins and SQL Functions.

What is Join?

A JOIN in SQL is used to link or combine rows from two or more tables based on related column between them and it is usually a Primary Key and Foreign Key.
Think of it like, one table has students and another has scores, JOIN will help you see which student took which course.

Types of Joins

  • LEFT JOIN (LEFT OUTER JOIN) This type of returns all records from Left table and matching records from the right table

Example:

SELECT s.name, c.course_name
FROM students s
LEFT JOIN courses c
ON s.course_id = c.id;

Enter fullscreen mode Exit fullscreen mode

All students appear, even if they are not assigned a course.

INNER JOIN
This type of JOIN returns only matching records from both tables.

Example:

SELECT s.name, c.course_name
FROM students s
INNER JOIN courses c
ON s.course_id = c.id;

Enter fullscreen mode Exit fullscreen mode

RIGHT JOIN (RIGHT OUTER JOIN)
The JOIN returns all records from the right table and matching ones from the left.

Example

SELECT s.name, c.course_name
FROM students s
RIGHT JOIN courses c
ON s.course_id = c.id;

Enter fullscreen mode Exit fullscreen mode

All courses appear, even if no student is enrolled.

FULL JOIN(FULL OUTER JOIN)
This type of JOIN returns all records when there is a match in either table.

Example:

SELECT s.name, c.course_name
FROM students s
FULL JOIN courses c
ON s.course_id = c.id;

Enter fullscreen mode Exit fullscreen mode

  • JOINs are about relationships between tables
  • Without JOINs, databases would be much less powerful

SQL Window Functions

What are Window Functions?
Window functions are used to calculate across rows without collapsing them.

Example:

SELECT name, department, salary,
       AVG(salary) OVER (PARTITION BY department) AS avg_salary
FROM employees;

Enter fullscreen mode Exit fullscreen mode

The output from this query, every employee still appears, which also includes department average.

SQL functions Every Beginner Should Know

COUNT():

The function counts rows present in a given table.

Example:

SELECT COUNT(*) FROM students;

Enter fullscreen mode Exit fullscreen mode

Counts total number of students

SUM():

This function is used to add numeric values.

Example:

SELECT SUM(salary) FROM employees;

Enter fullscreen mode Exit fullscreen mode

This will get the total salary.

AVERAGE():

The function is used to get Average values like school exam result performance.

Example:

SELECT AVG(marks) FROM exams;

Enter fullscreen mode Exit fullscreen mode

The output will give the average marks.

UPPER()/LOWER():

The function is used to get or change text case,
UPPER() is used to change text into upper case while
LOWER() is used to change text into lower case.

Example:

SELECT 
   UPPER(first_name),
   LOWER(last_name) 
FROM students;

Enter fullscreen mode Exit fullscreen mode

The student's first name will be in upper case and second name will be in lower case.

NOW()/CURRENT_DATE():
This function is used to get current date or time. It is useful when filtering recent records.

Example:

SELECT CURRENT_DATE;

Enter fullscreen mode Exit fullscreen mode

In SQL functions are many, the highlighted functions are most common and every beginner should know and understand how they work in order to ease the work as data analysts, data engineer or scientist.

SQL Subqueries

What is Subquery in SQL:
A Subquery is a query written inside another SQL Query, It executes first and its result is used by the outer query.

Example:

SELECT name, salary
FROM employees
WHERE salary > (
    SELECT AVG(salary)
    FROM employees
);

Enter fullscreen mode Exit fullscreen mode

  • The inner query calculates average salary and the outer query compares the employee's salary against average

Types of Subquery
We have different types of subqueries, they include;

Scalar Subquery: It is used to return single value.

Example:

SELECT *
FROM products
WHERE price > (
    SELECT AVG(price)
    FROM products
);

Enter fullscreen mode Exit fullscreen mode

Multiple-row Subquery: This subquery returns multiple rows as its name suggests.

Example:

SELECT name
FROM employees
WHERE department_id IN (
    SELECT id
    FROM departments
);

Enter fullscreen mode Exit fullscreen mode

Correlated Subquery: This query references one or more columns from the outer(main) query, it depends on the outer query.

Example:

SELECT e1.name, e1.salary
FROM employees e1
WHERE salary > (
    SELECT AVG(e2.salary)
    FROM employees e2
    WHERE e1.department = e2.department
);

Enter fullscreen mode Exit fullscreen mode

The query compares each employee to the average salary in their department.

Common Table Expression (CTE)

What is CTE?
A CTE (Common Table expression) is a temporary named result set created using the With clause.
CTE makes query easier to organize and read.

Example: same query using a CTE

WITH avg_salary AS (
    SELECT AVG(salary) AS avg_sal
    FROM employees
)

SELECT name, salary
FROM employees
WHERE salary > (
    SELECT avg_sal
    FROM avg_salary
);

Enter fullscreen mode Exit fullscreen mode

Reasons for using CTEs

  • The need for better readability
  • Simply complex queries
  • The need for organized structure
  • If you need to reuse intermediate results

CTE with Multiple Steps
One advantage of CTEs is chaining logic

Example: Monthly sales analysis

WITH monthly_sales AS (
    SELECT
        DATE_TRUNC('month', sale_date) AS month,
        SUM(amount) AS revenue
    FROM sales
    GROUP BY month
),

ranked_sales AS (
    SELECT *,
           RANK() OVER (ORDER BY revenue DESC) AS sales_rank
    FROM monthly_sales
)

SELECT *
FROM ranked_sales;

Enter fullscreen mode Exit fullscreen mode

This will calculate monthly revenue, rank months by revenue and return final results.

SQL Learning Roadmap for a Beginner

SQL Fundamentals

  • JOINs
  • Group BY
  • Window Functions
  • SQL Functions
  • Subqueries
  • CTEs

These will be core concepts needed for:

  • Preparing for SQL technical interview
  • Writing quality SQL scripts
  • Dashboard preparation for tools like Ms Power BI
  • Data analysis

Conclusion

Since now as a data scientist, data manipulation and analysis is easier now that I have learnt and understood SQL Functions, Window Function and also Joins.

Also the use of CTEs and Subquery makes SQL query to be easier to read and organization.
Note: If a subquery starts to become difficult to read, convert it into a CTE