摘要: MySQL索引的概念 python 创建索引 运行前: 运行后: 阅读全文
posted @ 2017-11-24 01:07 考鸡蛋 阅读(1223) 评论(0) 推荐(0) 编辑
摘要: ``` !/usr/bin/env python coding:utf 8 @Time : 2017/11/24 0:27 @Author : lijunjiang @File : delete.py import MySQLdb select_sql = ''' SELECT TID FROM ( 阅读全文
posted @ 2017-11-24 00:42 考鸡蛋 阅读(2244) 评论(0) 推荐(0) 编辑
摘要: ``` !/usr/bin/env python coding:utf 8 @Time : 2017/11/23 23:57 @Author : lijunjiang @File : update.py import MySQLdb select_sql = 'select Grade from S 阅读全文
posted @ 2017-11-24 00:25 考鸡蛋 阅读(1742) 评论(0) 推荐(0) 编辑
摘要: 查找课程不及格学生最多的前5名老师的id 表:student 字段名 | 类型 | 是否为空 | 主键 | 描述 | | | | StdID | int |否 | 是 | 学生ID StdName | varchar(100) | 否 | | 学生姓名 Gender | enum('M','F') 阅读全文
posted @ 2017-11-23 23:47 考鸡蛋 阅读(1773) 评论(0) 推荐(0) 编辑
摘要: 生成随机内容用到的方法: sql语句说明 示例: 阅读全文
posted @ 2017-11-23 01:10 考鸡蛋 阅读(8486) 评论(0) 推荐(0) 编辑
摘要: information_schema这个库,这个在mysql安装时就有了,提供了访问数据库元数据的方式。那什么是元数据库呢?元数据是关于数据的数据,如数据库名或表名,列的数据类型,或访问权限等。有些时候用于表述该信息的其他术语包括“数据词典”和“系统目录”。 information_schema数据 阅读全文
posted @ 2017-11-22 23:56 考鸡蛋 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 表设计 表:student 字段名 | 类型 | 是否为空 | 主键 | 描述 | | | | StdID | int |否 | 是 | 学生ID StdName | varchar(100) | 否 | | 学生姓名 Gender | enum('M','F') | 是 | | 性别 Age | 阅读全文
posted @ 2017-11-22 22:57 考鸡蛋 阅读(12323) 评论(0) 推荐(0) 编辑
摘要: 数据库连接池的作用: 数据库连接池负责分配、管理和释放数据库连接,它允许应用程序重复使用一个现有的数据库连接,而不是再重新建立一个;释放空闲时间超过最大空闲时间的数据库连接来避免因为没有释放数据库连接而引起的数据库连接遗漏。这项技术能明显提高对数据库操作的性能。 Python 创建、使用mysql连 阅读全文
posted @ 2017-11-22 22:42 考鸡蛋 阅读(291) 评论(0) 推荐(0) 编辑
摘要: mysql 事务 mysql 游标 阅读全文
posted @ 2017-11-20 23:22 考鸡蛋 阅读(594) 评论(0) 推荐(0) 编辑
摘要: ``` #!/usr/bin/env python # -*- coding:utf-8 -*- # @Time : 2017/11/20 16:03 # @Author : lijunjiang # @File : demo.py import MySQLdb # 连接数据库 # host 数据库IP # port 数据库监听端口 # user 数据库用户 # passwd 用户密... 阅读全文
posted @ 2017-11-20 23:18 考鸡蛋 阅读(6508) 评论(1) 推荐(1) 编辑