Database Reference
In-Depth Information
As with entities, attributes can exist at conceptual, logical, and physical levels. An attribute
at the conceptual level must be a concept both basic and critical to the business. We do not
usually think of attributes as concepts, but depending on the business need, they can be.
When I worked for a telecommunications company,
Telephone Number
was an attribute
that was so important to the business that it was represented on a number of conceptual
data models.
An attribute on a logical data model represents a business property. Each attribute shown
contributes to the business solution and is independent of any technology including soft-
ware and hardware. For example,
Author Last Name
is an attribute because it has business
significance regardless of whether records are kept in a paper file, within Oracle, or within
MongoDB.
An attribute on a physical data model represents a database column or MongoDB field.
The attribute
Author Last Name
might be represented as the column
AUTH_LAST_NM
within the relational table
AUTH
or the MongoDB field
authorLastName
within the
Author
collection.
MONGODB FIELD = RDBMS FIELD (ATTRIBUTE AT PHYSICAL LEVEL)
The concept of a physical attribute (also called a column or field) in relational databases
is equivalent to the concept of a field in MongoDB. MongoDB fields contain two parts, a
field name and a field value. This is the
order
collection we discussed earlier, with the field
names shown in bold and the field values shown in italics:
Order:
{
orderNumber
:
“4839-02”
,
orderShortDescription
:
“Professor review copies of several titles”
,
orderScheduledDeliveryDate
:
ISODate(“2014-05-15”)
,
orderActualDeliveryDate
:
ISODate(“2014-05-17”)
,
orderWeight
:
8.5
,
orderTotalAmount
:
19.85
,
orderTypeCode
:
“02”
,
orderTypeDescription
:
“Universities Sales”
,
orderStatusCode
:
“D”
,
orderStatusDescription
:
“Delivered”
,
orderLine :
[ {
productID
:
“9781935504375”
,
orderLineQuantity
:
1