Question
. Write a SELECT statement that returns these columns from the Orders table: The order_date column (four screenshots) a. A column that uses the DATE_FORMAT
. Write a SELECT statement that returns these columns from the Orders table: The order_date column (four screenshots) a.
A column that uses the DATE_FORMAT function to return the four-digit year thats stored in the order_date column
b. A column that uses the DATE_FORMAT function to return the order_date column in this format: Mon-DD-YYYY. In other words, use abbreviated months and separate each date component with dashes.
c. A column that uses the DATE_FORMAT function to return the order_date column with only the hours and minutes on a 12-hour clock with an am/pm indicator
d. A column that uses the DATE_FORMAT function to return the order_date column in this format: MM/DD/YY HH:MM. In other words, use two-digit months, days, and years and separate them by slashes. Use 2-digit hours and minutes on a 24-hour clock. And use leading zeros for all date/time components.
3. Write a SELECT statement that returns these columns from the Orders table: (two screenshots if you do the extra credit)
a. The card_number column
b. The length of the card_number column
c. The last four digits of the card_number column
d. When you get that working right, add the columns that follow to the result set. This is more difficult because these columns require the use of functions within functions. A column that displays the last four digits of the card_number column in this format: XXXX-XXXX-XXXX-1234. In other words, use Xs for the first 12 digits of the card number and actual numbers for the last four digits of the number
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started