From the course: MySQL Essential Training

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Selecting rows

Selecting rows

- [Instructor] Hi, I'm Bill Weinman. The SELECT statement is used for most data retrieval in SQL. For this lesson, we'll use the world database, and here in MySQL Workbench, I'm connected with my admin connection, and I'll simply type USE world and execute it. And that opens the world database for our use. Let's start with a simple SELECT statement. If I type SELECT 'Hello, World' and I have Hello, World in single quote marks, and I have terminated my statement with a semicolon, when I execute it, you notice that the result comes up and it gives us this one column in our result. The column is titled Hello, World and the result is Hello, World. So the SELECT statement is used for queries that will return a value or a set of values. SELECT is used to display the result of any query. In this case, the query is a literal string. It's still a query, it just doesn't come from the database. You could just as easily say SELECT 1 + 2, execute that. And I have a result with one column. The…

Contents