Oracle SQL Tutorial 9 - Intro to Queries

submitted by mkenny400 on 03/23/18 1

This video is for beginners who have never worked with SQL Developer, and we are going to teach how to begin writing queries. So the queries we are going to start with are queries when we give the database an expression and it will return back some kind of value. The most common keyword you are going to need to know for Oracle is SELECT. SELECT is the command we use to get data from the database. Even though we have not really put any data in our database, we can still use the SELECT statement to get data. That's because the database is capable of doing more than just creating tables and retrieving data from tables. So our first goal is to essentially write a Hello World, which just displays the text hello world to us. A good place to start is with: SELECT 'Hello World' This would actually work for many database management systems, but when you run it you will get an error. This actually doesn't work with Oracle, it will tell us we always need the FROM keyword. To get around this, there is a magical table called DUAL. We can put anything we want to SELECT and then say FROM DUAL and it will work. SELECT 'Hello World' FROM DUAL We can also do math: SELECT 1+1 FROM DUAL And we can run even run functions: SELECT SYSTIMESTAMP FROM DUAL To put all of this together, you can grab all of this data at the same time using commas to separate different columns from our generated table: SELECT 'Hello World', 1+1, SYSTIMESTAMP FROM DUAL Support me on Patreon: www.patreon.com/calebcurry Subscribe to my newsletter: eepurl.com/-8qtH Donate!: bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: CalebCurry.com Facebook: www.facebook.com/CalebTheVideoMaker Google+: plus.google.com/+CalebTheVideoMaker2 Twitter: twitter.com/calebCurry Amazing Web Hosting - www.dreamhost.com/r.cgi?1487063 (The best web hosting for a cheap price!)

Leave a comment

Be the first to comment

Collections with this video
Email
Message
×
Embed video on a website or blog
Width
px
Height
px
×
Join Huzzaz
Start collecting all your favorite videos
×
Log in
Join Huzzaz

facebook login
×
Retrieve username and password
Name
Enter your email address to retrieve your username and password
(Check your spam folder if you don't find it in your inbox)

×