minte9
LearnRemember / MYSQL



Create table

 
CREATE TABLE mytable (
    id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    myname VARCHAR(30)    
)

Get table structure

 
SHOW CREATE TABLE mytable;

-- result:
CREATE TABLE `mytable` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `myname` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1



  Last update: 688 days ago




Questions and answers




How do you create a table?

  • a) CREATE TABLE mytable ( ... )
  • b) CREATE TABLE mytable { ... }

How do you get table structure?

  • a) SHOW CREATE TABLE mytable
  • b) GET SELECT TABLE mytable


References