IP mySQL Assignment
IP mySQL Assignment
MY-SQL – ASSIGNMENT
Database changed
mysql> create table Item(Itemno int(4) Primary key, Item Varchar(20), Dcode int(
mysql> insert into Item values(5005, "Ball Pen 0.5", 102, 100, 16, "2018-03-10")
+--------+--------------+-------+------+-----------+------------+
+--------+--------------+-------+------+-----------+------------+
+--------+--------------+-------+------+-----------+------------+
1 row in set (0.04 sec)
mysql> insert into Item values(5003, "Ball Pen 0.25", 102, 150, 20, "2017-05-17"
);
mysql> insert into Item values(5002, "Gel Pen Premium", 101, 125, 14, "2018-04-2
0");
mysql> insert into Item values(5006, "Gel Pen Classic", 101, 200, 22, "2018-10-0
8");
mysql> insert into Item values(5001, "Eraser Small", 102, 210, 5, "2018-03-11");
mysql> insert into Item values(5004, "Eraser Big", 102, 60, 10, "2017-11-18");
mysql> insert into Item values(5004, "Sharpener Classic", NULL, 160, 8, "2017-06
-12");
mysql> insert into Item values(5009, "Sharpener Classic", NULL, 160, 8, "2017-06
-12");
+--------+-------------------+-------+------+-----------+------------+
+--------+-------------------+-------+------+-----------+------------+
+--------+-------------------+-------+------+-----------+------------+
+--------+-------------------+-----------+
+--------+-------------------+-----------+
+--------+-------------------+-----------+
Q4. Select all item record where Unitprice is more than 20.
+--------+-----------------+-------+------+-----------+------------+
+--------+-----------------+-------+------+-----------+------------+
+--------+-----------------+-------+------+-----------+------------+
Q5. Select Item name of those items which are quantity between 100-200.
mysql> select Item from Item where Qty between 100 and 200;
+-------------------+
| Item |
+-------------------+
| Sharpener Classic |
+-------------------+
5 rows in set (0.00 sec)
Q6. Select all record of Items which contains pen word in it.
+--------+-------------------+-------+------+-----------+------------+
+--------+-------------------+-------+------+-----------+------------+
+--------+-------------------+-------+------+-----------+------------+
+-------+
| Dcode |
+-------+
| 102 |
| 101 |
| NULL |
+-------+
3 rows in set (0.11 sec)
+--------+-------------------+-------+------+-----------+------------+
+--------+-------------------+-------+------+-----------+------------+
+--------+-------------------+-------+------+-----------+------------+
Q9. Display all items which are stocked in the month of March.
-> ;
+--------+--------------+-------+------+-----------+------------+
+--------+--------------+-------+------+-----------+------------+
+--------+--------------+-------+------+-----------+------------+
+--------+-------------------+-------+------+-----------+------------+
+--------+-------------------+-------+------+-----------+------------+
+--------+-------------------+-------+------+-----------+------------+