Category Archives: sql

SQL – Create and Insert Table

0
Filed under sql
Tagged as , , , , ,

Author: Rizky Ramadhan
Site: -
Summary: SQL syntax to create a table and insert to table.

/*
  _________      .__       .____   _______
 /   _____/ ____ |__|_____ |    |  \   _  \    ____
 \_____  \ /    \|  \____ \|    |  /  /_\  \  / ___\
 /        \   |  \  |  |_> >    |__\  \_/   \/ /_/  >
/_______  /___|  /__|   __/|_______ \_____  /\___  /
        \/     \/   |__|           \/     \//_____/  

Taken from: http://paste.c0de.me/pastebin.php?show=5
*/

/* create_table */
CREATE TABLE IF NOT EXISTS 'member' (
  'id' int(11) unsigned NOT NULL AUTO_INCREMENT,
  'namalengkap' varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  'email' varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  'password' tinyint(3) unsigned DEFAULT NULL,
  'gender' varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  'regdate' varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY ('id')
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;

/* Insert_table */
INSERT INTO 'member' ('id', 'namalengkap', 'email', 'password', 'gender', 'regdate') VALUES
(1, 'Rizky Ramadhan', 'rizky05@cs.its.ac.id', 123, 'm', '2009-09-20 03:29:17');

badge,pixel badge,sql