Database Reference
In-Depth Information
The
productnotes
Table
The
productnotes
table (see Table B.6) stores notes associated with specific
products. Not all products may have associated notes, and some products may
have many associated notes.
Table B.6
productnotes
Table Columns
Column
Description
note_id
Unique note ID
prod_id
Product ID (corresponds to
prod_id
in
products
table)
note_date
Date note added
note_text
Note text
All tables should have primary keys defined. This table should use
note_id
as its
■
primary key.
Column
note_text
must be indexed for
FULLTEXT
search use.
■
To follow
along with the examples, you need a set of populated tables.
Everything you need to get up and running can be found on this topic's Web
The Web page contains two SQL script files that you may download:
create.sql
contains the MariaDB SQL statements to create the six
database tables (including defining all primary keys and foreign key
constraints).
■
populate.sql
contains the SQL
INSERT
statements used to populate
these tables.
■
Note
For MariaDB Only The SQL statements in the downloadable
.sql
files are DBMS
specific and are designed to be used only with MariaDB.
After you have downloaded the scripts, you can use them to create and popu-
late the tables needed to follow along with the chapters in this topic. You can
do this using the
mysql
command line utility or MySQL Workbench.