Skip to content

sanskar-projects/MySQL-Database-Administrstion-using-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MySQL Database Administrstion using Python

It's a simple python-SQL program to perform basic DDL and DML commands on a mysql database minimising the use of structured query language (SQL) for the user,
the program is almost fully divided into independent functions hence the program can also be used as a module,
mysql.connector module is required to run this program,
database name and password must be entered in the source code before compilation,
editing of host name and user name may also be required in case you are not using the default values,
you can refer the documentation for the last 2 points,
NOTE : this program may be prone to SQL injection techniques hence careful handling is advised.

Add database name and password in the sourcecode



Run



#1:CHECKING ESTABLISHMENT OF CONNECTION TO THE DATABASE
connect()



#2:CREATE A DATABASE
create()



#3:DROP A DATABASE
drop()



#4:SHOW DATABASES
show()



#5:Create a table
createtable()



#7:Show tables
showtables()



#8:Show structure of a table
desc()



#9:Add a column in a table
addcolumn()



#10:Drop a column in a table
dropcolumn()



#11:Rename a column in a table
renamecolumn()



#12:Change type of a column in a table
retypecolumn()



#13:Insert a record in a table
insert()



#14:Delete a record in a table
delete()



#15:Clear a table
clear()



#16:Show a record in a table
select()



#17:Show all records in a table
selectstar()



#18:Update a record in a table
update()



#6:Drop a table
droptable()



Terminate