Database Management
primer-original-v2mediumDatabase Management06 Function-Scalar & Aggregateprimer-original-v2

We need to create a report to display the order id, ship date and order total of your ORDER table. If the order has not been shipped, your report must display 'Not Shipped'. If the total is not available, your report must display 'Not Available'. In the ORDER table, the SHIPDATE column has a datatype of DATE. The TOTAL column has a datatype of INT. Which statement do you use to create this report?

Answer options

A
SELECT ordid, IFNULL(shipdate, 'Not Shipped') SHIPDATE, IFNULL(total,'Not Available') TOTAL FROM order;
B
SELECT ordid, IFNULL(shipdate, 'Not Shipped') as SHIPDATE, Total FROM order;
C
SELECT ordid, TO_CHAR(shipdate, 'Not Shipped'), TO_CHAR(total,'Not Available') FROM order;
D
SELECT ordid, shipdate 'Not Shipped', total 'Not Available' FROM order;

Correct answer: SELECT ordid, IFNULL(shipdate, 'Not Shipped') SHIPDATE, IFNULL(total,'Not Available') TOTAL FROM order;

Detailed Solution & Conceptual Analysis

This question has been retained as-is due to its unique context.

Key Engineering Takeaway

In Database Management, understanding the underlying mechanics of Database Management is critical for writing performant, bug-free production code and passing rigorous technical architecture reviews.

Related Database Management questions

Practice more Database Management questions

PrimerPrep has independently reviewed practice questions and coding exercises — all free.