Spaces:
Runtime error
Runtime error
Download SQL.py from AliZain1/SQL_LLM_APP: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/spaces/AliZain1/SQL_LLM_APP/resolve/main/SQL.py
- Command line
-
hf download hf://spaces/AliZain1/SQL_LLM_APP/SQL.py
-
curl -L -o SQL.py https://huggingface.co/spaces/AliZain1/SQL_LLM_APP/resolve/main/SQL.py
1 kB
| import sqlite3 | |
| ## Connectt to SQlite | |
| connection=sqlite3.connect("students.db") | |
| # Create a cursor object to insert record,create table | |
| cursor=connection.cursor() | |
| ## create the table | |
| table_info=""" | |
| Create table STUDENT(NAME VARCHAR(25),CLASS VARCHAR(25), | |
| SECTION VARCHAR(25),MARKS INT); | |
| """ | |
| cursor.execute(table_info) | |
| ## Insert Some more records | |
| cursor.execute('''Insert Into STUDENT values('Krish','Data Science','A',90)''') | |
| cursor.execute('''Insert Into STUDENT values('Sudhanshu','Data Science','B',100)''') | |
| cursor.execute('''Insert Into STUDENT values('Darius','Data Science','A',86)''') | |
| cursor.execute('''Insert Into STUDENT values('Vikash','DEVOPS','A',50)''') | |
| cursor.execute('''Insert Into STUDENT values('Dipesh','DEVOPS','A',35)''') | |
| ## Disspaly ALl the records | |
| print("The isnerted records are") | |
| data=cursor.execute('''Select * from STUDENT''') | |
| for row in data: | |
| print(row) | |
| ## Commit your changes int he databse | |
| connection.commit() | |
| connection.close() |