We can select a particular column to display, regretting the entire rows. Suppose you want to see the name of the students alone we can use the below query.
mysql> select name from student;
+---------+
| name |
+---------+
| steve |
| david |
| michael |
| jack |
| anne |
| steve |
| anne |
| mille |
+---------+
8 rows in set (0.27 sec)
We can also select multiple columns, separated by commas as given in the below query.
mysql> select name, marks from student;
+---------+-------+
| name | marks |
+---------+-------+
| steve | 100 |
| david | 98 |
| michael | 75 |
| jack | 82 |
| anne | 100 |
| steve | 75 |
| anne | 80 |
| mille | 98 |
+---------+-------+
8 rows in set (0.03 sec)
In the above query, we have selected both name and marks from the table student.
|