Count the total number of records in data table, Programming Languages

Assignment Help:

Make a database that contains emp_no, emp_name, emp_designation and emp_salary. Using filters perform the following:

a.                        Display the names of those employees that have a salary more than 5000.

b.                        Display the names of those employees that have a designation of “Manager” or “Vice President”.

c.                        Count the total number of records.

 echo "Employees whose salary more than 5000"

awk -F "-" '$4 >5000 { printf "%s\n",$2 }' emp.txt

//awk command specifies the selection criteria and action

echo "Employees whose designation is Manager or Vice President"

awk -F "-" '$3 == "Manager",$3 == "Vice President" { printf "%s\n", $2 }'

emp.txt

echo –e "Total no. of Records= \c"

awk -F"-" '{printf "%d\n",NR}' emp.txt|tail -n1

//option of awk –F is used for delimeter and printf is used for printing

Output

 

sh datab.sh

Employees whose salary more than 5000

Narendra

BGates

Employees whose designation is Manager or Vice President

Mittal

Total no. of Records= 3


Related Discussions:- Count the total number of records in data table

Reader-writer problem, The reader-writer problem can be stated as follows: ...

The reader-writer problem can be stated as follows: A shared memory location can be concurrently read by any number of tasks, but when a task must write to the shared memory locati

Develop a program on behavior of hospital personnel, A psychologist is inte...

A psychologist is interested in learning about the voting behavior of college students.  (4 points for each part.)Design a study which would yield data on this topic. a. state y

A traveler wants to purchase a number of traveler''s checks, A traveler wan...

A traveler wants to purchase a number of traveler''s checks, each having a set amount for four different currencies: Mexican pesos, Euro dollars, Swiss francs, and US dollars. A t

C# xna game project, I need to finish my game project within two weeks usin...

I need to finish my game project within two weeks using XNA. Would you guys can help me to finish it? Thank you

Develop a system for record student information, Your task for this project...

Your task for this project is to develop a system that would provide the following features: 1. Register new student 2. Drop student from university 3. Add a course and gr

Create a raptor program - use class in raptor and in python, In this porti...

In this portion of the lab you will analyze a problem and create a Raptor program to solve it.  Make sure you use a class in Raptor and in Python to solve the problem.  Read the fo

JSP, can you provide some assignments for JSP learning

can you provide some assignments for JSP learning

Improved support for javascript debugging, Improved Support for JavaScript ...

Improved Support for JavaScript Debugging ASP.NET has many benefits over vintage ASP in the place of debugging. You can now quickly debug your server-side value using the complete

Write a program to show twenty ellipses, Write a Program to Show Twenty Ell...

Write a Program to Show Twenty Ellipses 1. Write a program to show twenty ellipses which move away from the mouse pointer. Their initial locations should be random.

Shell script to print count & sum of digits of given number, Normal 0 ...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd