Databases Reporting with SQL Date and Time Functions Formatting Dates and Times

Arush Sharma
Arush Sharma
2,513 Points

This is the error message when I try to execute my query - " Your query retrieve the dates in the correct format (%m/%Y)

In a movies database we have a movies table. It has the columns of id, title, date_released and genre.

Write a query that returns the title first and the month and year it was released alias as month_year_released. Dates should look like "04/1983" for April 1983.

Can you please explain the solution?

devina christabela
devina christabela
12,525 Points

As the challenge said, you have 4 columns id, title, date_released, and genre

  • create the query to select title and the date_released from the table movies
  • modify the query to show alias of the date_released column as month_year_released
  • modify the query to change the date format of column date_released with format month/year, syntax clue on DATE_FORMAT, %m is to get the month value with 2 digit like 01, and %Y to get year value with 4 digit like 2020