
Tesco: Date Function
Authored by Ivy Professional School
Professional Development
Professional Development

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
8 questions
Show all answers
1.
OPEN ENDED QUESTION
2 mins • Ungraded
Full Name
Evaluate responses using AI:
OFF
2.
OPEN ENDED QUESTION
2 mins • Ungraded
Email ID
Evaluate responses using AI:
OFF
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which statement correctly finds the number of days between two dates in MySQL?
SELECT DAYS_BETWEEN(date1, date2);
SELECT DATE_SUB(date1, date2);
SELECT DATEDIFF(date1, date2);
SELECT DATE_DIFFERENCE(date1, date2);
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
If you want to retrieve all sales transactions that happened in the first quarter (Jan-Mar), which query should you use?
SELECT * FROM Sales WHERE MONTH(Date) IN (1, 2, 3);
SELECT * FROM Sales WHERE QUARTER(Date) = 1;
SELECT * FROM Sales WHERE EXTRACT(QUARTER FROM Date) = 1;
All of the above
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
How do you retrieve the year and month from a column named order_date?
SELECT YEAR(order_date), MONTH(order_date) FROM orders;
SELECT EXTRACT(YEAR FROM order_date), EXTRACT(MONTH FROM order_date) FROM orders;
Both
None of the above
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Your company wants to find employees who joined this year. The employees table has a column hire_date (DATE format). Which query correctly retrieves employees who joined in the current year?
SELECT * FROM employees WHERE YEAR(hire_date) = CURRENT_DATE;
SELECT * FROM employees WHERE YEAR(hire_date) = YEAR(CURRENT_DATE());
SELECT * FROM employees WHERE hire_date = GETDATE();
SELECT * FROM employees WHERE DATE_PART('year', hire_date) = NOW();
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
A banking system needs to find out the age of customers based on their birth_date. Which SQL query correctly calculates the age?
SELECT TIMESTAMPDIFF(YEAR, birth_date, CURDATE()) AS age FROM customers;
SELECT birth_date - CURRENT_DATE AS age FROM customers;
SELECT DATEDIFF(birth_date, CURDATE(), YEAR) / 365 AS age FROM customers;
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
PEC 200 quiz
Quiz
•
University - Professi...
10 questions
P-12 CARF Check in
Quiz
•
Professional Development
10 questions
Quiz 11
Quiz
•
Professional Development
13 questions
TS&E Know it all quiz
Quiz
•
Professional Development
10 questions
Product - EAE
Quiz
•
Professional Development
11 questions
Term 1 Reflection
Quiz
•
KG - Professional Dev...
10 questions
Business Networking Care 3 Topic 3.1
Quiz
•
Professional Development
11 questions
October Office Day 2021
Quiz
•
Professional Development
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade