Question

Database design.

Asked by: MOSTAGHASSI

Hello All
I want to design a "Magazine online" which consist of several
parts(categories) like literature, history,sports,and...   and
want design with mysql,
each category can have these fileds"
ID,"Title of paper",  "author or source of paper" "description",
"date" , "language"  and  "2 jpg files" for each record.

My question:
1-Which is the best? each category have a table? or only one table for all
of magazine? please write your suggestion and also relation between tables.

2-Do i put image files in folder? so what must be the name of images for each
record?

Thanks in advance
mostaghassi

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-09-14 at 10:38:35ID22829590
Tags

database

,

design

,

record

,

table

Topic

MySQL Server

Participating Experts
2
Points
125
Comments
4

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Sports Simulation
    I am creating a sports textual/statistical simulation. I would like to make the program output its text to a windown instead of a dos prompt. I am very new at windows programming and know little about creating win apps. All I would need is a window that has a text box in t...
  2. Logo for a Magazine
    How can I create a logo that shows fonts in either black or white color, but not the background. Kinda like the logo on magazines, where the name of the magazine appears on top on an image, without the background. Thanks! :)
  3. Picture and text quality in magazine ads.
    We create magazine ads with Photoshop 7 and Illustrator CS using various forms of text plus several pictures. Most ads are sent to the publication on a CD in PDF format, 300 dpi. The ads look good in print but of course we'd like for them to look even better. What bearing ...
  4. Your idea about this 2 tables db(mysql) design?
    Hi; I want design a db(mysql+php) for a magazine online with 10 parts (and some subparts- News,Sport,Culture,Technology and ...) my db consits of 2 tables which can cover multilevel as a tree: tb_categories .......................................................................

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: dqmqPosted on 2007-09-14 at 11:07:33ID: 19893795

1. One table for magazine
    One table for common fields of all categories
    One table for each category that has unique fields  (maybe you don't have any)
    One table for jpg references (to also support 0,1, or >2 images per category)

2.  Yes, put images in a folder. Name them however you like, but a standard seems like good idea.  
   
     

 

by: Binary1Posted on 2007-09-14 at 11:13:27ID: 19893841

This almost sounds like a homework assignment.

If each category has the same fields then you'll probably want to use the same table in which case you'll need to add a category field to the table beyond what you've listed. The category field would most likely be an id and a foreign key to a category table, containing the category name and id.

Whether the images are stored in the database or somewhere else will depend on how this data is to be presented and maintained.

The easiest is to store the image as an file and have a url/pathname to the file stored in the database for each image. This does lead to potential problems where the images are moved or deleted. but the database records still refer to the original image that's no longer there. You'll also have to deal with how to structure storing them on the disk so that multiple images that have the same name don't overwrite each other. Since you have an ID column in the database it may be helpful to include this id in the image filename so you can easily associate which images go with what article.

Storing them as a blob in the database is a good way to make sure you keep the image with the rest fo the information but there are the storage issues of whether the image sizes are larger than what the db can hold, although this is probably not an issue.

 

by: MOSTAGHASSIPosted on 2007-09-14 at 20:03:31ID: 19896292

Thanks for your comments.
Because i'm new in designing of a standard db would you please write the connection between tables,and have an example with a record? e.g i don't know that how can i store several images for one record in a table and then retrive them.
thanks

 

by: Binary1Posted on 2007-09-17 at 05:29:48ID: 19904294

Storing the images into the database or retrieving them once the table is created is going to depend on what language you are using to interact with the database. An example of storing and retrieving images from the MySQL database can be found at http://dev.mysql.com/doc/refman/4.1/en/blob.html (MySQL documentation). Each image in the record is it's own column, so for two images you'll have two BLOB columns.

I am not fully familiar with MySQL DDL syntax but you might do something like this if you are storing the images in the table:


CREATE TABLE CATEGORY (
        ID INTEGER AUTO_INCREMENT,
        DESCRIPTION VARCHAR(20),
        PRIMARY KEY (ID)
)

CREATE TABLE MAGAZINE (
        ID INTEGER AUTO_INCREMENT,
        CATEGORY INTEGER,
        TITLE VARCHAR(50),
        AUTHOR VARCHAR(35),
        DESCRIPTION VARCHAR(100),
        PUBDATE DATE,
        LANGUAGE VARCHAR(20),
        IMAGE1 BLOB,
        IMAGE2 BLOB,
        PRIMARY KEY (ID),
        FOREIGN KEY (CATEGORY) REFERENCES CATEGORY (ID)
)

The ID columns here will determine it's own value. If you need to specify the value yourself you'll want to remove the AUTO_INCREMENT option.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...