An Alternative to SQL?
Golygydd Max writes "Dave Voorhis from the University of Derbyshire has developed a program incorporating Tutorial D, a language designed to overcome of the shortcomings of SQL, and developed some years ago by Hugh Darwen and Chris Date. Until now, no-one had done anything with it but Voorhis is hoping for wider adoption; although we think it would be like pushing water uphill though." Update: 10/13 12:43 GMT by T : An anonymous reader writes "It's being picky I know, but the university in question is in fact called The University Of Derby, not Derbyshire."
Who remembers "Knowledgeman", that database language of 20 years ago which got eclipsed by dBase???
What are the shortcomings to sql? it seems to be able to handle anything you'd need it to do.
Try using Lotus Domino for a week. You'll be begging to go back to SQL.
"Have you ever thought about just turning off the TV, sitting down with your kids, and hitting them?"
Is there anything that SQL can't do? I've been using various RDBMS for years and it hasn't come up yet.
SQL also has decades of optimizations in reliable code...no one will be dropping their Oracle license over this.
I use SQL a lot and I agree that has failings. The clumsiness inherent in, say, nested joins is quite amazing when you consider how important databases are in modern industry. This is a consequence of the "near-English"ness that SQL strives for, but that property is also what causes people to adopt SQL in the first place. We'll probably look back at SQL in five years and laugh... but weren't people saying that five years ago?
apterous.org
so to overcome the (not really all that many) shortcomings of sql we will all learn how to use something completely new. Yeah, adoption going to be quik and complete........
"goodbye and hello, as always" ~Prince Corwin, from Zelazny's Amber series
The name doesn't help... "Tutorial D" doesn't sound advanced at all...
Try proposing to your boss to replace your mySQL database with "Tutorial D" for... no good reasons? Will happen. Soon. Right?
Eureka Science News - automatically updated
"SQL is sloppy and unpredictable; Tutorial D is a correct relational database language."
sounds a lot like
"C is sloppy and unpredictable; Pascal is a correct programming language."
The correlation between ignorance of statistics and using "correlation is not causation" as an argument is close to 1.
Seems like it can handle just about everything but maybe I'm not thinking outside the box. The biggest limitation is my lack of knowledge about how to do the things I want to do.
The man who trades freedom for security does not deserve nor will he ever receive either. - Benjamin Franklin
My buggywhip manufacturing plant uses good old fashioned chained flat files. No one in their right mind would EVER use some *toy* database structure, especially that whole relational database poppycock. balderdash!
meh
I really, really hate SQL. I have never found a way to generate SQL queries programmatically when there are many tables (and joins) involved. It quickly becomes quite hairy. But writing the queries explicitly causes massive code duplication.
I'd love some replacement for SQL that is suitable for dynamic query generation.
The only other solution I have is to query all the data and use only what I need, or to do a lot of little queries and join the data in my application.
Ever heard of TSQL? Neither would have I, if I hadn't been forced to read about it in college. It would seem that there has been a huge number of variants of SQL over the years that have tried to make it "better." The benefits just never seem to outweigh the cost of learning a new language.
For those of you that haven't been assimliated into the borg, microsoft's new version of SQL server accomodates for a new query language called XQuery which takes a lot of the best parts of XPath and XSLT and combines them and obviously the underlying framework is XML. This will cover a lot of the shortcomings over Transact SQL for those that are willing to adopt it, and honestly, it's really not that bad.
Any language is going to have quirks and inconsistencies between dialects.
SQL has worked so far but if Tutorial D really is better then bring it on.
I've gotten over SQL the "short commings" though
i dont think there is anything wrong with sql, if one to talk about optimization then thats simply something to do with the sql engine they use, if you think joins are sloppy then reconsider properly setting up proper indexes,
http://iesucks.org
If you read the article, this isn't about replacing SQL, but more about testing new ideas and languages that could replace SQL. This is better than just saying, "We have a better language. Switch now or be assimilated.", and I'm glad someone's finally taking this approach. Unfortunately, the article only mentions one specific problem with SQL, but I'm sure there are others that these people might eventually solve.
Hurricane Ivan: A 17th century prison collapsed. All of the inmates escaped.
One big thing I think a database could use is a hierarchy key instead of using parentid's as "foreign keys", is just one of the shortcomings. If I wanted to make a threaded thing for my forums, for example, I'd have to make a big PHP script just to sort it properly. I would have loved to have MySQL do it automatically. SQL has a very limited syntax, as well, and is inconsistent. "INSERT INTO table VALUES ('', '', '');" That's one of the only times you see the parenthasis used in that way. You don't see it here: "SELECT * FROM table WHERE id = '';" or "UPDATE table SET id = '';" I would like to have the ability to easily use my own functions just as you do with any language. It's especially important in database software.
Ask and Discuss your HTML and other web dev stuff
Hey! Having graduated colledge as a technical writer, much of whose work has been lost due to virii on my boxen, I think you are being unfair. I hope you loose your job, as I did.
UPDATE tblUsers SET Karma=Karma-1 WHERE UID=743982;
liqbase
that SQL is SOL.
I have gas, but my car uses petrol.
Comment removed based on user account deletion
It might be logically 'perfect' in terminal of relational math, but as a language, it's obtuse. The only book I could find on Bi Temporal database design ended up with all the tutorials written in this Utopian/Acadamian SQL language... holy crap was that annoying.
The reaons for wanting a change from SQL I agree with, but Tutorial D you'll never catch me using.
We need something to combine the power and speed of SQL query syntax with the nested filtering ability of XPath, yet doesn't require the entire DOM to be in memory to work.
-Malakai
A Dragon Lives in my Garage
You mean lose your job, don't you? And, I am sorry that you lost your job. A friend of mine, also a writer, has had an awful time keeping a writing gig for more than six months. Whenever a company needs or wants to "downsize," the writers seem to be the first to go. That is a shame, as is evidenced by most corporate writings these days.
Those are some strange looking guys...
you can always use:
Relational Algebra / Domain Relational Calculus / and Tuple Relational Calculus
Consensus is good, but informed dictatorship is better
http://shit.slashdot.org/article.pl?sid=04/10/12/2 159209
Almost all the Object Oriented stuff people layer on predicates are, at best, an ad hoc, and poor, means of optimizing execution speed.
Let me explain.
One of the principles of polymorphism is that the same method has the same abstract meaning regardless of the kind of object. A predicate considered as a method subsumes such polymorphism by simply trying the various possible implementations of the method and committing to only those that succeed. If more than one succeeds then so be it -- that's the whole idea of relations as opposed to functions.
So, one reason you want all this OO stuff is the inheritance hierarchies keep you from going through all possible interpretations of a given method when the vast majority of them will fail for a given object.
Another, related, problem is that inheritance provides defaults without requiring a lot of thinking on the part of the computer. What I mean by "thinking" here is the sort of thing that is done by statistical imputation of missing data via algorithms like expectation maximization (EM) or multi-relational data mining via inductive logic programming.
So, the other reason you want all this OO stuff is so you can avoid mining a background database to provide reasonable defaults for various aspects of the data.
Some might be concerned that over-riding isn't absolute in such a system -- that you don't absolutely block, say, more generic methods when you have more specific ones present, and they're right. You don't block those methods -- you lower their priority by lowering the probability of those implementations via the statistical methods of imputation and/or induction. In a microthreading environment they most likely won't get any resources allocated to them before other higher priority implementations have succeeded. In a single threaded/depth-first environment they will be down the list of desired alternatives -- but they won't be discarded until something equivalent to a prolog cut operation kills them off.
However, and this is the important point, the work that has been expended toward OO facilities has vastly outstripped the effort that which has been put toward more parsimonious ways of optimizing predicate systems.
One of the better predicate calculus systems out there -- more promising due to its use of tabling to avoid infinite regress on head-recursive definitions and its optimization of queries using some fairly general theorems of predicate calculus -- is XSB. It has an interface to odbc and a direct interface to Oracle, but it would be better if it had something like a recoverable virtual memory substrate to support its roll-back semantics.
Seastead this.
Is right here.
From the introduction: "Rel is intended to serve multiple purposes:
-It is a tool for learning, teaching, and exploring relational database concepts in general;
-It is a tool for discovering the power and expressiveness of a true relational language;
-It is a tool for learning Tutorial D;
-It is a relational database server;
-It may serve as a prototype or "working blueprint" for future implementations of Tutorial D or any "D" language (more on this later);
-It may serve as a platform for experimenting with and/or examining database engine internals. "
Water is the only fluid that has the ability to climb surfaces due to its cohesiveness.
Blessed be he who reads this post, Cursed be he who tells my boss.
--I run fedora on an older slower machine than the one you have (all I have is antiques really). I did the text based install (it's easy, but they have a GUI as well), and only did the gnome desktop stuff, not kde, and also skipped loading open office, as it really needs more than minimal to function. Small harddrive,low RAM, oldCPU at 200, etc, dictated my choices but even then it's a LOT of stuff.... a kitchen sink install is 4 cds! I think I got mine down a little over 2 gigs and I know there's stuff on here I haven't even looked at yet, let alone use.
It works swell for me. If you want MP3 playback, (like in the xmms player)google for instructions, RH leave that out from some licensing issues, but it's a snap to fix it. Easiest is just get the RPM direct from xmms guys and trash the included one.
I also hear mandrake is easy to use, but I haven't tried it since 7 or 8, I forget now. It is KDE sorta centric and I have found I prefer gnome, but it's really a choclate/strawberry/vanilla issue, it's all good. I am not much of a distro fanatic, I just use fedora because it's a large and heaviloy maintained distro, so I know it will be worked on and will be here for the long haul.
really, most any of the new distros should work, although you could bump up the RAM a lot to make it work better. I've found RAM to be a lot more important than processor speed.
As an alternative you might want to tryout knoppix, it's a hoot to have a full fledged operating system with tons of stuff running from just the cd and a temp ramdisk. Too cool really.
zogger
It's a shame such wit was lost on the illiterate moderators. I laughed hard at this one!
Dude, do you hear that whooshing sound? It's the the sound of the GPs joke going right over your little head.
Perhaps you lost your job because, as a technical writer, your spelling is inadequate and your grammar is pure spaghetti. I believe you intended to say "lose your job," college has no d, you don't graduate college but graduate from college, and the sentence structure is extremely confusing.
Geesh, links to a press release and trade rag article, and not even the name of the project itself? Go read some real information about Rel, look at the examples, download the source, have fun.
The evaluation of an action as 'practical' . . . depends on what it is that one wishes to practice.
So now we have Ogg Voorhis?
What?
Perhaps you have no sense of humor.
For those interested, the paper describing this language (linked to from the article) is available here. There's a link to the grammar of the language at the end of that paper.
I use SQL quite a lot. It's certainly great for a lot of things, but it does have some limitations here and there. For instance, trying to deal with things like hierarchical structures, or joining on having identical/similar children, is a nightmare in SQL. Even if the query doesn't need to be efficient to run, it can still be extremely complicated to write and test. SQL simply wasn't designed or intended to deal with those sorts of structures.
Unfortunately, short of using external code outside the database, it's so often a choice between using SQL or nothing else for writing a query in a particular database rather than an option between SQL and another language. In some ways it's like being forced to write every program in C or every program in Java or every program in Lisp, where realistically one or another might be better suited to a particular task.
I suppose one of the reasons for only supporting SQL is that a predictible query language makes it easier to arrange data structures so they can be queried most efficiently. Still, it'd be nice to see an alternative front-end language or two supported in one or more of the major databases. Not every query needs to be ultra-efficient, and there have been many times where I would've liked to trade an efficient query execution for a language where what I wanted was more writeable.
I've been learning Tutorial D in my database class, and it is so much more confusing than SQL. Maybe its cause I'm from a C and SQL background, but D really sucks IMO. SQL might not be terribly accurate from a mathematical sense, but it is much more practical at least in the smaller projects I've had experience with.
Not that hard.
Comment removed based on user account deletion
Prior to PostgreSQL, the Postgres database
was based on another query language other than
SQL.
One of the main reasons why
PostgreSQL took off after this was that
it changed over to SQL in response to
community/industry request and requirements
(and openness to community contributions),
bringing it in line with the industry
standard.
I suspect that the next evolutionary step will
be to allow multiple query languages to be used
on the same DB engine.
How the heck did you get UID==nick?
Thank you so much!!
Comment removed based on user account deletion
this proposed language is like a superset of sql. It also sort mixes itself with PL/SQL-like constructs as well. I think it's rather novel and it could make your optimization tasks easier if you had access to something like this... less trying to think in terms of the language, more in terms of how you want to acutally manipulate the data.
This is _not_ a query builder. It's going back, looking at what relational algebra is, seeing what people do with SQL, and then making sure the language has all the idioms required to be "complete" and not arbitrary.
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
currently walking dags for nodes requires database specific implementations. assuming oracle didnt patent the damn thing (and i'm guessing that they would want it standardized and more widely used since they have an efficient implementation), it's clearly a shortcoming of sql.
The article criticises SQL but the author has little familiarity with SQL for example:
"but the syntax is often inconsistent and unless you use one of the many vendor-specific supersets of SQL it can be tricky to express complex series of operations in a concise manner."
But in fact, SQL is so popular because complex expressions need little changing from specific vendor offerings. If people choose to program using the subsets, then well and good, but the ANSI standard is generally thought to be sufficient. This is like arguing for the abolishment of HTML and XHTML because Microsoft make a flawed browser - hopefully the database language is better than the reasoning here.
It then goes on to say "The idea is that there should be no arbitrary restrictions on the syntax of the query language, but at a lower level the database shouldn't run up against idiotic limitations. The limitation in existing implementations that generates the most comment from the various parties in the debate is the problem with "null" values in relational databases. Put simply, a database field has a type (50 characters, for instance, or a floating point number to two decimal places, or an 8-bit integer), but when you don't fill the field in (i.e. it's "null") it loses all its meaning. Even the ANSI standards state that if a field is null it's said not to exist - so if you ask a database for "all entries where field X is not equal to 47" it won't return any of those where field X is null because instead of saying "Null doesn't equal 47", the value "null" is deemed not to be comparable with any non-null field."
Well, for starters, null is not numeric zero, null is the absence of any data whatsoever, and every SQL doc in the world tells you to not mistake it for zero. Any arithmetic expression containing a null always evaluates to null. For example, null added to 7 is null. All operators (except concatenation) return null when given a null operand. That's exactly why it's the ANSI standard.
If you want to find "all entries where field X is not equal to 47" then pass your attribute a value like "0".
SQL is neither clunky nor obsolete. Tutorial D may actually be a better database modelling method, but the article's criticisms aren't sufficient to exault Tutorial D whatsoever. The "Project D" syntax and model may possibly be better, but these criticisms aren't a convincing reason to scrap SQL.
Si tacuisses philosophus mansisses. If you had kept quiet, you would have remained a philosopher.
select client.name, client.id, product.id, product.name, product.price from client_table client, product_table product where client.id = product.client_id and client.id = ? and product.discontinued = 0 order by product.price
Assuming you substitute something for ?, that will effectively join the two tables into one, and give you a list for all products from a certain client (given by ID) which have not been discontinued, and order these results by price.
The World Wide Web is dying. Soon, we shall have only the Internet.
Compare the symbolic forms:
Example, theta join
And the implementation in SQL:
SQL join example
Specifically in Tutorial D (and hence Rel) you would do this:And subsequently do shit with T1. That's it.
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
you tell them you want postgresql or you'll move to another host who costs the same, probably co-los in the same datacentre and offers the features you require.
I've even seen free hosting deals with postgresql on.
I am NaN
For all that Rel (Tutorial D) wants to be, I don't understand this obsession with NULLs.
:-)
I think the concept of null values is very sound, and how they behave in comparisons makes perfect sense.
Just put non-null constraints by default on the structures in the language, and then provide a way to mark relational fields as possibly having NULL values. Can they at least allow that?
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
RPG already overcomes the shortcomings of SQL
One of my favorite idiosyncracies with null is Null = Null is Null (unless you turn that off in the DB), but Group by groups together equal values except it also groups nulls!
Comment removed based on user account deletion
I looked at the articles, which are too broad by the way, and I didn't see enough of an explaination to make out real detail.
However, it seems as if Tutorial D is nothing more that a purely mathematical improvement of SQL. In other words, it's like comparing Lisp to Prolog or ZF Set Theory to HBG. (Okay, I'm not a logician..., so you math wizards can hold off on the flames.) I'm all for improving SQL. It just seems like Tutorial D addresses the usual complaints about the hazy concept of a NULL in a database.
SQL or any derivative thereof will be inherently complex. This is because SQL is merely an implementation of Relational Algebra. That's the key. Real RDBMS's are inherently mathematical in nature. Complex SQL queries are tough. Too often the average database programmer couldn't even tell you what the definition of a set, function (i.e. the mathematcial definition), or a cross-product is. Yet, they'll write code (or not) that incorporates complex joins. Incidentally, they'll do the same thing with regexs too. Programming still has it's deeply mathematical roots. Not as much as I'd like, but still...
In short, if you're looking for some cool new English Query tool to save the day, you won't find it here. Still, if you're a SQL wonk looking for a new toy or an improved SQL, this may be of interest to you.
Oh, by the way, I used to have a copy of Date's database book. I sold it along with my copy of Foley and Van Dam, Sipser's Theory of Computation, and Aho and Ullman's compiler design book [the "dragon" book] because I needed to pay the rent. Interestingly enough, the books retained a pretty high resale value even after all these years.
What do you mean my sig is repetitive? What do you mean my sig is repetitive? What do you mean....
And if it were actually relational, then it might be interesting in the current discussion. But it ain't. That it comes up is funny, in context, because mistaking things like XML for relational is something that Date regularly has massive heart failure over.
I forget what 8 was for.
Welcome to acronym-palooza? Anybody heard of D Programming Language? It's around since 1999 and has been covered here on ./
Some research (read as "Query") if that name is taken already you can expect from some database guys?!
The SQL issue seems to resurface on a regular basis. Not nearly as often as Microsoft complaints, but still enough to be enough. SQL + your language of choice can do pretty much anything you want. Sure, we all want and expect new implementations, but please people, stop the mindless rants against things that DO work. SQL works. It could be better, but it does what it does AND it works.
Jack Black and some bald dude have gotten into databases?
SQL was a language designed to allow relatively unskilled operators to be quickly trained for data entry using the language directly, and thus it was designed to be English-like, flexible, and forgiving.
SQL is only vaguely reminiscent of the true mathematics behind the relational data model. It continues to be used and expanded, despite its restrictions and shortcomings, because it is far and away more popular than any other database language.
The fundamental assumption of the relational model is that all data is represented as mathematical relations, or rather, a subset of the Cartesian product of n sets. Unlike SQL, in the mathematical model reasoning about such data is done in two-valued predicate logic (that is, without a null value), meaning there are two possible evaluations for each proposition: either true or false. The data is operated upon by means of a relational calculus and algebra.
The relational data model permits the designer to create a consistent logical model of the information to be stored. This logical model can be refined through a process of database normalization. A database built on the pure relational model would be entirely normalized. The access plans and other implementation and operation details are handled by the DBMS engine, and should not be reflected in the logical model. This contrasts with common practice for SQL DBMSs in which performance tuning often requires changes to the logical model.
A big move has already startedto move to Business Object Servers to host enterprise level application deployments. BOS's are currently used to run the core engineering departments of most F500 companies. These BOS's typically use a Query Language that is catered to printing and expanding data of and from business objects. I currently use a language called MQL which stands for Matrix Query Language. I have talked to some developers who use XML and they say that is has similarities.
:]
Basically any Query language should alow developers to build data models quickly without having to worry about the complexities of managing the data base. Most BOS's use a RDBMS in the background and manage all the SQL's under to the database.
If you want to find an area where the bucks are.. BOS's are it. The big companies are spending billions on these systems and they deployements are projected to only increase.
We were able to spec, build and deploy an enterprise HR Performance and Development system for a fraction of the cost and time with these systems. The only issue with these multi-teir systems is that they are very resource intensive but then again, processors and memory is getting cheaper by the day.
Hmmm how about an open source BOS...
I have been working on an SQL alternative myself for a while. My approach is more functional (not procedural) in nature. If the language is designed based on this, then new operations can be added without having to add to the syntax of the language. This would help vendor compatibility because if vendor B does not offfer an operation that vendor A does, then a DBA can simply add a clone of the "function" without tweaking the language parser.
Tutorial D uses infix notation, which tends hard-wire operations to a syntax parser. Prefix (functional-style) is more flexible, consistent, and easier to parse. For example, new parameters can be added to prefix without changing existing calls. It is just an extra, perhaps optional, parameter. It is hard to do with with infix.
My relational replacement would also make it syntactically easier to perform relational operations on things such as column name lists. The column list is simply a table in its own right (perhaps with syntactical shortcuts); thus it can have table operations (relational algebra) done on it just like tables. It is "conceptual reuse" you can say.
Table-ized A.I.
It is hard to do with with infix.
...
..."
:-)
Correction. Should be: "It is hard to do this with infix."
My relational replacement would
Correction. Should be: "My SQL replacement would
Also I forgot to mention that it's roughly influenced by an early IBM relational language called "Business System 12" (BS-12). It seems IBM thought the more wordy language, SQL, would appeal to PHB's more than the mathy style of BS-12. I guess the failure of PL/1 (spelling?) against COBOL had something to do with that decision. Thus, SQL is the COBOL of relational languages, more or less. Having the letters "BS" in the name is also a strike against it
Table-ized A.I.
We (BitMover, the people who produce BitKeeper) are building a database on top of our SCM system (yes, that's a little weird but it works out well).
/xyzzy/ {print $ID}' /rob|lm|wscott/ && $STATE =~ /open|assigned/ {print $ID, $SUMMARY}'
We played around with straight SQL syntax, flirted with ruby as the syntax, and ended up with awk (actually nawk). It was the best balance between simple enough for normal people to understand and powerful enough to get the job done.
So we can do stuff like
bk db -s'select from bugs
bk db -s'select from bugs where $OWNER == "rob" {print $ID}'
bk db -s'select from bugs where $OWNER =~
etc. The where clause and the print clause (print is implied) are full on awk scripts, do whatever you want with them.
We're big fans of not reinventing the wheel. Awk is a little weird but it's 95% of the way there and a few tweaks made it perfect for us. So why invent a whole new language? Especially when all the awk code is about 100K of text on x86 and includes a full on regular expression library.
that they are trying to give you the best of both worlds. Expressions that can be expressed simply in SQL have short forms in the language too. Expressions that were hard to express in SQL but easy in R.A. are still pretty basic forms.
By not trying to be like SQL, and more like {T,PL}SQL, I think they get the freedom they need.
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
It just means "unknown". Not N/A. But "unknown".
In a T/F column, it's not true, and it's not false. It _never_ short circuits and expression, behaving as TRUE with ANDs and FALSE with ORs.
I think it's great.
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
Quote
Most people who use databases in anger are familiar with the concept of a relational database.
Unquote
Maybe someone could enlighten me as to why the word
anger is in the first sentence of the article. Why
would using databases in anger be relevant? I use
databases in finanical situations, is that similar
to anger?
One thing I always wondered was if there was a way to make a table that had a different number of columns for each row.
I don't know if it would solve your particular problem, but I have kicked around the idea of dynamic relational databases.
Table-ized A.I.
Not on K-Man but on the network model database -- before it got the SQL front-end.
Wow -- that was something like 12 or 13 years ago. BTW, the people I worked with there were a great bunch of guys.
I would be interested to find out if there are any other mdbs alumni on slashdot.
You are not a beautiful or unique snowflake -- but you could be if you got off your ass.
I can't even begin to fathom that many lines of sql.
How would you even begin to troubleshoot something like that? I'd think you'd have to start breaking it into smaller sections.
The man who trades freedom for security does not deserve nor will he ever receive either. - Benjamin Franklin
see, if you were born around 1940 you could have been using IMS/DB, VSAM, ISAM, IDMS, etc back in the 70s.
Tons of opportunities there for low-level access to your data. Of course, there's a reason that all those database management systems were abandoned for a 'busted ass super high level language'. It's because they sucked to maintain, they didn't evolve well as business requirements changed over time, and if you had the *most* basic of business questions - you'd never get an answer without a month of writing code.
But don't despair - pick up a little more SQL and you may find it isn't that tough.
Now, I am sure you realize that most of the common databases (MS SQL, Oracle, DB2, PostgreSQL, Interbase, Firebird, Ingres, etc) have the ability to embed procedural extensions into SQL, at least in stored procedures.
The reason is that stored procedures are incredibly useful-- you can largely automate database management and the way in which it integrates with other software using stored procedures and triggers. without the procedural extensions, you cannot have stored *procedures.*
At the same time procedures should not be how applications *access* the data, and so you are right-- that is the idea-- a clean separation between data retrieval and programming procedure.
LedgerSMB: Open source Accounting/ERP
IT is not a replacement for SQL.
So that you can use VB or C# and probably other CLR supported languages to write database code.
See here under ".NET Framework Integration."
Yeah, a name like MySQL sounds so selfish. We should all have access to the source code. Therefore, it should be OurSQL!
Other than that, it's pretty g-darn spiffy.
- We don't know what the value for that field should be (or whether there is one).
- We know that there is no value for that field.
The first of these is "the database has no information for this field", the second is "the database has the information that there's no value for that field". I've seen a fair amount of confusion in cases where it's not clear which of these a NULL stands for in one case.Are you adequate?
By creating a new language, "Tutorial D", developers are excluding the other languages as much as they're including new features in the new language. Why not just add a Java package that includes the new syntax? To get anywhere in software development, even Tutorial D code will have to interoperate with existing systems and programmers with existing skills. Someone will have to code a "Tutorial D" JDBC driver, and ODBC, and all kinds of middleware that eats performance, developer time, and introduces the maintenance pitfalls of complexity. And by adding a package to an existing language, they can skip reimplementing the features of the existing language that they include in this new one, like loops, branches and character output. The effort seems as vain as the endless 19th Century conceits of inventing complete philosophical systems from scratch, to serve the reputations of egomaniacs dominating university debates. Why can't everyone just speak Object, with procedural slang and set-theoretical poetry?
--
make install -not war
Nothing that I have seen has such a strong basis. This was brought home to me quiet a few years ago when I was programming a reasonable size/complexity database (over 100 tables, millions of rows, untold triggers (pre-DRI days), stored procs, views etc) in Sybase SQLServer. In the next cubicle was a guy programming in Progress. One day I wrote a std query that crossed 4 or 5 tables and modified a large set of data - minutes to write, seconds to run. We were comparing notes and he was amazed - he said that he needed a large amount of code with nested this and for loop that to achieve the same end.
Point of this nostalgia trip is that when someone comes up with a system with a stronger theoretical base, I'll be very happy. But not yet. SQLs failing are in implementation, not concept.
Meh, Im sure in small amounts water isn't all that difficult to push uphill...
/sigh
Another article by someone that doesn't really understand what a database is or what a database is not.
SQL is a horribly complex system for doing set algebra, and it does an astonishingly good job at it.
Please don't clamor for a change just because you don't understand the full power of this amazing tool.
HaskellDB
SchemeQL
Are you adequate?
I have been really intrigued since some months ago about how to represent a network, meaning a model of an undirected unweighted graph, a la friendster. Of course there are some ways to do it, but does anyone know some "SQL direct2 way to do it efficiently and handle the kind of operations required, like BFS? How can one make an adjacency table without duplicating all Id's? I kind of solved the problem by stating a rule that any adjacency should always go from the lesser Id Number to the biggest one, meaning that a relationship between nodes 8967 and 4567 would focefully be saved as Id1=4567 Id2=8967 and never backwards. It indeed reduced the number of queries I needed to wun in order to get a depth 4 BFS. Has anyone another approach that could be worked out on SQL, specifically on MySql?
Contrary to what you're assuming, the people in question do not propose that NULL should be comparable to non-NULL values in SQL. What they propose is doing away completely with SQL's NULL semantics, and putting something substantially different in place (or maybe even nothing).
Are you adequate?
It is not true that no one ever did anything with Date's and Darwen's ideas on a relational language. Check, for instance, the category I edit at the Open Directory, or even Darwen's own The Third Manifesto website with its list of projects.
Probably the poster is confused about the nature of Tutorial D. As it names indicate, it is but an example of a possible 'D', and one targeted at instruction at that. This accounts for its COBOLishness. It is possible to implement a non-Tutorial D that is completely faithful to the Relational Model and the Third Manifesto, yet has a distinct flavour.
For example, Alphora Dataphor implements D4, which was a compliant D until having had to incorporate SQL NULLs quite recently, and it has a Pascal flavour to it; Opus and Duro are C-like; there was a guy wanting to implement a C#-like D-flat language; Alfredo Novoa is implementing Tutorial D itself in MS.Net; and so on.
By the way, it is interesting that until now the more ambitious projects, that seem to be Alphora's and Mr Novoa's, are in MS .Net. Time for the free software community to rise to the challenge!
Leandro Guimarães Faria Corcete DUTRA
DA, DBA, SysAdmin, Data Modeller
GNU Project, Debian GNU/Lin
One technique (albeit the examples are specific to SQL Server, the technique works elsewhere as well).
r archies.htm
http://www.yafla.com/papers/sqlhierarchies/sqlhie
While Oracle and SQL Server 2005 have hierarchical commands, they are in actuality recursive function calls and thus much slower than most database set logic.
Doesn't anyone have video of that thing on the web yet?
a correlated subquery in the WHERE clause will do the job without nulls:
SELECT * FROM T1
WHERE NOT EXISTS (
SELECT * FROM T2
WHERE T1.ID = T2.ID)
(some dialects also offer an IN () syntax)
vs:
SELECT T1.* FROM T1
LEFT JOIN T2 ON T1.ID = T2.ID
WHERE T2.ID IS NULL
Some might argue the correlated subquery is cleaner than the left join, since you aren't SELECTing any columns from the LEFT JOINed table, just using it to filter for NULLs, so why include it in the FROM clause to begin with?
I tend to agree that NULLs are a bad idea. I create my tables with a NOT NULL constraint, and then enforce dummy values for "Unknown" and "Not applicable" in the stored procedures & application code.
The usefulness of NULLs in the example above is more an artifact of SQL than a solid argument for allowing them in the language.
Why don't you participate in the development in one of the OSS database systems (like Postgres) to develop a CREATE TEMPRORARY VIEW syntax. Shouldn't be too hard to do, just make it valid for the current session (like a temporary table).
Bingo, there is your 'variable' functionality without inventing a whole new language.
FunOne
You just have to expand your mind a teensy bit. You can do with a single line of SQL what may take several pages to do with an object-oriented language. I can understand how someone who isn't used to that much power may find SQL a bit confusing at first, but with a little effort and experimentation, it starts to become second nature.
Not that it really matters to ME. I took a test for my current job that included a few very basic SQL queries. Not only did I ace it, but I was later told that most of the other candidates who claimed to know SQL wound up handing the test back blank. So, your refusal to adapt to a new and powerful tool is giving me a distinct competitive advantage. Perhaps I should just say "thank you."
--A/C
As opposed to regular programming languages, SQL is not Turing-complete, meaning that there are computations that can be expressed in a Turing-machine language, but not in SQL
Turing completeness does come for a price though - it's undecidable whether the execution of the program will even finish (instead of infinitely looping). SQL OTOH is guaranteed to complete in poly time of the input dataset. Different tasks - different hammers
The Raven
What? No love for Query By Example? I feel so lonely :(
If you missed your chance in the early 20th century, now you ladies have a second chance to have a Date with Darwen.
There: Something at a specific location.
Their: Owned by someone.
Please make sure your english compiles.
One thing that would be nice is "view columns". In other words, a calculated column (alias). Often one ends up making an entire view just to get a look-up of one column, such as a city description from a city ID. If one could create a virtual column on an *existing* table, it could simplify the view catalog and changes.
Table-ized A.I.
I use PostgreSQL for all my DB stuff. Comparing it to MySQL is like comparing a mini-pickup to an 18-wheeler. PostgreSQL ANSI support is good, and it's very stable.
When I write custom apps (pretty much all I do) I write to the full capabilities of PostgreSQL. It's "man enough" to handle the biggest projects I'll likely ever see, and I'm not worried that the vendor will up and leave, since there isn't one.
In fact, PostgreSQL has had an interesting history in that the primary supporters of it have changed several times. PostgreSQL has weathered them all with grace, and remains today an excellent database package with a good, active community and quality developers.
So, I don't worry about JDBC, I don't write to cross platform, I could give a whit about Oracle or DB2 or whatever, but I don't. PostgreSQL is free, plenty good enough, and it won't go away.
Why bother trying to make my application portable?
PS: The article's example about null is stupid. Null = "I don't know". In that context, how could you include values of " 47" if you don't know what the value should be for a particular record?
I'm interested in this new DB language, if it actually offers a real benefit - but the article does a lousy job of getting me excited about it...
I have no problem with your religion until you decide it's reason to deprive others of the truth.
Unlike SQL, in the mathematical model reasoning about such data is done in two-valued predicate logic (that is, without a null value), meaning there are two possible evaluations for each proposition: either true or false. The data is operated upon by means of a relational calculus and algebra.
In other words, it assumes that all values are definite (i.e. in SQL terms, NOT NULL) this will not fit all databases (i.e. how do you handle missing or unknown information). Null is a design feature of SQL designed to handle the real-world issue of unknown values, but does not really belong on the underlying mathematical model.
The relational data model permits the designer to create a consistent logical model of the information to be stored. This logical model can be refined through a process of database normalization. A database built on the pure relational model would be entirely normalized. The access plans and other implementation and operation details are handled by the DBMS engine, and should not be reflected in the logical model. This contrasts with common practice for SQL DBMSs in which performance tuning often requires changes to the logical model.
Ok, you have a couple issues here and they are completely practical.
First, one can create completely portable code in SQL which is completely normalized to at least third normal form (higher normal forms seem to be available for certain specialized uses). This does not always mean that it will perform ideally because of two issues:
1) Certain constraints on I/O bandwidth may restrict performance on joins
2) Query planners are not going to be perfect because the mathematics describe how the data fits together, not how to get it fast.... The query planner may have to choose between many different options for retrieving the data. So...
Usually, IMO, performance tuning, when it requires altering the storage schema, is done using one of two methods:
1) Denormalization-- essentially saving joined inforamtion in a single table as a way of saving page scans. this alters the relational logic, but does not break it.
2) Higher normal forms-- f. ex. breaking off specific MVD's onto separate tables so as to make specific searches faster (indexes make this less important, but in certain circumstances, it can be helpful). Note that this does also alter the logical layer but does not break it.
3) Summary tables... Quick hack but is useful when the summary don't need real-time statistics.
LedgerSMB: Open source Accounting/ERP
Lisps allow usage of SQL-like syntax inside programs without stuff like "SELECT X FROM Y WHERE Z = ? ORDER BY A" or "SELECT X FROM Y WHERE Z = '" + something + "' ORDER BY A". Look here and here.
Maybe try an object-oriented database....Relational databases aren't the only game in town
Object DB's don't have enough solid theory behind them. There is too much inconsistency and lack of consensus in the attempts to formalize them.
It may be because one man, Dr. Codd, created relational theory, and thus there is a narrow set of principles to follow. OO has yet to find a Great Consolidator of similar caliber. (I am skeptical it will happen, but won't rule it out.)
OO-DB's tend to resemble the type of systems that Dr. Codd was actually trying to "fix" when he came up with relational theory. Thus, OO-DB's tend to seem "primitive" to relational fans.
Part of the problem is that database themselves run counter to "pure" OO encapsulation. Encapsulation dictates and/or allows each entity to define and handle its own operations. This creates at least two problems:
1. There is no guarentee that the operations will be compatible or consistent across classes. One class might have a Find operation, but another call it Search, for example.
2. Encapsulation requires that a single entity (class) handle its own implimentation. However, automated optimization requires the implementation be consistent and known to something outside the entity. In other words, implementation efficiency coordination breaks encapsulation. Objects can't be selfish about their implementation.
Attempts to solve these tend to make it turn into relational in the end anyhow, making it seem futile to keep OO-ness.
Table-ized A.I.
do not place the client logic in the database!
do not place the client logic in the database!
do not place the client logic in the database!
*runs around in circles*
Your statement is inaccurate. You sure-as-hell can perform this operation in D without requiring any NULLs. The problem is that it requires a developer to understand relational theory a great deal more than most currently do. Please check the theory before making assumptions.
Tutorial D with a truly relational rdbms has already been implemented. The company is Alphora. The product is Dataphor. see http://www.alphora.com/
But what's happening with OQL ?
Talking SQL nowadays strikes me as being like talking raw assembler. You can do it, the tools are even rather nice nowadays, but any sane developer would use a higher level wrapper.
Like for instance, Hibernate. It does serialize/reconstitute, handles nested objects and data structures, and it's very nearly as easy as programming with regular heap-allocated objects. In any big app if you didn't use some such, you'd end up reimplementing it.
I see no reason wrappers like Hibernate have to backend onto SQL and only SQL. They could as easily emit and control this "Tutorial D" language.
Interbase/Firebird also supported some other language ... GDML, was it? Documentation
As I recall, it's all but impossible to get to anymore. As for multiple languages in the same engine, the SQL support has multiple dialects available, with slightly different support for certain datatypes (particularly date/time-related.) So there's a bit of that already, though not tons.
Business system 12 for an example of yet another language in early systems.
Per Wigren wrote:
The SQL standard (since SQL:1999) already specifies recursive SQL, through its WITH RECURSIVE construct (optional feature ID T131, "Recursive query"). You will sometimes see people referring to it using the name "common table expressions".
DB2 implements it, and it seems that SQL Server 2005 will also feature it.
Here's an article describing differences between WITH RECURSIVE and CONNECT BY.
If you follow the links in the article, you will get to the original article from the guy who has written this software. Tutorial D is just one implementation of the 'D@ specification. The reason it is called Tutorial is that it is not an enterprise strength version, but rather one for learning and experimental purposes.
Notes/Domino today is like the Amiga in the eighties and nineties - A great system but terribly missunderstood.
Yeat another alternative to SQL is the TopicMap QueryLanguage (TMQL). Topicmaps is a general format for databases, much like RDF and OWL. There is some work in progress on the forthcoming iso standard TopicMaps Query Language. The drafts suggests a hybrid between prolog/datalog and sql.
but I for one won't be going back to your SQL overlord. In RDBMS systems the fundamental element which stores data is the table, that is the thing that is real. There are views or queries which are virtual and there are records which only make sense with reference to the table they are part of. In Domino the fundamental element of data is the document, this is roughly equivalent to the level of a record in SQL. Basically any Domino database can be thought of as a collection of independent records, these can be displayed in views, which look a bit like tables, but only in the sense that a query in SQL looks like a table, views are virtual, but they are indexed so they are seriously quick. The advantages of this way of thinking is that documents (records) are not constrained by the restrictions of the table they happen to be in, I can add a field to any document without breaking anything, I don't need to redesign tables.
In addition to that the datatypes are much simpler and more powerful, there is no distinction between numeric data types, they are all stored as 8 byte floats, text fields are all variable length up to 15k, any field can store an array (in fact single value fields are stored as a single element array), and there are rich text fields which can store any amount of stuff. Overall this is a way more powerful toolkit than an RDBMS for most tasks in most businesses. That isn't to say it is a magic bullet which can replace your ERP, but for stuff I come across it is better.
English terms are only beneficial to english speakers....
SELECT,, UNION, DELETE, WHERE, etc.. mean little to non english speakers.... (and may even be more confusing!)
Why do syntactic terms have to be meaningful to everyone - all that happens is that newvbies imbue terms with invalid semantics-- which they then need to unlearn!
Someone please mod up. Absolutely awesome.
it's an interesting mix of SQL and OO interfaces. Version 2.0 (in development) has full SQL 92 support, but you can also treat the DB as a bunch of objects from just about any environment you're likely to encounter. It's intending to support OO things like inheritance, while retaining SQL compatibility.
It's also staggeringly fast - I do 5-term ORs on a 2Gb, 20 million record DB in 0.1 sec on a P3/600 with low RAM. http://www.paradigmasoft.com/ I'm just a contented user.
DELETE FROM tblUsers WHERE UID=634315;
SQL ERROR 234833: You must be logged in for this operation to proceed.
liqbase
IMHO, is that it's poorly understood by many developers. Joe Average learns how to program procedurally, picks up some SQL and doesn't change his approach.
At worst, I've seen developers suck a result set into a memory structure and then pass over it because they don't understand aggregates. I've seen fairly experienced (and otherwise well-thought of developers) perform multiple joins to the same table because they're unaware of how to avoid this. Personally, it's unusual for someone to use UNION correctly (typically UNION ALL is actually the intention, but they don't know this, and don't know the distinction or the impact of the wrong decision).
More generally, even databases aren't as well understood as they should be. From experience asking for a definition of isolation within a RDBMS in an interview raises the bar high enough that this question alone drops (well) over 95% of candidates.
If a SQL replacement help address this, that's only a good thing. I'm still wary of silver-bullets; a new syntax approach might help (although learning hows null works isn't that difficult; joins are not hard - buy a book and learn something properly). Meanwhile, there's little than can't be achieved in SQL directly (and that's without T-SQL or PL/SQL extensions or even cursors).
We may not imagine how our lives could be more frustrating and complex—but Congress can. – Cullen Hightower
I think all the "let's go improve on SQL" folks are missing the point. Indeed, the article touched on it but didn't understand it.
Databases are about storing and retrieving DATA. Tables with rows in a fixed structure are an excellent way of maintaining data. Using key values to associate one collection of data with another is a logical way to approach organization of resources.
Now, you don't like the language ( SQL ) that's a standard for manipulating that data? Why? Because there are huge joins, poor logic to retrieve information, etc. Sorry, that's implementation and has little to do with DATA. If you have to join 30 tables to get some useful information, you're asking wrong the question. The right question is, "is the information there, is it available and understandable, how do I present it in a timely fashion?"
Any system that functions on nightmarish SQL constructs is only going to give way to some other "alternative" that has similar problems.
Now, how will this odd math centric "Tutorial D" store it's data? In tables, maybe? That's called a front end. That's what developers are for, to abstract storage into function representations. End users never need see SQL, just as they'd never see this. So, what's new?
Didn't he drop some tracks with DRM and the D-bomb?
-----------------------
You are what you think.
You might want to check out datalog programming in XSB. XSB uses "tabling", which is a form of memoization of prior calls, to optimize datalog programming.
Seastead this.
Out of curiosity, what is deprecated?
After searching google I haven't found any SQL, Oracle functions, or syntax extenstions being deprecated. I don't doubt that it is possible, but I am curious as to specifically what you are refering to and to which version(s) of Oracle it applies to.
Lastly even if something is being depreicated, I'm sure it will be around till the end of time. I'm not using anything too crazy.
I think I would change careers if I ever had to write a statement like this:
SELECT * FROM CUSTOMERDETAILS C, CUSTOMERORDERS O WHERE CERTAINLY (O.ORDERID = 500) AND PERHAPS (C.CUSTTYPE = 4) AND JUST_SO_HAPPENS(O.CUSTID = C.CUSTID) AND (O.COMPLETEDATE MIGHT BE UNKNOWN OR O.STATUS IS NOT NECESSARILY 0) PLEASE ORDER BY O.ORDERNUMBER IF NOT TOO MUCH TROUBLE
-CausticPuppy "Of all the people I know, you're certainly one of them." -Somebody I don't know
you insensitive clods! ;-)
The use of (+) for joins has been phased out of Oracle at around 8i, and then deprecated in 9i. Also while decode has not been offical deprecated it has been strongly recommended that you use CASE instead.
example of new join format
perhaps... your mom!
What is all this shit about SQL is clunky with JOINS and that there has to be a better way.
How about this way: LEARN HOW TO PROPERLY CONSTRUCT A DATABASE.
Seriously, I been programming in SQL for years now and I have to say that it is easy as hell to get my data. Yeah I have a lot of table that are relational to each other and what not, but I use a lot of view in order to get the data I need. I only have to write the view once when I need to join 10 tables together and then just query that view from now on.
A lot of the "shortcomings" that people are saying here of the SQL language really has to do with the shortcomings of the DBA. If you don't know how to use VIEWS, INDEXES, UDFs and constuct your database properly, then you shouldn't be building them in the first place.
And just a note about the "D" language. It looks too friggin cryptic and hard to understand. SQL to the most straight forward language I have seen. With just a look, a moron can know what your doing to the tables. "D" looks to much like C++. If I wanted to use a C++ style language then I would use flatfile and parsers.
On the DECsystem-10 and then later on the VAX, we used a relational database with a query/procedural language that non-technical people could actually use. And the techincal folks liked it as well. No need for a GUI for those who could understand basic English. To find records, the command was ... FIND (which did not mean "find and print"). To print records, the command was, come on now... Yes, PRINT! ;-) And none of the redundancy of SQL. There was an attitude that if you were working with a table or group of tables, that you'd probably continue working with them for several commands or queries. This persistence eliminates the need to constantly add "FROM bla-bla-bla" (and often "WHERE bla-bla-bla") to every command.
Short comparison (if I recall correctly):SQL
S1032
Thanks for the info. I am a little amazed that the + operator is being deprecated. At the same time I am surprised that Oracle 8 and previous versions did not allow ANSI SQL join operations. The only time that I use the ANSI join is when doing a full outer join, which is rarely needed.
I've used both syntaxes and I prefer the + operator. It takes less characters and is usually more clear. It still works in 10g, so I doubt that it is going away any time soon.
"overlookers" of Progress get the "'Darwen' Award"? DOH!!!!!
Previously: "Linux... Toward the Sunrise..." Now: "Linux... Toward the-- No, now, part of Every Sunrise"
What is the difference between, lets say, mySQL, OpenCyc, and 'D?
Is there a "Ben Franklan" score sheet on 'D vs. mySQL vs. SQL?
For me, this would be a web site worth visiting.
this is a perfect example of why you should NOT use a boolean for a tristate variable. You are abusing a boolean (which can also be NULL) to contain an enum with three different states (Yes, No, SmackedMeInTheFace). What you actually want is proper enumeration support. That would force people to be explicit about precisely what values are allowed and about how/when they can be combined.
I think most people's gripe with NULL is that things become horribly undefined when you have automatic coersions and start to applying boolean logic.
HAND.
Okay, I need to get more informed about Hibernate et al., but it has so far seemed like an object generator based on tables. My current project has been using XML/XSL to generate Vo/Dao/DaoFactory objects for 4 years. Meh, it has it's uses.
The problem with such frameworks is:
1) One VO class per table, 1 object per row = tons of objects
2) Returning more fields than needed = more objects instantiated
3) joins = separate query/DB connection for every related^N table, esp. on proxy/delayed-instantiation objects
It seems that for any amount of performance on a big-system DB you need SQL. Then again maybe I just need to read more Hibernate and create new objects for every query - as long as searches can use conditionally-set fields that might work, or fields in the WHERE not actually returned in results, etc...
8-PP
Only the last of those was actually a motivating factor for the creation of C. C was created specifically for implementing UNIX because no other "high-level"(*) langauge of the time could actually "get the job done". They simply weren't low-level enough. Sometimes you just need to be able to do horribly unsound things like unchecked typecasts, accessing memory directly, etc. However, almost no user-space software should ever need to do any of these things and should definitely be written in higher-level languages. Just check any security mailing list and compare the number of security problems stemming from improper C usage (unchecked buffers, improper casts, etc.) to 'real' security flaws (default passwords, lacking credential checks, etc.).
I don't know about development practises where you work, but liking a language is almost never a good criterion for choosing it. I would, however, accept "I need to do 'unsafe' things", or "I need to be really portable"(**) as valid reasons.
Oh, and C is by no means "versatile" or "powerful", just look at LISP or any ML dialect.
(*) Pascal et al. were considered high level at the time... personally I wouldn't consider anything that doesn't have 1st class closures to be "high-level".
(**) C is the most portable language currently in use. There are very few Turing Complete platforms which don't have a C compiler.
HAND.
with it.
.dbf as the backend. I use it for .dbf for local desktop, but when I test forms in Approach from within w98 on the same box that MDK10 is running, I use MySQL running out of MDK. I rarely use MySQL as a service or process in win/win98.
This may seem simplistic, but the way I deal with null values is by considering where NULL is necessary to know, but not allowed by bog down my mind or schema. I create an additional column that is a "calculated field" In that calculated field is simlpy a calculation/formula that does something like this:
Example Fields (Yes, the database tool (Lotus Approach, in win98 in Win4Lin, running in Mandrake 10.0) I use lets me have spaces and mixed casing in the field names, AND I can use these in MySQL, too.
First Name | Family Name | DOB | Age |NullAge
Txt | Txt | Date | Calc | Calc
The text fields are whatever length I decide to set, usually 35 to 45 chars for family and given name, but sometimes 35 for middle, since some people have UK-like multi-hyphenated, triple/poly-syllabic heritage middle or surnames.
DOB is simply a date field, fixed in size.
"Age" is a calculated field that has a formula such as:
Today()-DOB or
Today()-(DOB)
When DOB is NULL (and in this case, today is 10/13/2004), then Approach returns 731867. Since nobody alive will have that number of days in their age, it's easy to have the "Age" field supplemented with yet another field that looks for ages beyond something I think sensible.
Let's suppose a DOB of 4/5/1965.
Age, using the formula:
Today()-DOB
returns 11436 (number of days)
Now, for example, I can have a calculated field called "Age Abnormal" check this.
"Age Abnormal" would have a formula such as this:
If (age >135, 'bad age', Age)
This simply means if the age is over 135 years, substitute text instead of the actualy age. (Astute observers will note that days will return until we fix the issue, further down...)
Alternatively, I can put this formula in the "Age" field instead of creating a separate, space-consuming field called "Age Abnormal". But I sometimes create these extra fields as a way to "parse" my mental logic and make troubleshooting much easier, at the expense of some used space. (When over-parsed, it is possible to use one of these as a dependency for other calculations, and if one is deleted in the name of disk space efficiency, a lot of troubleshooting may be necessary...unless good notes are on hand.)
So, I create another field called "Age Years", just to have it as a raw calculation, sitting there "just in case" I need it for some other calculations. (Yes, 365.25 may not be accurate for all years, and there may be some who'll have separate year tables serving as lookups, probably for financial scenarios where guessing or simple calcs are unacceptable...)
In Approach, this would work (for my purposes):
If ((right(today),4))-Age>135, 5, 2))
But, I really want dates' YEARS calculated on and displayed, not the raw number of days. So, I can use
As a separate field/column, I named it "Age 2"
If(right (today(),4) -Year (DOB) 135, 'bad age', Age/365.25)
---------Opinionated stuff----------
Also, while I realize that DBAs are accustomed to using "Emp_FN" instead of "Emp FN" or "Emp First Name", I don't, because eventually it's not human friendly. I appreciate that in the early days disk space and performance were major issues, but I despise cryptic field names that end up being a pain for regular users, or for myself. It is pleasing that MySQL doesn't have a problem with my use of spaces in field names, but it did require me to change "Date Created" to something like "DteCreated" or "Dte Created", since date is a reserved or key word. Approach will let you use a keyword or any word you want up to a certain length, when using
Actually, it's a travesty that IBM won't port or allow dual-licensing or
Previously: "Linux... Toward the Sunrise..." Now: "Linux... Toward the-- No, now, part of Every Sunrise"
And if all that doesn't make the problems with NULL look small, then surely nothing can.
...that if you have "nightmarish SQL constructs", someone didn't do a very good job of setting up and normalizing the tables properly in the first place...
Reason is the Path to God - Anon
Talking SQL nowadays strikes me as being like talking raw assembler. You can do it, the tools are even rather nice nowadays, but any sane developer would use a higher level wrapper.
How exactly are you measuring "high level" and "low level"? The wrappers I often see others put around SQL are a lower-level abstraction than what SQL is. I agree that SQL has flaws, but it is NOT "low level".
Some OO developers like to wrap SQL to convert it to their favorite paradigm, not necessarily change the absolute abstraction level. It is translating across paradigms, not upping abstraction necessarily.
Let's not get into a battle over whose paradigm is more higher-level than the other.
Table-ized A.I.
i was focusing on the non-short-circuiting nature of it, which is critical.
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
TutorialD could, with a few additions make a good procedural language. TutorialD could easily have a SQL backend. Infact some SQL databases can have another SQL database or CSV text files as a back end!
...I can reassure you that a lot of the faults you describe don't apply.
- Class-per-table, object-per-row, but the query language is smart enough to let you return only those rows you care to access. That includes when it's emulating data structures like Lists and Maps, from which you can filter a subset. In addition you can optionally use session.iterate() which transparently returns just the IDs and then selects each row seperately, so as to keep the memory usage low.
- If you don't want all the fields of the row, You can avoid creating the row objects entirely and instead instruct Hibernate to return primitive wrapper objects (String, Integer et al) representing the subset of the row you ask for.
- Hibernate is smart enough to translate joins properly into a single select of SQL. It's also smart enough you mosty don't have to think about such low-level stuff as joins at all. You just navigate data structures and references.
- Unlike many object DBs, Hibernate has a proper query language, not just query-by-example. So you can say stuff like session.find("from Person p, where p.age = ? and p.employer.country = Countries.ENGLAND", age, Hibernate.INTEGER)
*Shortcoming* of SQL?
You've got to be kidding./
SQL is the *only* properly written language out there. No extras words (except perhaps "INTO" after "INSERT"). The addition of the ANSI OUTER JOIN synbtax is confusing though.
Please, please, please, don't change SQL.
Have you read my journal today?
Why use them, why not make most of the schema
clientside instead of serverside, via ODBC/JDBC..
OR something similar.. Maybe I don't live in the optimal universe, but relational databases are not optimal unless you know how the searches perform..
How about this, a runtime average of query times,
on a per operation set basis.. I know Oracle probably won't like that.. Anything you know about the database you would have to get from database
classes.. If ever that's compromised many DBA's will lose their jobs..
Just say no to license servers!!
Suppose you have a table like this:
PK Value_1 Value_2
-- ------- -------
01 abc def
02 efg hij
03 klm NULL
04 ghi jkl
You can normalize it like this:
Table_1 Table_2
PK Value_1 PK Value_2
-- ------- -- -------
01 abc 01 def
02 efg 02 hij
03 klm 04 jkl
04 ghi
-- Qu'est-ce que la propriété intellectuelle? It is thought control.
The higher "level" a tool is, the more it operates in terms of the problem's abstractions. The lower, the more it operates in terms of its own internal featureset. So SQL with its task-irrelevant chatter about indexes and tables and whatnot is lower level than a wrapper layer which hides SQL behind purpose-designed data objects.