A Guide to SQL
A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
Expert Solution & Answer
Book Icon
Chapter 8, Problem 4RQ

Explanation of Solution

Obtaining today’s date in Oracle:

  • User can obtain the today’s date in Oracle by using “SYSDATE” function.
  • Example for “SYSDATE” function is given below:

    SELECT STUDENT_ID, SYSDATE AS TODAYS_DATE, JOINED_DATE, SYSDATE – JOINED_DATE AS NO_OF_DAYS FROM STUDENT;

  • The given query is used to display the student ID, today’s date, joined date, number of days for each student from “STUDENT” table.
    • Using “SYSDATE” function, user can compute today’s date. The computed column is represented by “TODAYS_DATE” with the help of “AS” operator.
    • The number of days is computed by subtracting the “SYSDATE” from “JOINED_DATE”. The computed column is represented by “NO_OF_DAYS” with the help of “AS” operator.

Obtaining today’s date in Access:

  • User can obtain the today’s date in Access by using “DATE” function...

Blurred answer
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning