All_Practice_Queries_for_database in your account_answers_updated(1).doc - Practice Set#1 for the database in your account solutions 1 Find all

All_Practice_Queries_for_database in your account_answers_updated(1).doc

This preview shows page 1 - 2 out of 4 pages.

Practice Set #1 for the database in your account - solutions 1) Find all employees who work on the fifth floor. List out their employee name, department name and department phone number (use this wording for the columns no the variable names). Put the output in order by department name and within department by employee name. Answer Select empfname as “employee Name”, qdept.deptname as “ Department Name”, qdept.deptphone as “Phone #” From qemp, qdept Where qemp.deptname=qdept.deptname And qdept.deptfloor = 5 Order by qdept.deptname, empfname Commands Alias’s Order by 2) Find all employee first names. List out each name just once Answer: Select distinct(empfname) from qemp Commands: DISTINCT 3) How many employees work on each floor? List out the floor numbers followed by the number of employees on each floor. Select count(QEMP.empno), deptfloor From qdept, qemp Where qemp.EMPNO=qdept.EMPNO Group by deptfloor Commands Group by Count Join 4) How many employees work on each floor, above the third floor? List out the floor numbers followed
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Spring '17
  • Personal name, select min, select bossno

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes