Computer Science
Create a table EMPLOYEE with Fields FIRST_NAME, LAST_NAME, AGE, GENDER and INCOME.
Python MySQL
1 Like
Answer
import mysql.connector
mydb = mysql.connector.connect(host = 'localhost',
user = 'root',
passwd = 'tiger',
database = "kboat_cbse_12")
mycursor = mydb.cursor()
mycursor.execute("CREATE table EMPLOYEE (FIRST_NAME VARCHAR(45),
LAST_NAME VARCHAR(45),
AGE INTEGER,
GENDER VARCHAR(10),
INCOME FLOAT)")
mydb.commit()
mycursor.close()
mydb.close()
Answered By
2 Likes
Related Questions
Write a program to display all records in ascending order of their salary from table employee.
Write a program to increase salary of the employee, whose name is "MANOJ KUMAR", by 3000.
Write a program to delete the employee record whose name is read from keyboard at execution time.
Create a database TESTDB.