School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,354 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,792 people online right now. Registration is fast and FREE... Join Now!




How to create "children" tables from a "parent" on

 

How to create "children" tables from a "parent" on, I canīt remember for the life of me! :D

papuccino1

27 Jun, 2009 - 05:31 PM
Post #1

C# Programmer
Group Icon

Joined: 2 Mar, 2008
Posts: 943



Thanked: 33 times
Dream Kudos: 50
My Contributions
Hey guys, first time EVER posting the Database area of the forums.

I recently got tasked with making a database for some glassworks business.

I need to make a table called Client, which acts as a parent of tables RandomClient and CorporateClient.

How the heck could I sort this out guys? tongue.gif Iīm sure itīs just a few lines of code but I can't find anything online, maybe I'm just searching for the wrong keywords.

So its:


IPB Image

User is offlineProfile CardPM
+Quote Post


baavgai

RE: How To Create "children" Tables From A "parent" On

27 Jun, 2009 - 06:26 PM
Post #2

Dreaming Coder
Group Icon

Joined: 16 Oct, 2007
Posts: 4,261



Thanked: 389 times
Dream Kudos: 550
Expert In: C, C++, Java, C#, ASP.NET, PHP, Perl, Python, Oracle, SQL Server, MySql, HTML, JavaScript, Lua, Cheese

My Contributions
Common fields should be in Client, distinct fields in the other two.

CODE

Client
    ClientId
    Name
    Address
    
RandClient
    RandClientId
    ClientId (FK to Client)
    RandInfo

CorpClient
    CorpClientId
    ClientId (FK to Client)
    TaxId


User is online!Profile CardPM
+Quote Post

papuccino1

RE: How To Create "children" Tables From A "parent" On

27 Jun, 2009 - 07:03 PM
Post #3

C# Programmer
Group Icon

Joined: 2 Mar, 2008
Posts: 943



Thanked: 33 times
Dream Kudos: 50
My Contributions
Baavgai, as always, my socks have been rocked.

Can I thank you enough? biggrin.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 06:58PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month