0% found this document useful (0 votes)
10 views12 pages

Insert Into Loan - Accounts Value (4,'

Uploaded by

dddssboy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views12 pages

Insert Into Loan - Accounts Value (4,'

Uploaded by

dddssboy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 12

insert into loan_accounts value(4,'M.P. Yadav',800000,60,10.

00,'2008-12-
06','0.00'),
insert into loan_accounts value(5,'S.P. Sinha',200000,36,12.50,'2010-01-
03','0.00'),
insert into loan_accounts value(6,'P. Sharma',700000,60,12.00,'2008-06-05','0.00');

+-------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+---------------+------+-----+---------+-------+
| AccNo | int(3) | NO | PRI | NULL | |
| Cust_name | varchar(30) | YES | | NULL | |
| Loan_Amount | int(3) | YES | | NULL | |
| Instalment | int(2) | YES | | NULL | |
| int_rate | decimal(4,2) | YES | | NULL | |
| Start_Date | date | YES | | NULL | |
| interest | decimal(10,2) | YES | | NULL | |
+-------------+---------------+------+-----+---------+-------+

+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+

select * from loan_accounts;


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
7 rows in set (0.00 sec)

mysql> select * from loan_accounts where instalment in(36,48);


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
5 rows in set (0.02 sec)

mysql> select * from loan_accounts where instalment in(36,48,50);


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
5 rows in set (0.00 sec)

mysql> select * from loan_accounts where instalment in(50);


Empty set (0.00 sec)

mysql> select * from loan_accounts where instalment not in(36,48,50);


+-------+------------+-------------+------------+----------+------------+----------
+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+------------+-------------+------------+----------+------------+----------
+
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
+-------+------------+-------------+------------+----------+------------+----------
+
2 rows in set (0.00 sec)

mysql> remane table loan_1 to loan_praveen;


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'remane
table loan_1 to loan_praveen' at line 1
mysql> rename table loan_1 to loan_praveen;
ERROR 1017 (HY000): Can't find file: '.\loan_1\loan_1.frm' (errno: 2)
mysql> rename table loan_accounts to loan_praveen;
Query OK, 0 rows affected (0.08 sec)

mysql> show tables;


+------------------+
| Tables_in_loan_1 |
+------------------+
| loan_praveen |
+------------------+
1 row in set (0.00 sec)

mysql> rename table loan_praveen to loan_accounts;


Query OK, 0 rows affected (0.03 sec)

mysql> show tables;


+------------------+
| Tables_in_loan_1 |
+------------------+
| loan_accounts |
+------------------+
1 row in set (0.00 sec)

mysql> select * from loan_accounts;


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
7 rows in set (0.00 sec)

mysql> select * from loan_accounts where cust_name like '%a';


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
4 rows in set (0.00 sec)

mysql> select * from loan_accounts where cust_name like %a;


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '%a' at
line 1
mysql> select * from loan_accounts where cust_name like '%p%';
+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
6 rows in set (0.00 sec)

mysql> select * from loan_accounts where cust_name like 'p%';


+-------+-----------+-------------+------------+----------+------------+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest |
+-------+-----------+-------------+------------+----------+------------+----------+
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00 |
+-------+-----------+-------------+------------+----------+------------+----------+
1 row in set (0.00 sec)

mysql> select * from loan_accounts where cust_name like 'S%';


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
2 rows in set (0.00 sec)

mysql> select * from loan_accounts where cust_name like 's% and %a';
Empty set (0.00 sec)

mysql> select * from loan_accounts where cust_name like 's%a';


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
2 rows in set (0.00 sec)

mysql> select * from loan_accounts where cust_name like '___ sharma';


Empty set (0.00 sec)

mysql> select * from loan_accounts where cust_name like '___sharma';


+-------+-----------+-------------+------------+----------+------------+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest |
+-------+-----------+-------------+------------+----------+------------+----------+
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00 |
+-------+-----------+-------------+------------+----------+------------+----------+
1 row in set (0.00 sec)

mysql> select * from loan_accounts where cust_name not like 's%';


+-------+------------+-------------+------------+----------+------------+----------
+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+------------+-------------+------------+----------+------------+----------
+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
+-------+------------+-------------+------------+----------+------------+----------
+
5 rows in set (0.00 sec)

mysql>
mysql>
mysql> select * from loan_accounts where int_rate is null;
+-------+------------+-------------+------------+----------+------------+----------
+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+------------+-------------+------------+----------+------------+----------
+
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
+-------+------------+-------------+------------+----------+------------+----------
+
2 rows in set (0.00 sec)

mysql> select * from loan_accounts where int_rate is not null;


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
5 rows in set (0.00 sec)

mysql> select * from loan_accounts order by int_rate;


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
7 rows in set (0.02 sec)

mysql> select * from loan_accounts order by cust_name;


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
7 rows in set (0.00 sec)

mysql> select * from loan_accounts order by int_rate;


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
7 rows in set (0.00 sec)

mysql> select * from loan_accounts order by desc int_rate;


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'desc
int_rate' at line 1
mysql> select * from loan_accounts order desc by int_rate;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'desc by
int_rate' at line 1
mysql> select * from loan_accounts desc order by int_rate;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'desc
order by int_rate' at line 1
mysql> select * from loan_accounts order by int_rate desc;
+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
7 rows in set (0.00 sec)

mysql> select * from loan_accounts order by cust_name, loan_amount desc;


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
7 rows in set (0.00 sec)

mysql> select * from loan_accounts order by cust_name,loan_amount desc;


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
7 rows in set (0.00 sec)

mysql> select * from loan_accounts order by loan_amount desc,cust_name;


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 0.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 0.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | 0.00
|
| 2 | S.P. Sharma | 500000 | 48 | 10.00 | 2008-03-22 | 0.00
|
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | 0.00
|
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 0.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 0.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
7 rows in set (0.00 sec)
8. select * from loan_accounts;
+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 36000.00
|
| 2 | S.P. Sharma | 550000 | 48 | 10.00 | 2008-03-22 | 55000.00
|
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | NULL
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 80000.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 25000.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 84000.00
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | NULL
|
+-------+-------------+-------------+------------+----------+------------
+----------+

9.mysql> select accno,cust_name,loan_amount from loan_accounts;


+-------+-------------+-------------+
| accno | cust_name | loan_amount |
+-------+-------------+-------------+
| 1 | R.K. Gupta | 300000 |
| 2 | S.P. Sharma | 550000 |
| 3 | K.P. Jain | 300000 |
| 4 | M.P. Yadav | 800000 |
| 5 | S.P. Sinha | 200000 |
| 6 | P. Sharma | 700000 |
| 7 | K.S. Dhall | 500000 |
+-------+-------------+-------------+
7 rows in set (0.00 sec)

10.mysql> select * from loan_accounts where instalment<40;


+-------+------------+-------------+------------+----------+------------+----------
+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+------------+-------------+------------+----------+------------+----------
+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 36000.00
|
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | NULL
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 25000.00
|
+-------+------------+-------------+------------+----------+------------+----------
+

11. select accno,loan_amount from loan_accounts where start_date<'2009-04-01';


+-------+-------------+
| accno | loan_amount |
+-------+-------------+
| 2 | 550000 |
| 3 | 300000 |
| 4 | 800000 |
| 6 | 700000 |
| 7 | 500000 |
+-------+-------------+
5 rows in set (0.00 sec)

12. mysql> select * from loan_accounts where int_rate is null;


+-------+------------+-------------+------------+----------+------------+----------
+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+------------+-------------+------------+----------+------------+----------
+
| 3 | K.P. Jain | 300000 | 36 | NULL | 2007-03-08 | NULL
|
| 7 | K.S. Dhall | 500000 | 48 | NULL | 2008-03-05 | NULL
|
+-------+------------+-------------+------------+----------+------------+----------
+
2 rows in set (0.00 sec)

13. mysql> select * from loan_accounts where int_rate is not null;


+-------+-------------+-------------+------------+----------+------------
+----------+
| AccNo | Cust_name | Loan_Amount | Instalment | int_rate | Start_Date | interest
|
+-------+-------------+-------------+------------+----------+------------
+----------+
| 1 | R.K. Gupta | 300000 | 36 | 12.00 | 2009-07-19 | 36000.00
|
| 2 | S.P. Sharma | 550000 | 48 | 10.00 | 2008-03-22 | 55000.00
|
| 4 | M.P. Yadav | 800000 | 60 | 10.00 | 2008-12-06 | 80000.00
|
| 5 | S.P. Sinha | 200000 | 36 | 12.50 | 2010-01-03 | 25000.00
|
| 6 | P. Sharma | 700000 | 60 | 12.00 | 2008-06-05 | 84000.00
|
+-------+-------------+-------------+------------+----------+------------
+----------+
5 rows in set (0.00 sec)

14.

11.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy