473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

please, how to realize generalization in sql server database

please help, I need professional approach how to realize generalization
(parent_table <- child_table) idea in sql server databse?

in my Oracle db I can have PK of child_table as FK from parent_table: let's
have shop with shoes, selling shoes, and foosd as well. Example of keys in
my tables:

Product (=parent_table)
-------------
1
2
3
4
5

Food (=child_table)
-------------
2
3
4

Shoes (=child_table)
-------------
1
5

Is that good idea, or not, and may I have the same in SQLServer (2005) ?
(and, what about administrative aspects (like
performance/concurency/updating ..) of generalization in RDMS?)


regards

Dec 12 '06 #1
1 5418
fireball wrote:
please help, I need professional approach how to realize generalization
(parent_table <- child_table) idea in sql server databse?

in my Oracle db I can have PK of child_table as FK from parent_table: let's
have shop with shoes, selling shoes, and foosd as well. Example of keys in
my tables:

Product (=parent_table)
-------------
1
2
3
4
5

Food (=child_table)
-------------
2
3
4

Shoes (=child_table)
-------------
1
5

Is that good idea, or not, and may I have the same in SQLServer (2005) ?
(and, what about administrative aspects (like
performance/concurency/updating ..) of generalization in RDMS?)


regards
The syntax is the same in SQL Server and Oracle (and other SQL DBMSs as
well):

CREATE TABLE Product (sku INT NOT NULL PRIMARY KEY);

CREATE TABLE Food (sku INT NOT NULL PRIMARY KEY REFERENCES Product
(sku));

CREATE TABLE Shoes (sku INT NOT NULL PRIMARY KEY REFERENCES Product
(sku));

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/m...S,SQL.90).aspx
--

Dec 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

39
by: Scotter | last post by:
Okay I think my title line was worded misleadingly. So here goes again. I've got quite 20 identical MDB files running on an IIS5 server. From time to time I need to go into various tables and add...
15
by: Robert Brown | last post by:
Is there a good approach to modelling many heterogeneous entity types with that have some attributes in common? Say I have entities "employees" which share some attibutes (e.g. firstname,...
0
by: Joshua Beall | last post by:
Hi All, I've been taking a look at DB Designer 4, and looking through the documentation (http://www.fabforce.net/dbdesigner4/doc/index.html) I am a little unclear on some of their nomenclature:...
5
by: KathyB | last post by:
If someone could just explain this to me...I just don't get it! I have an aspx page where I retrieve several session variables and use xmlDocument to transform xml file with xsl file into an...
4
by: Tarun Mistry | last post by:
Hi all, I have posted this in both the c# and asp.net groups as it applies to both (apologies if it breaks some group rules). I am making a web app in asp.net using c#. This is the first fully OO...
34
by: Ann | last post by:
I am opening a file which looks like 0xABCDEF01 on another machine but 0x01EFCDAB on my machine. Is this a byte swapping? Could anyone give a good way to check if bytes are being swapped?...
1
by: Brad Isaacs | last post by:
I am working with ASP.NET 2.0 and using an SQL Server 2000 database. I am using Visual Studio 2005 and developing on my Local machine. I am working with Login controls ASP.Configuration, I...
0
by: Nitinkcv | last post by:
Hi, I am using a dropdownlist in my asp.net proj. By default i have many listitem values listed. code is similar to: admin.aspx <asp:dropdownlist id="lstStudyType" runat=server...
4
by: Tonio Tanzi | last post by:
I have the following problem in a Win 2000 Server + SQL Server 2000 environment and I hope somewhat can help me to resolve it (after many days of useless attempts I am desperate). In my database...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.