[Gambas-user] [slightly OT] No Problem with Gambas or MySql!

Caveat Gambas at ...1950...
Sun Oct 6 00:05:20 CEST 2013


> If you wanted to delete one row with values 347 200, then which row would it be?

It *doesn't matter*!  The rows are the same, so pick a row, ANY row!

> Without the primary key, you're asking MySQL to guess, and it wont.

Yes it will, if you use LIMIT (see my previous two mails).  Otherwise, it'll happily delete all the rows that meet the criteria, whether they're duplicates or not.

> >"duplicate rows are and always were a mistake in SQL", C.J.Date

The guy has obviously never read William Kent's "Data and Reality". It's 
a book I'd still recommend to anyone working with data and particularly 
databases, even though it was written 35 years ago!

<RANT>
Why *must* every record be uniquely identifiable?  Explain why... don't 
just throw random snippets of relational database theory at me!  If I 
ask you to model the contents of your pockets on a database, are you 
going to attach some artificial key to each individual penny?  Why?  
They each buy the same number of penny chews (showing my age!), and if 
you take 3 pennies away, you've still got 3 pennies less than you had 
before, no matter how carefully you select those 3 pennies!
</RANT>

<HINT>
A tuple is, by definition, unique.  If I have 8 rows on my database 
representing 8 real-world penny objects and I can delete 3 of them... 
are the remaining 5 rows tuples?  How closely does the database model 
reality in this case?
</HINT>

Kind regards
Caveat




More information about the User mailing list