Durga

2.6K posts

Durga banner
Durga

Durga

@AI_with_Durga

Sharing the best AI tools, tips & trends | AI enthusiast on a mission to simplify tech | Follow for daily AI updates | ๐Ÿ’Œ Collabs: [email protected]

Indiana, USA Katฤฑlฤฑm ลžubat 2026
1 Takip Edilen196 Takipรงiler
SabitlenmiลŸ Tweet
Durga
Durga@AI_with_Durgaยท
๐Ÿšจ Anthropic just showed a 24-minute workshop on how to actually do prompts for Claude. Taught by the people who built it. Free. No registration. No paywall. I've seen $300 courses that don't cover what they teach in the first 8 minutes. Watch it and bookmark it now.
English
9
13
34
512
Durga
Durga@AI_with_Durgaยท
@ai_rohitt The future of coding workflows is here.
English
0
0
0
7
Rohit
Rohit@ai_rohittยท
new coding session, zero memory of yesterday's bug, the decision from standup, or the doc i read at 2am. every single time. screenpipe fixes that. local capture, searchable, pulled into the agent automatically. feels like the actual missing piece of agentic coding, not another wrapper.
screenpipe (YC S26)@screenpipe

introducing screenpipe: it records and learns how you work and turns it into a searchable memory, SOPs, and AI agents open source, local-first, 20K+ GitHub stars, 1,900+ forks, and 130+ contributors

