SQL Date Function
1.Which function returns current system date?
-
A. GETDATE()
-
B. CURRENT_DATE
-
C. NOW()
-
D. All of the above
All of the above
All of the above
2.What does DATEADD do?
-
A. Adds date to a column
-
B. Adds interval to a date
-
C. Multiplies dates
-
D. Sorts dates
Adds interval to a date
Adds interval to a date
3.Which function extracts the year from a date?
-
A. EXTRACT(YEAR FROM date)
-
B. DATEPART(YEAR, date)
-
C. YEAR(date)
-
D. All of the above
All of the above
All of the above
4.DATEDIFF('2024-01-01', '2023-12-25') returns:
-
A. 7
-
B. -7
-
C. 6
-
D. 1
7
7
5.Which function returns only the day part of a date?
-
A. DAY()
-
B. GETDAY()
-
C. DATE_DAY()
-
D. PARTDAY()
DAY()
DAY()