Kavya CS Project
Kavya CS Project
1
2
ST. XAVIER’S HIGH SCHOOL
Charwada, Koparli Road, Vapi
Tel.: +91- 9033041764
E-mail: [email protected]
Certificate
This is to certify that Mst./Ms. _____________________________ of
Class XII – ___ of St. Xavier’s High School, Vapi, has completed
his / her Term 1 project file under my supervision. He / She
has taken proper care & shown utmost sincerity in completion
of his / her project.
3
INDEX
1. Declaration 3
2. Acknowledgement 4
3. Introduction 5
4. Working Description 6
5. Coding 7-11
6. Output 12-17
7. Bibliography 18
4
DECLARATION
5
ACKNOWLEDGEMENT
6
INTRODUCTION
7
WORKING DESCRIPTION
Then the user has to enter a choice then according to the choice the input is
asked to enter by the user.
If the choice is equal to 1 then the user has to enter details such as
Patient_Name,Age,Doctor_Consulted, Address,Phone_Number and it is then inserted to
the table "Patient_record" and displays the message "RECORD ADDED"
If the choice is equal to 2, then the user has to enter details such as
Employee_Name,Proffession,Salary_Amount Address,Phone_Number which is inserted
into the "SALARY_RECORD" table and message is displayed " RECORD
ADDED ".
If the choice is equal to 3, then the user has to enter Patient_Name and it will
display all the details of the Patient.
If the choice is equal to 4, then the user has to enter Patient_Name and it will
delete the record of the patient and will display “RECORD DELETED
SUCCESSFULLY”
8
CODING
Database:
TABLE PATIENT_RECORD
create table patient_record( Patient_Name varchar(50),Age
int(3),Doctor_Consulted varchar(50),Address
varchar(150),Phone_Number bigint(15))
TABLE ACCOUNT
create table accounts( User_Name varchar(20) primary key,
password varchar(30) unique)
TABLE SALARY_RECORD
create table salary_record( Employee_Name
varchar(50),Proffession varchar(20),Salary_Amount
varchar(9),Address varchar(150),Phone_Number bigint(15))
9
Main code
import sys
import mysql.connector as sql
conn=sql.connect(host='localhost',user='root',passwd='kavya',database='dental_
management_system')
cur=conn.cursor()
10
if password==value_2:
print()
print('Login succefull')
print()
print("1. Add Patients records")
print("2. Add Salary records")
print("3. Veiw Patient Detail")
print("4. Delete patient detail")
print()
choice=int(input('Enter a option : '))
if choice==1:
print()
name=input('Name : ')
name=name.upper()
age=int(input('Age : '))
doc=input('Doctor Consulted : ')
doc=doc.upper()
add=input('Address : ')
add=add.upper()
phone_no=int(input('Phone Number : '))
cur.execute("insert into patient_record values('" + name + "'," +
str(age) + ",'" + doc + "','" + add + "'," + str(phone_no) + ")")
conn.commit()
print('Record added')
if choice==2:
print()
emp_name=input( 'Employee_Name : ')
emp_name=emp_name.upper()
proffesion=input('Proffession : ')
proffesion=proffesion.upper()
salary=int(input('Salary Amount : '))
add=input('Address : ')
add=add.upper()
phone_no=input( 'Phone_Number : ')
11
cur.execute("insert into salary_record values('" + emp_name + "','" +
proffesion + "'," + str(salary) + ",'" + add + "'," + str(phone_no) + ")")
conn.commit()
print('Record added')
if choice==3:
print()
name=input('Name of the patient : ')
name=name.upper()
cur.execute("select * from patient_record where patient_name like '"
+ str(name) + "'")
data=cur.fetchall()
if data!=0:
for row in data:
print()
print("Patient Details : ")
print()
print('Name : ',row[0])
print(' : ',row[1])
print('Doctor consulted : ',row[2])
print('Address : ',row[3])
print('Phone Number : ',row[4])
input()
else:
print()
print("Patient Record Doesnot Exist")
if choice==4:
print()
name=input('Name of the patient : ')
name=name.upper()
cur.execute("delete from patient_record where Patient_Name like '" +
name + "'")
print('Record Deleted Successfully')
else:
print('Invalid Password')
12
print('Tryagain')
elif option==2:
sys.exit()
conn.commit()
input()
13
OUTPUT
»MYSQL OUTPUT:
14
» PYTHON OUTPUT:
When the user to create a user name and
password:
15
When the user is asked to choose one of them
after successfully login :
16
When the user enters the choice "3" and asked to
enter some details :
17
BIBLOGRAPHY
18