Does KQL Order By Return Ascending No_Bikes Results?
Short answer
B The code's order by clause omits asc, so KQL sorts No_Bikes descending and does not meet the ascending-order requirement.
Question
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have a Fabric eventstream that loads data into a table named Bike_Location in a KQL database. The table contains the following columns:
BikepointID
Street
Neighbourhood
No_Bikes
No_Empty_Docks
Timestamp
You need to apply transformation and filter logic to prepare the data for consumption. The solution must return data for a neighbourhood named Sands End when No_Bikes is at least 15. The results must be ordered by No_Bikes in ascending order.
Solution: You use the following code segment:

Does this meet the goal?
Key Takeaways
The question tests whether you know KQL's order by operator defaults to descending, so any code that omits the asc keyword cannot satisfy an ascending-order requirement.
In Microsoft Fabric and Azure Data Explorer KQL, the order by (sort) operator defaults to descending order, unlike SQL's ascending default. For the Bike_Location query that must return Sands End rows with No_Bikes at least 15 sorted low-to-high, the sample code fails because it omits the explicit asc keyword, so the correct verdict is B (No).
Common mistake: Answer A (Yes) is the common wrong choice: learners transfer SQL semantics into KQL, assuming order by is ascending by default and that the filter and neighbourhood conditions alone satisfy the goal.
Expert Analysis
Why the Answer Is Correct
The stated requirement is explicit: results must be ordered by No_Bikes in ascending order. In KQL, order by (and its synonym sort by) defaults to desc, so the code segment sorts No_Bikes from high to low instead of low to high. Because the ordering clause in the exhibit contains no asc keyword, the solution does not meet one of the three mandatory conditions — filter on Sands End, No_Bikes >= 15, and ascending order. Therefore the correct verdict is B, No, since "Does this meet the goal?" requires every stated condition to hold.
Why the Other Options Are Wrong
Option A (Yes) would only be valid if KQL's default sort direction were ascending, which it is not; Microsoft's sort operator documentation states that asc sorts low to high and that the default is desc, high to low. This trap is deliberately inverted relative to T-SQL, where ORDER BY defaults to ascending, which is why learners from a SQL background误 select A. Even though the neighbourhood filter and the No_Bikes threshold may be correctly expressed in the code, a single unmet requirement — ascending ordering — makes the whole solution fail. The near-identical wording of the previous question in this series, where a correct variant presumably used an explicit asc or a different construct, further reinforces that the ordering keyword is the deciding factor.
Community Comment Notes
Multiple commenters converged on the same reasoning: benni_ale wrote "no, order by by default is desc in kql", and mauriciorosa8 confirmed that "The default sorting order in KQL is descending (desc); ascending (asc) must be explicitly specified when needed." GHill1982 pointed to Microsoft's sort-operator documentation and noted the behaviour is "the opposite of SQL," while 8d6881f quoted the parameter text "Default is desc, high to low." akmorsh highlighted that the code uses order by rather than sort by and still omits asc, and smanzana repeated "B-No, in KQL by default 'order by' is desc order." Only one dissenter, 568f95c, argued the question asks for ascending order without addressing the default, and Rozamunde noted the item is a duplicate of an earlier question in the series.
Official Reference
https://learn.microsoft.com/en-us/kusto/query/sort-operator?view=microsoft-fabric
This link opens the official vendor documentation in a new tab.
Exam Strategy
When a KQL snippet is graded against an ordering requirement, scan the sort clause first for an explicit asc or desc keyword — absence of asc means descending. Remember the KQL/SQL inversion: in SQL omission means ascending, in KQL omission means descending.
Frequently Asked Questions
Why does order by without asc fail the ascending requirement in KQL?
Is order by different from sort by in a Fabric KQL query?
Discussion 16 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 16
-
benni_ale 👍 11 Answered Bno, order by by default is desc in kql
-
GHill1982 👍 8The answer is no. The default for order by in KQL in desc therefore asc must be specified. Confusing at first as it is the opposite of SQL. https://learn.microsoft.com/en-gb/kusto/query/sort-operator?view=azure-data-explorer#parameters
-
mauriciorosa8 👍 5 Answered BThe default sorting order in KQL is descending (desc); ascending (asc) must be explicitly specified when needed.
-
Tuki93 👍 5 Answered Bdefault is desc in Kusto
-
8d6881f 👍 4 Answered Bno. In kql desc is default for sort/order by: "asc sorts into ascending order, low to high. Default is desc, high to low." https://learn.microsoft.com/en-us/kusto/query/sort-operator?view=microsoft-fabric
Show 11 more comments
-
akmorsh 👍 4 Answered BCorrect Answer: B. No 🔍 Explanation: The code is almost identical to the previous correct example, but this time it uses order by instead of sort by, and that’s the issue.
-
Rozamunde 👍 4 Answered BDuplicate of previous question
-
smanzana 👍 3 Answered BB-No, in KQL by default “order by” is desc order
-
smanzana 👍 3 Answered BB is correct
-
QAZdbarhate12345678 👍 2 Answered AThe provided solution meets the goal. Analysis: Filtering Condition: The code includes filter Neighbourhood == "Sands End" and No_Bikes >= 15, which satisfies the requirement to only include rows where the neighborhood is "Sands End" and No_Bikes is at least 15. Ordering: The order by No_Bikes clause ensures that the results are sorted by No_Bikes in ascending order, meeting the stated requirement. Projection: The project BikepointID, Street, Neighbourhood, No_Bikes, No_Empty_Docks, Timestamp ensures that the necessary columns are returned. Conclusion: The solution fulfills all the requirements. Correct Answer: A. Yes.
-
MuffiSan 👍 2 Answered Bno. In kql desc is default for sort by: "asc sorts into ascending order, low to high. Default is desc, high to low." https://learn.microsoft.com/en-us/kusto/query/sort-operator?view=microsoft-fabric
-
Bharat 👍 2 Answered Athe answer is yes since you don't have to specify the "asc" option. It is the default.
-
568f95c 👍 2 Answered AThey are asking for the order of No_Bikes in ascending order in this question
-
amli123 👍 2 Answered Bdefault is desc
-
alinavit 👍 1 Answered BTable name is case sensitive, thus bike_location (instead of Bike_location) will not work. The rest is correct
-
MuffiSan 👍 1"The sort and order operators are equivalent"
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.