Created
October 16, 2012 18:47
-
-
Save ashga/3901183 to your computer and use it in GitHub Desktop.
Question 4 & 5 Database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4a. select * from employee where age > 40; | |
4b. select top 1 * from employee order by age desc; | |
4c .select top 1 lastname,count(*) as count from employee group by lastname order by count desc; | |
4d. select lastname,count(*) as count from employee where count > 10 group by lastname HAVING COUNT(lastname) > 10 order by count desc; | |
5. SELECT employee.lastname +', '+employee.forename as 'employee_name' ,department.deptdesc AS 'department' | |
FROM department INNER JOIN | |
employee ON department.id = employee.deptid; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment