Professional Documents
Culture Documents
ML 7
ML 7
Aim
Algorithm
Step 2: Create the table named salesman using create table (salesman_id n(5), name char(30),
city char(35), commission decimal(7,2));")
Step 4: Insert the values into the table using INSERT INTO salesman(salesman_id, name, city,
commission)
Program
import sqlite3
cursor = conn.cursor ()
s_name = input('Name:')
s_city = input('City:')
s_commision = input('Commission:')
cursor.execute("""
VALUES (?,?,?,?)
conn . close ()
if (conn):
conn.close()
Output
Salesman ID:5
Name:Santhosh
City:Bagalore
Commission:5
Result
The program for creating a table and inserting values into the table was eexecuted
successfully.