filmov
tv
SQL Interview Question and Answers | To display the annual salary of all faculty members

Показать описание
To display the annual salary of all faculty members when the given salary is monthly, you can multiply the monthly salary by 12 (the number of months in a year). Here's the SQL query to achieve this:
```sql
SELECT Name, Salary * 12 AS AnnualSalary
FROM Teachers;
```
In this query:
- `Teachers` should be replaced with the actual name of your teacher table.
- `Salary` should be replaced with the actual name of the column that stores teacher salaries.
- We use the expression `Salary * 12` to calculate the annual salary by multiplying the monthly salary by 12 for each faculty member.
This query will display the faculty members' names along with their annual salaries based on the given monthly salary.
#sql
```sql
SELECT Name, Salary * 12 AS AnnualSalary
FROM Teachers;
```
In this query:
- `Teachers` should be replaced with the actual name of your teacher table.
- `Salary` should be replaced with the actual name of the column that stores teacher salaries.
- We use the expression `Salary * 12` to calculate the annual salary by multiplying the monthly salary by 12 for each faculty member.
This query will display the faculty members' names along with their annual salaries based on the given monthly salary.
#sql