At the moment, I am taking a Intro To Database class, which is very accelerated
ID: 3527789 • Letter: A
Question
At the moment, I am taking a Intro To Database class, which is very accelerated and brutal to say the least. During my homework assignment we're asked to create SQL statements for 8 simple but, tough queries in my opinion! So enclosed, I've enclosed the first 3 statements which are deemed "CORRECT" by my professor. However, I am severely struggling with the last 5. See my cut & paste for the results Using the formula for the first 3, I've been using SELECT FROM & WHERE to set up operations. I came up with and the other Open questions I need assistant with thank you... 1. List all branches in London SELECT * FROM branch WHERE City = 'London' 2. List all managers salaries SELECT salary FROM staff WHERE title = 'ManagerExplanation / Answer
Here are all the queries for your questions
4. SELECT count(*) FROM branch WHERE city='london'
5. SELECT sum(salary) FROM staff
6. SELECT sum(salary) FROM staff WHERE title='manager'
7. SELECT * FROM branch GROUP BY city ORDER BY desc
8. SELECT avg(salary) FROM staff,branch WHERE staff.empid=branch.empid GROUP BY salary HAVING city='london'
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.