QuestionQ10

VerifiedDatabase Fundamentals

Given the following customer table:

Question Image

Which ORM snippet would return the ID, state, and country for every customer, with the newest customers listed first?

Explanation

Descending ordering on First_Purchase_Date places the most recent date before older dates. SQLAlchemy supports this with Select.order_by(Customer.First_Purchase_Date.desc()), while still selecting only the ID, state, and country columns.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!