Mysql Stock 12 A
Mysql Stock 12 A
Database changed
mysql> create table stock(item_no int, item_name varchar(20), dcode int, quantity int, price int,
stock_date date);
mysql> insert into stock values(5005, 'ball pen classic', 102, 100, 26, '2020-03-31');
+---------+------------------+-------+----------+-------+------------+
+---------+------------------+-------+----------+-------+------------+
+---------+------------------+-------+----------+-------+------------+
+---------+------------------+-------+
+---------+------------------+-------+
+---------+------------------+-------+
+------------+------------+
| max(price) | min(price) |
+------------+------------+
| 32 | 18 |
+------------+------------+
+------------+
| sum(price) |
+------------+
| 172 |
+------------+
+----------+
| count(*) |
+----------+
| 7|
+----------+
+---------------+
| avg(quantity) |
+---------------+
| 143.7500 |
+---------------+
+----------+
| count(*) |
+----------+
| 4|
+----------+
mysql> select item_name, quantity, stock_date from stock where quantity>100 and
stock_date<'2021-12-30';
+-----------------+----------+------------+
+-----------------+----------+------------+
+-----------------+----------+------------+