MySQL Shell CRUD with Python: Read – with examples

In MySQL Shell CRUD with Python: Create – with examples, I visited the insert() method, demonstrating how simple it is to add new rows of data to a table using Python in the MySQL Shell. Now that the data is stored, if we want to retrieve any of it – for reading – we need to SELECT it, right? Luckily, there is a select() method available we can use in Python mode in the shell, making this operation relatively simple. But, as simple as it is, the power lies in the combinations of other similar class methods used for filtering. Interested? Keep reading… [Keep reading for more SQL database and Python-centric content >>>]
Advertisements

MySQL Shell CRUD with Python: Create – with examples.

I honestly feel like MySQL hit a home run with the release of version 8. Having included so many fantastic features, it is hard to single one out above the others. However, there is one – besides Window Functions – that is really a game-changer. To be exact, the one actually makes 3 (whatever kind of sense that makes). I am talking about the MySQL Shell, the Document Store, and the X DevAPI. The focus of this post is on the Shell itself. What is it about the Shell that intrigues me? I’m sure your curiosity is piqued so keep reading to find out about the functionality you simply cannot ignore… [Keep reading for more SQL database and Python-centric content >>>]

Pyodbc SQL CRUD – Delete: Examples with MySQL

So far in the Pyodbc CRUD series, we’ve seen examples of how to: 1)Create new rows of data with INSERT 2)Read some data with SELECT 3)Modify existing data with UPDATE. Rounding out the CRUD operations is perhaps the most powerful command in SQL: DELETE. When it’s time for those rows of data to disappear, DELETE comes in swinging, makes it happen, and doesn’t look back. It’s been said uncountable times before, but, it is always worth repeating; DELETE completely removes data. Enough with the antics, let’s see it in action using pyodbc…

[Keep reading for more SQL database and Python-centric content >>>]

Pyodbc SQL CRUD – Update: Examples with MySQL

Likely, some of the data you store will remain unchanged. Yet, the majority of it changes rapidly depending on its nature and the purpose it serves. How do you modify data already present in your tables? We know that to CREATE new rows of data in a table, we employ INSERT, and to see the data on hand, SELECT is there. However, to change it, that is the job of the UPDATE command. Keep reading to see a couple of simple examples using the pyodbc Python driver…

[Keep reading for more SQL database and Python-centric content >>>]

SQL to JSON using the JSON_OBJECT() function in MySQL – with examples.

I have begun exploring JSON, the MySQL X Dev API, and the Document Store in earnest due to a requirement I am facing in my day job. The data model I am working with presents several challenges (don’t they all). Inspired in my own right by 2 fantastic books I am currently reading and working through: SQL Antipatterns: Avoiding the Pitfalls of Database Programming by Bill Karwin and Introducing MySQL Shell by Charles Bell. I am starting to see that JSON, the MySQL X Dev API, and the Document Store just might be my salvation. Based on my understanding gained from both books – for differing reasons – I have come to this conclusion. Both books have influenced my thinking in terms of different options, applicable to my particular data needs. In this post, I will go from SQL to JSON all within MySQL using built-in functionality….

[Keep reading for more SQL database and Python-centric content >>>]