An Employees table was added to the JustLee Books database to track employee information. Display a list of each employee's name, job title, and manager's name. Use column aliases to clearly identify employee and manager name values. Include all employees in the list and sort by manager name.
Suppose JustLee Books database contains an Employee table with fields emp_id, name, job_title, mgr_id (at minimum) where emp_id is the primary key and mgr_id is the foreign key which references the Employee table .
SQL query to display a list of each employee's name, job title, and manager's name :
select e.name as "Employee Name", e.job_title as "Job Title", m.name as "Manager Name" from Employee e, m where e.mgr_id = m.emp_id sort by m.name;
The above statement displays the employee name, job title and manager name of all employees in the Employee table and the results are sorted by manager name. To obtain manager name from Employee table we join Employee table with itself using mgr_id and emp_id fields since both of them refers to emp_id of an employee.
An Employees table was added to the JustLee Books database to track employee information. Display a...
In mySQL Northwind data base. How many of Northwind's customers, that don't work in sales, are explicitly identified as "Manager" in their job title? Please use a subquery. What is the total order price for each order listed in Northwind's database? Add to the previous query. Include the Customer ID and Shipping Name for each order that is totaled in the previous query. Sort the output by Customer ID. Add to the previous query. Include the Title of Courtesy, First...
Problem 33, chapter 7 from Database Systems 13th edition by Coronel Write a query to display the employee number, last name, email address, title, and department name of each employee whose job title ends in the word “ASSOCIATE.” Sort the output by department name and employee title Problem 36, chapter 7 from Database Systems 13th edition by Coronel Write a query to display the number of products within each base and type combination, sorted by base and then by type...
The owner of a small chain of appliance stores wants to build a database to help track data about its regions, stores, employees and jobs. The chain has divided the map of where its stores exists into various regions. Each region has a description (of boundaries). Each store is named, has an average market size (expressed in dollars) and belongs to s specific region. Each store also has an address, city, state, and zip. The database should...
please help me out with these SQL problems: 1. Create a treewalking list of every employee's last name, his manager's last name, and his position in the company. – The top level manager has position 1, this manager's subordinates position 2, their subordinates position 3, and so on. – Start the listing with employee number 100. 2. create the list of department names and the departmental costs (salaries added up). – Include only departments whose salary costs are between 15000...
The Ch07_ConstructCo database stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each employee works on each project. The structure and contents of the Ch07_ConstructCo database are shown in Figure P7.1.Note that the ASSIGNMENT table in Figure P7.1 stores the JOB_CHG_HOUR values as an attribute (ASSIGN_CHG_HR) to maintain historical accuracy of the data. The JOB_CHG_HOUR values are likely to change over time. In fact, a JOB_CHG_ HOUR change will be...
The database(or the tables) are follow: CREATE TABLE employees ( id SERIAL NOT NULL PRIMARY KEY, name TEXT NOT NULL, salary REAL NOT NULL DEFAULT 25000.0 ); CREATE TABLE employee_audit_log ( employee_id INTEGER NOT NULL, occurred_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); INSERT INTO employees(name, salary) VALUES ('Arnold Schwarznegger', 35000), ('Yuri Gargarin', 27000), ('Anakin Skywalker', 450000), ('Said Faroghi', 15000), ('Zino Holwerda', 8500); 1. Create a trigger for the employees table so that a new row is inserted in employee audit_log...
Write the following SQL statements in Microsoft Access by using the Books database from Week 2 Assignment 2. Once complete, copy and paste the SQL statements in a Microsoft Word document: Write SQL statements: To update the publisher name from READ WITH US to READ FOR US To verify the updated name field for the publisher with ID 6 To make the following updates to the Publisher table (be careful with WHERE): Make Contact="John Travolta" for publisher with ID number...
SQL From employees table, display the first_name, last_name, phone_number and Phone number Type. Phone number type should be "USA Phone Number" (Length=12) or "International Phone Number" (Length=18) or "Unknown" based on the length of the phone number. Sort the display in desc order of phone number type Use Either CASE or DECODE. Output Column Heading: First Name, Last Name, Phone Number, Phone Number Type
a database of employees that corresponds to the
employee-payroll hierarchy is provided (see employees.sql to create
the employees for a MySQL database). Write an application that
allows the user to:
Add employees to the employee table.
Add payroll information to the appropriate table for each new
employee. For example, for a salaried employee add the payroll
information to the salariedEmployees table
1 is the entity-relationship diagram for the
employees database
Figure 1: Table relationships in the employees database [1].
Add...
Part 1 (employee.py): Write a class name Employee that holds the following data about an employee in attributes:name, ID number, department and job title. Once you have written the class, write a program that creates three Employee objects to hold the following data: The program should store this data in the three objects, then display the data for each employee on the screen as a table like this (Use fstring or "format" function to format the output as a table,...