Correctly applying different date functions
It's time to combine your knowledge on date functions!
In this exercise, you are going to extract information about each voter and the first time they voted. In the voters table, the date of the first vote is stored in the first_vote_date column.
You will use several date functions, like: DATENAME(), DATEDIFF(), YEAR(), GETDATE().
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Functions for Manipulating Data in SQL Server
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
SELECT
first_name,
last_name,
birthdate,
first_vote_date,
-- Find out on which day of the week each participant voted
___(___, ___) AS first_vote_weekday
FROM voters;