OpenVaultDB database

Pubs

Microsoft's classic publishing sample database, with authors, books, publishers, stores, sales, and publisher-logo images.

Published collections

11 read-only collections

10 declared foreign-key relationships. Names and keys preserve the source database schema. The database site includes the complete native schema, including views.

Explore complete schema and exports ↗

Machine-readable database descriptor ↗

Published recordsets

Read-only collections

11 collections

table

authors

9 columns · 23 rows

Authors represented in the Pubs title catalogue.

au_idCHAR(11) · PKau_lnameVARCHAR(40)au_fnameVARCHAR(20)phoneCHAR(12)addressVARCHAR(40) · nullablecityVARCHAR(20) · nullablestateCHAR(2) · nullablezipCHAR(5) · nullablecontractINTEGER

table

publishers

5 columns · 8 rows

Publishing organizations, contact details, and locations.

pub_idCHAR(4) · PKpub_nameVARCHAR(40) · nullablecityVARCHAR(20) · nullablestateCHAR(2) · nullablecountryVARCHAR(30) · nullable

table

titles

10 columns · 18 rows

Books and other publications with catalogue details and list prices.

title_idCHAR(6) · PKtitleVARCHAR(80)typeCHAR(12)pub_idCHAR(4) · nullablepriceNUMERIC · nullableadvanceNUMERIC · nullableroyaltyINT · nullableytd_salesINT · nullablenotesVARCHAR(200) · nullablepubdateTEXT

References publishers.pub_id

table

titleauthor

4 columns · 25 rows

Links authors to publications and records author order and royalty percentage.

au_idCHAR(11) · PKtitle_idCHAR(6) · PKau_ordINTEGER · nullableroyaltyperINT · nullable

References titles.title_id, authors.au_id

table

stores

6 columns · 6 rows

Retail stores that sell Pubs publications.

stor_idCHAR(4) · PKstor_nameVARCHAR(40) · nullablestor_addressVARCHAR(40) · nullablecityVARCHAR(20) · nullablestateCHAR(2) · nullablezipCHAR(5) · nullable

table

sales

6 columns · 21 rows

Recorded sales by store, order number, date, title, quantity, and payment terms.

stor_idCHAR(4) · PKord_numVARCHAR(20) · PKord_dateTEXTqtyINTEGERpaytermsVARCHAR(12)title_idCHAR(6) · PK

References titles.title_id, stores.stor_id

table

roysched

4 columns · 86 rows

Royalty percentages for title sales across sales-range bands.

title_idCHAR(6) · nullablelorangeINT · nullablehirangeINT · nullableroyaltyINT · nullable

References titles.title_id

table

discounts

5 columns · 3 rows

Initial, volume, and store-specific sales discounts.

discounttypeVARCHAR(40)stor_idCHAR(4) · nullablelowqtyINTEGER · nullablehighqtyINTEGER · nullablediscountDECIMAL(4,2)

References stores.stor_id

table

jobs

4 columns · 14 rows

Job titles and the permitted employee job-level range.

job_idINTEGER · PKjob_descVARCHAR(50)min_lvlINTEGERmax_lvlINTEGER

table

pub_info

3 columns · 8 rows

Publisher descriptions and the original GIF logos stored as BLOBs.

pub_idCHAR(4) · PKlogoBLOB · nullablepr_infoTEXT · nullable

References publishers.pub_id

table

employee

8 columns · 43 rows

Employees, their job levels, hire dates, and publisher assignments.

emp_idCHAR(10) · PKfnameVARCHAR(20)minitCHAR(1) · nullablelnameVARCHAR(30)job_idINTEGERjob_lvlINTEGER · nullablepub_idCHAR(4)hire_dateTEXT

References publishers.pub_id, jobs.job_id

Provenance

Published data

Source: https://github.com/microsoft/sql-server-samples at beaab06ef72831089ca80e5355d65e661fd19b26.

Source licence: MIT. Model licence: MIT. Meaning licence: CC0-1.0.

Published by DemoDB; provider repository ↗.

The pinned Microsoft SQL Server 2000 sample script is converted to SQLite by scripts/rebuild-source.py. Its original Microsoft 1994-2000 copyright header and the upstream repository MIT license are retained. The converter preserves all 255 INSERT statements, eleven tables, source keys and relationships, the titleview, seven ordinary equivalents of the SQL Server indexes, and eight publisher-logo GIF BLOBs. discounts and roysched have no primary key or unique index in the source; their entities omit ModelSpec keys. The generated descriptor records empty primary-key arrays but its current format does not include a unique-key inventory. Two text fields preserve the pinned source's U+FFFD replacement character in M�nchen; they are not reconstructed. Two-digit dates are normalized to ISO text; money values use SQLite numeric affinity and SQL Server collation behavior is not reproduced. The two omitted pubdate GETDATE() defaults are frozen to 2000-01-01 for reproducibility; SQL Server-only setup, triggers, and stored procedures are not part of the SQLite fixture. The build recipe validates complete logical equivalence to the committed SQLite artifact; SQLite file bytes may vary across SQLite library versions. SQLite and JSON preserve NULL values; generated CSV represents NULL as an empty field, which is indistinguishable from empty text in CSV. BLOB values in JSON and CSV are base64 encoded. The sha256 identifies the generated SQLite fixture at data-source/source.sqlite; recipe inputs are identified separately by the provider manifest.

Semantic references

Published models