Study Notes (23): 21 days clearance Python (Video Lesson only) - Case practical operation: create dynamic data tables

Learning immediately: https://edu.csdn.net/course/play/24797/282202?utm_source=blogtoedu

the sqlite3 Import 

# 1. Open Database Connectivity 
Conn = sqlite3.connect ( 'test49.db') 
# 2. Open the cursor 
CN = conn.cursor () 
# 3. Use the cursor execute () method 
cn.Execute ( '' ' 
    Create user_tb table ( 
        the _id Integer Primary Key AUTOINCREMENT, 
        name text, 
        the passwd text 
        Age Integer) 
'' ') 
# create multiple tables 
# cn.Execute (' '' 
# 
# '' ') 

# 4. Close the cursor 
cn.Close () 
# 5. Close the connection 
conn.Close ()
发布了39 篇原创文章 · 获赞 29 · 访问量 905

Guess you like

Origin blog.csdn.net/happyk213/article/details/105225877