From the course: Text to SQL: Amazon Redshift Serverless for Generative SQL in Amazon Q

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Ranking the rows on specific criteria

Ranking the rows on specific criteria

- [Instructor] Oftentimes, as data analysts and data scientists, we want to be able to extract data from databases and we want to be able to rank our rows according to a specific criteria. In this movie, we'll be focusing on the QS World University Rankings dataset. And we have attributes within the schema that includes employer reputation rank, academic reputation score, and also citation per faculty rank as well. And we'll navigate back to Amazon Redshift and we can click on the icon Amazon Q generative SQL which will allow us to access our chat pane. And we'll start with a question and we'll ask, "Write a query using window function to list the institution sorted in descending order of er score," which was employer reputation score. And we'll wait a few seconds and we can see that Amazon Q has produced the SQL code for us using a window function. And we'll add this to our notebook and we will click on Run and generate our code. So within our results set, it should be ranked…

Contents