Tuesday, October 27, 2009

How to create database tables 1

If you making the database needs to consider writing the database name should not use spaces and non-standard characters. The form of writing the command to create a new database is 'create database dbname',
ex:
mysql > create database perpustakaan;
see the results of a database that was created with the command:
mysql > show databases;
before making a table in the database 'perpustakaan', we have entered into the database 'perpustakaan' first, with the command:
mysql > use perpustakaan;

after entry into perpustakaan database, then create the tables needed such as buku, judul buku, kelompok buku, pengarang, and penerbit. First create a table of buku, which contain id_buku, no_urut, index_buku and referensi.
mysql > create table buku (
          > id_buku bigint(5) NOT NULL auto_increment primary key,
          > no_urut tinyint(3) default 0,
          > index_buku varchar(15) NOT NULL default '',
          > referensi tinyint(1) type=myISAM;
check with the command:
mysql > show tables;
see description table:
mysql > describe buku;

to be continued...

0 comments:

Post a Comment