我正在VB.NET中開發一個「AddressBook」項目。在SQL Server2005中開發數據庫時,我想遵循規範化原則並儘可能保持其規範化程度。數據庫設計和規範化
我正在使用的字段是這些。
Create table AddressBook_Contact
(
Contact_ID int Primary Key,FirstName varchar(15),MiddleName varchar(15),LastName varchar(15),BirthDay datetime,HomeCountry varchar(20),HomeState varchar(20),HomeCity varchar(20),HomeMobile varchar(40),HomePhone varchar(40),HomeMobile varchar(40),HomeFax varchar(40),HomeZipCode varchar(10),HomeEmail varchar(50),HomeAddress text,
BusIndustry varchar(20),BusCompany varchar(20),BusWebsite varchar (30),BusCountry varchar(20),BusState varchar(20),BusCity varchar(20),BusMobile varchar(40),BusPhone varchar(40),BusFax varchar(40),BusZipCode varchar(10),BusEmail varchar(50),
BusAddress text,Note text
)
如果我在一個表中創建所有的字段..它反對規範化?如果由於時間的規模大幅增加而變得緩慢,對桌子的影響是什麼。
如果我創建聯繫(生物數據,HomeInfo,的BusinessInfo)單獨的表
create table AddressBook_Bio
(
BookID int Primary Key,
Title varchar(15),
FirstName varchar(15),
SecondName varchar(15),
LastName varchar(15),
BirthDay datetime,
Note text
)
create table AddressBook_Home
(
'My question in this case is should i declare BookID as foreign key or primary key to the table and why?'
FOREIGN KEY (BookID) REFERENCES AddressBook_ContactBio(BookID),
HCountry varchar(20),
HState varchar(20),
HCity varchar(20),
HMobile varchar(40),
HPhone varchar(40),
HFax varchar(40),
HZipCode varchar(10),
HEmail varchar(50),
HAddress text
)
create table AddressBook_Business
(
same issue as "AddressBook_Home"
)
感謝關懷,以表達並分享您的意見,知識。
這種解決方案看起來很公平...但它使編碼有點困難,但真的保險箱空間..我會去這個..謝謝 – Saqib 2011-03-31 07:15:29
@Saqib好吧!你也可以接受這個答案:) – TheDude 2011-03-31 14:59:58