CRM sample database — MongoDB, embedded (264,024 rows)

Tables that belong to another are folded into it as arrays, so the documents read the way the application uses them. The rest are collections of their own, joined by key as in the flat version.

Load it:
  sh import.sh                    (into mongodb://localhost:27017)
  sh import.sh "<connection string>"

Or one collection at a time: mongoimport --db crm --collection <name> --file <name>.ndjson

Collections:
  accounts — 2,000 documents, each with its account_territories
  business_units — 5 documents
  calls — 10,000 documents
  campaign_members — 8,000 documents
  campaigns — 40 documents
  competitors — 15 documents
  contacts — 6,000 documents
  contracts — 3,000 documents
  deal_stages — 7 documents
  deals — 8,000 documents, each with its deal_competitors, its deal_products
  industry_types — 15 documents
  invoices — 25,000 documents, each with its invoice_lines
  kb_articles — 50 documents
  kb_categories — 8 documents
  lead_sources — 8 documents
  lead_statuses — 6 documents
  leads — 6,000 documents
  meetings — 4,000 documents, each with its meeting_participants
  payments — 22,000 documents
  price_book_entries — 180 documents
  price_books — 3 documents
  products — 60 documents
  quotes — 6,000 documents, each with its quote_line_items
  roles — 6 documents
  tasks — 6,000 documents
  territories — 12 documents
  ticket_priorities — 4 documents
  ticket_statuses — 5 documents
  tickets — 5,000 documents
  users — 100 documents

Folded in (no collection of their own):
  account_territories — 2,500 rows, as the "account_territories" array on accounts (its account_id is the parent's _id)
  deal_competitors — 3,000 rows, as the "deal_competitors" array on deals (its deal_id is the parent's _id)
  deal_products — 20,000 rows, as the "deal_products" array on deals (its deal_id is the parent's _id)
  invoice_lines — 100,000 rows, as the "invoice_lines" array on invoices (its invoice_id is the parent's _id)
  meeting_participants — 9,000 rows, as the "meeting_participants" array on meetings (its meeting_id is the parent's _id)
  quote_line_items — 18,000 rows, as the "quote_line_items" array on quotes (its quote_id is the parent's _id)

Types: numeric columns are Decimal128, so totals stay exact; dates and timestamps are
Date values read as UTC (the data has no time zone); times and UUIDs are strings;
JSON columns are embedded objects.

Synthetic data, CC0-1.0, from databasesample.com. The same rows as the SQL and CSV files.
