0% found this document useful (0 votes)
39 views

Assignment 1

The document outlines an assignment with multiple tasks involving date functions in Oracle SQL. It includes demonstrating date functions like ADD_MONTHS and MONTHS_BETWEEN on a sample table. Another task is to create a table to store project details, perform operations on dates like increasing end dates and finding last working days. Formatting dates and numbers using functions like TO_CHAR, TO_DATE and TO_NUMBER is also included. The last task is to create an employee table and format fields like DOB, DOJ, salary using functions and formats.

Uploaded by

Simranjeet Kaur
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Assignment 1

The document outlines an assignment with multiple tasks involving date functions in Oracle SQL. It includes demonstrating date functions like ADD_MONTHS and MONTHS_BETWEEN on a sample table. Another task is to create a table to store project details, perform operations on dates like increasing end dates and finding last working days. Formatting dates and numbers using functions like TO_CHAR, TO_DATE and TO_NUMBER is also included. The last task is to create an employee table and format fields like DOB, DOJ, salary using functions and formats.

Uploaded by

Simranjeet Kaur
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment

1. Give Syntax and Queries to demonstrate the use of following Date functions in System
Defined Table
a. Add_months(d,n)
b. Last_day(d)
c. Months between(d2,d1)
d. Next_day(d,day)
2. Create table task___ and perform the following operations
Task_name
Start_date
End_Date
Planning
01-april-1995
23-april-1995
Analysis
24-april-1995
14-may-1995
Design
15-may-1995
30-may-1995
Coding
01-june-1995
30-june-1995
Testing
01-july-1995
02-aug-1995
a. Increase End date by 3 months and name the column as new end date
b. Find the last working day of every end date
c. Calculate months between start date and end date.
d. Find the next working day of every start date.
3. Give Syntax and Queries to demonstrate the use of following Date functions in System
Defined Table
a. To_Char()
b. To_Date()

c. To_number

4.
4. Create table employee with fields: Empid,DOB(char), doj, salary,deptname
a. Format DOJ to yyyy/mm/dd
b. Format DOJ to Month dd,yyyy
c. Use FM to do the above tasks again
d. Format salary column to $
e. Format salary column to $999.99
f. Convert dob to date format
g. Convert dob to number format
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.

38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.

You might also like