Create Table Create Table in Mysql Create Table With The Columns in Mysql Database

We can make a table simply by typing in the query

 > create table t1 (c1 int) ; 
(t1 is the name of the table)

You might be thinking what is '(c1 int)'

Whenever you make a table you need to define the column and its type .

Every table comprise some column (at least 1) which in the above query is c1 with type int 'int' states that the column will only take integer(...-3,-2,-1,0,1,2,3...) (no alphabets) values You might be confused take integer values is when we fill the column with some value(record or information or data) it should be a number (...-3,-2,-1,0,1,2,3...) not an Alphabet (a,b,dfh)

What if you just type

> create table t1 ;

it will give ERROR saying that 'it must have at least 1 Column' .

What if we want to make more columns in the table we can do this by typing in the query

 > create table t2 (c1 int  ,  c2  int) ; 
('t1' is the name of the table, 'c1','c2' are columns integer types)

Simple and fast PlanetGhost Mysql Tutorial with Examples.

If You Think This Post has helped you buy us a Coffee :)

Make Donation

  • Other: $

Donate now