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

Pseudo code the shows logic for a program that generates a random number, then ask the user to think of a number between 1 and 10

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

Write a function called triple (in a file called 'triple.m'). That takes a single variable x and returns a single variable in which every element of x is multiplied by 3. Make sure

Example- Arithmetic :  Given the subsequent two matrices, So calculate A-5B. Solution There isn't much to do now other than the work. We first multiplied

Create a visualization (programming project) and demonstrate it in the class. The project should be related to distributed systems. (A distributed system consists of multiple auton

Programming Project Specification: IRC or Internet Relay Chat is an application that lets multiple users communicate via text messages with each other in common "virtual" rooms.

Expertsmind brings you unique solution in java assignments Multithreaded Programming Java provides built-in support for multithreaded selection. A multithreaded applicatio

I can attach or send the assignment instructions, but they''re rather long. 90% of the code is already written and given to us. The assignment is primarily rewriting and rearrangin

What is an abstract class:   Abstract class is stated as an abstract concept that cannot be instantiated or comparing to interface this can have some implementation and interface c