Home › coding › sql › sql date functions

Sql Date Functions — Free Sql Tutorial

Learn Sql Date Functions in Sql with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.

✓ 100% Free ✓ No Login Needed ✓ NCERT / CBSE Aligned ✓ Download as PDF

TL;DR: Learn Sql Date Functions in Sql with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.

Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated Jul 14, 2026

🤖 Stuck on any question? Ask Syllab's free AI Tutor for a step-by-step explanation — instant, unlimited, no login.

Sql Date Functions in Sql

SQL has rich date/time functions: NOW() returns current timestamp, CURDATE() returns today's date, YEAR/MONTH/DAY() extract parts, DATEDIFF() computes difference in days.

DATE_ADD(date, INTERVAL n unit) adds time: DATE_ADD(NOW(), INTERVAL 7 DAY) = one week from now. DATE_SUB subtracts.

DATE_FORMAT(date, format) formats dates: DATE_FORMAT(order_date, "%d %M %Y") → "15 January 2025".

Filtering by date: WHERE order_date >= "2025-01-01" AND order_date < "2026-01-01" selects all 2025 orders. Use BETWEEN for inclusive ranges.

Sql Date Functions — Syntax

SELECT NOW()                        -- current timestamp
SELECT CURDATE()                    -- today's date
SELECT YEAR(date_col)               -- extract year
SELECT DATEDIFF(end_date, start_date)  -- days between
SELECT DATE_ADD(date, INTERVAL 30 DAY)
SELECT DATE_FORMAT(date, '%d %M %Y')  -- "15 

Learn Sql Date Functions step by step with Syllab's free interactive Sql tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full Sql course →

Explore:

  • Syllabus
  • Practice
  • Mock Tests
  • NCERT Solutions
  • Coding
  • GK Quiz
  • Career Predictor
  • AI Tutor
  • Live Quiz
  • Doubt Solver
  • Microlearning
  • Free Alternatives
  • Kids Zone
  • Study Room
  • Calculators
  • Worksheets

Syllab.in — Free learning for Indian students, Class 1–12