课程名为DataBase的学分改为5学分

简介: 【8月更文挑战第5天】课程名为DataBase的学分改为5学分。

(3)由于培养计划改,现需将课程号为00001、课程名为DataBase的学分改为5学分。
import pymysql.cursors

连接数据库

connect = pymysql.Connect(
host='localhost',
port=3306,
user='root',
passwd='123456789',
db='school',
charset='utf8'
)

获取游标

cursor = connect.cursor()

设置sql语句

sql = "UPDATE course SET Credit = %d " \
"WHERE Cno = '%s'"

设置数据

data = (5, '00001')

执行sql语句,并获取执行结果

result = cursor.execute(sql % data)

提交事务

connect.commit()

查看执行结果

print(result)

关闭数据库连接

cursor.close()
connect.close()

相关文章
|
机器学习/深度学习 人工智能 自动驾驶
全球名校AI课程库(12)| CMU卡内基梅隆 · 数据库系统进阶课程『Advanced Database Systems』
数据库进阶课程,讨论了很多数据库方向的新技术,适合有数据库基础又想在该方向有深入研究的同学。
2417 1
全球名校AI课程库(12)| CMU卡内基梅隆 · 数据库系统进阶课程『Advanced Database Systems』
|
SQL 机器学习/深度学习 人工智能
全球名校AI课程库(11)| CMU卡内基梅隆 · 数据库系统导论课程『Database System』
数据库方向的专业课程,详尽介绍了数据库的基本知识、底层原理、效率优化、查询优化、新数据库等,是数据库管理系统设计与实施方向的权威好课。
2253 1
全球名校AI课程库(11)| CMU卡内基梅隆 · 数据库系统导论课程『Database System』
|
SQL Oracle 关系型数据库
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database (
403 2
|
Oracle 关系型数据库
19c 开启Oracle Database Vault
19c 开启Oracle Database Vault
272 1
|
SQL Oracle 关系型数据库
Connect to Autonomous Database Using Oracle Database Tools
Connect to Autonomous Database Using Oracle Database Tools
134 1
|
人工智能 Oracle 关系型数据库
一篇文章弄懂Oracle和PostgreSQL的Database Link
一篇文章弄懂Oracle和PostgreSQL的Database Link
|
Oracle 关系型数据库 Linux
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
147 0
|
SQL Oracle 安全
Oracle Database Vault Access Control Components
Oracle Database Vault Access Control Components
101 0
|
Oracle 安全 关系型数据库
What Is Oracle Database Vault?
The Oracle Database Vault security controls protect application data from unauthorized access, and helps you to comply with privacy and regulatory requirements. You can deploy controls to block privileged account access to application data and control sensitive operations inside the database using
90 0
|
Oracle 关系型数据库 Linux
服务器Centos7 静默安装Oracle Database 12.2
服务器Centos7 静默安装Oracle Database 12.2
535 0

热门文章

最新文章