Question

In: Computer Science

Write an SQL query that will output the employee id, first name and hire date from...

  1. Write an SQL query that will output the employee id, first name and hire date from the employee table. Pick only those employees whose employee ID is specified in the employee table (no nulls). If the employee id is 777, name is ABC and hire date is 01-JAN-2016, the output should be like - ' ABC (Employee ID - 777) was hired on 1, January of 2016'. Note - The date should not have preceding zeros.

Solutions

Expert Solution

Code

/*Drop all the Table */
drop table Employees;


/*Create new table */
Create table Employees(EmployeeID number Primary Key,First_Name varchar(20),Last_Name varchar(20),hirde_date date);
desc Employees;
insert into Employees values(777,'ABC','Rajgor','01-jan-2016');
Select * from Employees;

output:

Query:

/*in this query we have to use concate for concating string with each other */
Select concat(First_Name,concat(' (Employee ID -',concat(EmployeeID,concat(')',concat(' was hired on ',TO_CHAR(hirde_date,'DD-MONTH-YYYY'))))))"Outupt" from Employees;

if you still have any Problem regarding this question please comment and if you like my code please appreciate me by thumbs up thank you.........


Related Solutions

Employee ID First Name Last Name email Title Address Extension Department Department ID Hiring Date Department...
Employee ID First Name Last Name email Title Address Extension Department Department ID Hiring Date Department Phone # 0001 John Smith jsmith Accountant 1300 West st 5775 Accounting 2100 8/1998 407-366-5700 0002 Brian Miller badams Admin Assistant 1552 Palm dr 5367 Human resource 2300 4/1995 407-366-5300 0003 James Miller miller Inventory Manager 2713 Buck rd 5432 Production 2520 8/1998 407-366-5400 0004 John Jackson jackson_sam Sales Person 433 tree dr 5568 Sales 2102 6/1997 407-366-5500 0005 Robert Davis Davis Manager 713...
Problem 44 Write a query to display the employee number, last name, first name, and sum...
Problem 44 Write a query to display the employee number, last name, first name, and sum of invoice totals for all employees who completed an invoice. Sort the output by employee last name and then by first name (Partial results shown in Figure P7.44).
write a sql statement that retrieves product ID (ProductID) and name (Name) from Production.product table for...
write a sql statement that retrieves product ID (ProductID) and name (Name) from Production.product table for all product whose name includes both the words "silver" and "frame"
1. Write a query in SQL to find the full name of the “Actors” who appeared...
1. Write a query in SQL to find the full name of the “Actors” who appeared in the movie titled Star Wars (using JOIN ). 2.Write a SQL query to find the movie Title that has received Lowest rating from reviewers, but whose actors have received an award for their contribution in movie. (Expected Output: Fantastic Beasts and Where to Find Them) 3.Write a SQL query that display the list of genres, Number of movies in that genre grouped by...
Create a query that shows the last name, employee ID, hours worked, and overtime amount owed...
Create a query that shows the last name, employee ID, hours worked, and overtime amount owed for hourly employees who earned overtime during week 2. Overtime is paid at 1.5 times the normal hourly rate for all hours worked over 40. Note that the amount shown in the query should be just the overtime portion of the wages paid. Also, this is not a totals query- amounts should be shown for individual workers. QBE grid template. This is the exact...
Write a query to return the date and day of the week of the first day...
Write a query to return the date and day of the week of the first day of the month two years from today. If today is 10/16/20, then the expect output is 10/01/2022 and the day of the week is thursday. I am using postgresql.
1. Write the SQL code required to list the employee number, first and last name, middle...
1. Write the SQL code required to list the employee number, first and last name, middle initial, and the hire date. Sort your selection by the hire date, to display the newly hired employees first. 2. Modify the previous query and list the employee first, last name and middle initial as one column with the title EMP_NAME. Make sure the names are listed in the following format: First name, space, initial, space, last name (e.g. John T Doe). Hint: use...
java/netbeans 1.Design an abstract class Employee that stores: employee name, unique auto-generated id, hire year. Implement...
java/netbeans 1.Design an abstract class Employee that stores: employee name, unique auto-generated id, hire year. Implement any necessary methods in addition to: a.The toString and equals methods. The equals method should NOT compare the id. b.The copy constructor (should copy the same id too) c.An abstract method float getWeeklyCheckAmount() d.Implement the appropriate interface to be able to sort employee names in alphabetical order. Subclasses should NOT be allowed to override this implementation. 2.Design an abstract class HourlyWorker that extends Employee...
Step 1: Write SQL to List the information delivered (PO number, order date, vendor ID &...
Step 1: Write SQL to List the information delivered (PO number, order date, vendor ID & name, product ID & name, Product quantity) of transaction records, sorted by order date? Step 2: Write SQL For orders that were placed between 9/1/2016 and 9/30/2016, list (product IDs, product names, order dates, PO numbers) sort by order date Step 3: Write SQL and find In the month of August, which vendor received the smallest order for a product in terms of dollars?...
Create a table ‘StudentInfo’ with following fields: ID First Name Last Name SSN Date of Birth...
Create a table ‘StudentInfo’ with following fields: ID First Name Last Name SSN Date of Birth Create a table ‘ClassInfo’ table: ID Class Name Class Description Create a table ‘RegisteredClasses’ table: StudentID ClassID The RegisteredClasses table should have a foreign key relationship to StudentInfo and ClassInfo tables for the respective IDs. Also the IDs in StudentInfo and ClassInfo need to be primary keys. When you submit the file your email should also contain the following SQL Queries: Query to show...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT