站内搜索: 请输入搜索关键词
当前页面: 图书首页 > MySQL Tutorial

MySQL Tutorial

[ Directory ] Previous Section Next Section

Simple Queries

An example of the simplest form of the SELECT statement is as follows:


select * from department;

If you run this query on the data we have in the employee database, you should get a result something like this:


+---------------+--------------------------+
| departmentID  | name                     |
+---------------+--------------------------+
|            42 | Finance                  |
|           128 | Research and Development |
|           129 | Human Resources          |
|           130 | Marketing                |
+---------------+--------------------------+
4 rows in set (0.00 sec)

This query has selected all the data in the chosen table梩hat is, all the rows and all the columns from the department table.

You can test this out on another table梩ry selecting all the rows and columns from the employeeSkills table, for example.

Of course, the power of a relational database is not in its capability to give you back all the data you put in, but instead in its capability to allow you to search the data for particular pieces of information.

    [ Directory ] Previous Section Next Section