请阅读下面文字并完成这个数据库的ER图 题目背景以及要求 SirenCD is a digital media company that runs several retail stores that sell CDs to customers. In this coursework, you are asked to design a database for SirenCD to help manage the information of artists, albums, media tracks, and media purchases. The final database must be in 3NF and have no M:N relationships. You will also be asked to write a few queries based on your database design. 数据库设计 The retail stores of SirenCD sell many different CD albums. An album can have one or more soundtracks. Each soundtrack has its track name, release date, genre, length and composer. Each album is associated with an artist. Customers can look up information about all artists, such as date of birth, biography and all his/her albums from the website of the company. The company provides a special service that allows customers to make their own CDs by providing a playlist to the company. These playlists can have tracks from different albums. The selection of soundtracks for these playlists are private to customers and are not visible to others. The price of such a customised CD is the sum of the prices of all soundtracks plus 30. Before being able to make purchases, a customer needs to register an account with the help of a retail store staff. The information needed for registration includes name, phone number, membership card number, address (for delivery, when needed) and the staff id who helped with the registration. The information about staff members consists of the staff id, name, the store he works in and the date of joining the store. After purchasing CDs, the customer will receive an invoice with the list of items he/she purchased. The information of invoices should also be stored in the database. You need to decide what to include in your database.
时间: 2024-02-14 07:34:11 浏览: 90
根据题目提供的信息,以下是SirenCD数据库的ER图设计:
```
+--------------+ +--------------+
| Artists | | Albums |
+--------------+ +--------------+
| ArtistID (PK)| | AlbumID (PK)|
| Name | | Title |
| DateOfBirth | | ReleaseDate |
| Biography | | ArtistID (FK)|
+--------------+ +--------------+
| |
| |
| |
| |
v v
+-------------------+ +------------------+
| Soundtracks | | Playlists |
+-------------------+ +------------------+
| SoundtrackID (PK) | | PlaylistID (PK) |
| TrackName | | CustomerID (FK) |
| ReleaseDate | +------------------+
| Genre |
| Length |
| Composer |
| AlbumID (FK) |
+-------------------+
|
|
|
v
+---------------------+
| Customers |
+---------------------+
| CustomerID (PK) |
| Name |
| PhoneNumber |
| MembershipCardNumber|
| Address |
| StaffID (FK) |
+---------------------+
|
|
|
v
+------------------+
| Staffs |
+------------------+
| StaffID (PK) |
| Name |
| Store |
| DateOfJoining |
+------------------+
|
|
|
v
+---------------------+
| Invoices |
+---------------------+
| InvoiceID (PK) |
| CustomerID (FK) |
| TotalPrice |
+---------------------+
```
根据题目要求,这个ER图包含了以下实体和关系:
- 实体:Artists、Albums、Soundtracks、Playlists、Customers、Staffs、Invoices
- 关系:Artist与Album之间的关系、Album与Soundtrack之间的关系、Playlist与Soundtrack之间的关系、Customer与Playlist之间的关系、Customer与Staff之间的关系、Customer与Invoice之间的关系
请注意,这只是一个基本的ER图设计,具体的属性和关系可能需要根据实际需求进行调整和完善。
阅读全文