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
hi, can you help me with testing java classes I have wrote using java and jsp and servlet in eclipse ? I want to use JUnit for testing

write and compile a simple program in Assembly Language that compute and print student grades for a course.which you can open a file, read from it, and compute the results...using

looking for help with a flash game assignment.

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

Why is this correct/when is this the right idea

Oracle 11G Reports We are troubleshooting the pagination of Oracle reports when printed from a browser. We need help determining the issue and correcting within the report ou

As with 2 nd order differential equations we can't determine a non-homogeneous differential equation unless we can initially solve the homogeneous differential equation. We'll als

I have to create a bank atm machine using MS-DOS. I am struggling to create LIST ALL ACCOUNTS ROLL-BACK TRANSACTIONS ACCESS AN ACCOUNT

How to build one dimensional list from string and build string from a list? Suppose input string is: STACKOVERFLOW then the output list should be outputList = [S,T,A,C,K,O,V,E,R,F

Design an application that opens and analyses word files. Requirements: Create an application that analyses text documents. It should open a text file, read each word in