Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Intelligent IoT Projects in 7 Days

You're reading from   Intelligent IoT Projects in 7 Days Build exciting projects using smart devices

Arrow left icon
Product type Paperback
Published in Sep 2017
Publisher Packt
ISBN-13 9781787286429
Length 206 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Agus Kurniawan Agus Kurniawan
Author Profile Icon Agus Kurniawan
Agus Kurniawan
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. A Simple Smart Gardening System FREE CHAPTER 2. A Smart Parking System 3. Making Your Own Vending Machine 4. A Smart Digital Advertising Dashboard 5. A Smart Speaker Machine 6. Autonomous Firefighter Robot 7. Multi-Robot Cooperation Using Swarm Intelligence 8. Essential Hardware Components

Designing a database model

If you have a vending machine with various products and payment methods, it's recommended you use a database to store all transactions in the vending machine.

Three data points that you should take care about are product, transaction, and machine vending capabilities. In general, we can describe the core database design as follows:

The Product table consists of product information, including quantity and price. If you look at the schema in the figure, there are two fields: product_code and product_vending_code. product_code is the internal manufacturing identity that the system will use for all transactions. You can put Stock Keeping Unit (SKU) data into this field. Each product usually has an SKU ID so we can use it for our product identity. Otherwise, the product_vending_code field is designed for identity numbers on vending machines. These are...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image