| |||
6 tables ordering system model - running output
More MySQL commands example from a Well House Consultants training course
More on More MySQL commands [link]
Source code: rz Module: S157
mysql> source shopper; Query OK, 0 rows affected (0.02 sec) Query OK, 1 row affected (0.00 sec) Database changed Query OK, 0 rows affected (0.00 sec) Query OK, 2 rows affected (0.01 sec) Records: 0 Duplicates: 2 Warnings: 0 Query OK, 0 rows affected (0.00 sec) Query OK, 4 rows affected (0.00 sec) Records: 0 Duplicates: 4 Warnings: 0 Query OK, 0 rows affected (0.00 sec) Query OK, 6 rows affected (0.01 sec) Records: 0 Duplicates: 6 Warnings: 0 +-----+--------------------+-----+-------+------------------------+-----+-------+---------------------+---------+ | sid | s_name | aid | a_sid | a_name | pid | p_aid | p_name | p_price | +-----+--------------------+-----+-------+------------------------+-----+-------+---------------------+---------+ | 301 | The Emporium | 201 | 301 | African Products | 101 | 201 | Rhino Horn | 100000 | | 301 | The Emporium | 201 | 301 | African Products | 102 | 201 | Biltong | 500 | | 301 | The Emporium | 202 | 301 | Chinese Products | 103 | 202 | Sweet and Sour Soup | 130 | | 301 | The Emporium | 202 | 301 | Chinese Products | 104 | 202 | Flied Lice | 120 | | 302 | Cleaning made Easy | 203 | 302 | Products for Bathrooms | 105 | 203 | Squeegee | 287 | | 302 | Cleaning made Easy | 204 | 302 | Products for Outhouses | 106 | 204 | Spiderweb | 5 | +-----+--------------------+-----+-------+------------------------+-----+-------+---------------------+---------+ 6 rows in set (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 2 rows affected (0.00 sec) Records: 0 Duplicates: 2 Warnings: 0 Query OK, 0 rows affected (0.01 sec) Query OK, 3 rows affected (0.00 sec) Records: 0 Duplicates: 3 Warnings: 0 Query OK, 0 rows affected (0.00 sec) Query OK, 6 rows affected (0.00 sec) Records: 0 Duplicates: 6 Warnings: 0 +------------+---------------------+---------+---------+------------------------+--------------------+ | c_name | p_name | i_count | p_price | a_name | s_name | +------------+---------------------+---------+---------+------------------------+--------------------+ | Jean Janes | Rhino Horn | 3 | 100000 | African Products | The Emporium | | Joe Public | Biltong | 1 | 500 | African Products | The Emporium | | Joe Public | Rhino Horn | 1 | 100000 | African Products | The Emporium | | Jean Janes | Sweet and Sour Soup | 1 | 130 | Chinese Products | The Emporium | | Jean Janes | Flied Lice | 2 | 120 | Chinese Products | The Emporium | | Jean Janes | Spiderweb | 15 | 5 | Products for Outhouses | Cleaning made Easy | +------------+---------------------+---------+---------+------------------------+--------------------+ 6 rows in set (0.01 sec) +------------+---------------------+---------+---------+------------------------+--------------------+ | c_name | p_name | i_count | p_price | a_name | s_name | +------------+---------------------+---------+---------+------------------------+--------------------+ | Jean Janes | Rhino Horn | 3 | 100000 | African Products | The Emporium | | Joe Public | Biltong | 1 | 500 | African Products | The Emporium | | Joe Public | Rhino Horn | 1 | 100000 | African Products | The Emporium | | Jean Janes | Sweet and Sour Soup | 1 | 130 | Chinese Products | The Emporium | | Jean Janes | Flied Lice | 2 | 120 | Chinese Products | The Emporium | | Jean Janes | Spiderweb | 15 | 5 | Products for Outhouses | Cleaning made Easy | +------------+---------------------+---------+---------+------------------------+--------------------+ 6 rows in set (0.01 sec) +--------------------+------------------------+----------+---------+ | s_name | a_name | p_name | i_count | +--------------------+------------------------+----------+---------+ | Cleaning made Easy | Products for Bathrooms | Squeegee | NULL | +--------------------+------------------------+----------+---------+ 1 row in set (0.00 sec) +------------+-----+---------+---------+-----------+ | c_name | rid | i_count | n_items | req_total | +------------+-----+---------+---------+-----------+ | Jean Janes | 501 | 3 | 3 | 300000 | | Joe Public | 502 | 1 | 2 | 100500 | | Jean Janes | 503 | 1 | 18 | 445 | +------------+-----+---------+---------+-----------+ 3 rows in set (0.01 sec) +---------------------+---------+-------+---------+ | p_name | price | count | total | +---------------------+---------+-------+---------+ | Rhino Horn | 1000.00 | 4 | 4000.00 | | Biltong | 5.00 | 1 | 5.00 | | Flied Lice | 1.20 | 2 | 2.40 | | Sweet and Sour Soup | 1.30 | 1 | 1.30 | | Spiderweb | 0.05 | 15 | 0.75 | | Squeegee | 2.87 | NULL | NULL | +---------------------+---------+-------+---------+ 6 rows in set (0.00 sec) +-----+--------------------+ | sid | s_name | +-----+--------------------+ | 301 | The Emporium | | 302 | Cleaning made Easy | +-----+--------------------+ 2 rows in set (0.01 sec) +-----+-------+------------------------+ | aid | a_sid | a_name | +-----+-------+------------------------+ | 201 | 301 | African Products | | 202 | 301 | Chinese Products | | 203 | 302 | Products for Bathrooms | | 204 | 302 | Products for Outhouses | +-----+-------+------------------------+ 4 rows in set (0.00 sec) +-----+-------+---------------------+---------+ | pid | p_aid | p_name | p_price | +-----+-------+---------------------+---------+ | 101 | 201 | Rhino Horn | 100000 | | 102 | 201 | Biltong | 500 | | 103 | 202 | Sweet and Sour Soup | 130 | | 104 | 202 | Flied Lice | 120 | | 105 | 203 | Squeegee | 287 | | 106 | 204 | Spiderweb | 5 | +-----+-------+---------------------+---------+ 6 rows in set (0.00 sec) +-----+------------+------------------+ | cid | c_name | c_addy | +-----+------------+------------------+ | 601 | Jean Janes | 501 Tight Street | | 602 | Joe Public | 10 Market Place | +-----+------------+------------------+ 2 rows in set (0.00 sec) +-----+-------+ | rid | r_cid | +-----+-------+ | 501 | 601 | | 502 | 602 | | 503 | 601 | +-----+-------+ 3 rows in set (0.00 sec) +-----+-------+-------+---------+ | iid | i_rid | i_pid | i_count | +-----+-------+-------+---------+ | 401 | 501 | 101 | 3 | | 402 | 502 | 102 | 1 | | 403 | 502 | 101 | 1 | | 404 | 503 | 103 | 1 | | 405 | 503 | 104 | 2 | | 406 | 503 | 106 | 15 | +-----+-------+-------+---------+ 6 rows in set (0.00 sec) mysql> Learn about this subject
This module and example are covered on our public MySQL course. If you have a group of
three or more trainees who need to learn the subject, we can also arrange a
private or on site course for you.
Books covering this topic
Yes. We have over 700 books in our library. Books
covering are listed here and when you've selected a
relevant book we'll link you on to Amazon to order.
Other Examples
This example comes from our "More MySQL commands" training module. You'll find a description of the topic and some
other closely related examples on the "More MySQL commands" module index page.
Full description of the source code
You can learn more about this example on the training courses listed on this page,
on which you'll be given a full set of training notes.
Many other training modules are available for download (for limited use) from our download centre under an Open Training Notes License. Other resources
• Our Solutions centre provides a number of longer technical articles.
• Our Opentalk forum archive provides a question and answer centre. • The Horse's mouth provides a daily tip or thought. • Further resources are available via the resources centre. • All of these resources can be searched through through our search engine • And there's a global index here. Purpose of this website
This is a sample program, class demonstration or answer from a
training course. It's main purpose
is to provide an after-course service to customers who have attended our
public private or
on site courses, but the examples are made
generally available under conditions described below.
Web site author
Conditions of use
Past attendees on our training courses are welcome to use individual
examples in the course of their programming, but must check
the examples they use to ensure that they are suitable for their
job. Remember that some of our examples show you how not to do
things - check in your notes. Well House Consultants take no responsibility
for the suitability of these example programs to customer's needs.
This program is copyright Well House Consultants Ltd. You are forbidden from using it for running your own training courses without our prior written permission. See our page on courseware provision for more details. Any of our images within this code may NOT be reused on a public URL without our prior permission. For Bona Fide personal use, we will often grant you permission provided that you provide a link back. Commercial use on a website will incur a license fee for each image used - details on request. | |||
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho PAGE: http://www.wellho.net/resources/ex.php4 • PAGE BUILT: Sun Oct 11 14:50:09 2020 • BUILD SYSTEM: JelliaJamb |