.sql

5 claimants 4 primary 1 secondary shared primary (4)

SWH popularity

Distinct files in the full Software Heritage archive (2026-06-04 export), dated by first appearance, following Desmazières, Di Cosmo, Lorentz (MSR 2025). Case-aggregated. citation.

46.9M
total files
21.0M
first seen 2021–2025 (44.8%)
2020
median year (half its files since)

Case variants in archive: .sql (46.7M), .SQL (155.9K), .Sql (4.0K), .SQl (96), .sqL (49), .sQL (10), .SqL (3), .sQl (3) — aggregated above.

Attribution status

This extension is attributed to PLSQL; SQL; SQL PL; TSQL as primary by 8 authoritative claims.

Authoritative sources: ✓ Linguist ✓ Pygments ✓ Wikidata · Q47607 ✗ Wikipedia · no claim

Disagree or have a correction? Open a labelling issue.

Claimants (10)

Languages that list .sql among their extensions. Strength reflects whether the upstream source treated it as their primary extension.
LanguageSourceStrength
PLSQLpygmentsprimary
SQLlinguistprimary
SQLpygmentsprimary
SQLwikidataprimary
SQL PLlinguistprimary
SQL PLpygmentsprimary
TSQLlinguistprimary
TSQLpygmentsprimary
PL/pgSQLlinguistsecondary
PLSQLlinguistsecondary

Wikidata says… (3)

File formats, image formats, audio codecs and other non-PL entities that claim .sql on Wikidata (property P1195) or in the Wikipedia infobox. Source: data/derived/external_extension_index.csv. Click Use as new PL on any row to open the Add-PL form pre-filled with that entry's name, Wikipedia/Wikidata URL, and this extension — one submission creates the PL + claim.
Right entry isn't listed? Add manually ↗
FormatClass (Wikidata P31)Suggested labelMIMENotesAction
phpMyAdmin SQL dumpTRUM Q105853077
FILE FORMATDWE
file format———Use as new PL ↗
Structured Query Language script Q62625630
file format
file format—application/sql; text/x-sql—Use as new PL ↗
Transact-SQL file format Q131304603
file format
file format—text/x-tsql—Use as new PL ↗

Disambiguation rules (5)

Linguist heuristics that decide, by content, which language a .sql file actually is.
RulePredictsKindPredicates (truncated)Measured on SWH
h/linguist/.sql/0PL/pgSQLpredicates[{"kind": "any", "regexes": ["(?i:^\\\\i\\b|^\\s*DO\\s+\\$|LANGUAGE\\s+'?plpgsql'?|BEGIN(\\s+WORK)?\\s*;)"]}]
h/linguist/.sql/1SQL PLpredicates[{"kind": "any", "regexes": ["(?i:ALTER\\s+MODULE|MODE\\s+DB2SQL|\\bSYS(CAT|PROC)\\.|ASSOCIATE\\s+RESULT\\s+SET|\\bEND!\\s*$)"]}]
h/linguist/.sql/2PLSQLpredicates[{"kind": "any", "regexes": ["(?i:\\$\\$PLSQL_|XMLTYPE|systimestamp|\\.nextval|CONNECT\\s+BY|AUTHID\\s+(DEFINER|CURRENT_USER)|constructor\\W+function)"]}]
h/linguist/.sql/3TSQLpredicates[{"kind": "any", "regexes": ["(?i:^\\s*GO\\b|BEGIN(\\s+TRY|\\s+CATCH)|OUTPUT\\s+INSERTED|DECLARE\\s+@|\\[dbo\\])"]}]
h/linguist/.sql/4SQLdefault[]

SWH-mined examples (2)

Real archived programs with this extension, byte-verified against the SWH archive, grouped by predicted language and by how the prediction was made. Useful for deciding what this extension actually is when the attribution is uncertain.
PL/pgSQL (1) — 1 via Linguist heuristic
get_stat_activity.sql · 779 B · seen 2136× in SWH
predicted: PL/pgSQL via heuristic
swh:1:cnt:b9668f1083290e2af716061aca470fcc93e3d310;origin=https://github.com/PNNL-Comp-Mass-Spec/DBSchema_PgSQL_DMS;anchor=swh:1:rev:ba3195740b6407e08d3a6c8dfe0e2d7454c740c5;path=/dms/get_stat_activity.sql
Open in SWH · Raw bytes
TSQL (1) — 1 via Linguist heuristic
Schema_LOC_DMS_Ops_Admin.sql · 92 B · seen 2650× in SWH
predicted: TSQL via heuristic
swh:1:cnt:208f7fec9e6092c3253088427bc5d6c2fe69f050;origin=https://github.com/PNNL-Comp-Mass-Spec/DBSchema_DMS;anchor=swh:1:rev:b3fe150766644acb8c82e5900ba1b642233b8e05;path=/DMS5/Schema_LOC_DMS_Ops_Admin.sql
Open in SWH · Raw bytes
Request more SWH-mined examples
If the examples above don't disambiguate what .sql is, request a fresh mining run.
(or open the pre-filled issue directly)