{
  "format": "dataset-manifest/1",
  "slug": "query-insights-repository",
  "version": 3,
  "seed": "query-insights-repository:1",
  "spec": {
    "format": "dataset/1",
    "slug": "query-insights-repository",
    "name": "Query Insights Repository",
    "tagline": "User activities, query performance, dashboards, alerts, and performance metrics from SaaS database management tools.",
    "description": "The Query Insights Repository is a synthetic dataset designed to help developers and data analysts understand user interactions with database management tools. This dataset models various aspects of database performance, including user activities, query execution times, dashboard configurations, and alert mechanisms. Each table contains relevant details that paint a comprehensive picture of how organizations utilize their database tools for monitoring and optimizing data operations. \n\nThe tables are interconnected through foreign keys, allowing users to explore relationships such as which users are executing the most complex queries, how dashboard configurations influence query performance, and how alerts are triggered based on user-defined thresholds. By working with this dataset, developers can practice SQL queries, build ETL pipelines, and engage in teaching scenarios that require a real-world context. This repository serves as a valuable resource for anyone looking to gain insights into database management practices and improve their analytical skills using synthetic data.",
    "domain": "saas",
    "shape": "slowly-changing",
    "useCases": [
      "etl-pipelines",
      "teaching"
    ],
    "keywords": [
      "database management",
      "query performance",
      "user activities",
      "dashboard configurations",
      "alert mechanisms"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "users": {
        "description": "This table contains information about users interacting with the database management tool, allowing tracking of user activities.",
        "rows": 150,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the user."
          },
          "full_name": {
            "kind": "fullName",
            "description": "The user's full name.",
            "nullable": true
          },
          "email": {
            "kind": "email",
            "from": "full_name",
            "description": "Email address of the user, derived from full name.",
            "nullable": true
          },
          "created_at": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date when the user was created.",
            "dayProfile": "business"
          }
        }
      },
      "queries": {
        "description": "This table logs queries executed by users, detailing their performance and complexity.",
        "rows": 300,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the query."
          },
          "user_id": {
            "kind": "fk",
            "ref": "users.id",
            "description": "The user who executed the query."
          },
          "execution_time": {
            "kind": "decimal",
            "min": 0.01,
            "max": 120,
            "scale": 2,
            "description": "Time taken to execute the query in seconds.",
            "nullable": true,
            "distribution": "normal"
          },
          "query_text": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "The SQL text of the executed query.",
            "nullable": true,
            "pool": [
              "select",
              "from",
              "where",
              "join",
              "inner",
              "outer",
              "left",
              "right",
              "group",
              "by",
              "order",
              "asc",
              "desc",
              "limit",
              "offset",
              "having",
              "count",
              "sum",
              "avg",
              "min",
              "max",
              "distinct",
              "as",
              "on",
              "and",
              "or",
              "not",
              "like",
              "in",
              "between",
              "exists",
              "case",
              "when",
              "then",
              "else",
              "end",
              "union",
              "intersect",
              "except",
              "values",
              "insert",
              "update",
              "delete",
              "set",
              "create",
              "table",
              "drop",
              "alter",
              "index",
              "view",
              "procedure",
              "function",
              "trigger",
              "transaction"
            ]
          },
          "created_at": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date when the query was executed.",
            "dayProfile": "waking"
          }
        }
      },
      "dashboards": {
        "description": "This table captures the configurations of dashboards created by users, including visualizations and metrics.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the dashboard."
          },
          "user_id": {
            "kind": "fk",
            "ref": "users.id",
            "description": "The user who created the dashboard."
          },
          "configuration": {
            "kind": "json",
            "template": {
              "widgets": {
                "kind": "words",
                "min": 1,
                "max": 10,
                "description": "List of widgets configured in the dashboard."
              }
            },
            "description": "The JSON configuration of the dashboard.",
            "nullable": true
          },
          "created_at": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date when the dashboard was created.",
            "dayProfile": "business"
          }
        }
      },
      "alerts": {
        "description": "This table records alert mechanisms configured by users for monitoring query performance and system health.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the alert."
          },
          "user_id": {
            "kind": "fk",
            "ref": "users.id",
            "description": "The user who created the alert."
          },
          "threshold": {
            "kind": "decimal",
            "min": 0.01,
            "max": 100,
            "scale": 2,
            "description": "Performance threshold that triggers the alert.",
            "nullable": true,
            "when": {
              "column": "alert_type",
              "in": [
                "email",
                "sms"
              ]
            },
            "distribution": "high"
          },
          "alert_type": {
            "kind": "enum",
            "values": [
              "email",
              "sms",
              "webhook"
            ],
            "description": "Type of alert notification.",
            "weights": [
              8,
              2,
              1
            ]
          },
          "created_at": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date when the alert was created.",
            "dayProfile": "business"
          }
        }
      },
      "performance_metrics": {
        "description": "This table tracks performance metrics over time, capturing the efficiency of queries run by users.",
        "rows": 250,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the performance metric entry."
          },
          "query_id": {
            "kind": "fk",
            "ref": "queries.id",
            "description": "The query linked to these performance metrics."
          },
          "metric_name": {
            "kind": "words",
            "description": "Name of the performance metric.",
            "pool": [
              "response-time",
              "throughput",
              "latency",
              "error-rate",
              "cpu-usage",
              "memory-usage",
              "disk-io",
              "network-traffic",
              "query-count",
              "cache-hit",
              "cache-miss",
              "load-time",
              "execution-time",
              "wait-time",
              "connection-pool",
              "request-rate",
              "success-rate",
              "failure-rate",
              "uptime",
              "availability",
              "scalability",
              "reliability",
              "performance",
              "efficiency",
              "utilization",
              "service-level",
              "benchmark",
              "monitoring",
              "alerting",
              "logging",
              "profiling",
              "analysis",
              "optimization",
              "saturation",
              "bottleneck",
              "degradation",
              "latency-variance",
              "response-variance",
              "resource-allocation",
              "cost-effectiveness",
              "load-balancing",
              "failover",
              "redundancy"
            ],
            "min": 1,
            "max": 3
          },
          "metric_value": {
            "kind": "decimal",
            "min": 0,
            "max": 100,
            "scale": 2,
            "description": "Value of the performance metric.",
            "distribution": "high"
          },
          "recorded_at": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date when the metric was recorded."
          }
        }
      },
      "user_activity_logs": {
        "description": "This table records user activities within the database management tool, tracking actions and timestamps.",
        "rows": 180,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the activity log."
          },
          "user_id": {
            "kind": "fk",
            "ref": "users.id",
            "description": "The user associated with the activity."
          },
          "action": {
            "kind": "enum",
            "values": [
              "login",
              "logout",
              "query_executed",
              "dashboard_created"
            ],
            "description": "Type of action performed by the user.",
            "weights": [
              5,
              3,
              4,
              2
            ]
          },
          "timestamp": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date and time when the action occurred.",
            "nullable": true,
            "when": {
              "column": "action",
              "in": [
                "login",
                "logout"
              ]
            },
            "dayProfile": "waking",
            "trend": "growing"
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "nullable",
      "timestamped",
      "high-cardinality"
    ],
    "analysisQuestions": [
      "What types of queries do users execute most frequently?",
      "How does query performance vary across different users?",
      "What dashboard configurations are most commonly used?",
      "Which alert mechanisms are preferred by users?",
      "How often do users log in and what activities do they perform?"
    ],
    "suggestedQueries": [
      {
        "title": "Get all queries executed by a specific user",
        "sql": "SELECT * FROM queries WHERE user_id = ?;",
        "dialect": "postgres"
      },
      {
        "title": "Count the number of dashboards created by each user",
        "sql": "SELECT user_id, COUNT(*) FROM dashboards GROUP BY user_id;",
        "dialect": "postgres"
      },
      {
        "title": "Calculate average execution time of queries by alert type",
        "sql": "SELECT alerts.alert_type, AVG(queries.execution_time) FROM queries JOIN alerts ON queries.user_id = alerts.user_id GROUP BY alerts.alert_type;",
        "dialect": "postgres"
      },
      {
        "title": "Find the most common actions performed by users",
        "sql": "SELECT action, COUNT(*) FROM user_activity_logs GROUP BY action ORDER BY COUNT(*) DESC;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Database Administrators Monitoring Performance",
        "body": "Database administrators can use this dataset to analyze the performance of various queries executed by users. By examining execution times and user activities, they can identify bottlenecks and optimize the database system for better efficiency."
      },
      {
        "title": "Teaching Database Management Concepts",
        "body": "Educators can leverage this dataset in classroom settings to teach students about database management practices, SQL query writing, and performance analysis. The realistic scenarios presented in the dataset provide a hands-on learning experience for students."
      },
      {
        "title": "Developing ETL Pipelines for Data Integration",
        "body": "Data engineers can utilize this dataset to develop and test ETL pipelines, ensuring that they can efficiently extract, transform, and load data related to user activities and query performance within database management tools."
      },
      {
        "title": "Monitoring User Engagement with Alerts",
        "body": "Product managers can analyze user engagement with alert mechanisms, understanding which types of alerts are most effective in notifying users about performance issues and ensuring they are promptly addressed."
      }
    ]
  },
  "counts": {
    "users": 150,
    "alerts": 100,
    "dashboards": 200,
    "queries": 300,
    "performance_metrics": 250,
    "user_activity_logs": 180
  },
  "stats": {
    "users": {
      "rows": 150,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 150,
          "min": 1,
          "max": 150
        },
        "full_name": {
          "nulls": 16,
          "distinct": 133,
          "min": "Alice Flores",
          "max": "Zoe Zhang"
        },
        "email": {
          "nulls": 24,
          "distinct": 125
        },
        "created_at": {
          "nulls": 0,
          "distinct": 150,
          "min": "2020-01-06 05:22:26",
          "max": "2023-12-08 17:55:23"
        }
      }
    },
    "queries": {
      "rows": 300,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 300
        },
        "user_id": {
          "nulls": 0,
          "distinct": 130,
          "min": 1,
          "max": 150
        },
        "execution_time": {
          "nulls": 28,
          "distinct": 270,
          "min": 8.15,
          "max": 109.42
        },
        "query_text": {
          "nulls": 31,
          "distinct": 221
        },
        "created_at": {
          "nulls": 0,
          "distinct": 300,
          "min": "2020-01-02 07:09:51",
          "max": "2023-12-31 14:21:43"
        }
      }
    },
    "dashboards": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "user_id": {
          "nulls": 0,
          "distinct": 108,
          "min": 1,
          "max": 150
        },
        "configuration": {
          "nulls": 23,
          "distinct": 175
        },
        "created_at": {
          "nulls": 0,
          "distinct": 200,
          "min": "2020-01-17 16:15:06",
          "max": "2023-12-27 10:16:34"
        }
      }
    },
    "alerts": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "user_id": {
          "nulls": 0,
          "distinct": 67,
          "min": 9,
          "max": 149
        },
        "threshold": {
          "nulls": 14,
          "distinct": 86,
          "min": 1,
          "max": 100
        },
        "alert_type": {
          "nulls": 0,
          "distinct": 3,
          "min": "email",
          "max": "webhook"
        },
        "created_at": {
          "nulls": 0,
          "distinct": 100,
          "min": "2020-01-01 10:24:31",
          "max": "2023-12-30 13:43:56"
        }
      }
    },
    "performance_metrics": {
      "rows": 250,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 250,
          "min": 1,
          "max": 250
        },
        "query_id": {
          "nulls": 0,
          "distinct": 168,
          "min": 1,
          "max": 300
        },
        "metric_name": {
          "nulls": 0,
          "distinct": 207
        },
        "metric_value": {
          "nulls": 0,
          "distinct": 242,
          "min": 2.89,
          "max": 99.98
        },
        "recorded_at": {
          "nulls": 0,
          "distinct": 250,
          "min": "2020-01-01 00:38:08",
          "max": "2023-12-30 22:47:06"
        }
      }
    },
    "user_activity_logs": {
      "rows": 180,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 180,
          "min": 1,
          "max": 180
        },
        "user_id": {
          "nulls": 0,
          "distinct": 111,
          "min": 1,
          "max": 150
        },
        "action": {
          "nulls": 0,
          "distinct": 4,
          "min": "dashboard_created",
          "max": "query_executed"
        },
        "timestamp": {
          "nulls": 68,
          "distinct": 112,
          "min": "2020-01-31 00:46:53",
          "max": "2023-12-31 19:38:10"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/users.csv",
      "format": "csv",
      "table": "users",
      "key": "datasets/query-insights-repository/v3/csv/users.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/csv/users.csv",
      "bytes": 8363,
      "sha256": "273dc194dc9fe8828eecb845eeefc75b438dae4be3c6916350cc13cc9b04f916",
      "rows": 150,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/alerts.csv",
      "format": "csv",
      "table": "alerts",
      "key": "datasets/query-insights-repository/v3/csv/alerts.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/csv/alerts.csv",
      "bytes": 3882,
      "sha256": "044d2244cfff7c34ad776325706dfe92454ad700d61af2f556f2b87d7996702f",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/dashboards.csv",
      "format": "csv",
      "table": "dashboards",
      "key": "datasets/query-insights-repository/v3/csv/dashboards.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/csv/dashboards.csv",
      "bytes": 16156,
      "sha256": "d0dd0007c96b2e422002d15227250edb7c01241afabbc88a35c8dc8c9d4ea0f6",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/queries.csv",
      "format": "csv",
      "table": "queries",
      "key": "datasets/query-insights-repository/v3/csv/queries.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/csv/queries.csv",
      "bytes": 13358,
      "sha256": "2bf7bf00fc18d01cf3a74fc75f128654e57b7b28dd12627f5873e180613d2aff",
      "rows": 300,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/performance_metrics.csv",
      "format": "csv",
      "table": "performance_metrics",
      "key": "datasets/query-insights-repository/v3/csv/performance_metrics.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/csv/performance_metrics.csv",
      "bytes": 14693,
      "sha256": "8cc1415a28cbbf615973da89b514c7eaa880bcf71f1a8ed4c8cbdfc13ea19230",
      "rows": 250,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/user_activity_logs.csv",
      "format": "csv",
      "table": "user_activity_logs",
      "key": "datasets/query-insights-repository/v3/csv/user_activity_logs.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/csv/user_activity_logs.csv",
      "bytes": 5514,
      "sha256": "58677b3e97d9b0501e2eef54038ddddea88afb03eb34250e53c730f2cb098cc7",
      "rows": 180,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "query-insights-repository.json",
      "format": "json",
      "table": null,
      "key": "datasets/query-insights-repository/v3/query-insights-repository.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/query-insights-repository.json",
      "bytes": 183267,
      "sha256": "42046d854aea2c5f5f0c2586ce239d85ed2e1d87fa42b64d405f2ede979585ec",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/query-insights-repository/v3/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/sql/postgres.sql",
      "bytes": 80950,
      "sha256": "06c886a395ef4d10a3ec168794643b2cce3cc89c4e58b4e90c8a9f70c019f5b4",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/query-insights-repository/v3/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/sql/mysql.sql",
      "bytes": 80250,
      "sha256": "b9473fdaefad0e4ad1feb9ca4ea5e717e33c3ff0b4e69626a10fbb3cbefa93b6",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/query-insights-repository/v3/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/sql/mssql.sql",
      "bytes": 83019,
      "sha256": "be6b50d813e1af419d7d83a17475bd192e28ab561421febb6a95e476ac93e6dd",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/query-insights-repository/v3/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/sql/sqlite.sql",
      "bytes": 79984,
      "sha256": "b110e662d51942149c498d634dc51b7ebe3985aa4e8e764ca259cb9d6104c3c9",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/query-insights-repository/v3/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/prisma/seed.ts",
      "bytes": 156526,
      "sha256": "f7194c3b2cfe50b480754571bfd440eeb0e934ae713d95f450b9cf18cc47667b",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/query-insights-repository/v3/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/query-insights-repository/v3/django/fixtures.json",
      "bytes": 237452,
      "sha256": "4bb240a810d578e5f7cb00e2dceed00c1c14a7ed6d45966cda5da29edcf91f8d",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788733925404,
  "updatedAt": 1788798150916
}
