mysql, Programming




Find the collation of all tables within a mysql database

Needing to find a collation of a mysql database for a migration I went to google. Found several options, but the best was one from stack overflow. SELECT TABLE\_CATALOG, TABLE\_SCHEMA, TABLE\_NAME, COLUMN\_NAME, COLLATION\_NAME FROM INFORMATION\_SCHEMA.COLUMNS; This will output something like: mysql> SELECT …



Query to insert all countries into database

I needed to insert all of the countries in the world into a database. I couldn't find the query to run, so I created my own. Here it is. 'country' is the table name and 'name' is the column name. INSERT INTO country (name) VALUES ('Afghanistan'), ('Albania'), ('Algeria'), ('Andorra'), ('Angola' …