8 ms·
Whoah whoah whoah. SQL IS NOT RELATIONAL. Let's put that to rest right now. You can have relational databases if you like, but put SQL in front of it and now yo
by TheZenPsycho 14y ago
Whoah whoah whoah. SQL IS NOT RELATIONAL. Let's put that to rest right now. You can have relational databases if you like, but put SQL in front of it and now you don't have a relational database system anymore. you have an SQL database. This is because SQL actually violates a few of CODD's axioms for what constitutes a "relational" database. The tragedy of NoSQL is really the setting up of this dichotomy between "SQL/Relational" and "NoSQL/NotRelational" which ignores the possibility that "SQL CAN'T BE RELATIONAL" and "Relational with no SQL"
- daigoba66 14y agoSQL can be relational, if you do it right: http://en.m.wikipedia.org/wiki/Relational_model#SQL_and_the_relational_model http://en.m.wikipedia.org/wiki/Relational_model#SQL_and_the_...
- TheZenPsycho 14y agoTrue. You can also make good programs in PHP if you "do it right". it's not exactly promoted or encouraged, or even anywhere on the radar though, and doing so involves a fair bit of that relational logic being implemented and enforced in the client. The point is, it's possible to have a "relational database management system" which enforces the relational axioms for you. SQL is fundamentally incompatible with this concept, and forces the programmer to keep the databases relational.
- skore 14y ago> True. You can also make good programs in PHP* if you "do it right". it's not exactly promoted or encouraged, or even anywhere on the radar though, and doing so involves a fair bit of that relational logic being implemented and enforced in the client. It seems while you see that you're making a concession, you fail to understand that that actually disproves your own point. I repeat: Your argument is invalid. > The point is, it's possible to have a "relational database management system" which enforces the relational axioms for you. People aren't saying that it's impossible - they're saying it's a question of practicality, with the most true to the abstract concept being the least practical in real world applications. > SQL is fundamentally incompatible with this concept, and forces the programmer to keep the databases relational. What? * By the way: Classic case of "doubting, supported by not looking". Even for PHP, there are plenty of resources like http://www.phptherightway.com/ http://www.phptherightway.com/ and they are widely known and shared amongst people who know their stuff.
- TheZenPsycho 14y agoThere is a difference between "SQL is relational" and "SQL can be used to maintain a relational database". the first is false, the second is true. As for whether it's practical to have a relational database system, are you claiming that it isn't ? Re: PHP. I said that PHP can be used to make good programs. Is this a point you disagree with? or, do you see some other point?
- twic 14y agoI don't believe this is correct. SQL certainly includes some things which don't exist in the pure relational model (LIMIT, stored procedures, array types), but i am not aware of anything in SQL which prevents you using a pure relational model. SQL is not a pure implementation of the relational model, but it's close enough that is's reasonable to talk about SQL being relational.
- TheZenPsycho 14y ago1. The existence of a null value (3-value-logic) 2. permitting duplicate rows 3. permitting duplicate columns. 4. "outer" joins. and.. other things, that you can enforce in your client application, but then that rather defeats the whole point of having a "relational database management system". you might as well just have a dumb key-value store, if you have to enforce so much of what a "relational database" is in your app. note that not even the SQL standards use the word "relational". anywhere. Years ago I couldn't believe this, but go ahead and look. It's not there.
- ucee054 14y agoYou've been smoking too much FabianPascal
- TheZenPsycho 14y agowell, just because he's an antisocial unbearable asshole doesn't mean he's not right.
- ucee054 14y agoNo, the fact that he's not living in reality does. I never heard about Codd complaining about IBM's first relational implementation. In fact, have you read Codd's papers defining relational databases and normal forms? To even get to 1NF, you have to eliminate any non-atomic datatypes. How the hell are you going to do that? Get rid of strings? Any idiot can put "key1=value1;key2=value2" into a string and violate 1NF. Any idiot can create two identically typed columns for storing the same attribute, instead of one, in the same table, and violate 1NF. Even frickin' dates are non-atomic. There is no practical way for a database server to ENFORCE what Pascal calls "relational" on the users. So actually the whole "SQL's not relational" bullshit boils down to three things: "WAAAH! DISTINCT should be the default!" "WAAAAH! we shouldn't have NULLs!" and "WAAAH! we shouldn't have recursive table definitions or hierarchy types!" Back in the real world we want those features, because we NEED to represent hierarchies and "Not Applicable" values in our databases.
- TheZenPsycho 14y agoerr.... I think you are deeply confused. http://en.wikipedia.org/wiki/First_normal_form#Atomicity http://en.wikipedia.org/wiki/First_normal_form#Atomicity The rules of relational databases aren't the rules because some guy named CODD said they are. There are deeper principles of mathematics and logic at work. It's rather hysterical to claim that, because some guy named CODD explained the properties of this system in an ambiguous or confusing way, that the whole system should be disregarded as impractical nonsense.
- 14y ago