From the course: MySQL Essential Training (2019)

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Selecting columns

Selecting columns

- [Instructor] A given table may have a lot of columns, and you may often be interested in only some of them. Fortunately selecting particular columns is easy, and here's how it's done in SQL. For this lesson we'll use the world database, so I'll type in here, USE world. And you'll notice that I am connected with my admin connection here in the MySQL Workbench. And so I'll execute this command, and we're using the world database. Now I can select from the Country table, so I say SELECT * FROM Country ORDER BY Code. And when I execute this you'll notice that I get the Country table. I get all of the columns, so I scroll side to side, there you see all the columns, and all of the rows. And this is because I used the asterisk here. The asterisk is in the place where you would list the columns you want returned in the query. The asterisk is simply a wildcard. It means all of the columns. You can select particular columns from the table by listing them in the SELECT statement in place of…

Contents