- 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
.
- Photoshop CC 網(wǎng)店視覺設(shè)計(jì)
- VR、AR與MR項(xiàng)目開發(fā)實(shí)戰(zhàn)
- Midjourney AI繪畫藝術(shù)創(chuàng)作教程:關(guān)鍵詞設(shè)置、藝術(shù)家與風(fēng)格應(yīng)用175例
- 青少年美育趣味課堂:青少年學(xué)攝影修圖
- 音樂日記:Logic Pro X場(chǎng)景x風(fēng)格編曲實(shí)用教程
- RESTful PHP Web Services
- 中文版AutoCAD 2014高手之道
- Small Business Server 2008 – Installation, Migration, and Configuration
- Java EE 6 with GlassFish 3 Application Server
- Photoshop CS6案例教程(第3版)
- Python 3 Web Development Beginner's Guide
- Hello HarmonyOS?。壶櫭蓱?yīng)用開發(fā)從入門到精通
- OpenGL 4.0 Shading Language Cookbook
- 同花順軟件操作技巧與實(shí)戰(zhàn)指南
- SolidEdge ST10中文版標(biāo)準(zhǔn)教程