Full Name

Tesco: Date Function

Quiz
•
Professional Development
•
Professional Development
•
Hard

Ivy Professional School
FREE Resource
8 questions
Show all answers
1.
OPEN ENDED QUESTION
2 mins • Ungraded
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;
8.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Your company is sending birthday discounts to customers whose birthdays fall in the current month. Which query is correct?
SELECT * FROM customers WHERE MONTH(birth_date) = MONTH(NOW());
SELECT * FROM customers WHERE DATE_PART('month', birth_date) = CURRENT_DATE();
SELECT * FROM customers WHERE EXTRACT(MONTH FROM birth_date) IN EXTRACT(MONTH FROM NOW());
None
Similar Resources on Quizizz
13 questions
Call Flow

Quiz
•
Professional Development
10 questions
SNAP

Quiz
•
Professional Development
10 questions
MCP P&L

Quiz
•
1st Grade - Professio...
10 questions
Email Basics

Quiz
•
10th Grade - Professi...
10 questions
JavaScript 小測驗

Quiz
•
Professional Development
10 questions
HR CA Refresher Post-Assessment | January 2025

Quiz
•
Professional Development
10 questions
Intuitive Dashboard in TallyPrime 4.0

Quiz
•
Professional Development
11 questions
Huddle Quiz

Quiz
•
Professional Development
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade