3. Maximum Distance
A ride hailing company has their DB structured in 3 major tables as described in the SCHEMA section below.
Write a query to fetch the top 100 users who traveled the most distance using the service. The output should be stru
users.name distance_traveled
Sort the output by distance traveled in descending order, then by the user name in ascending order. Show only the top 100 users,
ignoring the ties at the last position.
Note: There could be multiple users with the same name but they will have different IDs.
Schema
You are provided 3 tables: CITIES, USERS, and RIDES.
CITIES
Name Type
Description
id
String The assigned ID to the city presented as 32 character UUID.
name
String The name

Respuesta :

A query to fetch the top 100 users who traveled the most distance using the service is SQL COUNT(column_name) Syntax. The COUNT(column_name) feature returns a variety of values.

Which question can fetch statistics from consumer desk and taken care of ascending ORDER BY first name?

The ORDER BY assertion in SQL is used to type the fetched records in both ascending or descending consistently with one or greater columns. By default ORDER BY kinds the records in ascending order. We can use the keyword DESC to type the records in descending order and the key-word ASC to type in ascending order.

  1. SQL COUNT(column_name) Syntax. The COUNT(column_name) feature returns the variety of values (NULL values will now no longer be counted) of the desired column:
  2. SQL COUNT() Syntax. The COUNT() feature returns a variety of statistics in a desk:
  3. SQL COUNT(DISTINCT column_name) Syntax.
  4. The SQL ORDER BY Keyword.

Read more about the keyword:

https://brainly.com/question/25110079

#SPJ1