Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- insert into customers(cust_id,cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country,cust_contact,cust_email) values ('10002','Mouse House','333 Fromage Lane','Columbus','OH','43333','USA','Jerry Mouse','NULL');
- Query OK, 1 row affected (0.096 sec)
- MariaDB [orderentry]> insert into customers(cust_id,cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country,cust_contact,cust_email) values ('10003','Wascals','1 Sunny Place','Muncie','IN','42222','USA','Jim Jones','rabbit@wascally.com');
- Query OK, 1 row affected (0.055 sec)
- insert into customers(cust_id,cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country,cust_contact,cust_email) values ('10004','Yosemite Place','829 Riverside Drive','Phoenix','AZ','88888','USA','Y Sam','sam@yosemite.com');
- Query OK, 1 row affected (0.096 sec)
- insert into customers(cust_id,cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country,cust_contact,cust_email) values ('10005','E Fudd','4545 53RD Street','Chicago','IL','54545','USA','E Fudd','NULL');
- Query OK, 1 row affected (0.096 sec)
- insert into products
- values('ANV01','1001','.5 ton anvil','6','.5 ton anvil, black , complete with hook'),
- ('ANV02','1001','1 ton anvil','10','1 ton anvil, black , complete with hook'),
- ('ANV03','1001','2 ton anvil','15','2 ton anvil, black , complete with hook'),
- ('DTNTR','1003','detonator','13','detonator(plunger powdered) , fuses not included'),
- ('FB','1003','bird seed','10','large bag(suitable for road runners)'),
- ('FC','1003','Carrots','3','carrots (rabbit hunting season only)'),
- ('FUI','1002','Fuses','3','1 dozen,extra long'),
- ('JP1000','1005','JetPack 1000','35','JetPack 1000,intended for single use'),
- ('JP2000','1005','JetPack 2000','55','JetPack 2000,multi use'),
- ('OLI','1002','Oil Can','9','oil can,red'),
- ('SAFE','1003','Safe','50','Safe with combination lock'),
- ('Sling','1003','Sling','4','Sling,one size fits all'),
- ('TNT1','1003','TNT (1 stick)','3','TNT, red, single stick'),
- ('TNT2','1003','TNT (5 sticks)','10','TNT, red, pack of 10 sticks');
- Query OK, 14 rows affected, 14 warnings (0.141 sec)
- Records: 14 Duplicates: 0 Warnings: 14
- insert into vendors values('1001','Anvils R US', '123 Main Street','Southfield','MI','48075','USA'),
- ('1002','LT Supplies', '500 Park Street','Anytown','OH','44333','USA'),
- ('1003','ACME', '555 High Street','Los Angeles','CA','90046','USA'),
- ('1004','Furball Inc', '1000 5th Avenue','New York','NY','11111','USA'),
- ('1005','Jet Set', '42 Galaxy Road','London','NULL','N16 GPS','England'),
- ('1006','Jouets Et Ours', '1 Rue Amusement','Paris','NULL','45678','France');
- Query OK, 6 rows affected (0.059 sec)
- Records: 6 Duplicates: 0 Warnings: 0
- insert into orderitems values('20005','1','ANV01','10'),
- ('20005','2','ANV02','3'),
- ('20005','3','TNT2','5'),
- ('20005','4','FB','1'),
- ('20006','1','JP2000','1'),
- ('20007','1','TNT2','100'),
- ('20008','1','FC','50'),
- ('20009','1','FB','1'),
- ('20009','2','OLI','1'),
- ('20009','3','SLING','1'),
- ('20009','4','ANV03','1');
- Query OK, 11 rows affected (0.115 sec)
- Records: 11 Duplicates: 0 Warnings: 0
- MariaDB [orderentry]> update customers set cust_address = 'Gejayan Jogjakarta', cust_country = 'INA' where cust_id = '10002';
- Query OK, 1 row affected (0.181 sec)
- Rows matched: 1 Changed: 1 Warnings: 0
- MariaDB [orderentry]> select * from customers;
- +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
- | cust_id | cust_name | cust_address | cust_city | cust_state | cust_zip | cust_country | cust_contact | cust_email |
- +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
- | 10002 | Mouse House | Gejayan Jogjakarta | Columbus | OH | 43333 | INA | Jerry Mouse | NULL |
- | 10003 | Wascals | 1 Sunny Place | Muncie | IN | 42222 | USA | Jim Jones | rabbit@wascally.com |
- | 10004 | Yosemite Place | 829 Riverside Drive | Phoenix | AZ | 88888 | USA | Y Sam | sam@yosemite.com |
- | 10005 | E Fudd | 4545 53RD Street | Chicago | IL | 54545 | USA | E Fudd | NULL |
- +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
- 4 rows in set (0.000 sec)
- MariaDB [orderentry]> delete from vendors where vend_id ='1001';
- Query OK, 1 row affected (0.063 sec)
- MariaDB [orderentry]> select * from vendors;
- +---------+----------------+-----------------+-------------+------------+----------+--------------+
- | vend_id | vend_name | vend_address | vend_city | vend_state | vend_zip | vend_country |
- +---------+----------------+-----------------+-------------+------------+----------+--------------+
- | 1002 | LT Supplies | 500 Park Street | Anytown | OH | 44333 | USA |
- | 1003 | ACME | 555 High Street | Los Angeles | CA | 90046 | USA |
- | 1004 | Furball Inc | 1000 5th Avenue | New York | NY | 11111 | USA |
- | 1005 | Jet Set | 42 Galaxy Road | London | NULL | N16 GPS | England |
- | 1006 | Jouets Et Ours | 1 Rue Amusement | Paris | NULL | 45678 | France |
- +---------+----------------+-----------------+-------------+------------+----------+--------------+
- 5 rows in set (0.000 sec)
- MariaDB [orderentry]> select from orderitems order_num,quantity;
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'from orderitems order_num,quantity' at line 1
- MariaDB [orderentry]> select order_num,quantity from orderitems;
- +-----------+----------+
- | order_num | quantity |
- +-----------+----------+
- | 20005 | 10 |
- | 20005 | 3 |
- | 20005 | 5 |
- | 20005 | 1 |
- | 20006 | 1 |
- | 20007 | 100 |
- | 20008 | 50 |
- | 20009 | 1 |
- | 20009 | 1 |
- | 20009 | 1 |
- | 20009 | 1 |
- +-----------+----------+
- 11 rows in set (0.021 sec)
- MariaDB [orderentry]> select * from customers where cust_country ='USA';
- +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
- | cust_id | cust_name | cust_address | cust_city | cust_state | cust_zip | cust_country | cust_contact | cust_email |
- +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
- | 10003 | Wascals | 1 Sunny Place | Muncie | IN | 42222 | USA | Jim Jones | rabbit@wascally.com |
- | 10004 | Yosemite Place | 829 Riverside Drive | Phoenix | AZ | 88888 | USA | Y Sam | sam@yosemite.com |
- | 10005 | E Fudd | 4545 53RD Street | Chicago | IL | 54545 | USA | E Fudd | NULL |
- +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
- 3 rows in set (0.065 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement