• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1417
  • Last Modified:

A composite attribute in Microsoft Access

Hello EE. I am taking an Access class and I am having some difficulties. I come from a hardware and networking background which doesn't help any. I am trying to design a database for a project with a few tables. The tables have some common attributes like Addresses for example. The requirement is that Addresses be a composite attribute comprised of specific fields. I am trying to figure out what that means and how to implement it. Does it mean creating another table and linking it with a key? Any advice would be greatly appreciated.
0
InSearchOf
Asked:
InSearchOf
  • 3
  • 2
  • 2
  • +2
3 Solutions
 
Rey Obrero (Capricorn1)Commented:
a composite key is a combination of two or more fields that you will use as the primary key of the table.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
The term 'common attributes' isn't really an Access term.  Your instructor may be referring to Composite Key or Compound Key, however that would not likely apply to Addresses.  You should ask for a clarification.

mx
0
 
hnasrCommented:
Table: Persons (PersonID, personFirstNAme, PersonLastName, Address1, Address2, Address 3, DateOfBirth, ... - PersonID forms the primary key.)
Then You fill the table with unique record for each person. Assume you have a table of 5 Persons. The data can be anything, not in a specific order, but should be of the same format for all values in each field.
01  fName1  LName1 Add11 Add12 Add13  01/01/2000
02  fName2  LName2 Add21 Add22 Add23  02/02/2000
03  fName3  LName3 Add31 Add32 Add33  03/0132000
04  fName4  LName4 Add41 Add42 Add43  04/04/2000
05  fName5  LName5 Add51 Add52 Add53  05/05/2000
You can query this table.
Another table may be, Meals consumed,
Meals (MealID, PearsonID, MealNAme, PlaceConsumed - MealID and PersonID form the Primary Key, a composite key)
01  01  Meal1  Place1
02  01 Meall2  Place1
01  02  Meal1  Place1
02  02 Meall2  Place2
and so on..

To query the data to find out the meals consumed and places for each person, you create a query by linking the Persons, and Meals tables through the field PersonID. This will make available all the data as if it is is a wider table.
01  fName1  LName1 Add11 Add12 Add13  01/01/2000 01 01 Meal1  Place1
01  fName1  LName1 Add11 Add12 Add13  01/01/2000 02 01 Meall2  Place1
and so on.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Rey Obrero (Capricorn1)Commented:
if you need more info, google on
composite keys in access table,
how to create a composite key in access table
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Typo ...The term 'common attributes' isn't really an Access term.

s/b The term 'composite attributes' isn't really an Access term.
                      ^^^^^^^^^

mx
0
 
Armen Stein - Microsoft Access MVP since 2006PresidentCommented:
Maybe the instructor meant for you to build a set of custom field templates for Address fields.  Search help for "field template".

But I agree that the best approach is to just ask the instructor for clarification.
0
 
InSearchOfAuthor Commented:
The wording on the assignment was:
There are fiour groups and each gpoup will represent one table. Each table will have SSN#, Name, DOB, Phone, and Address. The Address attribute will be a composite consisting of street number , apt, city, and zipcode fields. Then I have to creat an E/R model. I understand table creation and the E/R model. I don't know how to show the composite Address with the addtion fields.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
OK ... ask the instructor *exactly* what they mean by 'composite Address' ?

There are so many ways you could do the address information.  Most likely if I was doing it ... depending
on what data needed to be extracted later (reports, searches, etc) ... I would probably have a separate field for each of those 'attributes' (st num, apt, city, <state>?, zipcode) ... again depending ....

mx
0
 
InSearchOfAuthor Commented:
Thanks for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now