You are on page 1of 4

Microsoft Windows [Version 10.0.17134.

1006]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\PC04>cd..

C:\Users>cd..

C:\>/xampp/mysql/bin
'/xampp/mysql/bin' is not recognized as an internal or external command,
operable program or batch file.

C:\>cd xampp/mysql/bin

C:\xampp\mysql\bin>mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.33-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use test;


Database changed
mysql> create table tblCustomer (ID INT, NAME VARCHAR(30), ADDRESS VARCHAR(50),
TELNO VARCHAR(10), AGE INT, PRODUCT VARCHAR(30), PRICE INT, QUANTITY INT);
Query OK, 0 rows affected (0.13 sec)
mysql> INSERT INTO tblCustomer VALUES('2001', 'MIKA REYES', 'ROSARIO BATANGAS',
'4567896', '25', 'SOFA BED', '24500', '2');
Query OK, 1 row affected (0.00 sec)

mysql> SELECT * FROM tblCustomer;


+------+------------+------------------+---------+------+----------+-------
+----------+
| ID | NAME | ADDRESS | TELNO | AGE | PRODUCT | PRICE |
QUANTITY |
+------+------------+------------------+---------+------+----------+-------
+----------+
| 2001 | MIKA REYES | ROSARIO BATANGAS | 4567896 | 25 | SOFA BED | 24500 |
2 |
+------+------------+------------------+---------+------+----------+-------
+----------+
1 row in set (0.00 sec)

mysql> INSERT INTO tblCustomer VALUES('2021', 'JUN CORTEZ', 'TANAUAN CITY',


'5674356', '36', 'CABINET', '12000', '4');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO tblCustomer VALUES('2025', 'ROSE QUINTO', 'LIPA CITY',


'4356734', '24', 'BED FRAME', '24000', '1');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO tblCustomer VALUES('2050', 'NICA LEYNES', 'IBAAN BATANGAS',


'1234567', '28', 'DINNING SET', '35000', '3');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO tblCustomer VALUES('2060', 'DARWIN GO', 'LIPA CITY', '654786',
'30', 'STOVE', '18300', '2');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO tblCustomer VALUES('2088', 'ANDREW TAN', 'BATANGAS CITY',


'3416459', '35', 'CABINET', '30570', '4');
Query OK, 1 row affected (0.00 sec)

mysql> SELECT * FROM tblCustomer;


+------+-------------+------------------+---------+------+-------------+-------
+----------+
| ID | NAME | ADDRESS | TELNO | AGE | PRODUCT | PRICE |
QUANTITY |
+------+-------------+------------------+---------+------+-------------+-------
+----------+
| 2001 | MIKA REYES | ROSARIO BATANGAS | 4567896 | 25 | SOFA BED | 24500 |
2 |
| 2021 | JUN CORTEZ | TANAUAN CITY | 5674356 | 36 | CABINET | 12000 |
4 |
| 2025 | ROSE QUINTO | LIPA CITY | 4356734 | 24 | BED FRAME | 24000 |
1 |
| 2050 | NICA LEYNES | IBAAN BATANGAS | 1234567 | 28 | DINNING SET | 35000 |
3 |
| 2060 | DARWIN GO | LIPA CITY | 654786 | 30 | STOVE | 18300 |
2 |
| 2088 | ANDREW TAN | BATANGAS CITY | 3416459 | 35 | CABINET | 30570 |
4 |
+------+-------------+------------------+---------+------+-------------+-------
+----------+
6 rows in set (0.00 sec)

mysql> delete from tblCustomer where name="ROSE QUINTO";


Query OK, 1 row affected (0.00 sec)

mysql> select * from tblCustomer;


+------+-------------+------------------+---------+------+-------------+-------
+----------+
| ID | NAME | ADDRESS | TELNO | AGE | PRODUCT | PRICE |
QUANTITY |
+------+-------------+------------------+---------+------+-------------+-------
+----------+
| 2001 | MIKA REYES | ROSARIO BATANGAS | 4567896 | 25 | SOFA BED | 24500 |
2 |
| 2021 | JUN CORTEZ | TANAUAN CITY | 5674356 | 36 | CABINET | 12000 |
4 |
| 2050 | NICA LEYNES | IBAAN BATANGAS | 1234567 | 28 | DINNING SET | 35000 |
3 |
| 2060 | DARWIN GO | LIPA CITY | 654786 | 30 | STOVE | 18300 |
2 |
| 2088 | ANDREW TAN | BATANGAS CITY | 3416459 | 35 | CABINET | 30570 |
4 |
+------+-------------+------------------+---------+------+-------------+-------
+----------+
5 rows in set (0.00 sec)

mysql> select name, address, telno, product from tblCustomer;


