0

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

4

1 回答 1

1

我使用 SQL Server 2008 Express 为 Northwind db 创建了这个图表。该图由SSMS绘制 替代文字

  1. 按着这些次序
  2. 在 SSMS 中扩展数据库
  3. 右键单击数据库图
  4. 选择新的数据库图
  5. 在 Add Table 对话框中选择您的表 该图将被创建并显示在窗口中。可以在图表窗口中创建新表、关系、索引等。

对于 SQL-DDL,我使用 SSMS 编写数据库脚本

于 2010-11-28T17:02:31.597 回答