- MySQL for Python
- Albert Lukaszewski, PhD
- 289字
- 2021-04-13 17:12:28
Record retrieval is without doubt the most common activity employed with regard to MySQL and other relational databases. Like most computer programs, MySQL functions on the basis of being invoked with parameters and returning results in accordance with them. As we seen, Python acts as an intermediary to that process. We can use it to access MySQL, login, and connect to a database of our choice.
In this chapter, we will look at the following:
- Forming a MySQL query directly
- Passing a query to MySQL
- User-defined variables in a MySQL query
- Determining characteristics of a database and its tables
- Changing queries dynamically, without user input
Working through each of these points will help you at the end of the chapter, when we get to the project: a command-line search tool.
The four basic functions of any persistent storage system like MySQL spell CRUD:
- Create
- Read
- Update
- Delete
These are key concepts, which each of the basic MySQL commands reflect.
There is nothing technical about the words themselves, but the concepts are very important. They represent the four activities that you can expect to be able to do in every relational database system you use. There are several alternatives to this acronym and keyword series (for example, SCUD for "select, create, update, and delete" or SIDU for "select, insert, delete, and update"). The point of each of these is that database functionality boils down to two sets of opposing activities:
- Creating and deleting database objects (for example, databases, tables, records)
- Inserting and reading data (that is writing and reading)
Each of these will be addressed in the coming chapters. In this one, we start with reading data using SELECT
.
- AutoCAD Civil 3D 2018 場地設計實例教程
- VSTO 3.0 for Office 2007 Programming
- Django 1.2 E/commerce
- AI圖像處理:Photoshop+Firefly后期處理技術基礎與實戰
- 超簡單的攝影后期書
- 工業軟件研發、測試與質量管理論叢
- 深入理解OpenCV:實用計算機視覺項目解析(原書第3版)
- CAXA電子圖板2016基礎與實例教程
- 3ds Max/VRay印象燈光/材質/渲染技術精粹Ⅲ
- 剪映+Vlog+Premiere短視頻制作從新手到高手
- 抖音+剪映+Premiere短視頻制作從新手到高手(第2版)
- Oracle Warehouse Builder 11g R2: Getting Started 2011
- Photoshop數字圖像處理
- PKPM 2010結構分析從入門到精通
- 中文版3ds Max 2014基礎培訓教程