Question

This is for SQL Database (Oracle) I have three tables MPROPERTY, MEMPLOYEE, and MSERVICE with the...

This is for SQL Database (Oracle)

I have three tables MPROPERTY, MEMPLOYEE, and MSERVICE with the following attributes:

MPROPERTY (Property_ID, Owner_ID, Owner_Name, Owner_email, Owner_type)

Property_ID is the id of property owned by an owner (assume one property can be owned by one owner only)

Owner_ID is the ID of Owner

Owner_name is name of the owner

Owner_email is the e-mail of the owner

Owner_type is type of owner (individual, corporate or Partnership)

MEMPLOYEE (Employee_ID, Last_name, First_Name, CellPhone, ExperienceLevel)

EMPLOYEE_ID is the ID of employee

Last_name is last name of the employee

First_name is the first name of employee

CellPhone is cell number of employee

ExperienceLevel is based on number of years of experience and is classified as Master, Junior or Senior

MSERVICE (Property_ID, Employee_ID, Service_Date, Hours_worked)

Service_date is the date that property was serviced

Hours_worked is the number of hours that employee worked on that project

________________________________________________________________

Answer the following by writing SQL queries:

  1. Give the last name of all owners

  1. Give the total number (count) of properties owned by owner type

  1. Give the names of owners whose last names have an R in their name. (ex: MARY, GARY etc.)
  1. Give the total hours worked by each employee
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

Select owner_name from MProperty;

2.

Select owner_type, Count(Property_ID) from MProperty group by owner_type;

3.

Select owner_name from MProperty where owner_name LIKE '%R%';

4.

Select Employee_ID,Sum(Hours_Worked) from MService group by Employee_ID;

Do ask if any doubt. Please up-vote.

Add a comment
Know the answer?
Add Answer to:
This is for SQL Database (Oracle) I have three tables MPROPERTY, MEMPLOYEE, and MSERVICE with the...
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
  • This is for SQL Database (Oracle) I have three tables MPROPERTY, MEMPLOYEE, and MSERVICE with the...

    This is for SQL Database (Oracle) I have three tables MPROPERTY, MEMPLOYEE, and MSERVICE with the following attributes: MPROPERTY (Property_ID, Owner_ID, Owner_Name, Owner_email, Owner_type) Property_ID is the id of property owned by an owner (assume one property can be owned by one owner only) Owner_ID is the ID of Owner Owner_name is name of the owner Owner_email is the e-mail of the owner Owner_type is type of owner (individual, corporate or Partnership) MEMPLOYEE (Employee_ID, Last_name, First_Name, CellPhone, ExperienceLevel) EMPLOYEE_ID is...

  • Use the HR database for all the questions in this lab. For each item in this lab, paste the SQL y...

    Use the HR database for all the questions in this lab. For each item in this lab, paste the SQL you used to complete the task and the number of rows retrieved. Ensure you follow the coding standards listed in the ETSU SQL standards guide found on D2L. Save this document as a PDF and name it your_name_lab7.pdf Display the employees’ first name, last name and phone number of employees with salaries greater than 10,000 dollars. SELECT first_name, last_name, phone_number,...

  • Please refer to the following business scenarios: (i) Using SELECT statements of SQL, find the employee...

    Please refer to the following business scenarios: (i) Using SELECT statements of SQL, find the employee id, first name, last name, job title and email of all employees working in Asia (i.e. all countries coming from the region     ‘Asia’). This query must be implemented as a nested query! (ii) Using SELECT statements of SQL, find the employee id, first name, last name, job title and supervisor id of employees who had worked for more than 3 years and completed...

  • I am using Oracle SQL and am new to it. I have seven tables, one of...

    I am using Oracle SQL and am new to it. I have seven tables, one of them is a subtable of two of the others. I need to do the following queries: 1. List all Patients and what Bed they are assigned to 2. List all patients who had Treatments and what Treatment they received 3. List all patients who had tests and what Test they had 4. List the employees (doctors, nurses, etc.) who assisted each patient. 5. List...

  • I need oracle SQL queries: Find the first name and last name of all staff who...

    I need oracle SQL queries: Find the first name and last name of all staff who are supervised by Wilma Smith and worked a breakfast meeting. Find the number of staff who worked at morning events. Hints: use start_hour. Also, keep in mind that a staff member may have worked more than 1 morning event. We are looking for a count of distinct staff. List the total staff cost of each event. Your query should display the location as well...

  • IN THE PREVIOUS CHAPTER WE MADE A DATABASE USING OUR LAST NAME AS ITS NAME. QUESTION...

    IN THE PREVIOUS CHAPTER WE MADE A DATABASE USING OUR LAST NAME AS ITS NAME. QUESTION 1 STATES THIS. PLEASE TYPE WHAT NEEDS TO BE TYPED FOR ALL STEPS. THIS USES CODIO a. 1. Connect to the database you created and named in Module One (for example, Jetson). Type after the prompt mysql> a. use (table you named); i. Example: mysql> use Jetson; 2. Create the Employee table using the SQL statement shown here. Press Return after each line. CREATE...

  • Lesson 10Create the DEPARTMENT tables based on the following: Column Name   ID      Name Data Type     Number...

    Lesson 10Create the DEPARTMENT tables based on the following: Column Name   ID      Name Data Type     Number Varchar2 Length        7      25 Populate the DEPARTMENT table with data from the DEPT table. Include only columns that you need. Create the EMPLOYEE table based on the following table chart: Column Name    ID      LAST_NAME     FIRST_NAME     DEPT_ID Data Type      Number Varchar2      Varchar2       Number Length         7       25            25             7 Modify the EMPLOYEE table to allow for longer employee last names. Confirm your modification. Confirm that both the...

  • CIT 214 - Homework 4 - Alexamara Marina Group Multiple Table Queries Use Notepad to create...

    CIT 214 - Homework 4 - Alexamara Marina Group Multiple Table Queries Use Notepad to create the commands that will run the following queries/problem scenarios. For every boat, list the marina number, slip number, boat name, owner number, owner's first name, and owner's last name. For every completed or open service request for routine engine maintenance, list the slip ID, description, and status. For every service request for routine engine maintenance, list the slip ID, marina number, slip number, estimated...

  • I need this written in SQL Employee EMP ID EMP FNAME EMP LNAME EMP STREET EMP...

    I need this written in SQL Employee EMP ID EMP FNAME EMP LNAME EMP STREET EMP CITY EMP STATE EMP ZIP EMP START DATE Table TABLE ID AREA IDTABLE SEATS Area AREA ID AREA NAME AREA SUPERVISOR EMPLOYEE ID Customer CUST ID CUST LAST NAME CUST NUMBER OF GUESTS Assignment EMPID TABLE ID Seating CUST IDTABLE ID SEATING COST SEATING DATE SEATING TIP Question 29 (10 points) Write an SQL query to list the employee ID and first and last...

  • I have already turned in my HW, I need some understanding of the below SQL queries....

    I have already turned in my HW, I need some understanding of the below SQL queries. 1. Find the number of employees in each department. 2. List the names of departments that have more than 5 employees working there. 3. Retrieve the lowest and highest salary in each department. Output the department name in alphabetical order. Consider the following relational schema. An employee can work in more than on department; also, the percentTime field of the Works relations shows the...

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
ADVERTISEMENT