sql插入语句(推荐):
1 str_mac = "nihao" 2 # SQL 插入语句 3 4 sql = "INSERT INTO EMPLOYEE(FIRST_NAME, \ 5 LAST_NAME, AGE, SEX, INCOME) \ 6 VALUES ('%s', '%s', %s, '%s', %s)" % \ 7 (str_mac, 'Mohan', 20, 'M', 2000)
sql更新语句:
常见问题在update set age = age+1 and income=10 。。。数据库会出现age=0
1 sql = "UPDATE EMPLOYEE SET AGE = AGE + 10,INCOME = INCOME+50 WHERE SEX = '%c'" % ('M')