Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MariaDb Essentials

You're reading from  MariaDb Essentials

Product type Book
Published in Oct 2015
Publisher
ISBN-13 9781783982868
Pages 206 pages
Edition 1st Edition
Languages
Toc

Table of Contents (15) Chapters close

MariaDB Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Installing MariaDB 2. Databases and Tables 3. Getting Started with SQL 4. Importing and Exporting Data 5. Views and Virtual Columns 6. Dynamic Columns 7. Full-Text Searches 8. Using the CONNECT Storage Engine Index

Using the OCCUR table type


The OCCUR table type allows you to create a new view of a table. A new row will be created for each cell of the table, the row will contain the name of the row, the name of the column, and the value in the corresponding cell.

We will first create a standard table with some data for practice:

CREATE TABLE `visitors` (
  `year` char(4) NOT NULL,
  `Jan` int(10) NOT NULL DEFAULT '0',
  `Feb` int(10) NOT NULL DEFAULT '0',
  `Mar` int(10) NOT NULL DEFAULT '0',
  `Apr` int(10) NOT NULL DEFAULT '0',
  `May` int(10) NOT NULL DEFAULT '0',
  `Jun` int(10) NOT NULL DEFAULT '0',
  `Jul` int(10) NOT NULL DEFAULT '0',
  `Aug` int(10) NOT NULL DEFAULT '0',
  `Sep` int(10) NOT NULL DEFAULT '0',
  `Oct` int(10) NOT NULL DEFAULT '0',
  `Nov` int(10) NOT NULL DEFAULT '0',
  `Dec` int(10) NOT NULL DEFAULT '0'
) ENGINE=CONNECT;
INSERT INTO visitors VALUES
('2015', 121, 172, 199, 181, 108, 199, 171, 156, 170, 183, 105, 176),
('2014', 167, 108, 137, 161, 198, 104, 129, 132, 172, 167,...
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 €14.99/month. Cancel anytime}