{
  "contractVersion": 1,
  "database": {
    "id": "employees",
    "name": "Employees (browser edition)"
  },
  "source": {
    "repository": "https://github.com/datacharmer/test_db",
    "version": "MySQL Employees sample dataset (schema and data credited 2007–2008)",
    "revision": "e324b56193ca506ab7cc1ab143a9153d8c4535d7",
    "path": "employees.sql",
    "license": "CC-BY-SA-3.0",
    "licenseFile": "LICENSE",
    "notes": "Browser-sized subset of the upstream MySQL Employees sample, not a copy of the full dataset. The exact source header credits MySQL AB (2007/2008), original temporal data to Fusheng Wang and Carlo Zaniolo, the current schema to Giuseppe Maxia, and XML-to-relational conversion to Patrick Crews; it states CC BY-SA 3.0 Unported and says the data is fabricated. The selected employee set is IDs 10001 through 11000 inclusive plus every distinct employee ID listed in the source dept_manager rows (1,024 total). All nine departments and all 24 manager assignments are included, with every dept_emp, titles, and salaries row for those employees. All six native tables and both native views are retained. The source repo inserts in batches, and salaries span three dump files; CI downloads every exact upstream source file at the pinned commit, checks its hash, rebuilds the subset, and compares the full logical SQLite database. SQLite fixture file bytes can vary by SQLite library version; the committed gzip is checked by its exact compressed and decoded hashes and by full logical contents. The upstream sample says its data is fabricated and does not correspond to real people.",
    "recipe": [
      {
        "path": "employees.sql",
        "sha256": "cfe3f89f7b21326c516ba65d253e35e795877e9bb60c388520d915f348403a9a"
      },
      {
        "path": "load_departments.dump",
        "sha256": "2271cfef20852e395ec72ce269a119b2c799a973a9277c971409ea53d5a17cfa"
      },
      {
        "path": "load_dept_emp.dump",
        "sha256": "52cc6dbc1b139254533264bd5d44a6012377f34ecf1eef693ddfb349aeb40ed6"
      },
      {
        "path": "load_dept_manager.dump",
        "sha256": "d9cff691f09f2399f5490e435deb8c932946246aaf483b8f1cbef0bc556aa1dc"
      },
      {
        "path": "load_employees.dump",
        "sha256": "ba004ebc5fcdad59544fd8ced262d1793ca02c7936c5d7668a355c6a683d6fa8"
      },
      {
        "path": "load_salaries1.dump",
        "sha256": "aa485ea7b1553f1660d6db5a93e9ede0a0c182cb923f9471a39594f7ca967c5b"
      },
      {
        "path": "load_salaries2.dump",
        "sha256": "cad589bff736cb575358d7806e4e4a13e28a2e9c714c2fb51fbe4db74a5706fa"
      },
      {
        "path": "load_salaries3.dump",
        "sha256": "75fc473d2472341fbfd635d6f4853c63645051829a9c7a1a18ee819fe5816f45"
      },
      {
        "path": "load_titles.dump",
        "sha256": "dcd382989c46719e1e216ffef4919483f0f71d52da517c37c22d39cdaf9bc044"
      }
    ],
    "databaseSha256": "46b49dd0e141cd8db66d57680a10febfccc15e6f54dc7b8f3c2316b55e11c5f0",
    "inputCompression": "gzip",
    "inputSha256": "ed59fc6b30599422bd9b5762fd3ebfcdee8bb57a1ecf10c47a0bbcdfdec608ba",
    "fullTableCounts": {
      "departments": 9,
      "employees": 300024,
      "dept_manager": 24,
      "dept_emp": 331603,
      "titles": 443308,
      "salaries": 2844047
    }
  },
  "blobEncoding": "base64",
  "modelingLimitations": [],
  "tables": [
    {
      "name": "departments",
      "modelEntity": "departments",
      "modelRecordset": null,
      "kind": "table",
      "description": "All nine departments in the source sample.",
      "columns": [
        {
          "name": "dept_no",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": true,
          "primaryKeyOrder": 1,
          "primaryKeyPosition": 1,
          "defaultValue": null,
          "description": "Original four-character department code, stored as text."
        },
        {
          "name": "dept_name",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null,
          "description": "Original department name."
        }
      ],
      "primaryKey": [
        {
          "column": "dept_no",
          "position": 1
        }
      ],
      "uniqueKeys": [
        {
          "name": "sqlite_autoindex_departments_2",
          "origin": "u",
          "columns": [
            "dept_name"
          ]
        }
      ],
      "uniqueIndexes": [
        {
          "name": "sqlite_autoindex_departments_1",
          "origin": "pk",
          "partial": false,
          "columns": [
            {
              "position": 0,
              "column": "dept_no",
              "expression": false,
              "descending": false,
              "collation": "BINARY"
            }
          ],
          "sql": null
        },
        {
          "name": "sqlite_autoindex_departments_2",
          "origin": "u",
          "partial": false,
          "columns": [
            {
              "position": 0,
              "column": "dept_name",
              "expression": false,
              "descending": false,
              "collation": "BINARY"
            }
          ],
          "sql": null
        }
      ],
      "foreignKeys": [],
      "rowCount": 9,
      "viewSql": null,
      "tableSql": "CREATE TABLE departments (\n                dept_no TEXT NOT NULL PRIMARY KEY,\n                dept_name TEXT NOT NULL UNIQUE\n            )",
      "rows": [
        {
          "dept_no": "d001",
          "dept_name": "Marketing"
        },
        {
          "dept_no": "d002",
          "dept_name": "Finance"
        },
        {
          "dept_no": "d003",
          "dept_name": "Human Resources"
        },
        {
          "dept_no": "d004",
          "dept_name": "Production"
        },
        {
          "dept_no": "d005",
          "dept_name": "Development"
        },
        {
          "dept_no": "d006",
          "dept_name": "Quality Management"
        },
        {
          "dept_no": "d007",
          "dept_name": "Sales"
        },
        {
          "dept_no": "d008",
          "dept_name": "Research"
        },
        {
          "dept_no": "d009",
          "dept_name": "Customer Service"
        }
      ]
    },
    {
      "name": "dept_emp",
      "modelEntity": "dept_emp",
      "modelRecordset": null,
      "kind": "table",
      "description": "Department assignments and date ranges for selected employees.",
      "columns": [
        {
          "name": "emp_no",
          "type": "INTEGER",
          "nullable": false,
          "primaryKey": true,
          "primaryKeyOrder": 1,
          "primaryKeyPosition": 1,
          "defaultValue": null
        },
        {
          "name": "dept_no",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": true,
          "primaryKeyOrder": 2,
          "primaryKeyPosition": 2,
          "defaultValue": null
        },
        {
          "name": "from_date",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null,
          "description": "Start date of the source department assignment."
        },
        {
          "name": "to_date",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null,
          "description": "End date of the source assignment; 9999-01-01 denotes current assignment in this sample."
        }
      ],
      "primaryKey": [
        {
          "column": "emp_no",
          "position": 1
        },
        {
          "column": "dept_no",
          "position": 2
        }
      ],
      "uniqueKeys": [],
      "uniqueIndexes": [
        {
          "name": "sqlite_autoindex_dept_emp_1",
          "origin": "pk",
          "partial": false,
          "columns": [
            {
              "position": 0,
              "column": "emp_no",
              "expression": false,
              "descending": false,
              "collation": "BINARY"
            },
            {
              "position": 1,
              "column": "dept_no",
              "expression": false,
              "descending": false,
              "collation": "BINARY"
            }
          ],
          "sql": null
        }
      ],
      "foreignKeys": [
        {
          "column": "dept_no",
          "table": "departments",
          "referencedColumn": "dept_no",
          "constraint": 0,
          "position": 0,
          "onUpdate": "NO ACTION",
          "onDelete": "CASCADE",
          "match": "NONE"
        },
        {
          "column": "emp_no",
          "table": "employees",
          "referencedColumn": "emp_no",
          "constraint": 1,
          "position": 0,
          "onUpdate": "NO ACTION",
          "onDelete": "CASCADE",
          "match": "NONE"
        }
      ],
      "rowCount": 1127,
      "viewSql": null,
      "tableSql": "CREATE TABLE dept_emp (\n                emp_no INTEGER NOT NULL,\n                dept_no TEXT NOT NULL,\n                from_date TEXT NOT NULL,\n                to_date TEXT NOT NULL,\n                PRIMARY KEY (emp_no, dept_no),\n                FOREIGN KEY (emp_no) REFERENCES employees(emp_no) ON DELETE CASCADE,\n                FOREIGN KEY (dept_no) REFERENCES departments(dept_no) ON DELETE CASCADE\n            )",
      "rows": [
        {
          "emp_no": 10001,
          "dept_no": "d005",
          "from_date": "1986-06-26",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10002,
          "dept_no": "d007",
          "from_date": "1996-08-03",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10003,
          "dept_no": "d004",
          "from_date": "1995-12-03",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10004,
          "dept_no": "d004",
          "from_date": "1986-12-01",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10005,
          "dept_no": "d003",
          "from_date": "1989-09-12",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10006,
          "dept_no": "d005",
          "from_date": "1990-08-05",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10007,
          "dept_no": "d008",
          "from_date": "1989-02-10",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10008,
          "dept_no": "d005",
          "from_date": "1998-03-11",
          "to_date": "2000-07-31"
        },
        {
          "emp_no": 10009,
          "dept_no": "d006",
          "from_date": "1985-02-18",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10010,
          "dept_no": "d004",
          "from_date": "1996-11-24",
          "to_date": "2000-06-26"
        },
        {
          "emp_no": 10010,
          "dept_no": "d006",
          "from_date": "2000-06-26",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10011,
          "dept_no": "d009",
          "from_date": "1990-01-22",
          "to_date": "1996-11-09"
        }
      ]
    },
    {
      "name": "dept_manager",
      "modelEntity": "dept_manager",
      "modelRecordset": null,
      "kind": "table",
      "description": "All manager assignments in the source sample.",
      "columns": [
        {
          "name": "emp_no",
          "type": "INTEGER",
          "nullable": false,
          "primaryKey": true,
          "primaryKeyOrder": 1,
          "primaryKeyPosition": 1,
          "defaultValue": null
        },
        {
          "name": "dept_no",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": true,
          "primaryKeyOrder": 2,
          "primaryKeyPosition": 2,
          "defaultValue": null
        },
        {
          "name": "from_date",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null,
          "description": "Start date of the source manager assignment."
        },
        {
          "name": "to_date",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null,
          "description": "End date of the source assignment; 9999-01-01 denotes current assignment in this sample."
        }
      ],
      "primaryKey": [
        {
          "column": "emp_no",
          "position": 1
        },
        {
          "column": "dept_no",
          "position": 2
        }
      ],
      "uniqueKeys": [],
      "uniqueIndexes": [
        {
          "name": "sqlite_autoindex_dept_manager_1",
          "origin": "pk",
          "partial": false,
          "columns": [
            {
              "position": 0,
              "column": "emp_no",
              "expression": false,
              "descending": false,
              "collation": "BINARY"
            },
            {
              "position": 1,
              "column": "dept_no",
              "expression": false,
              "descending": false,
              "collation": "BINARY"
            }
          ],
          "sql": null
        }
      ],
      "foreignKeys": [
        {
          "column": "dept_no",
          "table": "departments",
          "referencedColumn": "dept_no",
          "constraint": 0,
          "position": 0,
          "onUpdate": "NO ACTION",
          "onDelete": "CASCADE",
          "match": "NONE"
        },
        {
          "column": "emp_no",
          "table": "employees",
          "referencedColumn": "emp_no",
          "constraint": 1,
          "position": 0,
          "onUpdate": "NO ACTION",
          "onDelete": "CASCADE",
          "match": "NONE"
        }
      ],
      "rowCount": 24,
      "viewSql": null,
      "tableSql": "CREATE TABLE dept_manager (\n                emp_no INTEGER NOT NULL,\n                dept_no TEXT NOT NULL,\n                from_date TEXT NOT NULL,\n                to_date TEXT NOT NULL,\n                PRIMARY KEY (emp_no, dept_no),\n                FOREIGN KEY (emp_no) REFERENCES employees(emp_no) ON DELETE CASCADE,\n                FOREIGN KEY (dept_no) REFERENCES departments(dept_no) ON DELETE CASCADE\n            )",
      "rows": [
        {
          "emp_no": 110022,
          "dept_no": "d001",
          "from_date": "1985-01-01",
          "to_date": "1991-10-01"
        },
        {
          "emp_no": 110039,
          "dept_no": "d001",
          "from_date": "1991-10-01",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 110085,
          "dept_no": "d002",
          "from_date": "1985-01-01",
          "to_date": "1989-12-17"
        },
        {
          "emp_no": 110114,
          "dept_no": "d002",
          "from_date": "1989-12-17",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 110183,
          "dept_no": "d003",
          "from_date": "1985-01-01",
          "to_date": "1992-03-21"
        },
        {
          "emp_no": 110228,
          "dept_no": "d003",
          "from_date": "1992-03-21",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 110303,
          "dept_no": "d004",
          "from_date": "1985-01-01",
          "to_date": "1988-09-09"
        },
        {
          "emp_no": 110344,
          "dept_no": "d004",
          "from_date": "1988-09-09",
          "to_date": "1992-08-02"
        },
        {
          "emp_no": 110386,
          "dept_no": "d004",
          "from_date": "1992-08-02",
          "to_date": "1996-08-30"
        },
        {
          "emp_no": 110420,
          "dept_no": "d004",
          "from_date": "1996-08-30",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 110511,
          "dept_no": "d005",
          "from_date": "1985-01-01",
          "to_date": "1992-04-25"
        },
        {
          "emp_no": 110567,
          "dept_no": "d005",
          "from_date": "1992-04-25",
          "to_date": "9999-01-01"
        }
      ]
    },
    {
      "name": "employees",
      "modelEntity": "employees",
      "modelRecordset": null,
      "kind": "table",
      "description": "The selected employees from the pinned Employees sample, retaining their source identifiers and demographics.",
      "columns": [
        {
          "name": "emp_no",
          "type": "INTEGER",
          "nullable": false,
          "primaryKey": true,
          "primaryKeyOrder": 1,
          "primaryKeyPosition": 1,
          "defaultValue": null,
          "description": "Original upstream employee identifier; selected rows are 10001–11000 plus all 24 source managers."
        },
        {
          "name": "birth_date",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null,
          "description": "Birth date from the source sample, stored as ISO date text."
        },
        {
          "name": "first_name",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null
        },
        {
          "name": "last_name",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null
        },
        {
          "name": "gender",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null,
          "description": "Source M/F gender code."
        },
        {
          "name": "hire_date",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null,
          "description": "Hire date from the source sample, stored as ISO date text."
        }
      ],
      "primaryKey": [
        {
          "column": "emp_no",
          "position": 1
        }
      ],
      "uniqueKeys": [],
      "uniqueIndexes": [],
      "foreignKeys": [],
      "rowCount": 1024,
      "viewSql": null,
      "tableSql": "CREATE TABLE employees (\n                emp_no INTEGER NOT NULL PRIMARY KEY,\n                birth_date TEXT NOT NULL,\n                first_name TEXT NOT NULL,\n                last_name TEXT NOT NULL,\n                gender TEXT NOT NULL CHECK (gender IN ('M', 'F')),\n                hire_date TEXT NOT NULL\n            )",
      "rows": [
        {
          "emp_no": 10001,
          "birth_date": "1953-09-02",
          "first_name": "Georgi",
          "last_name": "Facello",
          "gender": "M",
          "hire_date": "1986-06-26"
        },
        {
          "emp_no": 10002,
          "birth_date": "1964-06-02",
          "first_name": "Bezalel",
          "last_name": "Simmel",
          "gender": "F",
          "hire_date": "1985-11-21"
        },
        {
          "emp_no": 10003,
          "birth_date": "1959-12-03",
          "first_name": "Parto",
          "last_name": "Bamford",
          "gender": "M",
          "hire_date": "1986-08-28"
        },
        {
          "emp_no": 10004,
          "birth_date": "1954-05-01",
          "first_name": "Chirstian",
          "last_name": "Koblick",
          "gender": "M",
          "hire_date": "1986-12-01"
        },
        {
          "emp_no": 10005,
          "birth_date": "1955-01-21",
          "first_name": "Kyoichi",
          "last_name": "Maliniak",
          "gender": "M",
          "hire_date": "1989-09-12"
        },
        {
          "emp_no": 10006,
          "birth_date": "1953-04-20",
          "first_name": "Anneke",
          "last_name": "Preusig",
          "gender": "F",
          "hire_date": "1989-06-02"
        },
        {
          "emp_no": 10007,
          "birth_date": "1957-05-23",
          "first_name": "Tzvetan",
          "last_name": "Zielinski",
          "gender": "F",
          "hire_date": "1989-02-10"
        },
        {
          "emp_no": 10008,
          "birth_date": "1958-02-19",
          "first_name": "Saniya",
          "last_name": "Kalloufi",
          "gender": "M",
          "hire_date": "1994-09-15"
        },
        {
          "emp_no": 10009,
          "birth_date": "1952-04-19",
          "first_name": "Sumant",
          "last_name": "Peac",
          "gender": "F",
          "hire_date": "1985-02-18"
        },
        {
          "emp_no": 10010,
          "birth_date": "1963-06-01",
          "first_name": "Duangkaew",
          "last_name": "Piveteau",
          "gender": "F",
          "hire_date": "1989-08-24"
        },
        {
          "emp_no": 10011,
          "birth_date": "1953-11-07",
          "first_name": "Mary",
          "last_name": "Sluis",
          "gender": "F",
          "hire_date": "1990-01-22"
        },
        {
          "emp_no": 10012,
          "birth_date": "1960-10-04",
          "first_name": "Patricio",
          "last_name": "Bridgland",
          "gender": "M",
          "hire_date": "1992-12-18"
        }
      ]
    },
    {
      "name": "salaries",
      "modelEntity": "salaries",
      "modelRecordset": null,
      "kind": "table",
      "description": "Salary history for selected employees.",
      "columns": [
        {
          "name": "emp_no",
          "type": "INTEGER",
          "nullable": false,
          "primaryKey": true,
          "primaryKeyOrder": 1,
          "primaryKeyPosition": 1,
          "defaultValue": null
        },
        {
          "name": "salary",
          "type": "INTEGER",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null,
          "description": "Original integer salary amount; no currency is declared by the upstream schema."
        },
        {
          "name": "from_date",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": true,
          "primaryKeyOrder": 2,
          "primaryKeyPosition": 2,
          "defaultValue": null,
          "description": "Start date of the source salary history row."
        },
        {
          "name": "to_date",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null,
          "description": "End date of the source salary history row; source values are retained."
        }
      ],
      "primaryKey": [
        {
          "column": "emp_no",
          "position": 1
        },
        {
          "column": "from_date",
          "position": 2
        }
      ],
      "uniqueKeys": [],
      "uniqueIndexes": [
        {
          "name": "sqlite_autoindex_salaries_1",
          "origin": "pk",
          "partial": false,
          "columns": [
            {
              "position": 0,
              "column": "emp_no",
              "expression": false,
              "descending": false,
              "collation": "BINARY"
            },
            {
              "position": 1,
              "column": "from_date",
              "expression": false,
              "descending": false,
              "collation": "BINARY"
            }
          ],
          "sql": null
        }
      ],
      "foreignKeys": [
        {
          "column": "emp_no",
          "table": "employees",
          "referencedColumn": "emp_no",
          "constraint": 0,
          "position": 0,
          "onUpdate": "NO ACTION",
          "onDelete": "CASCADE",
          "match": "NONE"
        }
      ],
      "rowCount": 9876,
      "viewSql": null,
      "tableSql": "CREATE TABLE salaries (\n                emp_no INTEGER NOT NULL,\n                salary INTEGER NOT NULL,\n                from_date TEXT NOT NULL,\n                to_date TEXT NOT NULL,\n                PRIMARY KEY (emp_no, from_date),\n                FOREIGN KEY (emp_no) REFERENCES employees(emp_no) ON DELETE CASCADE\n            )",
      "rows": [
        {
          "emp_no": 10001,
          "salary": 60117,
          "from_date": "1986-06-26",
          "to_date": "1987-06-26"
        },
        {
          "emp_no": 10001,
          "salary": 62102,
          "from_date": "1987-06-26",
          "to_date": "1988-06-25"
        },
        {
          "emp_no": 10001,
          "salary": 66074,
          "from_date": "1988-06-25",
          "to_date": "1989-06-25"
        },
        {
          "emp_no": 10001,
          "salary": 66596,
          "from_date": "1989-06-25",
          "to_date": "1990-06-25"
        },
        {
          "emp_no": 10001,
          "salary": 66961,
          "from_date": "1990-06-25",
          "to_date": "1991-06-25"
        },
        {
          "emp_no": 10001,
          "salary": 71046,
          "from_date": "1991-06-25",
          "to_date": "1992-06-24"
        },
        {
          "emp_no": 10001,
          "salary": 74333,
          "from_date": "1992-06-24",
          "to_date": "1993-06-24"
        },
        {
          "emp_no": 10001,
          "salary": 75286,
          "from_date": "1993-06-24",
          "to_date": "1994-06-24"
        },
        {
          "emp_no": 10001,
          "salary": 75994,
          "from_date": "1994-06-24",
          "to_date": "1995-06-24"
        },
        {
          "emp_no": 10001,
          "salary": 76884,
          "from_date": "1995-06-24",
          "to_date": "1996-06-23"
        },
        {
          "emp_no": 10001,
          "salary": 80013,
          "from_date": "1996-06-23",
          "to_date": "1997-06-23"
        },
        {
          "emp_no": 10001,
          "salary": 81025,
          "from_date": "1997-06-23",
          "to_date": "1998-06-23"
        }
      ]
    },
    {
      "name": "titles",
      "modelEntity": "titles",
      "modelRecordset": null,
      "kind": "table",
      "description": "Title history for selected employees.",
      "columns": [
        {
          "name": "emp_no",
          "type": "INTEGER",
          "nullable": false,
          "primaryKey": true,
          "primaryKeyOrder": 1,
          "primaryKeyPosition": 1,
          "defaultValue": null
        },
        {
          "name": "title",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": true,
          "primaryKeyOrder": 2,
          "primaryKeyPosition": 2,
          "defaultValue": null
        },
        {
          "name": "from_date",
          "type": "TEXT",
          "nullable": false,
          "primaryKey": true,
          "primaryKeyOrder": 3,
          "primaryKeyPosition": 3,
          "defaultValue": null,
          "description": "Start date of the source title history row."
        },
        {
          "name": "to_date",
          "type": "TEXT",
          "nullable": true,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null,
          "description": "End date of the source title history row; NULL is retained when present in source."
        }
      ],
      "primaryKey": [
        {
          "column": "emp_no",
          "position": 1
        },
        {
          "column": "title",
          "position": 2
        },
        {
          "column": "from_date",
          "position": 3
        }
      ],
      "uniqueKeys": [],
      "uniqueIndexes": [
        {
          "name": "sqlite_autoindex_titles_1",
          "origin": "pk",
          "partial": false,
          "columns": [
            {
              "position": 0,
              "column": "emp_no",
              "expression": false,
              "descending": false,
              "collation": "BINARY"
            },
            {
              "position": 1,
              "column": "title",
              "expression": false,
              "descending": false,
              "collation": "BINARY"
            },
            {
              "position": 2,
              "column": "from_date",
              "expression": false,
              "descending": false,
              "collation": "BINARY"
            }
          ],
          "sql": null
        }
      ],
      "foreignKeys": [
        {
          "column": "emp_no",
          "table": "employees",
          "referencedColumn": "emp_no",
          "constraint": 0,
          "position": 0,
          "onUpdate": "NO ACTION",
          "onDelete": "CASCADE",
          "match": "NONE"
        }
      ],
      "rowCount": 1524,
      "viewSql": null,
      "tableSql": "CREATE TABLE titles (\n                emp_no INTEGER NOT NULL,\n                title TEXT NOT NULL,\n                from_date TEXT NOT NULL,\n                to_date TEXT,\n                PRIMARY KEY (emp_no, title, from_date),\n                FOREIGN KEY (emp_no) REFERENCES employees(emp_no) ON DELETE CASCADE\n            )",
      "rows": [
        {
          "emp_no": 10001,
          "title": "Senior Engineer",
          "from_date": "1986-06-26",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10002,
          "title": "Staff",
          "from_date": "1996-08-03",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10003,
          "title": "Senior Engineer",
          "from_date": "1995-12-03",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10004,
          "title": "Engineer",
          "from_date": "1986-12-01",
          "to_date": "1995-12-01"
        },
        {
          "emp_no": 10004,
          "title": "Senior Engineer",
          "from_date": "1995-12-01",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10005,
          "title": "Senior Staff",
          "from_date": "1996-09-12",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10005,
          "title": "Staff",
          "from_date": "1989-09-12",
          "to_date": "1996-09-12"
        },
        {
          "emp_no": 10006,
          "title": "Senior Engineer",
          "from_date": "1990-08-05",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10007,
          "title": "Senior Staff",
          "from_date": "1996-02-11",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10007,
          "title": "Staff",
          "from_date": "1989-02-10",
          "to_date": "1996-02-11"
        },
        {
          "emp_no": 10008,
          "title": "Assistant Engineer",
          "from_date": "1998-03-11",
          "to_date": "2000-07-31"
        },
        {
          "emp_no": 10009,
          "title": "Assistant Engineer",
          "from_date": "1985-02-18",
          "to_date": "1990-02-18"
        }
      ]
    },
    {
      "name": "current_dept_emp",
      "modelEntity": null,
      "modelRecordset": null,
      "kind": "view",
      "description": "",
      "columns": [
        {
          "name": "emp_no",
          "type": "",
          "nullable": true,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null
        },
        {
          "name": "dept_no",
          "type": "",
          "nullable": true,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null
        },
        {
          "name": "from_date",
          "type": "",
          "nullable": true,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null
        },
        {
          "name": "to_date",
          "type": "",
          "nullable": true,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null
        }
      ],
      "primaryKey": [],
      "foreignKeys": [],
      "rowCount": 1024,
      "viewSql": "CREATE VIEW current_dept_emp AS\n              SELECT l.emp_no, d.dept_no, l.from_date, l.to_date\n              FROM dept_emp AS d\n              INNER JOIN dept_emp_latest_date AS l\n                ON d.emp_no = l.emp_no AND d.from_date = l.from_date AND l.to_date = d.to_date",
      "tableSql": null,
      "rows": [
        {
          "emp_no": 10001,
          "dept_no": "d005",
          "from_date": "1986-06-26",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10002,
          "dept_no": "d007",
          "from_date": "1996-08-03",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10003,
          "dept_no": "d004",
          "from_date": "1995-12-03",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10004,
          "dept_no": "d004",
          "from_date": "1986-12-01",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10005,
          "dept_no": "d003",
          "from_date": "1989-09-12",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10006,
          "dept_no": "d005",
          "from_date": "1990-08-05",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10007,
          "dept_no": "d008",
          "from_date": "1989-02-10",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10008,
          "dept_no": "d005",
          "from_date": "1998-03-11",
          "to_date": "2000-07-31"
        },
        {
          "emp_no": 10009,
          "dept_no": "d006",
          "from_date": "1985-02-18",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10010,
          "dept_no": "d006",
          "from_date": "2000-06-26",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10011,
          "dept_no": "d009",
          "from_date": "1990-01-22",
          "to_date": "1996-11-09"
        },
        {
          "emp_no": 10012,
          "dept_no": "d005",
          "from_date": "1992-12-18",
          "to_date": "9999-01-01"
        }
      ]
    },
    {
      "name": "dept_emp_latest_date",
      "modelEntity": null,
      "modelRecordset": null,
      "kind": "view",
      "description": "",
      "columns": [
        {
          "name": "emp_no",
          "type": "",
          "nullable": true,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null
        },
        {
          "name": "from_date",
          "type": "",
          "nullable": true,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null
        },
        {
          "name": "to_date",
          "type": "",
          "nullable": true,
          "primaryKey": false,
          "primaryKeyOrder": 0,
          "primaryKeyPosition": null,
          "defaultValue": null
        }
      ],
      "primaryKey": [],
      "foreignKeys": [],
      "rowCount": 1024,
      "viewSql": "CREATE VIEW dept_emp_latest_date AS\n              SELECT emp_no, MAX(from_date) AS from_date, MAX(to_date) AS to_date\n              FROM dept_emp GROUP BY emp_no",
      "tableSql": null,
      "rows": [
        {
          "emp_no": 10001,
          "from_date": "1986-06-26",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10002,
          "from_date": "1996-08-03",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10003,
          "from_date": "1995-12-03",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10004,
          "from_date": "1986-12-01",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10005,
          "from_date": "1989-09-12",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10006,
          "from_date": "1990-08-05",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10007,
          "from_date": "1989-02-10",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10008,
          "from_date": "1998-03-11",
          "to_date": "2000-07-31"
        },
        {
          "emp_no": 10009,
          "from_date": "1985-02-18",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10010,
          "from_date": "2000-06-26",
          "to_date": "9999-01-01"
        },
        {
          "emp_no": 10011,
          "from_date": "1990-01-22",
          "to_date": "1996-11-09"
        },
        {
          "emp_no": 10012,
          "from_date": "1992-12-18",
          "to_date": "9999-01-01"
        }
      ]
    }
  ],
  "sourceViews": []
}
