3 MySQL Commands Developers should know.

If you are a developer working in a MySQL environment, this blog post is for you. I share 3 MySQL commands or statements that you should know. That is a bold statement, I know. Turns out, once you do know (of) these commands, you will use them all the time. They minimize guesswork which leads to better productivity in other facets of your programming and querying workflow. I use them myself almost daily and am sure you will too once you see how simple they are to use. So why should you know them? Continue reading and find out…

[Keep reading for more MySQL database and Python/PHP-centric content >>>]
Advertisements

TRIM() string function in MySQL – with examples.

In this post, I’ll cover examples of the MySQL TRIM() function. TRIM() removes specific characters – or spaces – from a given string, at either: the beginning, ending, or potentially in both locations depending on several factors. With an optional keyword argument that controls which character(s) – if any – are removed, TRIM() can be tricky so let’s gain understanding with several easy-to-digest examples…

[Keep reading for more MySQL database and Python/PHP-centric content >>>]

Exploring .count() and COUNT() – MySQL Shell Python mode

Retrieving a table count of rows using the COUNT(*) aggregate function in MySQL is a straight-forward query. What if I told you that with the MySQL Shell, there are actually 3 possible ways – between 2 Shell modes (\sql and \py) – to retrieve a table row count? Would you be interested in knowing about them? Honestly, one of the queries will not surprise you in the least bit, as you are likely already using it. However, the other 2 queries – in this context – are specific to MySQL Shell Python mode. You can likely execute these queries in Javascript Mode. However, I am not versed in Javascript programming nor MySQL Shell Javascript mode so those queries are not covered here. Continue reading to see the example queries in Python mode…

[Keep reading for more MySQL database and Python/PHP-centric content >>>]

Pivot query in MySQL – Learning by example.

While reading in a fantastic SQL book I frequent quite a bit, I discovered a type of query in one of the examples that I really should know. For a better learning experience, in order to solidly the concepts presented, I applied them to some data that I am familiar with. The topic: pivoting rows of data. Although I am aware of this data presentation, I have never studied a pivot query. ‘So why not learn it then’ I thought to myself. Are you interested in learning about a pivot query also? Continue reading and see an easy-to-comprehend example…

[Keep reading for more MySQL database and Python/PHP-centric content >>>]

Export MySQL data to CSV with phpMyAdmin

Comma-separated values files – also known as CSV’s – are one of the most recognized and used data storage/exchange formats. Whether a CSV is the best choice or not remains to be seen. For some data, a CSV is fine. For others, not so much. At some point, chances are someone will need data from a MySQL database in CSV format. That’s not at all difficult and there are several ways to do that. What if you are working in the phpMyAdmin interface? Can you export CSV’s from the phpMyAdmin environment? You sure can. Continue reading to see simple examples of exporting MySQL table data to a CSV file using phpMyAdmin…

[Keep reading for more MySQL database and Python/PHP-centric content >>>]