I am currenty using MySQL 5. To use foreign keys on MySQL you will want to use InnoDB stored engine. Use a parameterized query to insert dynamic data into a MySQL table in Python. csv file into MySQL using Pandas (Python). group by day and save the result set into MySQL. PyMySQL is fully written in Python and can be used from Python implementations - CPython, PyPy and IronPython. Creating the Database User Before you create a database you need to create its User who will be granted the right to perform any operations on the database. NET data providers in June, 2002, DataDirect Technologies has been fully committed to boosting operational performance in real-world environments such as Microsoft SQL Server. A DataFrame is a Dataset organized into named columns. You insert rows into a database by adding objects to the associated LINQ to SQL Table collection and then submitting the changes to the database. MySql split table on insert. php, asp, jsp,. pyodbc does not do any conversion between Unicode encoding schemes. 08/08/2019; 7 minutes to read +5; In this article. , is possible as well). It inserts data remarkably fast. The following describes the different techniques (again, in order of importance) you can use to quickly insert data into a table. Load and run the www example program helloWeb2. (I guess this is because I am a Windows luser. Close the database connection. Welcome to an SQLite mini-series! SQLite, as the name suggests, is a lite version of an SQL database. How to rectify it?. Python parameterized query and Prepared Statement to Insert data into MySQL table. Once you established such a connection between Python and SQL Server, you can start using SQL in Python to manage your data. In this tutorial we will learn how to use show tables and Select table_name in order to list and print table names. We’re going to load some NYC Uber data into a database for this Spark SQL with MySQL tutorial. NET data providers in June, 2002, DataDirect Technologies has been fully committed to boosting operational performance in real-world environments such as Microsoft SQL Server. Click the With selected: drop down menu and choose Drop. You can insert multiple rows into MySQL table. This Windows batch file, in turn, invokes the Python script for downloading nvda historical stock prices for trading days in 2016 and 2017. It is one of the most commonly used Python packages for MySQL. The classname and subprotocol attributes are set for their appropriate PostgreSQL values. The first way specifies both the column names and the values to be inserted:. (as the single-quote character would be auto-quoted), but you might run into some slight data loss in the second case. With huge tables/db's you don't have the choice of backup/restore or even use ALTER on. read()) work or is it best to use Image or ImageGrab?. First program. CREATE TABLE NewName SELECT Name FROM Matrix WHERE 1=2; INSERT INTO NewName SELECT Name FROM AdminAccounts A LEFT JOIN Matrix B USING (Name) WHERE B. If you are going to be working on a data set long-term, you absolutely should load that data into a database of some type (mySQL, postgreSQL, etc) but if you just need to do some quick checks / tests / analysis of the data, below is one way to get a look at the data in these large files with python, pandas and sqllite. In this syntax, instead of using the VALUES clause, you can use a SELECT statement. If you are using phpMyAdmin, you can manually enter this information. So you may load financial reports, stock and option quotes, fundamental data, social contacts, etc. If you want to select all the columns of the data from a table, you can use the asterisk (*). With dbForge Studio for MySQL, you can export or import data to/from most popular formats such as Text, MS Excel, XML, CSV, DBF, etc. Php Mysql Query not working properly php , mysql No need to use union as it will give a lots of duplicate data What you want to achieve can be done with simple left join or inner join SELECT m. HTML is a Markup Language, which means you can't process the form. The following statement inserts values into a table using MySQL INSERT INTO statement when the column names and values are collected from another identical table using MySQL SELECT and WHERE. To insert new rows into a MySQL table, you follow these steps: Connect to the MySQL database server by creating a new MySQLConnection object. The first thing you often do is to insert new rows into the table. Note! You can get the code of this tutorial from my GitHub repository. 0 ; Thread-safety; Thread-friendliness (threads will not block each other) MySQL-3. Each entry of the table will have. Using PHP and Mysql, we can store data obtained from radio button into mysql table. NET, create an INSERT statement and loop through each row, instead you can simply use the SqlBulkCopy class using WriteToServer method that accepts a DataTable object as an argument. DictReader method. How to insert data from an excel file into a Mysql database using python I am trying to insert data from an excel file into my database but I'm struggling(new to python) Here is my code :. 1 Database layout; 2 Logging into MySQL. With huge tables/db's you don't have the choice of backup/restore or even use ALTER on. This tutorial will guide you step by step to read a JSON file in PHP and insert JSON to MySQL database with PHP. The following working example, assumes that you have already an existing database company. Suppose you have a table where you want to encrypt user’s name & address. [mysql dir]/bin/mysql -h hostname -u root -p: Create a database on the sql server. So in your Raspberry Pi will must prepare MySQL Library for programming before. Lists can be indexed, sliced and manipulated with other built-in functions. php" 文件连接数据库，并通过 $_POST 变量从表单取回值。 然后，mysql_query() 函数执行 INSERT INTO 语句，一条新的记录会添加到数据库表中。 下面是 "insert. To insert a date in a MySQL database, you need to have a column of Type date or datetime in your table. In this article, I'll show you three different import methods: When you want to add the data line by line. How to display data from a MySQL query in a table on a Flask App I'm relatively new to Python/flask and I'm having trouble with some database stuff. Confirm by clicking Yes. HTML is a Markup Language, which means you can’t process the form. While inserting a row, if the columns are not specified, it means that vales are added for all of the columns of the table resulting addition of a single row. Summary: in this tutorial, you will learn how to create new tables in the PostgreSQL database using Python. To do this work we have to do first install python on our machine also have setup xampp and MySQL. What happens to web2py? It gets confused about what exactly is the table structure actually stored in the database. MySQL is the world's most popular open source database, recognized for its speed and reliability. The following working example, assumes that you have already an existing database company. LOAD DATA LOCAL INFILE 'path/pub. We’ll briefly explore how to use SQLAlchemy and then dive deeper into how to execute raw SQL statements from within the comfort of the Python domain language. 3- We can also avoid duplicate values storing in mysql table while inserting by primary key. If you are going to be working on a data set long-term, you absolutely should load that data into a database of some type (mySQL, postgreSQL, etc) but if you just need to do some quick checks / tests / analysis of the data, below is one way to get a look at the data in these large files with python, pandas and sqllite. 7; Python 3 support coming soon. SQL Server Query to Tableau Data Extract LIKE A BOSS – Some more TDE API fun with Python & Tableau 8 Coming off the excitement of my last post about writing a simple bare-bones python usage of Tableau's brand-new Data Extracts API from version 8. Contact WHERE EmailPromotion = 2 ----Verify that Data in TestTable SELECT FirstName, LastName FROM TestTable ----Clean Up Database DROP TABLE TestTable GO. I talk a lot about server software and apps that require. Network interaction is quite slow compared with CPU. While this works well under some loads, more traditional DBMSs can improve p Django is a flexible framework for quickly creating Python applications. This is mostly useful when there are zero (or very few) rows in the table into which you are inserting data. But still there are some other frameworks which though not much popular, but are still appreciated by folks who have used it. Scripting Languages are of two type :- * Server Side Scripting Language (e. You can read and learn from the this guide:. We also define the database in a global variable called DB_NAME, which enables you to easily use a different schema. Once you have created a table, you need to add data into it. Python File Handling Python Read Files Python Write/Create Files Python Delete Files Python MySQL MySQL Get Started MySQL Create Database MySQL Create Table MySQL Insert MySQL Select MySQL Where MySQL Order By MySQL Delete MySQL Drop Table MySQL Update MySQL Limit MySQL Join. Using an SQL database with our GUI. 3- We can also avoid duplicate values storing in mysql table while inserting by primary key. txt' INTO TABLE pet LINES TERMINATED BY '\r\n'; (On an Apple machine running OS X, you would likely want to use LINES TERMINATED BY '\r'. In this post I’ll show how you can use the Flask-Login extension to add user authentication to your applications and deploy them on OpenShift. MariaDB is the fork of the MySQL database and it is compatible with MySQL. Grid View (Table list) in tkinter. Import data from Excel into MySQL using Python Insert CSV File into mySQL Database using php create a Python script that will import data from Excel into MySQL using the xlrd library. (I guess this is because I am a Windows luser. connect('Type your DataBase name here. SQLite3 comes as a part of the Python 3 standard library. Connect to the local MySQL database server; Use the demo database; Insert each line of the Books table into the tutorial database we created earlier; Connecting to the Database Server and Selecting the Correct Database. To demonstrate how this is possible, I will use a Sports example. With any database, importing data from a flat file is faster than using insert or update statements. Insert-data-into-MySQL-from-CSV-file-using-python-3 Introduction: Our aim is to insert data into MySQL database from defferent CSV file. Generate SQL for insertation into table from dictionary object (Python recipe) It is often the case that a developer needs to insert a variety of values into many different individual tables on a SQL server. MySQL stores given relation data in tables. It is that plain and simple. If i launch the server for the first time i get the "Unknown column in field list" exception. In this article I'll take the next step and show how to insert data. On MySQL, instead of using the "mysql" interactive client program provided, you can write your own client programs (in Java or other languages) to access the MySQL server. php page in a new folder("764") created under public_html folder present in your home directory. It is conceptually equivalent to a table in a relational database or a data frame in R/Python, but with richer optimizations under the hood. Connecting to MySQL using PHP. To insert a date in a MySQL database, you need to have a column of Type date or datetime in your table. It is one of the most commonly used Python packages for MySQL. This post will show you how to use Python to connect to a SQL Server database, save and retrieve data. csv file into MySQL using Pandas (Python). The simple changes from helloWeb1. Here is a picture of a typical table displayed within a scroll pane: The rest of this section shows you how to accomplish some common table-related tasks. How do i get this done? I am stuck because with my limited SQL knowledge, i only know how to do this using a bulk insert statement in my procedure. db') Steps to Create a Database in Python using. If you want to store your own data, it is best to create your own database to add tables to instead of messing with the mysql database. To delete a table, type the following command from the mysql> prompt. Using PHPMyAdmin, it is easy to. Hi, I want to know how to use Python variables in My sql statement and below is the syntax i am using. The key used in UPDATE, DELETE, and MERGE is specified by setting the key column. Delete and Truncate. fieldstorage, massages that data and finally attempts to insert it into an mysql table. So, let’s first check the details and see how to use the INSERT command. MySql split table on insert. The SQL statement to update the table uses parametrization. Using the generic ‘Insert’ template that was introduced at the beginning of this post, you can then apply the following code in Python to insert the 2 records into the MySQL table. connect (host = "localhost",user = "usr", passwd. The SELECT statement can retrieve data from one or more tables. Even Python language has some built-in libraries to access and use SQL related database system like SQLite3, MySQL…. Insert Operation with MySQL in Python: Let's perform insertion operation in MySQL Database table which we already create. The examples were created and tested on Ubuntu Linux. ) You can specify the column value separator and end of line marker explicitly in the LOAD DATA statement if you wish, but the defaults are tab and linefeed. For modern Python 3 MySQL programming, use PyMySQL module. ROUTINES and try to map provided command parameter values to the called procedures parameters and type cast values accordingly. A common usage pattern for streaming data into BigQuery is to split a logical table into many smaller tables to create smaller sets of data (for example, by user ID). Handy MySQL Commands: Description: Command: To login (from unix shell) use -h only if needed. First your android app calls a PHP script in order to perform a data operation, lets say “create”. Step 1: Install MySQL. 23 through 5. Crate a dictionary in the form of a string to use as JSON; Use the JSON module to convert your string into a dictionary. The fastest way to achieve this is exporting a table into a CSV file from the source database and importing a CSV file to a table in the target database. Click the With selected: drop down menu and choose Drop. If the opposite option, create no tables , is used, then the target tables must already exist in the target Postgres database prior to the migration. If you liked this post, you can share it with your followers or follow me on Twitter!. How to Insert Data Into a MySQL Database From an HTML Form In this tutorial, we will show how to insert data into a MySQL table of a database from an HTML form. There may be times when you need to analyze the data stored in several MySQL tables or views, (possibly in an Excel PivotTable which will. sqlite3 — DB-API 2. The PHP script then connects to your MySQL database to perform the operation. Learn how here. For example sales department sends daily sale data in excel sheet to IT department, how this data feed into Oracle database (to tables) ? we will examine different methods. I have a form which uploads data to an action page - which then picks up the data via cgi. With any database, importing data from a flat file is faster than using insert or update statements. MySql split table on insert. Reading the file row by row (say in PHP) and inserting into MYSQL is very poor style of coding which is inefficient and takes a lot of time. You can insert multiple rows into MySQL table. Google Cloud IoT Core makes it easy to get data from constrained devices to Google’s cloud by giving devices a conversion from HTTP or MQTT messages to Cloud PubSub messages. MySQL query INSERT INTO Table with Examples. Sometimes you need to insert a python variable as a column value in the insert query. It covers the basics of MySQL programming with Python. On the other side of the horizon, we have the NoSQL. It is conceptually equivalent to a table in a relational database or a data frame in R/Python, but with richer optimizations under the hood. Never use string operations or concatenation to make your queries because is very insecure. We will insert data oi STUDENT table and EMPLOYEE table. As the question implies, you can use the Java Statement class to issue a MySQL INSERT statement, but the Java PreparedStatement class provides a much better way to insert data into a MySQL database table. For instance, after downloading your text file, you can import the values in an Excel sheet, or into an Access table, or later on, even in a MySQL table. 2 Creating Tables Using Connector/Python All DDL (Data Definition Language) statements are executed using a handle structure known as a cursor. The SQL INSERT statement is used to insert a single record or multiple records into a table. To insert new rows into a MySQL table, you follow these steps: Connect to the MySQL database server by creating a new MySQLConnection object. Creating the Database User Before you create a database you need to create its User who will be granted the right to perform any operations on the database. Load XML Into MySQL Using Java If you like XML's handy hierarchical style and the familiarity of Java, you're in luck: You can quickly parse your XML data and put it into a MySQL database with. insert inserts values into the database table todo and gives you back the ID of the new row. This blog post addresses that and provides fully working code, including scripts for some of the steps described in their tutorial. Create database "data" and table "tb". MYSQL has an inbuilt query and. This article demonstrates how to use Python to connect to an Azure Database for MySQL. Use a parameterized query to insert dynamic data into a MySQL table in Python. Anyway, I have a log file(txt file) that contains data that I want to import into a table. 4 through 2. NET, create an INSERT statement and loop through each row, instead you can simply use the SqlBulkCopy class using WriteToServer method that accepts a DataTable object as an argument. Once you have created a table, you need to add data into it. SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database. Format : SHOW TABLE STATUS;-- this shows the status for all the tables in the database SHOW TABLE STATUS LIKE '[TABLE_NAME}';-- this shows the status for a particular table in the database. In the next section, we're going to use SQLAlchemy's declarative to map the Person and Address tables into Python classes. Once you have your data ready, proceed to the next step. You can use the cursor’s executemany() function to insert multiple records into a table. Here is my code that I have so far. It inserts data remarkably fast. Inserting data into the table. Notice the use of \ in line 18, \ is used to split python statements to multiple lines. How to Add a Column to a MySQL TAble In Python. This tutorial will explain how to create a new database and give a user the appropriate grant permissions. In this tutorial we will show how to create an HTML form and process the data. Do not forget to add db. What happens to web2py? It gets confused about what exactly is the table structure actually stored in the database. I could have used Python as well as both ways work, but MySql makes it more visual and easier to use. If you need to copy data in the DataTable to SQL database table, you don't need to use ADO. I'm generating a multi-row insert/update with the MySQLdb/MySQL-python module from lists of data rows and field names. Allright, lets dig deeper. you want to add data too then the. Let’s see this in action. You can read and learn from the this guide:. Each entry of the table will have. Table Basics. We can use GUI tools like MySQL tools, Heidi, Toad or command line tools provided by MySQL package. MySQL Update Example. LAST_INSERT_ID Function. The values will be supplied by the user in the same order as columns are listed in the table. To connect to MySQL and execute SQL statements with Python, we will use the pymysql module. Generic Database Interfaces and APIs. 2- Check whether the value is present in table or not using PHP and Mysql before inserting data into the table. Delete and Truncate. How to create tables and add data to MySQL database with MySQL Workbench. How to connect to MySQL database using PHP Before you can get content out of your MySQL database, you must know how to establish a connection to MySQL from inside a PHP script. Insert INTO command is an important function in Database. (Also it is worth to mention the MySQL Event Scheduler, but again I would go for a Cronjob) A copy would be something like this SQLFIDDLE: create table t ( id int, d date ); insert into t values( 0, CURDATE() ); insert into t values( 2,. To add a column called email to the contacts table created in Create a basic MySQL table with a datatype of VARCHAR(80), use the following SQL statement: ALTER TABLE contacts ADD email VARCHAR(60); This first statement will add the email column to the end of the table. Step 1: Install MySQL. Also, you can download Laptop table creation with data in MySQL file which contains SQL queries for table creation along with data so you can use this table for your UPDATE operations. If you want to inspect your database visually, you can use the SQLite Manager plugin for Firefox or if you like the command line, you can use SQLite’s command line shell. This is not necessary anymore. But I want to optimize it and I have 2 requests: I want to use. Python Database. MySQL/Connector for Python: This is a library provided by the MySQL community. I am submitting two text field values from a form to cgi page written in Python 3. Generate docx and PDFs with Python, node. [code]now = datetime. Connecting to MySQL using Python. There are 10 rows in the table TBLTEST. I was using them in MySQL and PostgreSQL, and they worked perfectly just as described above, so I sort of assumed it was a SQL standard. To achieve the requirement, the following components are involved: Hive: Used to Store data; Spark 1. Let's make a SQL query using the INSERT INTO statement with appropriate values, after that we will execute this insert query through passing it to the PHP mysqli_query() function to insert data in table. 5+ seconds as discussed above. txt file with table's data in CSV-format:. Most Python database interfaces adhere to this standard. Execute the following SQL script against the FruitShop database:. MySQL stored functions provide a powerful and flexible way to manipulate and process data. See PyMySQL tutorial. To use MySQL database using Python, you need first to install it on your machine; then just type the script given below to implement MySQL within your program. Summary: in this tutorial, you will learn how to create new tables in the PostgreSQL database using Python. The INSERT INTO SELECT statement is very useful when you want to copy data from other tables to a table or to summary data from multiple tables into a table. To understand how they work, let's write one ourselves!. Create tables in SQLite database using Python: shows you step by step how to create tables in an SQLite database from a Python program. Consider a database “studentsDB” in MySQL, in which we shall create a table called students with properties (columns) – Name and Roll Number. commit() at the end of the Python code to ensure that the Insert command would be applied. Using C++ to INSERT INTO MySql Database The problem I'm having is with adding data to the tables via C++. Load and run the www example program helloWeb2. For wide tables, it can be a pain to write those long create table statements and load the data into Redshift. First, add a new column to the world_x city table using the following MySQL command:. 3- We can also avoid duplicate values storing in mysql table while inserting by primary key. Table Basics. The phpMyAdmin script that restores your database does not drop the tables first. CREATE TABLE, DROP TABLE, CREATE VIEW, DROP VIEW are optional. The SQLAlchemy Expression Language presents a system of representing relational database structures and expressions using Python constructs. txt file with table's data in CSV-format:. I have an excel sheet which has a large amount of data. How to insert images into word document table - Duration: Import data from Excel into MySQL using Python - Duration:. In the previous SQLite tutorial, we learned how to create a database, a table, and how to insert data. From a Python program, you can connect to MySQL database to access the tables and manipulate your data. Now that you've understood how to create database and tables in MySQL. When you use a transactional storage engine such as InnoDB (the default in MySQL 5. *Notice that the data is a string with the comma character as the field…. Data Structure is the logical relationship between these data. For a better understanding we will change our student table a bit by adding marks in different subjects for each. [code]now = datetime. A mapper that maps a Python class to a table in a database. 4 Querying Data Using Connector/Python These coding examples illustrate how to develop Python applications and scripts which connect to MySQL Server using MySQL Connector/Python. The syntax to create an AFTER INSERT Trigger in MySQL is: CREATE TRIGGER trigger_name AFTER INSERT ON table_name FOR EACH ROW BEGIN -- variable declarations -- trigger code END; Parameters or Arguments trigger_name The name of the trigger to create. Once you've read in the whole file, you can look up any IP address and instantly see its list of lines. Code Examples - Microsoft SQL Server Overview Since the release of our first ADO. Using MySQL on a Raspberry Pi. You can see some revised code on GitHub. To create smaller tables that are not date-based, use template tables and BigQuery creates the tables for you. However, this scenario is not high performing and should not be relied upon for normal use. Get the Xml data,insert into database table and display in gridview How to speed up import a large csv file to mysql database? Insert data from a PHP dropdown menu into a Mysql database table. Import your JSON file into Python and iterate over the resulting data. It means that MySQL generates a sequential integer whenever a row is inserted into the table. import pandas as pd from pandas. SQL DELETE Learn how to use the SQL DELETE statement to delete remove records from a SQL database table. The INSERT INTO statement is used to insert new data to a MySQL table:. For example sales department sends daily sale data in excel sheet to IT department, how this data feed into Oracle database (to tables) ? we will examine different methods. How to create a MySQL user and database using the MySQL Database Wizard. As we know today everyone wants a device with good data size. JDBC driver connects to a database through connection string or url string. We will use the tasks table that we created in the PHP MySQL create table tutorial. Python Forums on Bytes. But I want to optimize it and I have 2 requests: I want to use. How to Implement MySQL Database. The phpMyAdmin script that restores your database does not drop the tables first. priority ,m. How to Add a Column to a MySQL TAble In Python. I was able to connect to a MySQL db in a different function and get form inputs from a user inserted into the db using wtforms. Here I'll show you how to write HTML using Python. sql dump file, connect to your new database using HeidiSQL. Users (Username,FirstName,LastName,IsSuperUser,AffiliateId,Email,DisplayName,UpdatePassword) SELECT Username. 1 Using sql. Most HTTP servers are written in C or C++, so they cannot execute Python code directly – a bridge is needed between the server and the program. Prepared statements are done in similar way as common string formatting in python. net, java or ruby, from scratch or using templates or databases. In this tutorial, you have learned how to use PHP to INSERT data into MySQL database using MySQLi and PDO. Users (Username,FirstName,LastName,IsSuperUser,AffiliateId,Email,DisplayName,UpdatePassword) SELECT Username. Here are some syntax rules to follow: The SQL query must be quoted in PHP; String values inside the SQL query must be quoted; Numeric values must not be quoted; The word NULL must not be quoted. If you’re using iptables, you need to add an entry to your firewall rule for Transmission Control Protocol (TCP) port 3306. With the JTable class you can display tables of data, optionally allowing the user to edit the data. In this article, I will let you know how to insert or save any digital information such as a file, image, video, or a song as a blob data into MySQL table from python. By using the MySQL Database Wizard tool you can easily create a MySQL user and a database and then assign the user to the database. NET, create an INSERT statement and loop through each row, instead you can simply use the SqlBulkCopy class using WriteToServer method that accepts a DataTable object as an argument. commit() at the end of the Python code to ensure that the Insert command would be applied. After creating a database and its table, you have to insert data into MySQL database. (as the single-quote character would be auto-quoted), but you might run into some slight data loss in the second case. See PyMySQL tutorial. 04 Setting up PostgreSQL with Python 3 and psycopg on Ubuntu 16. H ow do I find out the current date and time in Python? What is the module or function I need to use to get current time or date in Python programming language? You can use time module (low level) which provides various time-related functions. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems. And if you're using Python, you'll be definitely using Pandas and NumPy, the third-party packages designed specifically for data analysis. When you use a transactional storage engine such as InnoDB (the default in MySQL 5. Master SQL Databases with Python. The type database describes a database connection and the type sqlStatement can store a prepared statement. If you want to inspect your database visually, you can use the SQLite Manager plugin for Firefox or if you like the command line, you can use SQLite’s command line shell. MySQL is the world's most popular open source relational database and Amazon RDS makes it easy to set up, operate, and scale MySQL deployments in the cloud. This blog post addresses that and provides fully working code, including scripts for some of the steps described in their tutorial. It is a highly flexible tool, built upon the foundations of progressive enhancement, that adds all of these advanced features to any HTML table. Inside ItemListDb create a table called tblUser. 04 How to Use Redis with Python 3 and redis-py on Ubuntu 16. In this tutorial we are learning to draw Bar Graph using data from MySQL table and PHP. You insert rows into a database by adding objects to the associated LINQ to SQL Table collection and then submitting the changes to the database. Before you can enter data (rows) into a table, you must first define what kinds of data will be stored (columns). Python has several client APIs available to connect to the MySQL database server and perform the database operations. Assuming that MySQL database named as test is present on server and a table named employee is also created. MySQL has been established as a preferred database platform due to the indisputable qualities of this database server. Doing that would be the harder way of doing it. A table has a specified number of columns, but can have any number of rows.
How To Insert Data Into Table Using Python And Mysql