> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sdf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SDF Information Schema

### Overview

During compilation, SDF creates a comprehensive **Information Schema** (IF) which contains metadata
about your workspace. This metadata includes basic information such as tables, columns, data types, and descriptions
along with more complex metadata like column level lineage, and data classifiers.

This workspace IF can be used to enrich data catalogs, and queried to power [Checks](/guide/data-quality/checks).
Under the hood, SDF stores the analysis output as Parquet.

### Information Schema

The below tables represent the SDF Information Schema. They are always accessible, after any compilation, in the *sdftarget* under `sdftarget/dbg/data/system/information_schema::sdf`

<img src="https://cdn.sdf.com/docs/Information-schema-RD.png" />

You may dynamically query the information schema in any valid SDF workspace.

**To query your tables:**

```shell theme={null}
sdf run -q "select * from sdf.information_schema.tables" 
```

**To query your columns:**

```shell theme={null}
sdf run -q "select * from sdf.information_schema.columns" 
```

**To query your column\_lineage:**

```shell theme={null}
sdf run -q "select * from sdf.information_schema.column_lineage" 
```

The information schema tables have the following schemas.

```shell theme={null}
$sdf man information-schema --format markdown
```

### Information Schema DDLs

Below are the DDLs representing these tables in SQL.

<div className="bg-[#0F1117] dark:bg-codeblock rounded-xl dark:ring-1 dark:ring-gray-800/50 relative">
  <pre style={{ fontFamily: 'monospace', backgroundColor: 'transparent' }} className="language-sql">
    <code className="language-sql">
      \--information\_schemas.sql

      CREATE TABLE sdf.information\_schema.tables(
          "table\_id" varchar not null,
          "catalog\_name" varchar not null,
          "schema\_name" varchar not null,
          "table\_name" varchar not null,
          "depends\_on" array\<varchar>,
          "depended\_on\_by" array\<varchar>,
          "description" varchar,
          "dialect" varchar not null,
          "materialization" varchar,
          "purpose" varchar,
          "origin" varchar,
          "classifiers" array\<varchar>,
          "source\_locations" array\<varchar>,
          "meta" map\<varchar not null, varchar>
      );

      CREATE TABLE sdf.information\_schema.columns(
          "table\_id" varchar not null,
          "catalog\_name" varchar not null,
          "schema\_name" varchar not null,
          "table\_name" varchar not null,
          "depends\_on" array\<varchar>,
          "depended\_on\_by" array\<varchar>,
          "description" varchar,
          "dialect" varchar not null,
          "materialization" varchar,
          "purpose" varchar,
          "origin" varchar,
          "classifiers" array\<varchar>,
          "source\_locations" array\<varchar>,
          "meta" map\<varchar not null, varchar>
      );

      CREATE TABLE sdf.information\_schema.table\_lineage(
          "from\_table\_id" varchar,
          "to\_table\_id" varchar,
          "lineage\_kind" varchar
      );

      CREATE TABLE sdf.information\_schema.column\_lineage(
          "from\_table\_id" varchar,
          "from\_column\_id" varchar,
          "to\_table\_id" varchar,
          "to\_column\_id" varchar,
          "lineage\_kind" varchar
      );
    </code>
  </pre>
</div>