+-------------+------------------+---------+-------------+
| name | address | telno | product |
+-------------+------------------+---------+-------------+
| MIKA REYES | ROSARIO BATANGAS | 4567896 | SOFA BED |
| JUN CORTEZ | TANAUAN CITY | 5674356 | CABINET |
| NICA LEYNES | IBAAN BATANGAS | 1234567 | DINNING SET |
| DARWIN GO | LIPA CITY | 654786 | STOVE |
| ANDREW TAN | BATANGAS CITY | 3416459 | CABINET |
+-------------+------------------+---------+-------------+
5 rows in set (0.00 sec)

mysql> select name, product, price, quantity from tblCustomer where id > 2030;
+-------------+-------------+-------+----------+
| name | product | price | quantity |
+-------------+-------------+-------+----------+
| NICA LEYNES | DINNING SET | 35000 | 3 |
| DARWIN GO | STOVE | 18300 | 2 |
| ANDREW TAN | CABINET | 30570 | 4 |
+-------------+-------------+-------+----------+
3 rows in set (0.00 sec)

mysql> select * from tblCustomer where age < 30;


+------+-------------+------------------+---------+------+-------------+-------
+----------+
| ID | NAME | ADDRESS | TELNO | AGE | PRODUCT | PRICE |
QUANTITY |
+------+-------------+------------------+---------+------+-------------+-------
+----------+
| 2001 | MIKA REYES | ROSARIO BATANGAS | 4567896 | 25 | SOFA BED | 24500 |
2 |
| 2050 | NICA LEYNES | IBAAN BATANGAS | 1234567 | 28 | DINNING SET | 35000 |
3 |
+------+-------------+------------------+---------+------+-------------+-------
+----------+
2 rows in set (0.00 sec)

mysql> select name from tblCustomer where price < 50000;


+-------------+
| name |
+-------------+
| MIKA REYES |
| JUN CORTEZ |
| NICA LEYNES |
| DARWIN GO |
| ANDREW TAN |
+-------------+
5 rows in set (0.00 sec)

mysql> insert into tblCustomer values ('3010','LIMUEL GARCIA','SAN


ANTONIO,QUEZON','7023564','22','SOFA','42500','1');
Query OK, 1 row affected (0.00 sec)

mysql> select * from tblCustomer where name like "j%";


+------+------------+--------------+---------+------+---------+-------+----------+
| ID | NAME | ADDRESS | TELNO | AGE | PRODUCT | PRICE | QUANTITY |
+------+------------+--------------+---------+------+---------+-------+----------+
| 2021 | JUN CORTEZ | TANAUAN CITY | 5674356 | 36 | CABINET | 12000 | 4 |
+------+------------+--------------+---------+------+---------+-------+----------+
1 row in set (0.14 sec)

mysql> select * from tblCustomer where address ="LIPA CITY";


+------+-----------+-----------+--------+------+---------+-------+----------+
| ID | NAME | ADDRESS | TELNO | AGE | PRODUCT | PRICE | QUANTITY |
+------+-----------+-----------+--------+------+---------+-------+----------+
| 2060 | DARWIN GO | LIPA CITY | 654786 | 30 | STOVE | 18300 | 2 |
+------+-----------+-----------+--------+------+---------+-------+----------+
1 row in set (0.00 sec)
mysql> SELECT NAME,ADDRESS FROM tblCustomer WHERE ADDRESS ="TANAUAN" OR AGE>"26";
+-------------+----------------+
| NAME | ADDRESS |
+-------------+----------------+
| JUN CORTEZ | TANAUAN CITY |
| NICA LEYNES | IBAAN BATANGAS |
| DARWIN GO | LIPA CITY |
| ANDREW TAN | BATANGAS CITY |
+-------------+----------------+
4 rows in set (0.00 sec)

mysql> UPDATE tblCustomer SET ADDRESS = "ROSARIO BATANGAS" WHERE NAME = "DARWIN
GO";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> SELECT * FROM TBLCUSTOMER;


+------+---------------+--------------------+---------+------+-------------+-------
+----------+
| ID | NAME | ADDRESS | TELNO | AGE | PRODUCT | PRICE
| QUANTITY |
+------+---------------+--------------------+---------+------+-------------+-------
+----------+
| 2001 | MIKA REYES | ROSARIO BATANGAS | 4567896 | 25 | SOFA BED | 24500
| 2 |
| 2021 | JUN CORTEZ | TANAUAN CITY | 5674356 | 36 | CABINET | 12000
| 4 |
| 3010 | LIMUEL GARCIA | SAN ANTONIO,QUEZON | 7023564 | 22 | SOFA | 42500
| 1 |
| 2050 | NICA LEYNES | IBAAN BATANGAS | 1234567 | 28 | DINNING SET | 35000
| 3 |
| 2060 | DARWIN GO | ROSARIO BATANGAS | 654786 | 30 | STOVE | 18300
| 2 |
| 2088 | ANDREW TAN | BATANGAS CITY | 3416459 | 35 | CABINET | 30570
| 4 |
+------+---------------+--------------------+---------+------+-------------+-------
+----------+
6 rows in set (0.00 sec)

mysql> exit
Bye

C:\xampp\mysql\bin>

You might also like