Categories: MySQL

MySQL CREATE TABLE

Share

Using CREATE TABLE statement in MySQL you can create a table into the database. The following example shows the statement in the simple form:

CREATE TABLE Format:

CREATE TABLE IF NOT EXISTS `tbl` (
  tbl_id int(11) NOT NULL AUTO_INCREMENT,
  tbl_title varchar(100) DEFAULT NULL,
  post_date DATE DEFAULT NULL,
  update_date DATE DEFAULT NULL,
  PRIMARY KEY (tbl_id)
) ENGINE=InnoDB
  • CREATE TABLE use for creating table
  • IF NOT EXISTS checks whether same name exists in the database
  • tbl is the table name
  • tbl_id, tbl_title, post_date etc are columns
  • AUTO_INCREMENT indicates that the value of column automatically increased whenever a new row is inserted
  • Storage engine is InnoDB

Recent Posts

Optimize Your Hormonal Balance: Enclomiphene Citrate for Enhanced Wellness

Hormonal balance plays a pivotal role in overall well-being, influencing various aspects of health, from…

6 hours ago

Paul Kanes Explores the World of Canine Companionship through Dog Walking

Dog walking is an excellent way to maintain your furry friend's camaraderie and provides many…

9 hours ago

Top 5 Must-Have Features Every Mobile App Needs to Succeed

Introduction Businesses understand the diverse requirements of mobile applications, which provide a competitive advantage. There…

13 hours ago

IoT Data Analytics: Ways to Gain Value from IoT Data

The Internet of Things (IoT) has recently changed the world. It links gadgets together and…

14 hours ago

The Rise of NFTs: Exploring the Impact of Non-Fungible Tokens on the Digital Economy

NFTs, or Non-Fungible Tokens, are revolutionizing the digital economy. These unique digital assets, authenticated through…

1 day ago

What to Ask Before You Hand Your Laptop For Repairing

It is safe to say that if you are in need of a good laptop…

1 day ago