Skip to main content

More Functions Combined

Changing the previous examples to:

SELECT student_number "Number", title " ", forename "Firstname", surname "Surname", date_of_birth "DOB"

FROM student

WHERE student_number = 'L0001234';


Number TITL Firstname Surname DOB
L0001234 Mr Trevor Jones 07-SEP-74

SELECT SUM(salary) "Salary Sum"

FROM employee;


Salary Sum

SELECT employee_number "Employee Number", salary *12 "Annual Salary"

FROM employee

The first column contains employee_number with the heading 'Employee Number'. The second column contains the salary figure multiplied by 12 and has the heading 'Annual Salary'.

Note the double quotes used with multiple-word headings because there are spaces and other non-text characters in the heading.

Now let us put into practice what you have just learnt by trying the following activity.

Next: Activity 2.4A