{
  "format": "dataset-manifest/1",
  "slug": "library",
  "version": 1,
  "seed": "library:1",
  "spec": {
    "format": "dataset/1",
    "slug": "library",
    "name": "Library Event Tracking",
    "tagline": "Member interactions, subscriptions, books, wishlists, reviews, and loans from a vibrant library community.",
    "description": "Members explore the library's vast collection of books, engaging with various services that enhance their reading experience. Each member may hold multiple subscriptions, granting them access to different genres and services. As they browse the catalog, they build wishlists filled with desired titles, while also providing valuable feedback through reviews that help improve the library's offerings. Alongside this, the library tracks loans of devices such as e-readers and tablets, ensuring that members have the tools they need to enjoy their literary adventures.\n\nThe database consists of several interrelated tables that capture these activities: the 'members' table documents individual library users, containing information such as their ID, name, and membership status. The 'subscriptions' table links members to their active subscriptions, detailing which services they can access. 'Books' lists the available titles in the library, while 'wishlists' connects members to the books they are interested in, allowing staff to see which titles are in demand. 'Reviews' provides insights into member feedback on books, helping to shape future acquisitions and services. Lastly, 'loans' tracks the devices rented out to members, indicating which items are popular and how often they are utilized.\n\nThis dataset is particularly valuable for analyzing member engagement and preferences, as it answers questions such as: Which genres are most popular among subscriptions? How do wishlist items correlate with actual loans and purchases? What types of reviews do well-received books receive compared to those that are less popular? Through these inquiries, users can practice their data analysis skills, uncovering trends and insights that drive library operations. Keep in mind, the data provided is synthetic, crafted for the purpose of learning and experimentation.",
    "domain": "hospitality",
    "shape": "event-log",
    "useCases": [
      "analytics-demo",
      "etl-pipelines"
    ],
    "keywords": [
      "library",
      "members",
      "subscriptions",
      "books",
      "wishlists",
      "reviews",
      "loans",
      "engagement"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "members": {
        "description": "Each row represents a library member, linking to their subscriptions and interactions with books.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each member."
          },
          "full_name": {
            "kind": "fullName",
            "description": "The member's full name."
          },
          "email": {
            "kind": "email",
            "from": "full_name",
            "description": "The member's email address."
          },
          "join_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-01-01",
            "description": "Date when the member joined the library."
          },
          "membership_type": {
            "kind": "enum",
            "values": [
              "regular",
              "premium"
            ],
            "description": "Type of membership held by the member."
          }
        }
      },
      "subscriptions": {
        "description": "Tracks the subscriptions held by each member, detailing the subscription plans.",
        "rows": {
          "per": "members",
          "via": "member_id",
          "min": 1,
          "max": 3,
          "skew": "long-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each subscription."
          },
          "member_id": {
            "kind": "fk",
            "ref": "members.id",
            "description": "Reference to the member who holds the subscription."
          },
          "start_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-01-01",
            "description": "Subscription start date.",
            "trend": "growing"
          },
          "end_date": {
            "kind": "date",
            "after": "start_date",
            "withinDays": 30,
            "description": "Subscription end date."
          },
          "plan_type": {
            "kind": "enum",
            "values": [
              "monthly",
              "yearly"
            ],
            "description": "Type of subscription plan."
          }
        }
      },
      "books": {
        "description": "Each row represents a book available in the library, linked to wishlists and reviews.",
        "rows": 300,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each book."
          },
          "title": {
            "kind": "sentence",
            "max": 10,
            "description": "The title of the book."
          },
          "author": {
            "kind": "sentence",
            "max": 5,
            "description": "The author(s) of the book."
          },
          "genre": {
            "kind": "enum",
            "values": [
              "fiction",
              "non-fiction",
              "science",
              "history",
              "biography"
            ],
            "description": "The genre of the book."
          },
          "published_date": {
            "kind": "date",
            "from": "1900-01-01",
            "to": "2023-01-01",
            "description": "Date when the book was published."
          }
        }
      },
      "wishlists": {
        "description": "Tracks the wishlist items for each member, indicating books they wish to borrow or purchase.",
        "rows": {
          "per": "members",
          "via": "member_id",
          "min": 0,
          "max": 10,
          "skew": "heavy-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each wishlist entry."
          },
          "member_id": {
            "kind": "fk",
            "ref": "members.id",
            "description": "Reference to the member who created the wishlist."
          },
          "book_id": {
            "kind": "fk",
            "ref": "books.id",
            "description": "Reference to the book on the wishlist."
          },
          "added_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-01-01",
            "description": "Date when the book was added to the wishlist."
          }
        }
      },
      "reviews": {
        "description": "Captures reviews submitted by members for various books, linking them to the relevant books.",
        "rows": {
          "per": "members",
          "via": "member_id",
          "min": 0,
          "max": 5,
          "skew": "long-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each review."
          },
          "member_id": {
            "kind": "fk",
            "ref": "members.id",
            "description": "Reference to the member who submitted the review."
          },
          "book_id": {
            "kind": "fk",
            "ref": "books.id",
            "description": "Reference to the book being reviewed."
          },
          "rating": {
            "kind": "int",
            "min": 1,
            "max": 5,
            "description": "Rating given to the book by the member."
          },
          "comment": {
            "kind": "paragraph",
            "max": 200,
            "description": "Text of the review comment."
          },
          "review_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-01-01",
            "description": "Date when the review was submitted.",
            "trend": "seasonal"
          }
        }
      },
      "loans": {
        "description": "Tracks the loaned devices or books to members, linking them to the books they borrowed.",
        "rows": {
          "per": "members",
          "via": "member_id",
          "min": 0,
          "max": 3,
          "skew": "long-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each loan."
          },
          "member_id": {
            "kind": "fk",
            "ref": "members.id",
            "description": "Reference to the member who borrowed the book."
          },
          "book_id": {
            "kind": "fk",
            "ref": "books.id",
            "description": "Reference to the book that was borrowed."
          },
          "loan_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-01-01",
            "description": "Date when the book was loaned out."
          },
          "return_date": {
            "kind": "date",
            "after": "loan_date",
            "withinDays": 30,
            "description": "Date when the book was returned."
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "categorical",
      "nullable",
      "timestamped",
      "self-referencing"
    ],
    "analysisQuestions": [
      "What are the most popular genres requested by members?",
      "How do reviews impact the borrowing frequency of books?",
      "What subscription patterns exist among different member types?",
      "Are there seasonal trends in book loans and returns?",
      "How do wishlist items correlate with actual borrowing behavior?"
    ],
    "suggestedQueries": [
      {
        "title": "List all members and their subscriptions",
        "sql": "SELECT members.full_name, subscriptions.plan_type FROM members JOIN subscriptions ON members.id = subscriptions.member_id;",
        "dialect": "postgres"
      },
      {
        "title": "Count books by genre",
        "sql": "SELECT genre, COUNT(*) FROM books GROUP BY genre;",
        "dialect": "postgres"
      },
      {
        "title": "Find average rating for each book",
        "sql": "SELECT book_id, AVG(rating) FROM reviews GROUP BY book_id;",
        "dialect": "postgres"
      },
      {
        "title": "Get members who have borrowed books more than twice",
        "sql": "SELECT member_id, COUNT(*) FROM loans GROUP BY member_id HAVING COUNT(*) > 2;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Library Management Analytics",
        "body": "Library administrators can use this dataset to analyze member engagement and preferences. By examining the relationships between subscriptions, loans, and reviews, they can better understand which services are most valued and make data-driven decisions to enhance member experiences."
      },
      {
        "title": "ETL Pipeline Development",
        "body": "Data engineers can utilize this dataset to develop ETL pipelines that extract, transform, and load library event data into a data warehouse. This allows for the integration of library data with other systems, providing a comprehensive view of member interactions and library performance."
      },
      {
        "title": "Market Research for New Services",
        "body": "Marketing teams can leverage insights from this dataset to identify trends in book loans and wishlist requests. This information is valuable for planning new services or book acquisitions that align with member interests and improve overall satisfaction."
      },
      {
        "title": "Training and Workshops for Staff",
        "body": "Library staff can use this dataset as a training tool to learn about data analysis techniques. By practicing with real-world data, they can improve their skills in SQL and data interpretation, enabling them to make more informed recommendations to library members."
      }
    ]
  },
  "counts": {
    "books": 300,
    "members": 200,
    "loans": 191,
    "reviews": 287,
    "subscriptions": 309,
    "wishlists": 463
  },
  "stats": {
    "members": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "full_name": {
          "nulls": 0,
          "distinct": 197,
          "min": "Alice Hassan",
          "max": "Zara Murphy"
        },
        "email": {
          "nulls": 0,
          "distinct": 198
        },
        "join_date": {
          "nulls": 0,
          "distinct": 188,
          "min": "2020-01-05",
          "max": "2022-12-24"
        },
        "membership_type": {
          "nulls": 0,
          "distinct": 2,
          "min": "premium",
          "max": "regular"
        }
      }
    },
    "subscriptions": {
      "rows": 309,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 309,
          "min": 1,
          "max": 309
        },
        "member_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "start_date": {
          "nulls": 0,
          "distinct": 268,
          "min": "2020-01-02",
          "max": "2022-12-30"
        },
        "end_date": {
          "nulls": 0,
          "distinct": 265,
          "min": "2020-01-15",
          "max": "2023-01-16"
        },
        "plan_type": {
          "nulls": 0,
          "distinct": 2,
          "min": "monthly",
          "max": "yearly"
        }
      }
    },
    "books": {
      "rows": 300,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 300
        },
        "title": {
          "nulls": 0,
          "distinct": 299
        },
        "author": {
          "nulls": 0,
          "distinct": 296
        },
        "genre": {
          "nulls": 0,
          "distinct": 5,
          "min": "biography",
          "max": "science"
        },
        "published_date": {
          "nulls": 0,
          "distinct": 300,
          "min": "1900-02-06",
          "max": "2021-12-11"
        }
      }
    },
    "wishlists": {
      "rows": 463,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 463,
          "min": 1,
          "max": 463
        },
        "member_id": {
          "nulls": 0,
          "distinct": 109,
          "min": 1,
          "max": 198
        },
        "book_id": {
          "nulls": 0,
          "distinct": 240,
          "min": 1,
          "max": 300
        },
        "added_date": {
          "nulls": 0,
          "distinct": 394,
          "min": "2020-01-01",
          "max": "2022-12-31"
        }
      }
    },
    "reviews": {
      "rows": 287,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 287,
          "min": 1,
          "max": 287
        },
        "member_id": {
          "nulls": 0,
          "distinct": 110,
          "min": 2,
          "max": 199
        },
        "book_id": {
          "nulls": 0,
          "distinct": 182,
          "min": 1,
          "max": 300
        },
        "rating": {
          "nulls": 0,
          "distinct": 5,
          "min": 1,
          "max": 5
        },
        "comment": {
          "nulls": 0,
          "distinct": 287
        },
        "review_date": {
          "nulls": 0,
          "distinct": 250,
          "min": "2020-01-01",
          "max": "2022-12-25"
        }
      }
    },
    "loans": {
      "rows": 191,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 191,
          "min": 1,
          "max": 191
        },
        "member_id": {
          "nulls": 0,
          "distinct": 98,
          "min": 2,
          "max": 200
        },
        "book_id": {
          "nulls": 0,
          "distinct": 152,
          "min": 6,
          "max": 298
        },
        "loan_date": {
          "nulls": 0,
          "distinct": 181,
          "min": "2020-01-02",
          "max": "2023-01-01"
        },
        "return_date": {
          "nulls": 0,
          "distinct": 175,
          "min": "2020-01-16",
          "max": "2023-01-23"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/books.csv",
      "format": "csv",
      "table": "books",
      "key": "datasets/library/v1/csv/books.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/csv/books.csv",
      "bytes": 37430,
      "sha256": "a8184370a794c25f5126c869e95dd75116f2053edd7fd1cfabb8f6df628a0707",
      "rows": 300,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/members.csv",
      "format": "csv",
      "table": "members",
      "key": "datasets/library/v1/csv/members.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/csv/members.csv",
      "bytes": 11956,
      "sha256": "0826ee6bf02020784ec8975fa104b466c2bba92912fd5efe241052fd7675c60c",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/loans.csv",
      "format": "csv",
      "table": "loans",
      "key": "datasets/library/v1/csv/loans.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/csv/loans.csv",
      "bytes": 6462,
      "sha256": "787dfe31baaaba3156912dc0ba4c9e3cc1b428a25bb8cc85aa6ea583b744d133",
      "rows": 191,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/reviews.csv",
      "format": "csv",
      "table": "reviews",
      "key": "datasets/library/v1/csv/reviews.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/csv/reviews.csv",
      "bytes": 56869,
      "sha256": "946bafa56a1800821e37ce587465ca7da8a2802b2bcb4524b35983feb79a110d",
      "rows": 287,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/subscriptions.csv",
      "format": "csv",
      "table": "subscriptions",
      "key": "datasets/library/v1/csv/subscriptions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/csv/subscriptions.csv",
      "bytes": 11660,
      "sha256": "eedb6434a7646b35357316cd6b71dafc53fda56f640be3b614694203c4fd1248",
      "rows": 309,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/wishlists.csv",
      "format": "csv",
      "table": "wishlists",
      "key": "datasets/library/v1/csv/wishlists.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/csv/wishlists.csv",
      "bytes": 10628,
      "sha256": "1b3799ee8bf88468f7110d3d90e8db52bdd1c81bb868c4373dedcf77b0869afb",
      "rows": 463,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "library.json",
      "format": "json",
      "table": null,
      "key": "datasets/library/v1/library.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/library.json",
      "bytes": 318340,
      "sha256": "ae05a2a603c5e9629a9254f800d7a6e9ff315a710c7aca005805ffb304785e6c",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/library/v1/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/sql/postgres.sql",
      "bytes": 164279,
      "sha256": "8565c98f5cff95d67247c57b0453b6770041731a44f9d72fff0ffbea05deb2fb",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/library/v1/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/sql/mysql.sql",
      "bytes": 163612,
      "sha256": "8b0a1418069da2d7ff511606be14c5e79ce5634b92c9a9ad967f67a1eec3ff03",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/library/v1/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/sql/mssql.sql",
      "bytes": 168352,
      "sha256": "c3befc9eeca5ff94b31f3def0e824cb95f200e8956c293b8d50f5ac1302c0260",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/library/v1/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/sql/sqlite.sql",
      "bytes": 163373,
      "sha256": "4713122c85ef1b975a90d76270d7146c791d21cc6ec74bcc67104a8588890814",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/library/v1/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/prisma/seed.ts",
      "bytes": 257713,
      "sha256": "df68c07c04e37a472dc963e6a2eeff0aa53d1e29b789ac75c6b2dd92e899647f",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/library/v1/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/library/v1/django/fixtures.json",
      "bytes": 388697,
      "sha256": "1c2b662f042853edd9ee3c8bc206e147dc3eefff99c952d3b88c227478aefa38",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788768430185,
  "updatedAt": 1788768430185
}
