comparing multiple variables by 'if then'

Hi,
I am a noob at shell scripting.
basically I am trying to compare row counts from 8 tables in different databases. I have managed to get the row counts using awk from the spool files for both databases.

now I have 16 variables with me

for database 1 :

$A
$B
$C
$D
$E
$F
$G
$H

for database 2:

$A1
$B1
$C1
$D1
$E1
$F1
$G1
$H1

now i want to compare the row counts if they r equal....if so, the script shud continue and execute my next script say 'next.sh' lying in the same directory
else it shud give an error and mail to the user.

what i am trying to do is

if $A = $A1 and
$B = $B1

...
... and
$H=$H1

then

all 8 variables must be equal to each other before continuing else the script shud error out.

PLease help

if [ $A -eq $A1 -a $B -eq $B1 ];then    ## -a = AND, -o = OR
 echo "equal"
else
 echo "not equal"
fi

Thanks Anchal,that worked.

But I want to run a script if the condition is true.how to do that

like if [$A -eq $A1 ]
then execute next.sh
else failure ( and mail to user with the error)
fi

how to get the correct syntax for that?

Thanks

anchal_khare gave you the answer.

if [ $A -eq $A1 -a $B -eq $B1 ];then
 ./next.sh
else
 mail address@you.com 'Failure'
fi