Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.
Write SOL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii) which are based on the tables.
TABLE : CUSTOMERS
| NO | CNAME | ADDRESS |
| 101 | Richa jain | Delhi |
| 101 | Surbhi Sinha | Chennai |
| 103 | Lisa Thomas | Bangalore |
| 104 | Imran Ali | Delhi |
| 105 | Roshan Singh | Chennai |
TABLE : TRANSACTION
| TRNO | CNO | AMOUNT | TYPE | DOT |
| T001 | 101 | 1500 | Credit | 2017-11-23 |
| T002 | 103 | 2000 | Debit | 2017-05-12 |
| T003 | 102 | 3000 | Credit | 2017-06-10 |
| T004 | 103 | 12000 | Credit | 2017-09-12 |
| T004 | 101 | 1000 | Debit | 2017-09-05 |
(a) To display details of all transactions of TYPE Credit from Table TRANSACTION.
(b) To display the CNO and AMOUNT of all transactions done in the month September 2017 from the table TRANSACTION.
(c) To display the last date of transaction (DOT) from the table TRANSACTION for the customer having CNO as 103.
(d) To display all CNO,CNAME and DOT (date of transaction) of those CUSTOMERS from tables CUSTOMERS and TRANSACTION who have done transactions more than or equal to 2000.
(e) Select count(*), avg(amount) from transaction where dot>= ‘2017-06-01’;
(f) Select cno, count(*), max (amount) from transaction group by cno having count(*)> 1;
(g) Select cno, cname from customer where address not in (‘Delhi, ‘Bangalore’);
(h) Select distinct cno from transaction;
For example:
if L =[1,-2,3,4,-5,7] ,
Then the output should be: [-2,-5,3,4,7]
Write the output of the given program: