Query1: display all person contain word like “tupe” in
name living in Hadpsar area. MariaDB [test]> create view nam_tupe as select pname,aname from person,area where aname='hadpsar' and pname like'%tupe'; Query OK, 0 rows affected (0.022 sec) MariaDB [test]> select * from nam_tupe; +-----+---------+ | pname | aname | +-------+---------+ | tupe | hadpsar | +-------+---------+ 1 row in set (0.005 sec) Query2: Count the all persons living in rural area having income more than 10000. MariaDB [test]> create view count_of_rural as select count(pname) from person,area where person.pno=area.pno and atype='rural' and income_money>10000; MariaDB [test]> select * from cout_of_rural; +--------------+ | count(pname) | +--------------+ | 2 | +--------------+ 1 row in set (0.150 sec) Query3: display area wise count of pepole having age more than 60. MariaDB [test]> create view age_limit_areawis as select person.pno,area.atype,count(person.pno) from area,person where person.pno=area.pno and bday>'1989.06.20' group by atype; Query OK, 0 rows affected (0.034 sec) MariaDB [test]> select * from age_limit_areawis; +------+-------+-------------------+ | pno | atype | count(person.pno) | +------+-------+-------------------+ | 2 | rural | 2| +------+-------+-------------------+ 1 row in set (0.039 sec) Query4: Display area and person name having maxim income, shorted by area name. MariaDB [test]> create view max_income as select aname,pname from area,person where person.pno=area.pno and income_money in(select max(income_money) from person) order by aname; Query OK, 0 rows affected (0.124 sec) MariaDB [test]> select * from max_income; +-------+-------+ | aname | pname | +-------+-------+ | hadpsar | tupe | +-------+-------+ 1 row in set (0.050 sec)