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

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

Posted Date: 9/26/2012 8:32:48 AM | Location : United States







Related Discussions:- Count the total number of records in data table, Assignment Help, Ask Question on Count the total number of records in data table, Get Answer, Expert's Help, Count the total number of records in data table Discussions

Write discussion on Count the total number of records in data table
Your posts are moderated
Related Questions
I am trying to get right side triangle in visual logic using for loop

How do i get back data from a FOR loop in order to print them on screen?

I have a problem which seems to be quite a rare one and I can safely say I know what exactly what is causing it. After some process of elimination I reached the conclusion that, in

Example :  Solve the following differential equation. y (3)   -  12 y''+48 y' + 64 y = 12 - 32 e -8t + 2 e 4t Solution :    We first require the complementary solution

Question 1- In engineering applications it is often necessary to fit a straight line to a set of N points with known coordinates (xi, yi), where i indexes the points (N in total).

One of the main strengths of the Perl programming language are its powerful text manipulation features. In this assignment, you will put them to use for writing a Perl program that

i have 4 variables in my linkage section of PIC 9(3) ..while submitting i m passing parameter value i.e. numeic to them but its taking space for 2 varaible and for two its taking c

You are to design and create a new class called SelectCallDataDialog, which opens by clicking browse  buttons for selection of ringtones,  vibrations or leds. Depending on which th


Write a Program to illustrate the call by value? #include . int compute_sum(int m); int main( void) { int n=3, sum; printf("%d\n",n); /*3 is printed */ sum=compute_sum(n