AccessMyLibrary : Search Information that Libraries Trust AccessMyLibrary | News, Research, and Information that Libraries Trust

AccessMyLibrary    Browse    P    Personal Computer World    DEC-05    Hands on - Databases - Reporting revisited. A solution is improved, and we go back to database basics to explain normalisation.(Column)

Hands on - Databases - Reporting revisited. A solution is improved, and we go back to database basics to explain normalisation.(Column)

Publication: Personal Computer World

Publication Date: 01-DEC-05
How to access the full article: Free access to all articles is available courtesy of your local library. To access the full article click the "See the full article" button below. You will need your US library barcode or password.

Bookmark this article

Print this article

Link to this article

Email this article

Digg It!

Add to del.icio.us

RSS

COPYRIGHT 2005 VNU Business Media Europe

In the June issue I provided a solution for a reporting problem, which has now been improved upon by a reader. Imagine we manufacture items to which different engineering processes (casting, milling and painting) can be applied - any component can have any number of processes. We store this information in a four-table database - the first stores information about each component, the casting table stores the ID of every product that is cast, together with details about the different casting processes applied. There are two other similar tables, one for milling and the other for painting (see screen 1).

This is a good, normalised structure (see box overleaf for more on normalisation), but suppose we need to produce a report where information from the three different tables appears under one heading. The solution I provided used several queries to create a materialised table, ReportHolder, which has a single column (Process) that contains information from the three different processes. Given the data in this format, it is simple to write the report we need. My solution worked, but Ian Williams has a much neater one.

He solved the problem using a single UNION query (called qryUNION) to combine data from the three process tables like this:

SELECT 'Casting' AS Header, 4

ComponentID, Description, 4

Process

FROM Casting

UNION ALL

SELECT 'Milling' AS Header, 4

ComponentID, Description, 4

Process

FROM Milling

UNION ALL

SELECT 'Painting' AS Header, 4

ComponentID, Description, 4

Process FROM Painting;

(Key: 4 code string continues)

Then...

Read the full article for free courtesy of your local library.


More Articles from Personal Computer World
Hands on - Visual programming - Unearthing Foxpro. Microsoft's forgott...
December 01, 2005
Flashback. From the archives: Take a look at the important events in t...
December 01, 2005
Find companies classified under Prepackaged software

What's on AccessMyLibrary?

31,982,826 articles
in the following categories:

Arts, Business, Consumer News, Culture & Society, Education, Government, Personal Interest, Health, News, Science & Technology


© 2008 Gale, a part of Cengage Learning  | All Rights Reserved | About this Service | About The Gale Group, a part of Cengage Learning
                                            Privacy Policy | Site Map | Content Licensing | Contact Us | Link to us
      Other Gale sites: Books & Authors | Goliath | MovieRetriever.com | WiseTo Social Issues