Saturday, November 15, 2008

Practice: How To Create my Table.

In second week of Database system laboratory is about "Table" in database. Teacher was teach How to create table in own database ,How to view details in your database that created ,How to Use data types in each field. He let me to do lab activity thorough Kubuntu environment and execute database by Oracle9i.

Student had not prepare my table contents so teacher brought his table contents to teach and let student to practice. He contents is Employee, about employee_id ,employee_name ,etc.

To create table we have to using "CREATE TABLE" command ,define each contents--[Field] in different data type ,and define properties such as "PRIMARY KEY".

In following data type and Properties that I was using to create table in my Laboratory :

VARCHAR(character length)
--- define field for store set of character in character length.
INT ---Integer --- define field for store Integer number.
Double(point length) --- decimal --- define field for store decimal number in point length.

I want to create my table is contains: department_id(length of character=5),set as primary key and department_name(length of character=50).

In following line that I type to let Oracle 9i execute:

#1 CREATE TABLE departments
#2 (department_id VARCHAR(5) PRIMARY KEY,
#3 department_name VARCHAR(50));


we can using that code in MySQL ,MicrosoftSQL Server ,etc

and when I type desc:departments;

My table contents was display as above figures.

I also practice to create my table with MySQL Database simulation and typing Command thorough phpMyAdmin. I assume phpMyAdmin is helping tools to manage database easier, you may not to type a lot of commands. MySQL and phpMyAdmin are required PHP HTTP server simulator and Apache Web server or Internet Information Service(IIS).

I get more enjoy and experience in my database lab. I'm going to generate my Database Contents and create my Database In my PC. And will present progress In my next time.


See Also
phpMyAdmin
MySQL
Apache Web Server
PHP
(Internet Information Service)IIS


POSTED 15/11/2008 12.09 pm


No comments: