Oracle SQL SELECT Query helps to get data from Oracle database. In this Oracle Tutorial, we will talk about syntax with an example.
This page contains (Skip to topic)..
SQL Query Syntax
SELECT * FROM table_name;
- The “SELECT” keyword tells Oracle that, we want to retrieve some data from the Oracle database.
- The “*” tells that we want to fetch all the columns.
- “FROM” keyword is like, from which tables we want to fetch the data from the database.
- “table_name” is the table from which we will fetch the data.
SQL Query Example
SELECT * FROM employees;
The result of the above query is,
Digging into SQL SELECT query
Data model diagram of HR.EMPLOYEES table
Please do not worry about what is the data model and what is this diagram. Let me tell you in brief. The data model diagram tells the structure of the table. Like, how many columns are there, what is the datatype of those columns, which is the primary key column, which column has a constraint, which is the foreign key column.
In the figure,
- We see that HR.EMPLOYEES is written on the top. It means EMPLOYEES table is in the HR schema.
- The 2nd block contains constraint info, column names, datatypes.
The other pieces of information are not required for now. We will cover that later in this course.
Now that you understood how basic select query looks like, let us see how we can select all columns data with the select query in the next post.