From the course: Oracle Database 12c: Basic SQL

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

SQL query structure

SQL query structure

- Before we'll start writing our own SQL queries, let's first understand at a high level, the basic syntax which makes a SQL query function and retrieve data from the database. The core syntax of a SQL query can be divided into a select clause, a from clause, and usually also a where clause. Let's review each one of these clauses, and understand their function. The from clause is where we specify the name of the database table or tables, in plural, from which we want to retrieve data. So for example, from employees specifies that we want to retrieve data from the employees table. The select clause, or select part of our SQL query is where we can specify the column names that we wish to return as part of the output of our query, so for example, if we have an employees table, which contains three columns: ID, Name, and Salary, and we specify in our SQL query to select the ID and name column from employees, we essentially…

Contents