Basic Data Analysis with MySQL Shell Python mode

I recently watched a fantastic Python Pandas library tutorial series on YouTube. Without a doubt, Pandas is great for all sorts of data stuff. On the same token, MySQL Shell in Python mode is quite powerful in the sense that Python and the MySQL Shell (version >= 8.0) are somewhat united in the same environment. Although Pandas is in a league all its own when it comes to data analysis, between the power of MySQL and Python, we can also perform some basic analysis easily in MySQL Shell Python mode. In this blog post, I will cover some basic data analysis using Python mode in the MySQL Shell. Continue reading to see examples…

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

MySQL Shell Python mode blog posts compilation

Over the last few months, I have written numerous blog posts on different features of the MySQL Shell ranging from basic CRUD to aggregate functions and DDL. As a part of the MySQL version 8 release, MySQL Shell is a powerful and alternative environment that you can manage and work with your data in using a choice of 3 languages: Python, Javascript, or SQL. So this blog post is a simple compilation of all the Python mode related posts, in one easy-to-access location…

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

PHP PDO lastInsertId() method with examples in MySQL

MySQL has an AUTO_INCREMENT column attribute which automatically generates a consistent integer value upon a successful (or not) INSERT. Oftentimes, this attribute is set on a column deemed the PRIMARY KEY. Therefore, providing a unique value for the column and ensuring each rows’ individual identity. The LAST_INSERT_ID() function returns the most recently generated value for a column with the AUTO_INCREMENT attribute. Many times, you use this value further in query processing (E.g., link a newly signed-on customers’ information to a joining table of orders, ensure referential integrity between parent and child tables using a FOREIGN KEY and PRIMARY KEY, INSERT into another related one-to-one table, etc…). The PDO PHP library has a like-named class method, lastInsertId(), which provides the same functionality as LAST_INSERT_ID() in a PHP context. In this post, I’ll visit lastInsertId() with a simple example. Continue reading to learn more…

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

Use phpMyAdmin to change column name and datatype in MySQL

Using the MySQL ALTER TABLE command, you can easily change an existing columns’ name and datatype. With just a few clicks, you can do the same in the phpMyAdmin visual web interface. For many developers, this interface is the one they lean on most while programming so it can’t hurt to know how to do it yourself should you find yourself programming in this environment…

Keep reading for more SQL database and Python/PHP-centric content

ALTER TABLE ADD COLUMN – MySQL Shell Python style

We all know as SQL professionals that a common use of the ALTER TABLE command is that we can change a tables’ structure in a myriad number of ways. And, that’s a good thing too because chances are, you won’t always nail down the initial structure. Due to changing business or application requirements, you may even have to add additional columns that were not considered during the schema design phase. Suppose you have many tables that are structured similarly and they all need a specific column added to their already-existing design. Under certain circumstances, using the MySQL Shell in Python mode (\py), can reduce the number of manual ALTER TABLE statements you have to type. Continue reading to see examples in the MySQL Shell…

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