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 rows

Selecting rows

- [Instructor] The SELECT statement is used for most data retrieval in SQL. For this lesson, we'll use the World database. So here in MySQL Workbench, I'm connected with my admin connection. And I'm going to type USE world and execute, which on this Mac is Command + Return, and if you're on a different operating system, it'll probably be Control + Return or Control + Enter. So let's start with a simple SELECT statement. I'm going to type SELECT and the literal string, Hello, World. And the literal string is enclosed in single quote marks. And when I execute this statement, you'll see I get a result in my result grid down below, and it says Hello, World. 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 can just as easily say SELECT 1 + 2, and you'll get a result of 3. So now let's get some…

Contents