Przejdź do treści
Biblioteka skilli
Dane i analityka · Budowanie i kod

sql-set-operations

/sql-set-operations

Łączy wyniki zapytań przez UNION, INTERSECT i EXCEPT i wskazuje, kiedy lepszy jest join lub klauzula exists.

Repozytorium
AI-SKILLS ↗
Licencja
MIT
Ostatnia zmiana repozytorium
05.09.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 05.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Łączy wyniki zapytań przez UNION, INTERSECT i EXCEPT i wskazuje, kiedy lepszy jest join lub klauzula exists.

Oryginalny opis (EN)

Combine result sets with UNION, INTERSECT, and EXCEPT, and know when a join or an exists clause is the better tool. Use when merging or comparing two query results rather than two tables.

Jak działa

  1. Method
  2. Boundaries
Sekcje z nagłówków SKILL.md, w oryginale · 37 linii, 264 słów
Podgląd SKILL.md
---
name: sql-set-operations
description: Combine result sets with UNION, INTERSECT, and EXCEPT, and know when a join or an exists clause is the better tool. Use when merging or comparing two query results rather than two tables.
---

# SQL set operations

Set operations stack result sets vertically, where joins widen them
horizontally. They are the right tool for combining like-shaped results
and for asking what is in one set and not the other, and the wrong tool
for enriching rows.

## Method

1. **Prefer UNION ALL unless you need deduplication.** UNION sorts or
   hashes to remove duplicates, which costs real time on large sets. If
   duplicates are impossible, say so with ALL.
2. **Match the column list exactly.** Same count, same order, compatible
   types. Positional matching means a reordered select in one branch
   produces plausible, wrong output rather than an error.
3. **Use EXCEPT to find what is missing.** It answers which rows in the
   first set have no counterpart, and it reads more clearly than an
   anti-join when both sides are already query results.
4. **Remember set operations compare whole rows.** INTERSECT and EXCEPT
   consider every selected column, so including an extra column changes
   the answer entirely.
5. **Order once at the end.** An ORDER BY applies to the combined
   result, and ordering inside branches is meaningless without a limit.
6. **Reach for EXISTS when you only need a test.** Checking whether a
   related row exists is cheaper and clearer than building and comparing
   sets (see sql-joins).

## Boundaries

- Set operations need like-shaped results; combining differently shaped
  data means a join or a rework of the query.
- INTERSECT and EXCEPT treat nulls as matching for these purposes, which
  differs from ordinary comparison (see null-semantics).
- Support varies: some engines lack INTERSECT and EXCEPT and need an
  anti-join instead.

Wersje

W bazie nie ma innych skilli o nazwie sql-set-operations.

Migawka bazy z 13.11.2026 · wersja paczki 9fbaa19ca268 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100sql-joins
    Pomaga dobrać i napisać join, który zachowuje właściwą liczbę wierszy, i wyjaśnia, dlaczego wynik urósł.
  • 100sql-query-generation
    Generuje zapytania SQL z wymagań w języku naturalnym: SELECT, JOIN, GROUP BY, funkcje okna, CTE i podzapytania, na podstawie pytania biznesowego lub schematu.
  • 100sql-query-optimizer
    Prawdopodobnie optymalizuje zapytania SQL w ramach kategorii Data Analytics.
  • 100sql-to-insights
    Zamienia wyniki zapytań SQL w narrację decyzyjną: główne ustalenie, czynniki i rekomendacja, z doborem wykresu do kształtu danych.
  • 92sql
    Odpytuje graf Minerval i jego rejestr działań tylko do odczytu w SQL: opisuje widoki, połączenia i liczniki dla typowych pytań.
  • 100sql
    Pisze, poprawia i uruchamia zapytania SQL oraz analizuje pliki CSV i SQLite przy pomocy narzędzia sqlite3.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.