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
what is a microprocessor? types of microprocessors? advantages disadvantages

P4's goal is to design the C# classes needed to track creature viability in a MMO game under development .  Part I: Class design 1)  GameCreature class (with derived ty

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

Please choose the best tutor to rewrite my assignment Ticket ID # EM201713THA711DSTN.because insructor does not accept. Thank you


how to create a screen for messages for a data transmission system

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

I need to write code to compute matrix multiplication without using built in function.

For this assignment you will read a file expression.txt and create an expression tree. The expression will be a valid infix expression with the all the necessary parentheses so tha

Write a Prolog predicate remove_nth(N,L1,L2) that is true if list L2 is just list L1 with its Nth element removed. If L1 does not have an Nth element then the predicate should fail