Data Interview Qs - Closest class scores

InterviewQs

Closest class scores

SQL Database Querying Cross Join

Forward this email to a friend or colleague and challenge them to solve it.

Hi, 

Suppose you are given a table containing students and their corresponding test scores:

Table: class_scores

student_id name score
1 John 95
2 Christy 98
3 Rita 87
4 Gilberto 55
5 Perry 80
6 Darlene 72
7 Raquel 68
8 Chris 88

Using the table, write a SQL query to return the two students with the closest test scores (absolute value).

You can view/query these tables in an interactive SQL fiddle here.



 

You’ve accumulated 309 questions since joining our email list. Create a premium account to access detailed solutions to each problem (including this one) + our new Case studies.


Was this email forwarded to you? You can join our list here to receive questions

How did you like today's question?

15411 Boischatel, Montreal, QC, H9H1Y7, Canada
Don't want to get these emails anymore? We'll forgive you if you unsubscribe

Key phrases

Older messages

Surveying class cheaters

Monday, June 20, 2022

Python, Bayes' Theorem, Binomial Distribution, Algorithms, PyMC3, InterviewQs Surveying class cheaters Python Bayes' Theorem Binomial Distribution Algorithms PyMC3 Forward this email to a

Maximum sliding subarrays

Friday, June 17, 2022

Python, Data Structures, Arrays, Algorithms, InterviewQs Maximum sliding subarrays Python Data Structures Arrays Algorithms Forward this email to a friend or colleague and challenge them to solve it.

Logic behind the stationary distribution

Friday, June 17, 2022

Python, Stochastic Process, Markov Chains, Linear Algebra, InterviewQs Logic behind the stationary distribution Python Stochastic Process Markov Chains Linear Algebra Forward this email to a friend or

Consecutive increases in annual earnings

Monday, June 13, 2022

SQL, Database Querying, Window Function, Lead Function, InterviewQs Consecutive increases in annual earnings SQL Database Querying Window Function Lead Function Forward this email to a friend or

Growth rate of US States

Friday, June 10, 2022

Python, Pandas, Merging Dataframes, Data Structures, External Dataset, InterviewQs Growth rate of US States Python Pandas Merging Dataframes Data Structures External Dataset Forward this email to a

You Might Also Like

Data Science Weekly - Issue 540

Friday, March 29, 2024

Curated news, articles and jobs related to Data Science, AI, & Machine Learning ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

This Week in Rust #540

Friday, March 29, 2024

Email isn't displaying correctly? Read this e-mail on the Web This Week in Rust issue 540 — 27 MAR 2024 Hello and welcome to another issue of This Week in Rust! Rust is a programming language

The Value Of A Promise 🤞

Friday, March 29, 2024

How much is a promise from a tech company really worth, anyway? Here's a version for your browser. Hunting for the end of the long tail • March 28, 2024 The Value Of A Promise When you hear a

New Elastic Security for SIEM Training Course

Friday, March 29, 2024

Detect and respond to evolving threats ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ elastic | Search. Observe. Protect Detect anomalies and malicious behavior March

SBF gets 25 years 

Thursday, March 28, 2024

Sam Bankman-Fried is sentenced View this email online in your browser By Christine Hall Thursday, March 28, 2024 Welcome back to TechCrunch PM! The editorial team spent a chunk of the day discussing

💎 Issue 410 - Being laid off in 2023-2024 as an early-career developer

Thursday, March 28, 2024

This week's Awesome Ruby Newsletter Read this email on the Web The Awesome Ruby Newsletter Issue » 410 Release Date Mar 28, 2024 Your weekly report of the most popular Ruby news, articles and

💻 Issue 403 - Microsoft defends .NET 9 features competing with open source ecosystem

Thursday, March 28, 2024

This week's Awesome .NET Weekly Read this email on the Web The Awesome .NET Weekly Issue » 403 Release Date Mar 28, 2024 Your weekly report of the most popular .NET news, articles and projects

💻 Issue 410 - Node.js TSC Confirms: No Intention to Remove npm from Distribution

Thursday, March 28, 2024

This week's Awesome Node.js Weekly Read this email on the Web The Awesome Node.js Weekly Issue » 410 Release Date Mar 28, 2024 Your weekly report of the most popular Node.js news, articles and

💻 Issue 410 - JSDoc as an alternative TypeScript syntax

Thursday, March 28, 2024

This week's Awesome JavaScript Weekly Read this email on the Web The Awesome JavaScript Weekly Issue » 410 Release Date Mar 28, 2024 Your weekly report of the most popular JavaScript news, articles

📱 Issue 404 - Dependency Injection for Modern Swift Applications Part II

Thursday, March 28, 2024

This week's Awesome iOS Weekly Read this email on the Web The Awesome iOS Weekly Issue » 404 Release Date Mar 28, 2024 Your weekly report of the most popular iOS news, articles and projects Popular