English
8
4
21
116.9K
Durga
Durga@AI_with_Durgaยท
๐Ÿšจ STOP wasting hours on stock market research. ๐Ÿค– Claude can now analyze stocks like a Wall Street research team โ€” for free. These 10 powerful prompts help you uncover financial insights ๐Ÿ“Š, evaluate companies ๐Ÿข, spot hidden risks โš ๏ธ, and make smarter investing decisions ๐Ÿ’ฐ without paying for expensive analyst reports. ๐Ÿ”ฅ Here are 10 Claude prompts that can replace a $100K/year stock research workflow. ๐Ÿ“Œ Perfect for: โœ… Investors โœ… Traders โœ… Finance Students โœ… Stock Market Enthusiasts ๐Ÿ”– Bookmark this thread before your next investment. ๐Ÿ’ฌ Which stock are you researching right now? Drop it in the comments ๐Ÿ‘‡ โค๏ธ Like โ€ข ๐Ÿ”„ Repost โ€ข ๐Ÿ’พ Save Follow ๐Ÿ‘‰ @AI_With_Durga for daily AI tools, prompts, and productivity hacks ๐Ÿš€ #AI #ClaudeAI #StockMarket #Investing #Finance #AITools #Trading #WealthBuilding #ArtificialIntelligence #AIWithDurga
Durga tweet media
English
4
5
14
124
Durga
Durga@AI_with_Durgaยท
@VarunSing1356 ๐Ÿ’ฏ Agreed. AI can save hours of research, but good investing still comes down to judgment, patience, and risk management. ๐Ÿ“Š๐Ÿš€
English
0
0
0
9
Varun Singh
Varun Singh@VarunSing1356ยท
@AI_with_Durga the โ€œfor freeโ€ part is the only thing here that really makes me pause. stock research still needs judgment, but faster digging would save a lot of time.
English
1
0
1
24
Durga
Durga@AI_with_Durgaยท
@ZunairaAi This is exactly the kind of content people should be seeing more of. Clear, practical, and easy to understand. Great work! ๐Ÿ‘
English
0
0
0
18
Zunaira Ai
Zunaira Ai@ZunairaAiยท
Precision FindingLost an AirPod in the couch cushions? The U1 chip has you covered. Through the Find My app, Precision Finding gives you AR arrows and exact distance to guide you to your AirPods โ€” down to the centimeter. The case can also chirp on command. โ†’ Find My app โ†’ select your AirPods โ†’ Find Nearby You will never tear apart your car again looking for one earbud.
English
3
1
22
40.6K
Zunaira Ai
Zunaira Ai@ZunairaAiยท
A GUY USED AIRPODS PRO 2 FOR 2 YEARS. HE PRESSED PLAY. HE PRESSED PAUSE. HE ANSWERED CALLS. HE SWITCHED TO NOISE CANCELLATION ON PLANES. THAT WAS IT. 4 FEATURES. ON A $249 DEVICE WITH 30+. HIS COWORKER โ€” A SOUND ENGINEER AT A RECORDING STUDIO โ€” BORROWED THEM FOR 10 MINUTES AT LUNCH. HE HANDED THEM BACK WITH A LOOK.
English
93
237
4.2K
2.5M
Durga
Durga@AI_with_Durgaยท
๐ŸšจAnthropic just showed a 24-minute workshop on how to actually do prompts for Claude. Taught by the people who built it. Free. No registration. No paywall. I've seen $300 courses that don't cover what they teach in the first 8 minutes. Watch it and bookmark it now!
English
0
0
1
42
Durga
Durga@AI_with_Durgaยท
๐Ÿš€๐Ÿค– Claude can now build your YouTube channel like MrBeastโ€™s strategy team โ€” for FREE! ๐Ÿ’ฐ๐Ÿ”ฅ ๐ŸŽฅ๐Ÿ“ˆ Here are 7 powerful prompts that can take your channel from $0 โžœ $10,000+ ๐Ÿ‘‡ โš ๏ธ (SAVE this before everyone catches on! ๐Ÿ“Œ) ๐Ÿ’ก Whether you're a beginner or an experienced creator, these prompts can help you: โœ… Find viral video ideas โœ… Write high-retention scripts โœ… Create clickable titles โœ… Design better thumbnails โœ… Grow faster โœ… Monetize smarter โœ… Scale like the pros ๐Ÿš€ ๐Ÿ”ฅ The creators who learn AI first will have the biggest advantage in 2026. ๐Ÿ“Œ Save this thread. ๐Ÿ”„ Repost to help other creators. โค๏ธ Like if you love AI. ๐Ÿ’ฌ Comment "YOUTUBE" if you want more prompts. ๐Ÿš€ Follow @AI_With_Durga for daily AI tools, prompts & growth hacks ๐Ÿค–โœจ
Durga tweet media
English
14
17
46
193
Durga
Durga@AI_with_Durgaยท
@DanKornas ๐Ÿค” Do you think AI will primarily replace repetitive tasks, or will it eventually become a true creative partner for professionals? Curious to hear your thoughts.
English
0
0
0
7
Dan Kornas
Dan Kornas@DanKornasยท
Your coding agent does not need another vague style prompt. agent-rules-books is a public GitHub repo of AGENTS.md rules / skills for Codex, Cursor, and Claude Code, distilled from classic software engineering books on refactoring, architecture, DDD, reliability, and code quality. It helps you give an agent more specific engineering judgment by turning book-backed principles into tool-agnostic Markdown rule sets you can load as skills, scoped rules, or on-demand guidance. Key features: โ€ข Book-based rule sets โ€“ includes Clean Code, Refactoring, Clean Architecture, DDIA, DDD, Release It!, and more โ€ข Three context sizes โ€“ mini for most real tasks, nano for tight context budgets, and full as the canonical reference โ€ข Agent/editor setup docs โ€“ usage guidance covers Codex, Claude Code, and Cursor workflows โ€ข Release matrix โ€“ shows lines, rule counts, and file sizes for each rule-set version โ€ข Compatibility guide โ€“ compares which book rules are complementary, overlapping, or conflicting Itโ€™s open-source (MIT license). Link in the reply ๐Ÿ‘‡
Dan Kornas tweet media
English
10
5
31
2.4K
Durga
Durga@AI_with_Durgaยท
@Samaira234 ๐Ÿš€ Fantastic post! What's the most surprising result you've achieved using this tool that made you think, "Wow, AI has come a long way"? ๐Ÿคฏ๐Ÿ‘‡
English
0
0
0
8
Samaira
Samaira@Samaira234ยท
15 sentences that will improve your thinking
Samaira tweet media
English
13
25
84
1.3K
Durga
Durga@AI_with_Durgaยท
@ShampaIslaa9va ๐Ÿ’ก I love discovering new tools like this. What's one AI tool that you think deserves much more attention but is still flying under the radar
English
0
0
0
8
Shampa
Shampa@ShampaIslaa9vaยท
Shampa tweet media
ZXX
1
12
49
1.7K
Durga
Durga@AI_with_Durgaยท
@e_opore ๐Ÿ”ฅ The competition between ChatGPT, Claude, Gemini, and Perplexity is getting intense. Which platform do you believe has improved the most over the past year? ๐Ÿ“ˆ
English
0
0
0
7
Dhanian ๐Ÿ—ฏ๏ธ
Dhanian ๐Ÿ—ฏ๏ธ@e_oporeยท
๐Ÿง Day 26/30 โ€” #Linux Modern applications are increasingly deployed in containers instead of traditional virtual machines. Containers provide lightweight, portable, and efficient environments that make software easier to develop, test, and deploy. Linux Containers โ€“ LXC, LXD, and Docker on Linux Linux is the foundation of container technology, providing the kernel features that make containers fast, secure, and resource-efficient. What Are Containers? Containers package an application together with its libraries, dependencies, and runtime environment. Unlike virtual machines, containers share the host operating system kernel, making them much lighter and faster to start. Benefits include: โ†’ Faster application deployment โ†’ Efficient resource utilization โ†’ Consistent environments across systems โ†’ Simplified application distribution โ†’ Improved scalability LXC (Linux Containers) LXC provides lightweight operating system-level virtualization. An LXC container behaves much like a complete Linux system while sharing the host kernel. Common use cases: โ†’ Development environments โ†’ Testing Linux distributions โ†’ Lightweight server virtualization Useful Command: โ†’ lxc-ls Lists available LXC containers. LXD โ€“ Container Manager LXD is a management platform built on top of LXC that simplifies container administration. Features include: โ†’ Easy container lifecycle management โ†’ Image repositories โ†’ Networking and storage management โ†’ Snapshots and backups Useful Commands: โ†’ lxc launch ubuntu:24.04 my-container Creates and starts a new Ubuntu container. โ†’ lxc list Displays running containers. Docker Docker is the world's most widely used container platform for application deployment. It packages applications into portable container images that run consistently across development, testing, and production environments. Common Commands: โ†’ docker pull nginx Downloads the Nginx image. โ†’ docker run -d -p 80:80 nginx Runs an Nginx container in the background. โ†’ docker ps Lists running containers. โ†’ docker images Displays downloaded container images. LXC vs Docker โ†’ LXC focuses on full Linux system containers. โ†’ Docker focuses on packaging and deploying individual applications. Why Containers Matter: โ†’ Simplify software deployment โ†’ Improve development workflows โ†’ Support microservices architecture โ†’ Power modern cloud platforms โ†’ Enable scalable DevOps practices Mastering LXC, LXD, and Docker gives you the skills needed to build, deploy, and manage modern Linux-based applications efficiently. ๐Ÿง Grab Linux Ebook: codewithdhanian.gumroad.com/l/hqtbxt #Linux #LinuxTutorial #Docker #LXC #LXD #Containers #DevOps #CloudComputing #OpenSource #100DaysOfCode
Dhanian ๐Ÿ—ฏ๏ธ tweet media
Dhanian ๐Ÿ—ฏ๏ธ@e_opore

๐Ÿง Day 25/30 โ€” #Linux File permissions alone aren't enough to secure a modern Linux system. Linux includes advanced security frameworks that enforce access policies, isolate applications, and record system activity for auditing. Linux Security โ€“ SELinux, AppArmor, and Auditing with auditd These security tools help protect servers against unauthorized access, privilege escalation, and configuration mistakes. SELinux (Security-Enhanced Linux) SELinux is a Mandatory Access Control (MAC) system that restricts what users, processes, and applications are allowed to accessโ€”even if traditional file permissions would permit it. Useful Commands: โ†’ sestatus Displays the current SELinux status. โ†’ getenforce Shows the current enforcement mode. SELinux Modes: โ†’ Enforcing โ€“ Security policies are actively enforced. โ†’ Permissive โ€“ Policy violations are logged but not blocked. โ†’ Disabled โ€“ SELinux is turned off. AppArmor AppArmor is another Mandatory Access Control framework used by several Linux distributions. Instead of labels, it secures applications using predefined security profiles. Useful Commands: โ†’ aa-status Displays loaded AppArmor profiles. โ†’ sudo aa-enforce profile_name Enforces a security profile. Benefits: โ†’ Application isolation โ†’ Reduced attack surface โ†’ Easier profile management on supported distributions auditd โ€“ Linux Auditing System auditd records security-related events and system activity, making it invaluable for monitoring and compliance. Examples of what it can log: โ†’ File access โ†’ User logins โ†’ Command execution โ†’ Permission changes โ†’ Security policy violations Useful Commands: โ†’ sudo systemctl status auditd Checks whether the auditing service is running. โ†’ ausearch -k login Searches audit logs for specific events. โ†’ aureport Generates audit reports from collected logs. Why Linux Security Tools Matter: โ†’ Protect critical systems from unauthorized access โ†’ Detect suspicious activity โ†’ Support compliance and auditing requirements โ†’ Strengthen server security โ†’ Reduce the impact of security breaches Best Practices: โ†’ Keep SELinux or AppArmor enabled whenever possible. โ†’ Monitor audit logs regularly. โ†’ Apply the principle of least privilege. โ†’ Keep systems updated with the latest security patches. Mastering SELinux, AppArmor, and auditd is an important step toward becoming a skilled Linux administrator, DevOps engineer, or cybersecurity professional. ๐Ÿง Grab Linux Ebook: codewithdhanian.gumroad.com/l/hqtbxt #Linux #LinuxTutorial #SELinux #AppArmor #auditd #CyberSecurity #LinuxCommands #DevOps #SystemAdministration #100DaysOfCode

English
2
25
135
6K
Durga
Durga@AI_with_Durgaยท
@dutt_ashishhh ๐Ÿค– Many people focus on AI-generated content, but I think AI-assisted thinking is even more valuable. What's your take on that? Do you agree or disagree
English
0
0
0
7
Ashish dutt
Ashish dutt@dutt_ashishhhยท
Good afternoon
Ashish dutt tweet mediaAshish dutt tweet media
English
14
4
92
55.6K
Durga
Durga@AI_with_Durgaยท
@wiliam23820a ๐Ÿ’ฌ Curious question: If a beginner had only 30 days to learn AI, what specific skills or tools would you prioritize first to get the fastest results? ๐Ÿš€
English
0
0
0
11
William AI
William AI@wiliam23820aยท
๐ŸŽฏ Ultimate App Showdown: Premium power or free gems? The smartest creators know itโ€™s not about priceโ€”itโ€™s about picking the right tool for the job. Which side are you on: #TeamPaid or #TeamFree? ๐Ÿš€ Follow for more AI tools & tech insights ๐Ÿ‘‡ @wiliam23820a
William AI tweet media
English
16
23
45
599
Durga
Durga@AI_with_Durgaยท
@PythonDvz ๐Ÿš€ One thing I've learned is that the best AI workflows often combine multiple tools together. What's your favorite AI stack at the moment and why? ๐Ÿค”
English
0
0
0
6
Durga
Durga@AI_with_Durgaยท
@KirkDBorne @SaiBysani18 ๐Ÿ”ฅ Thanks for sharing this! Have you found any unexpected use cases that weren't mentioned in the documentation but turned out to be incredibly useful? ๐Ÿ˜ฒ
English
0
0
0
7
Kirk Borne
Kirk Borne@KirkDBorneยท
16 Data Analytics Concepts For Data Scientists To Know in 2026 Source for all this information: dataleadership.biz/3ZUTYFk by @SaiBysani18 ๐…๐จ๐ฎ๐ง๐๐š๐ญ๐ข๐จ๐ง๐ฌ: 1 SQL Joins and Window Functions โ†ณ lnkd.in/dapaFjWv 2 Data Cleaning with Python (Pandas) โ†ณ lnkd.in/dzzzFBvM 3 Exploratory Data Analysis (EDA) โ†ณ lnkd.in/dPhTBNm3 4 Statistical Significance & Hypothesis Testing โ†ณ lnkd.in/d-nbprUd ๐•๐ข๐ฌ๐ฎ๐š๐ฅ๐ข๐ณ๐š๐ญ๐ข๐จ๐ง & ๐’๐ญ๐จ๐ซ๐ฒ๐ญ๐ž๐ฅ๐ฅ๐ข๐ง๐ : 5 Dashboard Design Principles โ†ณ lnkd.in/dAG2iAFj 6 Data Storytelling for Stakeholders โ†ณ lnkd.in/dXa6BmtU 7 Choosing the Right Chart Type โ†ณ lnkd.in/dWqGE9ed ๐๐ฎ๐ฌ๐ข๐ง๐ž๐ฌ๐ฌ ๐ˆ๐ฆ๐ฉ๐š๐œ๐ญ: 8 Defining KPIs and Metrics That Matter โ†ณ lnkd.in/dY85xhkB 9 Cohort Analysis โ†ณ lnkd.in/dqcPRH-v 10 Funnel Analysis โ†ณ lnkd.in/d2qgN2rm 11 A/B Testing & Experimentation โ†ณ lnkd.in/di4p3EKg ๐Œ๐จ๐๐ž๐ซ๐ง ๐“๐จ๐จ๐ฅ๐ฌ & ๐ˆ๐ง๐Ÿ๐ซ๐š๐ฌ๐ญ๐ซ๐ฎ๐œ๐ญ๐ฎ๐ซ๐ž: 12 dbt for Data Transformation โ†ณ lnkd.in/d7bszA99 13 Cloud Data Warehouses (Snowflake, BigQuery) โ†ณ lnkd.in/dh3A-QPG 14 Version Control with Git โ†ณ lnkd.in/dGucMpYm ๐€๐ˆ-๐๐จ๐ฐ๐ž๐ซ๐ž๐ ๐€๐ง๐š๐ฅ๐ฒ๐ญ๐ข๐œ๐ฌ: 15 Prompt Engineering for Data Analysis โ†ณ lnkd.in/df6pbWxB 16 Using LLMs as a Thinking Partner โ†ณ lnkd.in/dKW_vgMt
Kirk Borne tweet media
English
4
9
36
3.2K
Durga
Durga@AI_with_Durgaยท
@KirkDBorne @MIT_CSAIL ๐Ÿค– AI tools are becoming more accessible every day. Do you think we're approaching a point where AI literacy will be as important as computer literacy
English
0
0
1
11
Durga
Durga@AI_with_Durgaยท
@e_opore This tool looks powerful, but I'm curiousโ€”what are its biggest limitations right now? Understanding both strengths and weaknesses helps people make better decisions. ๐Ÿค
English
0
0
0
6
Dhanian ๐Ÿ—ฏ๏ธ
Dhanian ๐Ÿ—ฏ๏ธ@e_oporeยท
AWS INTERNET GATEWAYS EXPLAINED INTRODUCTION An AWS Internet Gateway (IGW) is a highly available networking component that enables communication between resources in a Virtual Private Cloud (VPC) and the public internet. It acts as the bridge that allows inbound and outbound internet traffic for public subnets. WHAT IS AN INTERNET GATEWAY? โ†’ A horizontally scaled, redundant, and highly available VPC component โ†’ Enables internet connectivity for AWS resources โ†’ Supports both IPv4 and IPv6 traffic โ†’ Attached directly to a single VPC WHY INTERNET GATEWAYS ARE IMPORTANT โ†’ Connect AWS resources to the internet โ†’ Enable public-facing applications โ†’ Support inbound and outbound communication โ†’ Allow users worldwide to access cloud-hosted services โ†’ Form the foundation of public networking in AWS HOW AN INTERNET GATEWAY WORKS โ†’ Internet user sends a request โ†’ Request reaches the Internet Gateway โ†’ Route Table forwards traffic to the correct public subnet โ†’ EC2 instance or Load Balancer processes the request โ†’ Response is sent back through the Internet Gateway to the user KEY COMPONENTS INVOLVED VIRTUAL PRIVATE CLOUD (VPC) โ†’ The Internet Gateway is attached to a VPC โ†’ Provides internet access for resources inside the VPC PUBLIC SUBNET โ†’ Contains resources accessible from the internet โ†’ Associated with a Route Table pointing to the Internet Gateway ROUTE TABLE โ†’ Directs internet-bound traffic to the Internet Gateway โ†’ Example Route: 0.0.0.0/0 โ†’ Internet Gateway PUBLIC IP ADDRESS โ†’ Required for EC2 instances to communicate directly with the internet โ†’ Can be automatically assigned or use an Elastic IP TRAFFIC FLOW THROUGH AN INTERNET GATEWAY โ†’ Internet User โ†’ Internet Gateway โ†’ Route Table โ†’ Public Subnet โ†’ EC2 Instance / Load Balancer โ†’ Application Response โ†’ Internet Gateway โ†’ User INTERNET GATEWAY VS NAT GATEWAY INTERNET GATEWAY โ†’ Supports inbound and outbound internet traffic โ†’ Used by public subnets โ†’ Resources require public IP addresses NAT GATEWAY โ†’ Supports outbound internet traffic only โ†’ Used by private subnets โ†’ Resources remain inaccessible directly from the internet FEATURES OF INTERNET GATEWAYS โ†’ Fully managed by AWS โ†’ Highly available and fault tolerant โ†’ Automatically scales with network traffic โ†’ No bandwidth limitations imposed by AWS โ†’ Supports IPv4 and IPv6 connectivity BEST PRACTICES โ†’ Attach only one Internet Gateway per VPC โ†’ Place internet-facing resources in public subnets โ†’ Use Security Groups to restrict instance access โ†’ Use Network ACLs for subnet-level protection โ†’ Keep databases in private subnets โ†’ Regularly review Route Tables and security configurations COMMON USE CASES WEB APPLICATIONS โ†’ Host websites accessible worldwide APPLICATION LOAD BALANCERS โ†’ Accept internet traffic and distribute requests PUBLIC APIs โ†’ Expose REST and GraphQL APIs to external users BASTION HOSTS โ†’ Securely access private EC2 instances through SSH or RDP REAL-WORLD INTERNET GATEWAY ARCHITECTURE โ†’ Internet User โ†’ Route 53 DNS โ†’ Route 53 โ†’ Internet Gateway โ†’ Internet Gateway โ†’ Public Subnet โ†’ Public Subnet โ†’ Application Load Balancer โ†’ Load Balancer โ†’ EC2 Instances โ†’ EC2 โ†’ Private Database Subnet COMMON MISCONCEPTIONS โ†’ Internet Gateway does not perform firewall functions โ†’ Internet Gateway does not assign public IP addresses โ†’ Simply attaching an Internet Gateway does not make resources public โ†’ Route Tables and public IP addresses are also required WHY INTERNET GATEWAYS MATTER โ†’ Enable public internet connectivity โ†’ Support scalable web applications โ†’ Simplify cloud networking โ†’ Work seamlessly with Route Tables and Security Groups โ†’ Essential for internet-facing AWS architectures Grab AWS EBOOK codewithdhanian.gumroad.com/l/tbpasf
Dhanian ๐Ÿ—ฏ๏ธ tweet media
English
3
27
77
3.8K
Durga
Durga@AI_with_Durgaยท
@e_opore ๐Ÿš€ Great recommendation! If you could only keep three AI tools for the next year and remove all others, which three would make your list and why
English
0
0
0
5
Dhanian ๐Ÿ—ฏ๏ธ
Dhanian ๐Ÿ—ฏ๏ธ@e_oporeยท
๐——๐—ฎ๐˜† ๐Ÿฎ๐Ÿด/๐Ÿฒ๐Ÿฌ ๐—ผ๐—ณ ๐—ฆ๐—ค๐—Ÿ ๐—ฆ๐—ฒ๐—ฟ๐—ถ๐—ฒ๐˜€ โ€” ๐—–๐—ผ๐—บ๐—บ๐—ผ๐—ป ๐—ง๐—ฎ๐—ฏ๐—น๐—ฒ ๐—˜๐˜…๐—ฝ๐—ฟ๐—ฒ๐˜€๐˜€๐—ถ๐—ผ๐—ป๐˜€ (๐—–๐—ง๐—˜๐˜€) โ€“ ๐—ช๐—œ๐—ง๐—› ๐—–๐—น๐—ฎ๐˜‚๐˜€๐—ฒ ๐—•๐—ฎ๐˜€๐—ถ๐—ฐ๐˜€ As SQL queries become more complex, they can quickly become difficult to read and maintain. Common Table Expressions (CTEs) help organize queries into smaller, reusable, and more readable parts. Todayโ€™s lesson introduces one of the most valuable features for writing clean SQL ๐Ÿ‘‡ 1๏ธโƒฃ ๐—ช๐—ต๐—ฎ๐˜ ๐—ถ๐˜€ ๐—ฎ ๐—–๐—ง๐—˜? A Common Table Expression (CTE) is a temporary named result set that exists only for the duration of a query. It is created using the WITH clause. 2๏ธโƒฃ ๐—•๐—ฎ๐˜€๐—ถ๐—ฐ ๐—–๐—ง๐—˜ ๐—ฆ๐˜†๐—ป๐˜๐—ฎ๐˜… Example: WITH department_totals AS ( SELECT department, SUM(salary) AS total_salary FROM employees GROUP BY department ) SELECT * FROM department_totals; The CTE is defined first, then referenced like a regular table. 3๏ธโƒฃ ๐—ช๐—ต๐˜† ๐˜‚๐˜€๐—ฒ ๐—–๐—ง๐—˜๐˜€? CTEs help you: โ€ข Improve readability โ€ข Break large queries into logical steps โ€ข Eliminate repeated subqueries โ€ข Simplify maintenance 4๏ธโƒฃ ๐—–๐—ง๐—˜๐˜€ ๐—ฎ๐—ฟ๐—ฒ ๐˜๐—ฒ๐—บ๐—ฝ๐—ผ๐—ฟ๐—ฎ๐—ฟ๐˜† A CTE exists only while the query is executing. It is not permanently stored in the database. 5๏ธโƒฃ ๐—–๐—ง๐—˜๐˜€ ๐—ฐ๐—ฎ๐—ป ๐—ฏ๐—ฒ ๐—ฟ๐—ฒ๐—ณ๐—ฒ๐—ฟ๐—ฒ๐—ป๐—ฐ๐—ฒ๐—ฑ ๐—บ๐˜‚๐—น๐˜๐—ถ๐—ฝ๐—น๐—ฒ ๐˜๐—ถ๐—บ๐—ฒ๐˜€ Once defined, the CTE can be used several times within the same query. Example: WITH employee_data AS ( SELECT * FROM employees ) SELECT COUNT(*) FROM employee_data; 6๏ธโƒฃ ๐—–๐—ง๐—˜๐˜€ ๐—ฐ๐—ฎ๐—ป ๐—ฟ๐—ฒ๐—ฝ๐—น๐—ฎ๐—ฐ๐—ฒ ๐—ฑ๐—ฒ๐—ฟ๐—ถ๐˜ƒ๐—ฒ๐—ฑ ๐˜๐—ฎ๐—ฏ๐—น๐—ฒ๐˜€ Instead of nesting subqueries inside the FROM clause, you can move them into a CTE for improved readability. This makes complex queries easier to understand. 7๏ธโƒฃ ๐— ๐˜‚๐—น๐˜๐—ถ๐—ฝ๐—น๐—ฒ ๐—–๐—ง๐—˜๐˜€ ๐—ถ๐—ป ๐—ผ๐—ป๐—ฒ ๐—พ๐˜‚๐—ฒ๐—ฟ๐˜† You can define more than one CTE by separating them with commas. Example: WITH departments AS ( SELECT * FROM department ), employees AS ( SELECT * FROM employee ) SELECT * FROM departments; This allows you to organize complex logic into separate building blocks. 8๏ธโƒฃ ๐—–๐—ง๐—˜๐˜€ ๐˜„๐—ผ๐—ฟ๐—ธ ๐˜„๐—ฒ๐—น๐—น ๐˜„๐—ถ๐˜๐—ต ๐—๐—ข๐—œ๐—ก๐˜€ Example: WITH department_stats AS ( SELECT department_id, AVG(salary) AS avg_salary FROM employees GROUP BY department_id ) SELECT d.department_name, s.avg_salary FROM departments d JOIN department_stats s ON d.department_id = s.department_id; 9๏ธโƒฃ ๐—–๐—ง๐—˜๐˜€ ๐—ถ๐—บ๐—ฝ๐—ฟ๐—ผ๐˜ƒ๐—ฒ ๐—บ๐—ฎ๐—ถ๐—ป๐˜๐—ฎ๐—ถ๐—ป๐—ฎ๐—ฏ๐—ถ๐—น๐—ถ๐˜๐˜† Breaking large SQL statements into named sections makes queries easier to debug, review, and modify as applications grow. ๐Ÿ”Ÿ ๐—–๐—ง๐—˜๐˜€ ๐—ฎ๐—ฟ๐—ฒ ๐˜๐—ต๐—ฒ ๐—ณ๐—ผ๐˜‚๐—ป๐—ฑ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ณ๐—ผ๐—ฟ ๐—ฎ๐—ฑ๐˜ƒ๐—ฎ๐—ป๐—ฐ๐—ฒ๐—ฑ ๐—ฆ๐—ค๐—Ÿ Recursive queries, hierarchical data, and many advanced reporting techniques rely on CTEs. Mastering the WITH clause prepares you for these more advanced topics. ๐Ÿ’ก ๐—ž๐—ฒ๐˜† ๐˜๐—ฎ๐—ธ๐—ฒ๐—ฎ๐˜„๐—ฎ๐˜†: CTEs, created with the WITH clause, provide temporary named result sets that make SQL queries cleaner, more modular, and easier to maintain. They're an excellent alternative to deeply nested subqueries and an essential skill for writing professional SQL. Grab SQL Playbook: codewithdhanian.gumroad.com/l/hjmix Do you prefer using CTEs or nested subqueries when writing complex SQL queries?
Dhanian ๐Ÿ—ฏ๏ธ tweet media
Dhanian ๐Ÿ—ฏ๏ธ@e_opore

๐——๐—ฎ๐˜† ๐Ÿฎ๐Ÿณ/๐Ÿฒ๐Ÿฌ ๐—ผ๐—ณ ๐—ฆ๐—ค๐—Ÿ ๐—ฆ๐—ฒ๐—ฟ๐—ถ๐—ฒ๐˜€ โ€” ๐—ฆ๐˜‚๐—ฏ๐—พ๐˜‚๐—ฒ๐—ฟ๐—ถ๐—ฒ๐˜€ ๐—ถ๐—ป ๐—ฆ๐—˜๐—Ÿ๐—˜๐—–๐—ง ๐—ฎ๐—ป๐—ฑ ๐—™๐—ฅ๐—ข๐—  โ€“ ๐——๐—ฒ๐—ฟ๐—ถ๐˜ƒ๐—ฒ๐—ฑ ๐—ง๐—ฎ๐—ฏ๐—น๐—ฒ๐˜€ Subqueries aren't limited to the WHERE clause. You can also use them in the SELECT list to calculate values and in the FROM clause to create temporary result sets known as derived tables. These techniques make complex SQL queries cleaner, more modular, and easier to maintain. Todayโ€™s lesson explores these advanced subquery patterns ๐Ÿ‘‡ 1๏ธโƒฃ ๐—ฆ๐˜‚๐—ฏ๐—พ๐˜‚๐—ฒ๐—ฟ๐—ถ๐—ฒ๐˜€ ๐—ถ๐—ป ๐˜๐—ต๐—ฒ ๐—ฆ๐—˜๐—Ÿ๐—˜๐—–๐—ง ๐—ฐ๐—น๐—ฎ๐˜‚๐˜€๐—ฒ A subquery in the SELECT clause returns a value for each row produced by the outer query. Example: SELECT name, ( SELECT COUNT(*) FROM orders WHERE orders.customer_id = customers.customer_id ) AS total_orders FROM customers; This displays each customer alongside the number of orders they have placed. 2๏ธโƒฃ ๐—ฆ๐—˜๐—Ÿ๐—˜๐—–๐—ง ๐˜€๐˜‚๐—ฏ๐—พ๐˜‚๐—ฒ๐—ฟ๐—ถ๐—ฒ๐˜€ ๐—ฐ๐—ฎ๐—ป ๐—ฏ๐—ฒ ๐—ฐ๐—ผ๐—ฟ๐—ฟ๐—ฒ๐—น๐—ฎ๐˜๐—ฒ๐—ฑ The inner query can reference values from the current row of the outer query. This allows SQL to calculate row-specific values dynamically. 3๏ธโƒฃ ๐—ช๐—ต๐—ฎ๐˜ ๐—ถ๐˜€ ๐—ฎ ๐——๐—ฒ๐—ฟ๐—ถ๐˜ƒ๐—ฒ๐—ฑ ๐—ง๐—ฎ๐—ฏ๐—น๐—ฒ? A derived table is a subquery placed inside the FROM clause. Its result behaves like a temporary table that can be queried further. 4๏ธโƒฃ ๐——๐—ฒ๐—ฟ๐—ถ๐˜ƒ๐—ฒ๐—ฑ ๐—ง๐—ฎ๐—ฏ๐—น๐—ฒ ๐—˜๐˜…๐—ฎ๐—บ๐—ฝ๐—น๐—ฒ SELECT department, average_salary FROM ( SELECT department, AVG(salary) AS average_salary FROM employees GROUP BY department ) AS dept_stats; The outer query works with the aggregated results as though they came from a regular table. 5๏ธโƒฃ ๐——๐—ฒ๐—ฟ๐—ถ๐˜ƒ๐—ฒ๐—ฑ ๐—ง๐—ฎ๐—ฏ๐—น๐—ฒ๐˜€ ๐—บ๐˜‚๐˜€๐˜ ๐—ต๐—ฎ๐˜ƒ๐—ฒ ๐—ฎ๐—ป ๐—ฎ๐—น๐—ถ๐—ฎ๐˜€ Every subquery in the FROM clause requires a table alias. Example: FROM ( ... ) AS dept_stats; Without an alias, most SQL databases will return an error. 6๏ธโƒฃ ๐—ช๐—ต๐˜† ๐˜‚๐˜€๐—ฒ ๐——๐—ฒ๐—ฟ๐—ถ๐˜ƒ๐—ฒ๐—ฑ ๐—ง๐—ฎ๐—ฏ๐—น๐—ฒ๐˜€? Derived tables help: โ€ข Simplify complex queries โ€ข Break large problems into smaller steps โ€ข Reuse calculated results โ€ข Improve query readability 7๏ธโƒฃ ๐—–๐—ผ๐—บ๐—ฏ๐—ถ๐—ป๐—ถ๐—ป๐—ด ๐——๐—ฒ๐—ฟ๐—ถ๐˜ƒ๐—ฒ๐—ฑ ๐—ง๐—ฎ๐—ฏ๐—น๐—ฒ๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—๐—ข๐—œ๐—ก๐˜€ Derived tables can be joined with other tables. Example: SELECT d.department, d.average_salary, m.manager_name FROM ( SELECT department, AVG(salary) AS average_salary FROM employees GROUP BY department ) AS d JOIN managers m ON d.department = m.department; 8๏ธโƒฃ ๐—ฆ๐—˜๐—Ÿ๐—˜๐—–๐—ง ๐˜€๐˜‚๐—ฏ๐—พ๐˜‚๐—ฒ๐—ฟ๐—ถ๐—ฒ๐˜€ ๐˜ƒ๐˜€. ๐——๐—ฒ๐—ฟ๐—ถ๐˜ƒ๐—ฒ๐—ฑ ๐—ง๐—ฎ๐—ฏ๐—น๐—ฒ๐˜€ SELECT subqueries return individual values. Derived tables return complete result sets that can be filtered, joined, and sorted. 9๏ธโƒฃ ๐—ช๐—ต๐—ฒ๐—ป ๐˜๐—ผ ๐˜‚๐˜€๐—ฒ ๐˜๐—ต๐—ฒ๐—บ Common use cases include: โ€ข Customer order summaries โ€ข Department salary reports โ€ข Sales analytics โ€ข Ranking and reporting โ€ข Preparing intermediate datasets ๐Ÿ”Ÿ ๐——๐—ฒ๐—ฟ๐—ถ๐˜ƒ๐—ฒ๐—ฑ ๐—ง๐—ฎ๐—ฏ๐—น๐—ฒ๐˜€ ๐—ฎ๐—ฟ๐—ฒ ๐—ฎ ๐˜€๐˜๐—ฒ๐—ฝ ๐˜๐—ผ๐˜„๐—ฎ๐—ฟ๐—ฑ ๐—–๐—ง๐—˜๐˜€ Understanding derived tables makes it much easier to learn Common Table Expressions (CTEs), which offer an even cleaner way to structure complex SQL queries. ๐Ÿ’ก ๐—ž๐—ฒ๐˜† ๐˜๐—ฎ๐—ธ๐—ฒ๐—ฎ๐˜„๐—ฎ๐˜†: Subqueries can appear in the SELECT clause to calculate row-level values and in the FROM clause as derived tables. These techniques help organize complex queries into smaller, reusable components, making your SQL easier to read and maintain. Grab SQL Playbook: codewithdhanian.gumroad.com/l/hjmix Do you prefer using derived tables or Common Table Expressions (CTEs) when writing complex SQL queries?

English
6
5
42
4K