Public channel ID 69194156236960

Data Science: SQL и Аналитика данных

На простом языке: про работу с данными, современные технологии, AI, машинное обучение и, немного, SQL.

Менеджер: https://vk.cc/cUAKaQ

Channels in category
1 757
This channel's rank
№ 22
Open category →
Channels in category
4 958
This channel's rank
№ 116
Open category →
Open in MAX

Posts for the period

By reactions

Search and the whole feed — after free registration. Custom dates — with a subscription; the channel owner sees them for free. Sorting by reactions — with a subscription. Sign up

Loading…

Loading image…
🔥 SQL-задача: ближайшие точки с подвохом

Карта размером 100 × 100 замкнута: переход вправо от x = 100 возвращает к x = 0. По вертикали действует то же правило.

CREATE TABLE points (
id INT PRIMARY KEY,
x INT,
y INT
);

INSERT INTO points VALUES
(1, 1, 1),
(2, 99, 99),
(3, 50, 50),
(4, 52, 52);


Напишите запрос, который найдёт все пары точек с минимальным расстоянием по прямой с учётом переходов через границы.

Условия:

⏺️ точку нельзя сравнивать с собой;
⏺️ пары (1, 2) и (2, 1) считаются одной;
⏺️ при одинаковом минимуме выведите все пары;
⏺️ результат: id1, id2, distance.

Обычная формула расстояния без учёта границ даст неверный ответ
Views: 107
Go to post Open in MAX Report an inaccuracy
VKontakte Telegram Odnoklassniki
Favorites at datool.ru

Follow the channel in your account

Sign up at datool.ru to add the channel “Data Science: SQL и Аналитика данных” to favorites and track its metrics.

Sign up
For channel owners

Verify your channel

Sign in or sign up at datool.ru, then add our bot to the channel following the instructions in your account. Once ownership is verified, the lock disappears and channel management becomes available.

Sign in or sign up

Report an inaccuracy

Describe what needs fixing. If you have a source, add a link.

You are leaving datool.ru

The link leads to an external website. datool.ru is not responsible for its content — check the address before entering passwords or payment details.

Redirecting in 10 s

Go