Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Help on exams

Author  Topic 

arsenala
Starting Member

2 Posts

Posted - 2011-05-24 : 04:25:44
this is how my BD looks like

Employees
Employee_id
First_name
Last_name
Hire_date
Job_id
Salary
Commission_pet
Department_id
Manager_id

Departments
Department_id
Department_name
Location_id

Locations
Location_id
Loc_name


1) Get the departments, names of departments and names of cities where they are
2) Show the name, salary and calculate the increase in annual salary by 100 for all employees, show new column named new_annualsalary
3) Display the name and post code of all officers of Department 20, formed as a izrechnie, show the new name of the column employee_details
4) Show the name, post code and name of the department of all employees who make salary greater than 10,000
5) Show the name and salary of employees of the table Employee, on which the salary is between 2500 and 3500
6) Display the family of any employee whose last name begins with the letter "Zhma"
7) Display names of all employees subject to the King
8) Show the name, department and position of all employees whose salary is not 2500, 3500, 4500
9) Increase the salary of all employees in department 10 with 100 and save it in the database
10) Show the name and salary of a fellow officer with first name John
11) get the departments, the maximum and minimum date of entry in each department
12) Show the three employees with the highest salaries in the company

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2011-05-24 : 05:08:59
So, what is your question? What have you tried?
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-05-24 : 05:14:23
We don't do your homework for you.

Show what you've done, explain where you're stuck, someone will offer suggestions.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

arsenala
Starting Member

2 Posts

Posted - 2011-05-24 : 07:14:41
ok, on number 12)

is it right?

select top 3 first_name, last_name
from employee
order by salary desc
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2011-05-24 : 08:43:05
yes, that is correct, but if you run it, you should have been able to gauge that anyway.
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-05-24 : 08:44:16
And it doesn't account for ties in salary.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -