- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibStruct_SQLdepCreate.py
More file actions
Latest commit
24 lines (23 loc) · 688 Bytes
/
Copy pathLibStruct_SQLdepCreate.py
File metadata and controls
24 lines (23 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
print("Creating Database")
importmysql.connector
mydb=mysql.connector.connect(
host="localhost",
user="########",
password="########",
)
mycursor=mydb.cursor()
q1="create database Library"
mycursor.execute(q1)
print("Database created")
print("Creating Table")
mydb=mysql.connector.connect(
host="localhost",
user="########",
password="########",
database="Library"
)
mycursor=mydb.cursor()
q2="create table librarydb(SNo int, BookName varchar(100), AuthorName varchar(50), Price int, TotalQty int, Available int)"
mycursor.execute(q2)
print("Table created")
print("You can now use LibStruct")