MySQL

Adding a New Column in a Specific Position

Consider the following table that already exists: CREATE TABLE ‘NUMBERS_TABLE’ (‘ONE’ INT(11) NULL DEFAULT NULL,’THREE’ INT(11) NULL DEFAULT NULL,’FIVE’ INT(11) NULL DEFAULT NULL)COLLATE=’utf8_bin’ENGINE=InnoDB; And we want to add a new

Using information_schema.TABLES to get approximate row counts instead of COUNT(*)

Get Detailed Information on Tables in MySQL

MySQL exposes a virtual schema called information_schema that describes every database, table, and column on the server. One of its most useful tables is TABLES, which includes a table_rows column

Understanding the INSTR Function

MySQL is very powerful with a lot of in-built features. Today we are analyzing the INSTR function. Syntax: INSTR (String, subString) Result: Returns the first index of the subString in

Trimming Decimal Places Using TRUNCATE

Use cases where we need to have the result with varying decimal places are possible. You can change the value in the resulting field using the TRUNCATE function. Consider the

Using MySqlCheck

MySQL provides many utilities for verifying and taking corrective actions in case of failures. One such tool is mysqlcheck Usage: [root@mypc]# mysqlcheck -h -u -p –analyze –databases ; The above