Question

Creating SQL Queries: IUCT 1SOMER P DESCRIPT P INDATE P.0OH P MN p RCE P DISCOUNT as DE CUS LNAME Cus ANAME aus INITIA auS AR

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

we need to find out the employee id's whose designation is a manager.And we need to find out the total number of employees working under him/her.

We need to use employee table. Emp_TITLE decides the designation of an employee.Emp_NUM defines the employee number.

Emp_MGR defines the manager number of an employee.

So we need to group the employees based on the Emp_MGR and we can count the total number of employees who are working under him/her.

we need to use group by clause for grouping the employees.

we need to use aggregate function count() for counting the total number of employees does the manager have.

Select EMP_MGR ,count(EMP_NUM) from EMPLOYE group by EMP_MGR;

If you have any queries please comment..

Thank you...

Add a comment
Know the answer?
Add Answer to:
Creating SQL Queries: IUCT 1SOMER P DESCRIPT P INDATE P.0OH P MN p RCE P DISCOUNT...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Answer all questions on paper: Consider the database model below The database model FIGURE 7.1 CUSTOMER...

    Answer all questions on paper: Consider the database model below The database model FIGURE 7.1 CUSTOMER INVOICE LINE PK CUS CODE INV NUMBER FK1 CUS_COOE NV DATE CUS LNAME CUS FNAME CUS INITIAL CUS AREACODE CUS PHONE CUS BALANCE LINE UNITS LINEPRICE - isfound in VENDOR PRODUCT V NAME supplies P INDATE P DESCRIPT CONTACT de- V AREACODE V PHONE V STATE V ORDER ?,.QOH P MIN P PRICE Write the SQL code for creating the database and all the...

  • CUSTOMER EMP INVOICE LINE P CODE V CODE CUS CODE EMP CODE NV NUMBER NV NUMBER,...

    CUSTOMER EMP INVOICE LINE P CODE V CODE CUS CODE EMP CODE NV NUMBER NV NUMBER, LINE NUMBER Create SQL queries for displaying the following results 5. List the customers who have ordered product bearing product code "23109-HB. Display first names, last names of customers, invoice numbers and product codes 6. Display Vendor details (V_CODE, V NAME) and product details (P CODE, P DESCRIPT) and product quantity on hand in excess of product min quantity (give alias of Quantity above...

  • Create SQL statements based on the given tables: Code to create the tables: CREATE DATABASE LAB...

    Create SQL statements based on the given tables: Code to create the tables: CREATE DATABASE LAB4DB; USE LAB4DB; CREATE TABLE CUSTOMER ( CUS_CODE int primary key, CUS_LNAME varchar(15), CUS_FNAME varchar(15), CUS_INITIAL varchar(1), CUS_AREACODE varchar(3), CUS_PHONE varchar(8), CUS_BALANCE float(8) ); INSERT INTO CUSTOMER VALUES('10010','Ramas','Alfred','A','615','844-2573','0'); INSERT INTO CUSTOMER VALUES('10011','Dunne','Leona','K','713','894-1238','0'); INSERT INTO CUSTOMER VALUES('10012','Smith','Kathy','W','615','894-2285','345.86'); INSERT INTO CUSTOMER VALUES('10013','Olowski','Paul','F','615','894-2180','536.75'); INSERT INTO CUSTOMER VALUES('10014','Orlando','Myron','','615','222-1672','0'); INSERT INTO CUSTOMER VALUES('10015','O''Brian','Amy','B','713','442-3381','0'); INSERT INTO CUSTOMER VALUES('10016','Brown','James','G','615','297-1228','221.19'); INSERT INTO CUSTOMER VALUES('10017','Williams','George','','615','290-2556','768.93'); INSERT INTO CUSTOMER VALUES('10018','Farriss','Anne','G','713','382-7185','216.55'); INSERT INTO CUSTOMER VALUES('10019','Smith','Olette','K','615','297-3809','0'); /*...

  • SQL Triggers: PESOFT P NOTE POO IS DOCE ESTE GIS DAN DISINI OS ARRANCE US PHONE...

    SQL Triggers: PESOFT P NOTE POO IS DOCE ESTE GIS DAN DISINI OS ARRANCE US PHONE QUS BALANCE WOO PARCE P DISCOUNT V OGLE VALE VONTACT VAREATCOS VEMONE V SAE VORCER SED IN DATE P ORDE UNE UNITS UPER BP NE BPNTAL PP 14 DATE VENTA DE BP VOR Create a trigger called named trg_prod QOH_on_line_add that will automatically update the product quantity on hand for a product when a corresponding product LINE row is added. We end a trigger...

  • All the required files are attached to this question here in the form of images. Please refer the attached images and answer the questions. List the names and codes of vendors and the number of produ...

    All the required files are attached to this question here in the form of images. Please refer the attached images and answer the questions. List the names and codes of vendors and the number of products each vendor has supplied, i.e. vendor AA has supplied xxx products, and vendor BB has supplied yyy products etc. Show the total value of invoices for each customer with the customer the Last Name, and a column heading showing ‘Total_invoice_value’ in the results. List...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT