Question
Asked Dec 4, 2019
56 views

- Delete the employee who has the longest employment in the company

EMP:
NUMBER (4)
EMPNO
VARCHAR2 (10)
ENAME
VARCHAR2 (9)
JOB
NUMBER (4)
MGR
HIREDATE
DATE
NUMBER (7,2)
SAL
NUMBER (7,2)
COMM
NUMBER (2)
DEPTNO
DEPT:
NUMBER (2)
DEPTNO
VARCHAR2 (14)
DNAME
VARCHAR2 (13)
help_outline

Image Transcriptionclose

EMP: NUMBER (4) EMPNO VARCHAR2 (10) ENAME VARCHAR2 (9) JOB NUMBER (4) MGR HIREDATE DATE NUMBER (7,2) SAL NUMBER (7,2) COMM NUMBER (2) DEPTNO DEPT: NUMBER (2) DEPTNO VARCHAR2 (14) DNAME VARCHAR2 (13)

fullscreen
check_circle

Expert Answer

Step 1

The longest employment in the company must have minimum HIREDATE so that to delete this employee data. Firstly, find the data who has minimum HIREDATE then delete this data. After deletion of data, showing all the employee data to check the query.

Step 2

Created schema of table:

 

/* Create a table called EMP */

CREATE TABLE EMP(EMPNO number(4) PRIMARY KEY, ENAME varchar2(10),JOB varchar2(9), MGR number(4), HIREDATE DATE, SAL number(7,2), COMM number(7,2), DEPTNO number(2));

Step 3

Created some dummy record in the table:

 

/* Create few records in this table */

INSERT INTO EMP VALUES(1,'Harry','Sales',45, '2003-06-17', 6000.00,400.00,1001);

INSERT INTO EMP VALUES(2,'Alpha','Operation',84,'2007-05-21',3100.00, 1500.00,2001);

INSERT INTO EMP VALUES(3,'Frank','...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Databases

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: Find the range of salaries (min, max) of each department in the following table:EMP(EID, ENAME, SAL,...

A: EMP is the name of the table Employee.EMP table has four rows named EID, ENAME, SAL, and DEPT. Find ...

question_answer

Q: In C++: Examine the code segment. What will be printed? If there are any errors indicate the nature ...

A: The code given in question will give two compile time errors. Both the errors are indicated in bold ...

question_answer

Q: Write a Python program that uses a for loop with the range function to inspect all integers from 300...

A: Following is the python program:Declare necessary variables to store the number 23 & total count...

question_answer

Q: Write a python program and solve the problem. Selling a new vehicle pays a salesperson $1800. Sellin...

A: Program Instructions:Prompt the user to enter type and selling price of 2 vehicles. One must be old ...

question_answer

Q: C++ program IF NOT COMFORTABLE WITH CLASSES,I WOULD START WITH DEFINING THE CLASS WITH ONE constru...

A: The implementation for the given criteria is as follows,File name: “student2.h”#include<iostream&...

question_answer

Q: In Book computer networking a top-down approach sixth edition 4.4 (Network Address Translation (NAT)...

A: NAT table stands for Network Address Translation table.It is used by routers to translate private IP...

question_answer

Q: What is encapsulation?Clarify with help of example?

A: Programming language assumed is c++.Data encapsulation:Normally, encapsulation is defined as wrappin...

question_answer

Q: in c++  Given the following, use a for loop to load the array with user input (include a prompt ...

A: Program Algorithm-STARTStep1: Import the essential headersStep2: Define the main function.Step3: Dec...

question_answer

Q: In a computer instruction format, the instruction length is 10 bits and the size of an addressfield ...

A:  Total number of instructions =210=1024Size of address field=3 bitsAnd the instruction length is 10 ...