I have used SQL Server & MySQL RDMS databases in my app development. I am new to sybase database in which I found that the string search is by default case-sensitive whereas in SQL Server and MySQL its not.
1. Is there any SQL Standard regarding string search case-sensitivity?
2. If there is unique key index over this string column, then will there be any issue if two rows found to be have same string but one in upper case and other in lower case?
SELECT * FROM TABLE1 WHERE COL1 = 'Sample'
SELECT * FROM TABLE1 WHERE COL1 = 'sample'
I think it depends on
CHARACTER SETandcollationin MySQL. Default character set islatin1_swedish_ciin whichcistands for case insensitive. You can change it tolatin1_swedish_csto make it case sensitive.In both MySQL and SQL server you can set character set and collation on column, table, database and server level.
http://dev.mysql.com/doc/refman/5.5/en/case-sensitivity.html
Unique index will remove duplicates based on character set and collation. So if you have a
latin1_swedish_csthen you will have two rows for ‘Sample’ & ‘sample’ and forlatin1_swedish_ciyou will have only first row ‘Sample’. So all the string comparisons (inWHERE, DISTINCT, GROUP BY) inside database will based on the character set and collation which you have set.