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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"analysis_notes": [
|
| 3 |
+
"Use analysis.transaction_lines_nonoverlapping for ordinary analytical questions unless the user explicitly asks about raw ingestion or data quality.",
|
| 4 |
+
"Each row in the primary relation is one transaction line. Signed line value is quantity * unit_price_gbp; negative quantities therefore reduce net sales.",
|
| 5 |
+
"Cancellation invoice identifiers commonly begin with C, but signed quantities are the safer basis for net calculations.",
|
| 6 |
+
"invoice_ts is a timezone-naive source timestamp. State calendar boundaries explicitly when filtering time periods.",
|
| 7 |
+
"customer_id and description can be missing. The packaged data also contains zero and negative prices; choose exclusions only when the question requires them.",
|
| 8 |
+
"The primary analysis view removes 22,523 cross-sheet overlap rows from the 1,067,371 raw rows. It intentionally retains 12,133 within-sheet duplicate occurrences.",
|
| 9 |
+
"Use raw.transaction_lines only when the question explicitly needs the original worksheets or their overlap. Use metadata.dataset and metadata.quality_summary for provenance and documented quality counts.",
|
| 10 |
+
"Documented quality counts are: 243,007 rows missing customer_id; 4,382 missing description; 19,494 cancellation-code rows; 3,457 negative-quantity rows without a cancellation code; 5 negative-price rows; and 6,202 zero-price rows."
|
| 11 |
+
],
|
| 12 |
+
"coverage": {
|
| 13 |
+
"country_values": 43,
|
| 14 |
+
"identified_customers": 5942,
|
| 15 |
+
"invoices": 53628,
|
| 16 |
+
"period_end": "2011-12-09 12:50",
|
| 17 |
+
"period_start": "2009-12-01 07:45",
|
| 18 |
+
"product_codes": 5305,
|
| 19 |
+
"transaction_lines": 1044848
|
| 20 |
+
},
|
| 21 |
+
"example_questions": [
|
| 22 |
+
"How did monthly net sales change over the available period?",
|
| 23 |
+
"Which products generated the most net sales in 2011?",
|
| 24 |
+
"How many identified customers made purchases in each country?",
|
| 25 |
+
"What share of invoice lines have no customer identifier?"
|
| 26 |
+
],
|
| 27 |
+
"format": "dsa-database-card/v1",
|
| 28 |
+
"primary_relation": "analysis.transaction_lines_nonoverlapping",
|
| 29 |
+
"relations": [
|
| 30 |
+
{
|
| 31 |
+
"columns": [
|
| 32 |
+
{
|
| 33 |
+
"data_type": "BIGINT",
|
| 34 |
+
"description": "Stable packaged row identifier.",
|
| 35 |
+
"name": "line_id"
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"data_type": "VARCHAR",
|
| 39 |
+
"description": "Original workbook worksheet containing the row.",
|
| 40 |
+
"name": "source_sheet"
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"data_type": "INTEGER",
|
| 44 |
+
"description": "Row number in the original worksheet.",
|
| 45 |
+
"name": "source_row"
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"data_type": "VARCHAR",
|
| 49 |
+
"description": "Invoice or cancellation identifier.",
|
| 50 |
+
"name": "invoice_id"
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"data_type": "VARCHAR",
|
| 54 |
+
"description": "Product or item code.",
|
| 55 |
+
"name": "stock_code"
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"data_type": "VARCHAR",
|
| 59 |
+
"description": "Product description from the source data.",
|
| 60 |
+
"name": "description"
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"data_type": "INTEGER",
|
| 64 |
+
"description": "Signed quantity recorded on the transaction line.",
|
| 65 |
+
"name": "quantity"
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"data_type": "TIMESTAMP",
|
| 69 |
+
"description": "Invoice timestamp without timezone information.",
|
| 70 |
+
"name": "invoice_ts"
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"data_type": "DECIMAL(18,3)",
|
| 74 |
+
"description": "Price per unit in British pounds.",
|
| 75 |
+
"name": "unit_price_gbp"
|
| 76 |
+
},
|
| 77 |
+
{
|
| 78 |
+
"data_type": "VARCHAR",
|
| 79 |
+
"description": "Source customer identifier when one is present.",
|
| 80 |
+
"name": "customer_id"
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"data_type": "VARCHAR",
|
| 84 |
+
"description": "Country recorded for the invoice.",
|
| 85 |
+
"name": "country"
|
| 86 |
+
}
|
| 87 |
+
],
|
| 88 |
+
"description": "The primary transaction-line view for ordinary questions, with cross-sheet overlap removed.",
|
| 89 |
+
"kind": "view",
|
| 90 |
+
"name": "analysis.transaction_lines_nonoverlapping",
|
| 91 |
+
"row_count": 1044848
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"columns": [
|
| 95 |
+
{
|
| 96 |
+
"data_type": "BIGINT",
|
| 97 |
+
"description": "Stable packaged row identifier.",
|
| 98 |
+
"name": "line_id"
|
| 99 |
+
},
|
| 100 |
+
{
|
| 101 |
+
"data_type": "VARCHAR",
|
| 102 |
+
"description": "Original workbook worksheet containing the row.",
|
| 103 |
+
"name": "source_sheet"
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"data_type": "INTEGER",
|
| 107 |
+
"description": "Row number in the original worksheet.",
|
| 108 |
+
"name": "source_row"
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"data_type": "VARCHAR",
|
| 112 |
+
"description": "Invoice or cancellation identifier.",
|
| 113 |
+
"name": "invoice_id"
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"data_type": "VARCHAR",
|
| 117 |
+
"description": "Product or item code.",
|
| 118 |
+
"name": "stock_code"
|
| 119 |
+
},
|
| 120 |
+
{
|
| 121 |
+
"data_type": "VARCHAR",
|
| 122 |
+
"description": "Product description from the source data.",
|
| 123 |
+
"name": "description"
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"data_type": "INTEGER",
|
| 127 |
+
"description": "Signed quantity recorded on the transaction line.",
|
| 128 |
+
"name": "quantity"
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"data_type": "TIMESTAMP",
|
| 132 |
+
"description": "Invoice timestamp without timezone information.",
|
| 133 |
+
"name": "invoice_ts"
|
| 134 |
+
},
|
| 135 |
+
{
|
| 136 |
+
"data_type": "DECIMAL(18,3)",
|
| 137 |
+
"description": "Price per unit in British pounds.",
|
| 138 |
+
"name": "unit_price_gbp"
|
| 139 |
+
},
|
| 140 |
+
{
|
| 141 |
+
"data_type": "VARCHAR",
|
| 142 |
+
"description": "Source customer identifier when one is present.",
|
| 143 |
+
"name": "customer_id"
|
| 144 |
+
},
|
| 145 |
+
{
|
| 146 |
+
"data_type": "VARCHAR",
|
| 147 |
+
"description": "Country recorded for the invoice.",
|
| 148 |
+
"name": "country"
|
| 149 |
+
}
|
| 150 |
+
],
|
| 151 |
+
"description": "All transaction lines from both source worksheets before cross-sheet overlap removal.",
|
| 152 |
+
"kind": "table",
|
| 153 |
+
"name": "raw.transaction_lines",
|
| 154 |
+
"row_count": 1067371
|
| 155 |
+
},
|
| 156 |
+
{
|
| 157 |
+
"columns": [
|
| 158 |
+
{
|
| 159 |
+
"data_type": "VARCHAR",
|
| 160 |
+
"description": "Stable short name of the dataset.",
|
| 161 |
+
"name": "dataset_slug"
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"data_type": "VARCHAR",
|
| 165 |
+
"description": "Human-readable dataset title.",
|
| 166 |
+
"name": "title"
|
| 167 |
+
},
|
| 168 |
+
{
|
| 169 |
+
"data_type": "VARCHAR",
|
| 170 |
+
"description": "Original UCI dataset page.",
|
| 171 |
+
"name": "source_url"
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"data_type": "VARCHAR",
|
| 175 |
+
"description": "Persistent DOI for the source dataset.",
|
| 176 |
+
"name": "source_doi"
|
| 177 |
+
},
|
| 178 |
+
{
|
| 179 |
+
"data_type": "VARCHAR",
|
| 180 |
+
"description": "License stated by the source repository.",
|
| 181 |
+
"name": "source_license"
|
| 182 |
+
},
|
| 183 |
+
{
|
| 184 |
+
"data_type": "VARCHAR",
|
| 185 |
+
"description": "Name of the ingested source archive.",
|
| 186 |
+
"name": "source_archive"
|
| 187 |
+
},
|
| 188 |
+
{
|
| 189 |
+
"data_type": "VARCHAR",
|
| 190 |
+
"description": "SHA-256 digest of the source archive.",
|
| 191 |
+
"name": "source_sha256"
|
| 192 |
+
},
|
| 193 |
+
{
|
| 194 |
+
"data_type": "VARCHAR",
|
| 195 |
+
"description": "Version of this packaged distribution.",
|
| 196 |
+
"name": "distribution_version"
|
| 197 |
+
},
|
| 198 |
+
{
|
| 199 |
+
"data_type": "VARCHAR",
|
| 200 |
+
"description": "DuckDB version used to build the database.",
|
| 201 |
+
"name": "duckdb_version"
|
| 202 |
+
},
|
| 203 |
+
{
|
| 204 |
+
"data_type": "TIMESTAMP WITH TIME ZONE",
|
| 205 |
+
"description": "UTC time at which the package was built.",
|
| 206 |
+
"name": "built_at_utc"
|
| 207 |
+
},
|
| 208 |
+
{
|
| 209 |
+
"data_type": "BIGINT",
|
| 210 |
+
"description": "Number of rows in the raw relation.",
|
| 211 |
+
"name": "raw_row_count"
|
| 212 |
+
},
|
| 213 |
+
{
|
| 214 |
+
"data_type": "BIGINT",
|
| 215 |
+
"description": "Number of rows in the primary analysis relation.",
|
| 216 |
+
"name": "analysis_row_count"
|
| 217 |
+
}
|
| 218 |
+
],
|
| 219 |
+
"description": "Source, license, build, version, and row-count metadata for the packaged database.",
|
| 220 |
+
"kind": "table",
|
| 221 |
+
"name": "metadata.dataset",
|
| 222 |
+
"row_count": 1
|
| 223 |
+
},
|
| 224 |
+
{
|
| 225 |
+
"columns": [
|
| 226 |
+
{
|
| 227 |
+
"data_type": "VARCHAR",
|
| 228 |
+
"description": "Name of the documented quality measure.",
|
| 229 |
+
"name": "metric"
|
| 230 |
+
},
|
| 231 |
+
{
|
| 232 |
+
"data_type": "BIGINT",
|
| 233 |
+
"description": "Count recorded for the quality measure.",
|
| 234 |
+
"name": "metric_value"
|
| 235 |
+
},
|
| 236 |
+
{
|
| 237 |
+
"data_type": "VARCHAR",
|
| 238 |
+
"description": "Human-readable explanation of the measure.",
|
| 239 |
+
"name": "description"
|
| 240 |
+
}
|
| 241 |
+
],
|
| 242 |
+
"description": "Counts of documented overlap, missing-value, cancellation, price, and duplicate conditions.",
|
| 243 |
+
"kind": "table",
|
| 244 |
+
"name": "metadata.quality_summary",
|
| 245 |
+
"row_count": 10
|
| 246 |
+
}
|
| 247 |
+
],
|
| 248 |
+
"summary": "This DuckDB contains the **Online Retail II** transaction-line dataset from the UCI Machine Learning Repository. The source describes a UK-based non-store retailer, and the records cover **1 December 2009 through 9 December 2011**. Unit prices are in GBP.",
|
| 249 |
+
"title": "Online Retail II"
|
| 250 |
+
}
|