<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.twig.es/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=Python_create_a_database</id>
		<title>Python create a database - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=Python_create_a_database"/>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Python_create_a_database&amp;action=history"/>
		<updated>2026-05-06T14:35:56Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.0</generator>

	<entry>
		<id>https://wiki.twig.es/index.php?title=Python_create_a_database&amp;diff=2953&amp;oldid=prev</id>
		<title>George2: Created page with &quot;&lt;source lang=&quot;python&quot;&gt; #!/usr/bin/python  import MySQLdb  # Open database connection db = MySQLdb.connect(&quot;localhost&quot;,&quot;testuser&quot;,&quot;test123&quot;,&quot;TESTDB&quot; )  # prepare a cursor objec...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Python_create_a_database&amp;diff=2953&amp;oldid=prev"/>
				<updated>2016-02-25T11:51:19Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt; #!/usr/bin/python  import MySQLdb  # Open database connection db = MySQLdb.connect(&amp;quot;localhost&amp;quot;,&amp;quot;testuser&amp;quot;,&amp;quot;test123&amp;quot;,&amp;quot;TESTDB&amp;quot; )  # prepare a cursor objec...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import MySQLdb&lt;br /&gt;
&lt;br /&gt;
# Open database connection&lt;br /&gt;
db = MySQLdb.connect(&amp;quot;localhost&amp;quot;,&amp;quot;testuser&amp;quot;,&amp;quot;test123&amp;quot;,&amp;quot;TESTDB&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
# prepare a cursor object using cursor() method&lt;br /&gt;
cursor = db.cursor()&lt;br /&gt;
&lt;br /&gt;
# Drop table if it already exist using execute() method.&lt;br /&gt;
cursor.execute(&amp;quot;DROP TABLE IF EXISTS EMPLOYEE&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Create table as per requirement&lt;br /&gt;
sql = &amp;quot;&amp;quot;&amp;quot;CREATE TABLE EMPLOYEE (&lt;br /&gt;
         FIRST_NAME  CHAR(20) NOT NULL,&lt;br /&gt;
         LAST_NAME  CHAR(20),&lt;br /&gt;
         AGE INT,  &lt;br /&gt;
         SEX CHAR(1),&lt;br /&gt;
         INCOME FLOAT )&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cursor.execute(sql)&lt;br /&gt;
&lt;br /&gt;
# disconnect from server&lt;br /&gt;
db.close()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>George2</name></author>	</entry>

	</feed>