Re: Terminology question - set of related records in multiple tables On Mon, 01 Nov 2004 08:36:03 +0000, Trevor Best <nospam@besty.org.uk> wrote:
>Steve Jorgensen wrote:
>> Terminology question:
>>
>> Is there a term for a set of records related directly or indirectly by key
>> value in several tables? For example, a single invoice record and its line
>> item records -or- a single customer, the customer's orders, the order lines
>> for those orders, the customer's invoices, and the invoice lines for those
>> invoices.
>>
>> I'm thinking the term might be graph, but I'm not at all certain of this.
>>
>> Thanks,
>>
>> Steve J
>
>Entity?
>
>Invoice Header + Invoice Items = Invoice.
I'm looking for a term that could apply to an arbitrarily complex set of
items, possibly with relationships among them, but all restricted by
relationship to a single key value somewhere. It could be as simple as an
invoice and its lines, or it could be as complex as a virtual schema for one
company in a database that supports multiple, independent companies
simultaneously, each with their own product catalog, customer, invoices, etc.,
and with no overlap allowed between records in different companies.
For example...
A collection of records comprising a single Company record and all other
records in all other tables that apply to that company and only that company.
Company
*CompanyId
CompanyName
Product
*ProductId
CompanyId
ProductName
(Unique CompanyId, ProductName)
Customer
*CustomerId
CompanyId
CustomerName
(Unique CompanyId, CustomerName)
Invoice
*InvoiceId
CompanyId
InvoiceNumber
(Unique CompanyId, InvoiceNumber)
InvoiceLine
*InvoiceLineId
CompanyId (part of both FKs to enforce same company)
InvoiceId (part FK to Invoice)
ProductID (part FK to Customer)
LineQty
UnitCost |