Search⌘ K

Question: Extract a Value From a Date

Explore how to extract the year value from a date column in SQL by writing queries that pinpoint the year an employee joined a company. This lesson helps you understand the use of date and time functions essential for solving real-world database challenges and SQL interview questions.

Question

Given the following EmployeesDetails table structure:

EmployeeDetails

EmpID

JobTitle

Country

DateOfJoining

1

Software Engineer

USA

2020-04-13

2

Data Analyst

Germany

2019-08-30

3

Content Writer

Holland

2024-02-29

4

Marketing Manager

Canada

2023-02-28

5

Software Engineer

USA

NULL

Additional information

You are provided with a table named Employees that contains the following columns: ...