Tesco: Date Function

Tesco: Date Function

Professional Development

8 Qs

quiz-placeholder

Similar activities

SNAP Intake Processing Post-Test

SNAP Intake Processing Post-Test

Professional Development

10 Qs

MicroStrategy: Understanding the Reports

MicroStrategy: Understanding the Reports

Professional Development

7 Qs

IVY SQL Internship Assessment

IVY SQL Internship Assessment

Professional Development

13 Qs

Huddle 2

Huddle 2

Professional Development

10 Qs

KC 56 POD 10

KC 56 POD 10

Professional Development

10 Qs

HR CA Refresher Post-Assessment |  January 2025

HR CA Refresher Post-Assessment | January 2025

Professional Development

10 Qs

Intuitive Dashboard in TallyPrime 4.0

Intuitive Dashboard in TallyPrime 4.0

Professional Development

10 Qs

Huddle Quiz

Huddle Quiz

Professional Development

11 Qs

Tesco: Date Function

Tesco: Date Function

Assessment

Quiz

Professional Development

Professional Development

Hard

Created by

Ivy Professional School

FREE Resource

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;

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