Question

Create a data file with 1000 lines. Each line in the file consists of an employee’s first name, l...

Create a data file with 1000 lines. Each line in the file consists of an employee’s first name, last name, position rank, and salary. The employee’s first name and last name for the i- th line are FirstName and LastName. The position rank is randomly generated as a clerk, supervisor, manager, director.

The salary is randomly generated as a number with two digits after the decimal point. The Salary for a clerk should be in the range from 40,000 to 50,000, for supervisor from 60,000 to 80,000, and manager from 75,000 to 90,000, and director from 85,000 to 120,000. 
0 0
Add a comment Improve this question Transcribed image text
Answer #1

First of all we will create a table employeee with id,first name,last name,position_rank,salary

then we will create a procedure .........

declare @id int

select @id = 1

while @id >=1 and @id <= 1000

begin

insert into employeee values(@id, 'First Name' ,'Last Name',(RAND()('Clerk','Supervisor','Manager','director')),(RAND()(120000-40000+1)+120000);

if @position_rank=='clerk'

begin

set @salary=floor(RAND()(50000-40000+1)+50000)

end

if @position_rank=='supervisor'

begin

set @salary=floor(RAND()(80000-60000+1)+80000)

end

if @position_rank=='manager'

begin

set @salary=floor(RAND()(90000-75000+1)+90000)

end

if @position_rank=='director'

begin

set @salary=floor(RAND()(120000-85000+1)+120000)

end

select @id = @id + 1

end

Add a comment
Know the answer?
Add Answer to:
Create a data file with 1000 lines. Each line in the file consists of an employee’s first name, l...
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
  • JAVA PROGRAMMING Create an Employee class which implements Comparable<Employee> The constructor consists of an employee’s first...

    JAVA PROGRAMMING Create an Employee class which implements Comparable<Employee> The constructor consists of an employee’s first name and an employee’s salary, both of which are instance variables. Create accessor and mutator methods for both of these variables Write an equals method that returns true if the salaries are equal with one cent and the names are exactly equal Write a compareTo method that returns 1 if the salary of this employee is greater than the salary of the comparable, -1...

  • Design a PayRoll class that has data members for an employee’s first and last name, hourly...

    Design a PayRoll class that has data members for an employee’s first and last name, hourly pay rate, number of hours worked. The default constructor will set the first and last name to empty string, and hours worked and pay rate to zero. The class must have mutator functions to set each of the data members of the class and accessors to access them. The class should also have the following member functions: displayPayroll function that displays all data members...

  • CSC151 JAVA PROGRAMMING LAB #7 OBJECTIVES . . . In this lab assignment, students will learn:...

    CSC151 JAVA PROGRAMMING LAB #7 OBJECTIVES . . . In this lab assignment, students will learn: To get an overview of exceptions and exception handling • To explore the advantages of using exception handling • To declare exceptions in a method header • To throw exceptions in a method • To write a try-catch block to handle exceptions To develop applications with exception handling To use the finally clause in a try-catch block To write data to a file using...

  • C# Language please. Create an “Employee” class with six fields: first name, last name, workID, yearStartedWked,...

    C# Language please. Create an “Employee” class with six fields: first name, last name, workID, yearStartedWked, initSalary, and curSalary. It includes constructor(s) and properties to initialize values for all fields (curSalary is read-only). It also includes a calcCurSalary function that assigns the curSalary equal to initSalary. Create a “Worker” classes that are derived from Employee class.  In Worker class, it has one field, yearWorked. It includes constructor(s) and properties. It also includes two functions: first, calcYearWorked function, it takes...

  • Reading and parsing a CSV file in Java NOTE: a.) The first row contains the field...

    Reading and parsing a CSV file in Java NOTE: a.) The first row contains the field definition b.) Columns are separated by comma This is the data.csv file These are the coding instructions. Questions 1,2 and 3 This is my code so far FirstName Radioactive Man LastName DateOfBirth SSN Salary Role Zip Phone garlic 9/29/1912 846330158 Administration 69989 39157 7166875260 Mockingbird Captain Triumph Deathstroke, th persimmon 9/22/1956 835340509 Administration 13884 39157 1421813391 usb 7/19/1940 8/8/1970 979204716 Back Office 75710 39157...

  • SQL - create statement for query For each patient, display his or her last name, first...

    SQL - create statement for query For each patient, display his or her last name, first name, and the name of his or her doctor. For each pediatrics patient, display his or her ID and his or her doctor's ID and name. For each doctor, display the name and the name of the doctor's supervisor in alphabetic order of supervisor's name. Include column aliases for clarity. Note: Check for accuracy. For each doctor in one of the two areas entered...

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