Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.30 KB | None | 0 0
  1. 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');
  2. Query OK, 1 row affected (0.096 sec)
  3.  
  4.  
  5. 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');
  6. Query OK, 1 row affected (0.055 sec)
  7.  
  8. 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');
  9. Query OK, 1 row affected (0.096 sec)
  10.  
  11. 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');
  12. Query OK, 1 row affected (0.096 sec)
  13.  
  14. insert into products
  15. values('ANV01','1001','.5 ton anvil','6','.5 ton anvil, black , complete with hook'),
  16. ('ANV02','1001','1 ton anvil','10','1 ton anvil, black , complete with hook'),
  17. ('ANV03','1001','2 ton anvil','15','2 ton anvil, black , complete with hook'),
  18. ('DTNTR','1003','detonator','13','detonator(plunger powdered) , fuses not included'),
  19. ('FB','1003','bird seed','10','large bag(suitable for road runners)'),
  20. ('FC','1003','Carrots','3','carrots (rabbit hunting season only)'),
  21. ('FUI','1002','Fuses','3','1 dozen,extra long'),
  22. ('JP1000','1005','JetPack 1000','35','JetPack 1000,intended for single use'),
  23. ('JP2000','1005','JetPack 2000','55','JetPack 2000,multi use'),
  24. ('OLI','1002','Oil Can','9','oil can,red'),
  25. ('SAFE','1003','Safe','50','Safe with combination lock'),
  26. ('Sling','1003','Sling','4','Sling,one size fits all'),
  27. ('TNT1','1003','TNT (1 stick)','3','TNT, red, single stick'),
  28. ('TNT2','1003','TNT (5 sticks)','10','TNT, red, pack of 10 sticks');
  29. Query OK, 14 rows affected, 14 warnings (0.141 sec)
  30. Records: 14 Duplicates: 0 Warnings: 14
  31.  
  32. insert into vendors values('1001','Anvils R US', '123 Main Street','Southfield','MI','48075','USA'),
  33. ('1002','LT Supplies', '500 Park Street','Anytown','OH','44333','USA'),
  34. ('1003','ACME', '555 High Street','Los Angeles','CA','90046','USA'),
  35. ('1004','Furball Inc', '1000 5th Avenue','New York','NY','11111','USA'),
  36. ('1005','Jet Set', '42 Galaxy Road','London','NULL','N16 GPS','England'),
  37. ('1006','Jouets Et Ours', '1 Rue Amusement','Paris','NULL','45678','France');
  38. Query OK, 6 rows affected (0.059 sec)
  39. Records: 6 Duplicates: 0 Warnings: 0
  40.  
  41. insert into orderitems values('20005','1','ANV01','10'),
  42. ('20005','2','ANV02','3'),
  43. ('20005','3','TNT2','5'),
  44. ('20005','4','FB','1'),
  45. ('20006','1','JP2000','1'),
  46. ('20007','1','TNT2','100'),
  47. ('20008','1','FC','50'),
  48. ('20009','1','FB','1'),
  49. ('20009','2','OLI','1'),
  50. ('20009','3','SLING','1'),
  51. ('20009','4','ANV03','1');
  52. Query OK, 11 rows affected (0.115 sec)
  53. Records: 11 Duplicates: 0 Warnings: 0
  54.  
  55. MariaDB [orderentry]> update customers set cust_address = 'Gejayan Jogjakarta', cust_country = 'INA' where cust_id = '10002';
  56. Query OK, 1 row affected (0.181 sec)
  57. Rows matched: 1 Changed: 1 Warnings: 0
  58.  
  59. MariaDB [orderentry]> select * from customers;
  60. +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
  61. | cust_id | cust_name | cust_address | cust_city | cust_state | cust_zip | cust_country | cust_contact | cust_email |
  62. +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
  63. | 10002 | Mouse House | Gejayan Jogjakarta | Columbus | OH | 43333 | INA | Jerry Mouse | NULL |
  64. | 10003 | Wascals | 1 Sunny Place | Muncie | IN | 42222 | USA | Jim Jones | rabbit@wascally.com |
  65. | 10004 | Yosemite Place | 829 Riverside Drive | Phoenix | AZ | 88888 | USA | Y Sam | sam@yosemite.com |
  66. | 10005 | E Fudd | 4545 53RD Street | Chicago | IL | 54545 | USA | E Fudd | NULL |
  67. +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
  68. 4 rows in set (0.000 sec)
  69.  
  70. MariaDB [orderentry]> delete from vendors where vend_id ='1001';
  71. Query OK, 1 row affected (0.063 sec)
  72.  
  73. MariaDB [orderentry]> select * from vendors;
  74. +---------+----------------+-----------------+-------------+------------+----------+--------------+
  75. | vend_id | vend_name | vend_address | vend_city | vend_state | vend_zip | vend_country |
  76. +---------+----------------+-----------------+-------------+------------+----------+--------------+
  77. | 1002 | LT Supplies | 500 Park Street | Anytown | OH | 44333 | USA |
  78. | 1003 | ACME | 555 High Street | Los Angeles | CA | 90046 | USA |
  79. | 1004 | Furball Inc | 1000 5th Avenue | New York | NY | 11111 | USA |
  80. | 1005 | Jet Set | 42 Galaxy Road | London | NULL | N16 GPS | England |
  81. | 1006 | Jouets Et Ours | 1 Rue Amusement | Paris | NULL | 45678 | France |
  82. +---------+----------------+-----------------+-------------+------------+----------+--------------+
  83. 5 rows in set (0.000 sec)
  84.  
  85. MariaDB [orderentry]> select from orderitems order_num,quantity;
  86. 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
  87. MariaDB [orderentry]> select order_num,quantity from orderitems;
  88. +-----------+----------+
  89. | order_num | quantity |
  90. +-----------+----------+
  91. | 20005 | 10 |
  92. | 20005 | 3 |
  93. | 20005 | 5 |
  94. | 20005 | 1 |
  95. | 20006 | 1 |
  96. | 20007 | 100 |
  97. | 20008 | 50 |
  98. | 20009 | 1 |
  99. | 20009 | 1 |
  100. | 20009 | 1 |
  101. | 20009 | 1 |
  102. +-----------+----------+
  103. 11 rows in set (0.021 sec)
  104.  
  105. MariaDB [orderentry]> select * from customers where cust_country ='USA';
  106. +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
  107. | cust_id | cust_name | cust_address | cust_city | cust_state | cust_zip | cust_country | cust_contact | cust_email |
  108. +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
  109. | 10003 | Wascals | 1 Sunny Place | Muncie | IN | 42222 | USA | Jim Jones | rabbit@wascally.com |
  110. | 10004 | Yosemite Place | 829 Riverside Drive | Phoenix | AZ | 88888 | USA | Y Sam | sam@yosemite.com |
  111. | 10005 | E Fudd | 4545 53RD Street | Chicago | IL | 54545 | USA | E Fudd | NULL |
  112. +---------+----------------+---------------------+-----------+------------+----------+--------------+--------------+---------------------+
  113. 3 rows in set (0.065 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement