Tag: SQL

HomeTagsSQL

Become a member

Get related updates from Syskool.

Date & Time Functions in SQL: NOW(), DATEDIFF(), EXTRACT() and More

Table of Contents Introduction Importance of Date and Time Functions Common Use Cases NOW() – Get Current Date and Time CURRENT_DATE and CURRENT_TIME DATEDIFF() – Difference Between Dates TIMESTAMPDIFF() in MySQL EXTRACT()...

String Functions in SQL: CONCAT, LENGTH, REPLACE and More

Table of Contents Introduction Why String Functions Matter Overview of SQL String Functions CONCAT() – Combine Strings LENGTH() – Get String Length CHAR_LENGTH() vs LENGTH() REPLACE() – Substitute Substrings UPPER() and LOWER()...

Conditional Logic with CASE Statements in SQL

Table of Contents Introduction What is a CASE Statement? Syntax of CASE Statement Simple CASE vs Searched CASE Using CASE in SELECT Using CASE in ORDER BY Using CASE in WHERE Nested...

Nested Subqueries and Derived Tables in SQL

Table of Contents Introduction What is a Nested Subquery? What is a Derived Table? Key Differences Between Nested Subqueries and Derived Tables When to Use Nested Subqueries When to Use...

Subqueries vs Joins: When to Use Each in SQL

Table of Contents Introduction What is a Subquery? What is a Join? Syntax Comparison: Subquery vs Join When to Use Subqueries When to Use Joins Types of Subqueries Types of Joins Performance Considerations Readability...

Combining Results with UNION and UNION ALL in SQL

Table of Contents Introduction What is UNION in SQL? When to Use UNION Basic Syntax of UNION What is UNION ALL? Difference Between UNION and UNION ALL Requirements for Using UNION Matching...

Creating Relationships with Foreign Keys in SQL

Table of Contents Introduction What is a Foreign Key? Importance of Foreign Keys Primary Key vs Foreign Key Syntax for Declaring a Foreign Key Creating Foreign Keys During Table Creation Adding...

Using Self-Joins in SQL

Table of Contents Introduction What is a Self-Join? When Do You Use a Self-Join? Basic Syntax of a Self-Join Real-World Example: Employees and Managers Using Table Aliases in Self-Joins Self-Join with...

Joining More Than Two Tables in SQL

Table of Contents Introduction Can We Join Multiple Tables in SQL? Why You Might Need Multi-Table Joins Basic Syntax for Joining Three Tables INNER JOIN Across Three Tables LEFT JOIN...

FULL OUTER JOIN and CROSS JOIN in SQL — Concepts and Use Cases

Table of Contents Introduction What is a FULL OUTER JOIN? Syntax of FULL OUTER JOIN When to Use FULL OUTER JOIN FULL OUTER JOIN Example Filtering with FULL OUTER JOIN Handling...

LEFT JOIN vs RIGHT JOIN in SQL — A Detailed Comparison with Examples

Table of Contents Introduction What are SQL Joins? Overview of LEFT JOIN Overview of RIGHT JOIN LEFT JOIN Syntax RIGHT JOIN Syntax Understanding Table Positioning Visualizing LEFT vs RIGHT JOIN Practical Use Case:...

INNER JOIN in SQL Explained with Examples

Table of Contents Introduction What is an INNER JOIN? Syntax of INNER JOIN How INNER JOIN Works INNER JOIN with Real Tables INNER JOIN with Aliases Filtering with INNER JOIN INNER JOIN...

Categories