(i) Select cust_name from customer c,transaction t where c.Acc_No=t.Acc_No and Transaction_Type= "Debit";
(ii) Select cust_name, t.* from customer c, transaction t where c.Acc_No=t.Acc_No;
(iii) Select cust_name from customer c,transaction t where c.Acc_No!=t.Acc_No;
(iv) Cartesian Product:
Number of Rows: 20
Number of Columns: 9
(v) 2301003 65000
(vi) Sometimes we do not want to see the whole output produced by a statement with Group By clause. We want to see the output only for those groups which satisfy some condition. It means we want to put some condition on individual groups (and not on individual records). A condition on groups is applied by Having clause.
For example consider the following query:
select Acc_No, sum(Amount) from Customer c, Transaction t where c.Acc_No=t.Acc_No group by c.Acc_No having Transaction_Type="Credit";
This query will create account number wise groups and instead of displaying the total amount of all type of transactions, it will only display the total of credit transactions only.