Mysql

How to create Database and tables in MySQL

This tutorial demonstrates how to SQL statement that create MySQL database tables in which  to store data.

A simple database table look like this  :

SQL table

Creating a database :

In MySQL  you can display a list of all databases by using this query :
Use an existing database using this query :
  • The SHOW TABLES; query used to display a list of all tables in a database, if this query return a “empty set” message there are no table in the database.

Creating tables :

A MySQL table is created by this query :

e.g :

You can discover  the format of any table by using these two queries :

Both query will return same result.

A table may also be deleted from a database with this query :

About the author

Anuj kumar

I'm Anuj kumar a web developer with 4+ year experience .I write blogs in my free time. I love to learn new technologies and share with others. I founded PHPGurukul in September 2015. The main aim of this website to is provide php , jquery , mysql , phpoops and other web development tutorials. I am trying best effort to make PHPGurukul useful for every single moment spend on this website. If you think this website is useful to visit please share with your friend and buddies.

Leave a Comment