| | 291 | |
| | 292 | ==== 12. ADMIN(user_id, admin_type, discount_percentage) |
| | 293 | |
| | 294 | {{{ |
| | 295 | R12 = R11 - {admin_type, discount_percentage} |
| | 296 | |
| | 297 | R12 = {user_id, points_collected, artist_id, release_id, album_id, song_id, product_id, order_id, modification_id, wishlist_id} |
| | 298 | }}} |
| | 299 | |
| | 300 | * **Lossless join:** The original relation can be reconstructed through a join using {{{user_id}}}. |
| | 301 | |
| | 302 | * **Dependency preservation:** The dependency {{{user_id → admin_type, discount_percentage}}} is preserved in the new ''ADMIN'' relation. |
| | 303 | |
| | 304 | ==== 13. CONSUMER(user_id, points_collected) |
| | 305 | |
| | 306 | {{{ |
| | 307 | R13 = R12 - {points_collected} |
| | 308 | |
| | 309 | R13 = {user_id, artist_id, release_id, album_id, song_id, product_id, order_id, modification_id, wishlist_id} |
| | 310 | }}} |
| | 311 | |
| | 312 | * **Lossless join:** The original relation can be reconstructed through a join using {{{user_id}}}. |
| | 313 | |
| | 314 | * **Dependency preservation:** The dependency {{{user_id → points_collected}}} is preserved in the new ''CONSUMER'' relation. |
| | 315 | |
| | 316 | ==== 14. WISHLIST(user_id, wishlist_id) |
| | 317 | |
| | 318 | {{{ |
| | 319 | R14 = R13 - {wishlist_id} |
| | 320 | |
| | 321 | R14 = {user_id, artist_id, release_id, album_id, song_id, product_id, order_id, modification_id} |
| | 322 | }}} |
| | 323 | |
| | 324 | * **Lossless join:** The original relation can be reconstructed through a join using {{{user_id}}}. |
| | 325 | |
| | 326 | * **Dependency preservation:** The dependencies {{{user_id → wishlist_id}}} and {{{wishlist_id → user_id}}} are preserved in the new ''WISHLIST'' relation. |
| | 327 | |
| | 328 | ==== 15. Removing Remaining Partial Dependencies |
| | 329 | |
| | 330 | Two non-prime attributes remain: |
| | 331 | |
| | 332 | 1. {{{order_id → user_id}}} |
| | 333 | 2. {{{product_id → release_id}}} |
| | 334 | |
| | 335 | Since {{{order_id}}} and {{{product_id}}} are proper subsets of the candidate key, these are still partial dependencies. However, these dependencies are already represented in ''ORDER'' and ''PRODUCT''. |
| | 336 | |
| | 337 | {{{ |
| | 338 | R15 = R14 - {user_id, release_id} |
| | 339 | |
| | 340 | R15 = {artist_id, release_id, album_id, song_id, product_id, |
| | 341 | order_id, modification_id} |
| | 342 | }}} |
| | 343 | |
| | 344 | * **Lossless join:** The removed {{{user_id}}} can be recovered through the existing ''ORDER'' relation using {{{order_id}}} and the removed {{{release_id}}} can be recovered through the existing ''PRODUCT'' relation using {{{product_id}}}. |
| | 345 | |
| | 346 | * **Dependency preservation:** The dependency {{{order_id → user_id}}} remains preserved in the existing ''ORDER'' relation and the dependency {{{product_id → release_id}}} remains preserved in the existing ''PRODUCT'' relation. |
| | 347 | |
| | 348 | }}} |