Comparison To RDBMS
An RDBMS might commonly involve SQL statements such as these:
CREATE TABLE Customers ( Id CHAR(12) NOT NULL PRIMARY KEY, Surname VARCHAR(32) NOT NULL, FirstName VARCHAR(32) NOT NULL, DOB DATE NOT NULL ); SELECT InitCap(Surname) || ', ' || InitCap(FirstName) FROM Customers WHERE MONTH(DOB) = MONTH(getdate) AND DAY(DOB) = DAY(getdate)Most current SQL databases allow the crafting of custom functions, which would allow the query to appear as:
SELECT Formal(Id) FROM Customers WHERE Birthday(Id) = TodayIn an object-relational database, one might see something like this, with user-defined data-types and expressions such as BirthDay
:
The object-relational model can offer another advantage in that the database can make use of the relationships between data to easily collect related records. In an address book application, an additional table would be added to the ones above to hold zero or more addresses for each user. Using a traditional RDBMS, collecting information for both the user and their address requires a "join":
SELECT InitCap(C.Surname) || ', ' || InitCap(C.FirstName), A.city FROM Customers C JOIN Addresses A ON A.Cust_Id=C.Id -- the join WHERE A.city="New York"The same query in an object-relational database appears more simply:
SELECT Formal( C.Name ) FROM Customers C WHERE C.address.city="New York" -- the linkage is 'understood' by the ORDBRead more about this topic: Object-relational Database
Famous quotes containing the words comparison to and/or comparison:
“In comparison to the French Revolution, the American Revolution has come to seem a parochial and rather dull event. This, despite the fact that the American Revolution was successfulrealizing the purposes of the revolutionaries and establishing a durable political regimewhile the French Revolution was a resounding failure, devouring its own children and leading to an imperial despotism, followed by an eventual restoration of the monarchy.”
—Irving Kristol (b. 1920)
“I have travelled a good deal in Concord; and everywhere, in shops, and offices, and fields, the inhabitants have appeared to me to be doing penance in a thousand remarkable ways.... The twelve labors of Hercules were trifling in comparison with those which my neighbors have undertaken; for they were only twelve, and had an end; but I could never see that these men slew or captured any monster or finished any labor.”
—Henry David Thoreau (18171862)