From the course: Oracle Database 12c: Basic SQL
Writing your first SELECT query - Oracle Database Tutorial
From the course: Oracle Database 12c: Basic SQL
Writing your first SELECT query
- [Instructor] All right, so now it's time for us to write our very first SQL query. For our first query we'll try and keep things as simple as possible. Every SQL commander where you wish to retrieve data from database tables start with the select keyword. I'm writing select in uppercase just for legibility purposes, but you can lowercase as well. So select signifies which columns I want to retrieve from my table. Note that I haven't specified the table name just yet. To select all of the columns the columns in the table, all I have to do is type the star character. We'll see how we can select individual columns later on. Going down one line I can specify from which table I want to select my columns. So I'll type from and the table name, for example, employees. Note that similarly to the select keyword, I've also specified the from keyword in uppercase, but you can use lowercase as well. Again, I'm using uppercase just for legibility purposes. We can now highlight this query and press the green play button, which will execute it. We will see the results presented in the bottom part of our screen. We can see a long list of rows with multiple columns representing all of the data in our table. Because I've typed the select star command from employees, I'm instructing the Oracle database to return all columns using the star keyword from the employees tables without filtering for any specific rows. We will see how we can filter rows later on.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Writing your first SELECT query1m 56s
-
(Locked)
Selecting only specific columns2m 22s
-
(Locked)
Using WHERE to filter specific rows1m 55s
-
(Locked)
Using multiple WHERE conditions3m 55s
-
(Locked)
Using WHERE to filter partial strings3m 12s
-
(Locked)
Using WHERE to filter numeric ranges1m 17s
-
(Locked)
Using WHERE IN and NOT IN for strings1m 54s
-
(Locked)
Using WHERE IN and NOT IN for numbers1m 35s
-
(Locked)
Using WHERE to filter dates2m 42s
-
(Locked)
Using WHERE to filter exact strings1m 55s
-
(Locked)
Using DISTINCT to eliminate duplicates4m
-
(Locked)
Performing basic numeric calculations2m 23s
-
(Locked)
Using column aliases2m 18s
-
(Locked)
Describe the structure of a table3m 16s
-
(Locked)
Using ORDER BY3m 29s
-
-
-
-
-
-
-