Jump to content
Larry Ullman's Book Forums

jtf2012

Members
  • Posts

    2
  • Joined

  • Last visited

jtf2012's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hello, 2nd time poster here and just learning MySQL and PHP using the 4th Edition. I've got my DB setup for a mobile web app that will basically used to enter in attributes of different items, let's call them widgets, gadgets and frazzles. I am trying to determine the best way to store the options available for certain attributes. Some attributes will require a number input, which isn't the problem. Many of the attributes will be a selection of one of 3-7 choices. In order to keep my tables normalized, my thought is to create an attrib_value table and store the options using Data Type ENUM and then use a foreign key to link the attribute to the proper attribute values and have them displayed as a pull-down in a form. lMy tables are like this Table1: item_type id_item_type INT NN UN AI item_name VARCHAR() NN item_descrip VARCHAR () Table2: item_attrib id_item_attrib INT NN UN AI fk_id_item_type INT NN attrib_name VARCHAR() NN attrib_units VARCHAR() Table3_attrib_value id_attrib_value INT NN UN AI fk_item_attrib INT NN attrib_value ENUM('x','y','z') NN There is a 1:N identifying key between the item_attrib table and the attrib_value table. Does this make sense to do it this way or is there a better way that I am not seeing? Thanks everyone for your insight!
  2. Hello, First I'd like to say this book is great! It is teaching me the things I need to know to design and build the web app I've sketched out. I'm slowling becomming proficient in database design and scripting. Thanks Larry! Ive got a database setup with an InnoDB engine for all of my tables. I've got several tables that I am using as "Master" tables to pull data from to automatically generate input forms based on certain variables. Some of these tables will have a few hundred rows of data. I want to use MS Excel to organize the data for these tables and then import them into my database using the MySQL workbench. I'm very comfortable with this interface for the EER diagram and configuring tables and foreign keys but I'm not so good yet using the command prompt for connecting and running commands. Can someone provide some instructions to use the LOAD DATA command to get the data into these tables? Ideally I'd like to write these scripts once and be able to run them whenever I've got updated tables from MS Excel. Overwriting the existing data is fine as it will all be in the MS Excel files. Thanks, JTF2012
×
×
  • Create New...