WDN Logo

home-icon Home / MySQL / MySQL lesson – MySQL tables

MySQL lesson – MySQL tables

MySQL lesson - MySQL tables

Now that we’ve created our employee_data table, let’s check its listing.
Type SHOW TABLES; at the mysql prompt. This should present you with the following display:

mysql> SHOW TABLES;
+---------------------+
| Tables in employees |
+---------------------+
| employee_data       |
+---------------------+
1 row in set (0.00 sec)

MySQL Table details – describe table command

MySQL provides up with a command that displays the column details of the tables.
Issue the following command at the mysql prompt:

DESCRIBE employee_data;

The display would be as follows:

mysql> DESCRIBE employee_data;
+--------+------------------+------+-----+---------+----------------+
| Field  | Type             | Null | Key | Default | Extra          |
+--------+------------------+------+-----+---------+----------------+
| emp_id | int(10) unsigned |      | PRI | 0       | auto_increment |
| f_name | varchar(20)      | YES  |     | NULL    |                |
| l_name | varchar(20)      | YES  |     | NULL    |                |
| title  | varchar(30)      | YES  |     | NULL    |                |
| age    | int(11)          | YES  |     | NULL    |                |
| yos    | int(11)          | YES  |     | NULL    |                |
| salary | int(11)          | YES  |     | NULL    |                |
| perks  | int(11)          | YES  |     | NULL    |                |
| email  | varchar(60)      | YES  |     | NULL    |                |
+--------+------------------+------+-----+---------+----------------+
9 rows in set (0.00 sec)

DESCRIBE lists all the column names along with their column types of the table.
Now let’s see how we can insert data into our table.

Sponsored Links

Search

Your comments
Star icon IMPORTANT Have a question / problem? Click here to ask an expert.

Why we hate Internet Explorer?

Sponsored Links

Tips

How do I view a deleted web page?
Is there a way to view a deleted web page - one that is no longer available? Yes there is and the solution is quite simple. [more...]

Fact

Brian Klug came across an item on Amazon.com carrying a price of $3 billion with $3.99 shipping. Out of curiosity, he ordered it from the Amazon affiliate. The order was processed but later cancelled. The reason given was "unable to complete the order". [more...]

Share on Whats app Share on Facebook Share on Twitter Share on Google plus