Yeah, come on all of you, big bright men, Data management needs your help again. He's got himself in a terrible jam Way down yonder in sql land So put down your server and pick up some rum, We're gonna have a whole lotta fun. To paraphrase William F. Buckley Jr.'s quote from Austrian Willi Schlamm: The trouble with sql is sql. The trouble with database management is sql. I'm an advocate of something wonder-filled called 'Dataphor' (www.alphora.com) If your into database management, data modeling and sql programming I have big news for you. So if your working with MS Sql Server, Oracle, DB2 etc. etc. here's a news flash: You've have been waiting for Dataphor forever but you just don't know it! Take a gander at these 'select' statements: Dataphor supports a table 'type'. So you can represent a table in a 'select' statement using keywords that define a table, ie. row, key and of course table. select table { row {1 ID,10 ID2,'AA' stringvalue}, row {1,20,'BB'}, row {1,30,'DD'}, row {1,40,'DD'}, row {1,50,'EE'}, row {2,60,'DD'}, row {2,70,'AA'}, row {2,80,'EE'}, row {2,90,'BB'}, row {2,100,'BB'}, row {2,110,'FF'}, key {ID2} } ID ID2 stringvalue -- --- ----------- 1 10 AA 1 20 BB 1 30 DD 1 40 DD 1 50 EE 2 60 DD 2 70 AA 2 80 EE 2 90 BB 2 100 BB 2 110 FF A rose is a rose is a rose. Tables in Dataphor are 'always' a table, ie. a row is always unique and the table has a key. If a key isn't specified all the columns of the table will make up the key. Therefore there is no DISTINCT keyword in Dataphor. This is a 'BIG,BIG' deal as you will see. select ( table { row {1 ID,10 ID2,'AA' stringvalue}, row {1,20,'BB'}, row {1,30,'DD'}, row {1,40,'DD'}, row {1,50,'EE'}, row {2,60,'DD'}, row {2,70,'AA'}, row {2,80,'EE'}, row {2,90,'BB'}, row {2,100,'BB'}, row {2,110,'FF'}, key {ID2} } ) over {ID,stringvalue} The above query returns only ID and stringvalue columns using over. Do you see that duplicate rows are eliiminated. You sent in a real table, you got a real table returned. ID stringvalue -- ----------- 1 AA 1 BB 1 DD 1 EE 2 AA 2 BB 2 DD 2 EE 2 FF Now lets return ID by removing the other columns. Why doesn't sql have a 'remove', especially when you want to get rid of one column and you got a bunch. select ( table { row {1 ID,10 ID2,'AA' stringvalue}, row {1,20,'BB'}, row {1,30,'DD'}, row {1,40,'DD'}, row {1,50,'EE'}, row {2,60,'DD'}, row {2,70,'AA'}, row {2,80,'EE'}, row {2,90,'BB'}, row {2,100,'BB'}, row {2,110,'FF'}, key {ID2} } ) remove{ID2,stringvalue} ID -- 1 2 Get it! :) Ok here's a little more nudging. Think of the verb to 'dup', as in 'de-duping' a table using GROUP BY, JOINS, DISTINCT. All that craziness of getting rid of duplicates is history. Good riddance. And note that 'dup' can also be an adjective:) Do these predicates look familiar: =, <>, <, <=, >, >=, well you can now apply them to tables! Is this a step forward? What do you think!:) Next some kewl examples of how to do stuff that usually drives you nuts.
Dataphor SQL RAC (Relational Application Companion)
A site of hope for those looking for a true relational database system
- a one-one requirement constraint with dataphor (1)
- anatomy of sql server part I - what is a stored procedure (1)
- anatomy of sql server part II - the unit test as part of the database (1)
- anatomy of sql server part III - what does deferred name resolution really mean (1)
- censoring sql posts (1)
- creating an opposite constraint in dataphor (1)
- dataphor (2)
- Dataphor (7)
- dataphor # 13 a table as a parameter (1)
- dataphor - download and start working with it (1)
- dataphor - fixed sized word segments (1)
- dataphor # 10 sql mythology (1)
- dataphor # 11 string differences (1)
- dataphor # 12 trimming a string (1)
- dataphor # 14 sql the meaning of Update..From (1)
- dataphor # 15 views with substance (1)
- dataphor # 16 inclusive vs exclusive solutions (1)
- dataphor # 17 a visual look at ranking queries (1)
- dataphor # 18 data scrubbing using lists (1)
- dataphor # 19 create intervals over strings (1)
- dataphor # 20 browsing an sql window (1)
- dataphor # 21 an example of relational division (1)
- dataphor # 22 reusable procedures (1)
- dataphor # 23 repley to Michel (1)
- dataphor # 24 basics of the table type (1)
- dataphor # 25 extending the dense rank function (1)
- dataphor # 26 query a hierarchy with explode (1)
- dataphor # 27 combine strings with Split and Concat (1)
- dataphor # 28 constants and variables or sql and D4 (1)
- dataphor # 29 another example of relational division (1)
- dataphor #1 introduction (1)
- dataphor #2 splitting strings (1)
- dataphor #3 string concatenation (1)
- dataphor #4 comment (1)
- dataphor #5 comment (1)
- dataphor #6 formal definition (1)
- dataphor #7 sql: table this (1)
- dataphor #8 list to table (1)
- dataphor #9 table constraints (1)
- dataphor creating lists in a query (1)
- extracting numbers from a string with dataphor (1)
- jeff modens dynamic crosstabs for sql server (1)
- linq to sql the what and why (1)
- linq to sql as a window of opportunity to sql users (1)
- linq to sql should be important to sql users (1)
- linq to sql vs. older 4GL attempts (1)
- listing missing table item (1)
- Multiple cascade paths to the same table (1)
- RAC (4)
- RAC #1 comment (1)
- RAC #2 example (1)
- RAC #3 finding the Nth number in a string (1)
- RAC #4 Sql Server 2005 ranking functions vs. Rac ranking (1)
- sorting a delimited string by its numerical string parts (1)
- sql an example of extreme implicit conversions (1)
- sql can't handle complicated cascading updates (1)
- sql CTE should be a variable not a value (1)
- sql dense rank for identifying consecutive runs (1)
- sql is there really a table variable (1)
- sql ranking functions explained by relational types (1)
- sql server triggers are best set based (1)
- sql the idea of using substring to simulate lists (1)
- sql the undefined trigger in Sql Server (1)
- sql vs relational on tables (1)
- sql what the sql CTE covers up (1)
- types and procedures (1)
Thursday, August 10, 2006
First Sql now Dataphor
Subscribe to:
Post Comments (Atom)
2 comments:
Test comment
It passed :-)
Post a Comment