如何在库数据库中添加具有唯一ID的同一本书的多个条目? [英] How to add multiple entries of the same book with unique ID in a library database?
问题描述
嗨..我目前正在开展图书馆管理系统项目。我创建了一个数据库来存储库中的书籍。在添加书籍时,我想添加同一本书的多个副本。我需要为每本书创建一个唯一的书籍ID。我可以为同一本书制作多个条目,每个条目都有不同的ID吗?
例如。,书名:工程热力学
作者:PK Nag
出版社:ABC
版本:2
类别:机械工程
数量:5
i需要将这些数据添加到数据库中,为同一本书创建5个不同的条目,并带有唯一的ID。 Plz帮助我!
Hi..I am currently working on a project on Library Management System. I ve created a database to store the books in the Library. While adding books, i want to add multiple copies of the same book. i need to create a unique book ID for each book..how can i make multiple entries of the same book wid different IDs for each?
eg., Book name: Engineering Thermodynamics
Author: P K Nag
Publisher: ABC
Edition: 2
Category: Mechanical Engineering
Quantity: 5
i need to add this data to the database making 5 different entries for the same book wid a unique ID. Plz help me!
推荐答案
在没有任何详细分析的情况下,我认为你应该拥有多个表格。研究我在下面输入的内容,并根据客户收集的信息进行扩展。
表1 - 标题(每个标题一个条目) >
ID IsIdentity
CategoryID表4的外键ID - 类别
标题
版
表5的作者外键ID - 作者
表6的出版商外键ID - 出版商
出版年份
关键词
简介
LOC号码
ISBN号
电话号码
表2 - 分行(每个图书馆分馆位置)
ID IsIdentity
名称
地址
City
州
邮编
电话
电子邮件地址
表3 - 客户(每个持有图书证的人)
ID IsIdentity
名称
地址
城市
州
邮编
电话
EmailAddress
LibraryCa rdNumber
LibraryCardIssuedDate
LibraryCardExpiresDate
表4 - 类别(小说,非小说,历史,等等。)
ID IsIdentity
CategoryName
表5 - 作者(图书作者)
ID IsIdentity
名称
出生年份
死亡年份>
表6 - 出版商(图书出版商)
ID IsIdentity
名称
地址
城市
州
邮编
电话
EmailAddress
表6 - CopiesOfTitle(标题的每个副本)
ID IsIdentity
表1的TitleId外键ID - 标题
表2的BranchID外键ID - 分支
条件
购置成本
购买日期
CheckedOutByID表3的外键ID - 客户
DateDue
表7 - CustomerFines(Histo罚款和未支付的罚款)
ID IsIdentity
表3的CustomerID外键ID - 客户
BookID外键ID表6 - CopiesOfTitle
FineDate
FineValue
FineDays
FineWaived
PaidValue
PaidDate
TimesNotified
Off the top of my head without any detailed analysis, I believe you should have multiple tables. Study what I entered below and expand with information gathered from your customer.
Table 1 - Titles (One entry per title)
ID IsIdentity
CategoryID Foreign Key ID of Table 4 - Category
Title
Edition
Author Foreign Key ID of Table 5 - Author
Publisher Foreign Key ID of Table 6 - Publisher
Publication Year
Keywords
Synopsis
LOC Number
ISBN Number
Call Number
Table 2 - Branch (Each library branch location)
ID IsIdentity
Name
Address
City
State
Zip
Phone
EmailAddress
Table 3 - Customer (Each person with a library card)
ID IsIdentity
Name
Address
City
State
Zip
Phone
EmailAddress
LibraryCardNumber
LibraryCardIssuedDate
LibraryCardExpiresDate
Table 4 - Category (Fiction, Non-Fiction, History, etc.)
ID IsIdentity
CategoryName
Table 5 - Author (Book Author)
ID IsIdentity
Name
Birth Year
Death Year
Table 6 - Publisher (Book Publisher)
ID IsIdentity
Name
Address
City
State
Zip
Phone
EmailAddress
Table 6 - CopiesOfTitle (Each copy of a title)
ID IsIdentity
TitleId Foreign Key Id of Table 1 - Titles
BranchID Foreign Key Id of Table 2 - Branch
Condition
Acquisition Cost
Acquisition Date
CheckedOutByID Foreign Key Id of Table 3 - Customer
DateDue
Table 7 - CustomerFines (History of fines paid and unpaid)
ID IsIdentity
CustomerID Foreign Key ID of Table 3 - Customer
BookID Foreign Key ID of Table 6 - CopiesOfTitle
FineDate
FineValue
FineDays
FineWaived
PaidValue
PaidDate
TimesNotified
这篇关于如何在库数据库中添加具有唯一ID的同一本书的多个条目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!