Share on Google+Share on Google+

Create a database

In this sction, you will learn how to create database.

Create a database


In this section, we will teach you to create a database. 

First of all, display all databases by show databases. This helps to find out the existing database. Then create a database using the given syntax and give the suitable name of database.






CREATE DATABASE database_name;

Then create connection with database. The connection  is included in the names of the database. 

Create a Table: the following query creates a table
CREATE TABLE table_name
column_name1 data_type,

Yet the table does not have any data. 

In the given example we show the use of the create to make a table email and populate it with the field named LName, FName and email_add.

LName varchar(20),
FName varchar(20),
email_add varchar(40)



Posted on: September 15, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: Create a database   View All Comments

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
November 17, 2011
regarding connection to the database

near the Create database statement u have mentioned that "create connection with the database" can u please tell how to create a connection to the database
Ibrahim Danlami Ahmed
February 13, 2012

Create a database, encapsulation of form application and installation to system. What is the way out 4 me carry out my project sir. Thank you. yours ever, ibrahim
Manche shekhar
March 6, 2012

can we create database object table by without fields.
September 26, 2012

Hi.. I'm trying to insert data into table... But, issue is that ,i need to insert a Sttaic table's data into 1 of the non static table... i,e DEPARTMENT is a static table which contains fields DEPT_ID and DEPT_NAME.. and EPLOYEE is slave of DEPARMENT,which contatains fileds EMPLOYYE_ID,EMPLOYEE_FIRST_NAME,EMPLOYEE_LAST_NAME,EMPLOYEE_DEPT So..How to resolve