Compare structures of two databases?

For MySQL database you can compare view and tables (column name and column type) using this query: SET @firstDatabaseName=”[first database name]”; SET @secondDatabaseName=”[second database name]”; SELECT * FROM (SELECT CONCAT(cl.TABLE_NAME, ‘ [‘, cl.COLUMN_NAME, ‘, ‘, cl.COLUMN_TYPE, ‘]’) tableRowType FROM information_schema.columns cl, information_schema.TABLES ss WHERE cl.TABLE_NAME = ss.TABLE_NAME AND cl.TABLE_SCHEMA = @firstDatabaseName AND ss.TABLE_TYPE IN(‘BASE TABLE’, … Read more

Why aren’t OODBMS as widespread as RDBMS?

One reason that RDBMS has retained popularity is that it’s established technology, well understood and has a standard language (SQL) that multiple vendors support. It also has a few good interfaces like ODBC and JDBC that make it connect with different languages pretty well. A stable API is a strong factor in keeping a technology … Read more

How to lay out B-Tree data on disk?

https://web.archive.org/web/20161221112438/http://www.toadworld.com/platforms/oracle/w/wiki/11001.oracle-b-tree-index-from-the-concept-to-internals Notes: Databases do not directly implement indexes based on B-tree but on a variant called B+ tree. Which according to wikipedia: A B+ tree can be viewed as a B-tree in which each node contains only keys (not key-value pairs), and to which an additional level is added at the bottom with linked leaves. … Read more

Why is negative id or zero considered a bad practice?

To be clear, this question and answer are about using negative numbers for surrogate keys, not for natural keys. As far as I know, there are three reasons for considering it to be a bad practice. It violates the principle of least surprise. Some people assume all ID numbers are non-negative. Some people use negative … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)