图书馆数据库的 ER 图和 SQL DDL
我正在尝试为一个简单的图书馆数据库绘制 ER 图和 SQL ddl。
我有以下实体:
Book (holds the ISBN as key, book title, author)
Copy (copyID of a copy of a book, dateAcquired, dateDestroyed)
Member (MemberID, name, address)
Loaned (i guess the date due and the date back and obviously foreign keys for memberID and copyID)
成员也可以是学生或工作人员。所以我认为这应该是一种“IS-A”关系。
我如何用正确的 ER 图和 SQL-DDL 来表示这一点
I'm trying to draw an ER-diagram and SQL ddl for a simple library database.
I have the following entities:
Book (holds the ISBN as key, book title, author)
Copy (copyID of a copy of a book, dateAcquired, dateDestroyed)
Member (MemberID, name, address)
Loaned (i guess the date due and the date back and obviously foreign keys for memberID and copyID)
Also a Member can be Student or Staff. So i think this should be a "IS-A" relationship.
How can i represent this in a proper ER-Diagram and SQL-DDL
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用 SQL Server 2008 Express 为 Northwind 数据库创建了此图表。该图是SSMS绘制的
该图将被创建并显示在窗口中。可以在图表窗口中创建新的表、关系、索引等。
对于 SQL-DDL,我使用 SSMS 编写数据库脚本
I used SQL Server 2008 Express to create this diagram for the Northwind db. The diagram was drawn by SSMS
The diagram will be created and displayed in the window. New tables, relationships, index etc may be created within the diagram window.
For the SQL-DDL I script the dataabse using SSMS