Relationship between two tables

Dunyazada

New member
Local time
Today, 18:30
Joined
Nov 22, 2012
Messages
9
I have two tables, "Style" and "Color". The first has two fields, "Student" and "Type of shoes", with the names of students and their preferred type of shoes respectively. The second has two tables, "Student" and "Color of shoes", with the names of OTHER students and their preferred color of shoes respectively. I need to display only students whose preference is black >or< heels (display their name, preferred style, and preferred color). They must display on one screen. I have tried to do it through creating a select query, but I am not sure about what relationship should be between the two tables, since they are not really related. Also I don't know what criteria to use. Could anybody help?
 
As I can understand you, you don't need 2 tables, and
you don't need a RELATIONSHIPS between these 2 tables.
One tabe is enough.
 
I have to have two tables, because this is an assignment :)
 
If you have to use 2 tables, can you change the layout of the tables?
First table is Students
Second table is Shoes (field for type and field for color)
 
No, I cannot :( And the students' names are different. The professor said that there are several ways of doing that, so, maybe, I can do it without using a query?
 
Thanks :)
The purpose, as he said, is for us to get to know Access (the course is about Excel, actually). This is the description of the assignment:
"Please enter the following two tables into an access database:

Call the first table "style"

Andrea Flats
Brianna Heels
Morgan Sneakers
Stephanie Wedges
Ana Sandals
Natalia Boots
Angelika Pumps
Josh Heels
Moises Heels

Call the second table "Color"

Brad Blue
Sebastian Red
Morgan Animal Print
Stephanie Black
Josh Beige
Angelika Black
Andrea Black
Daniela Black
Mikaylo Black

Enter the above tables.

Part II
-------

Now display only students whose preference is black >or< heels - display their name, preferred style, and preferred color. They must display on one screen.

There are several ways to do this; select one. (Hint: You do not make a table with three fields)".

Do you think I should use a query, or there is another way to do it?
 
What if they don't have to have a style and a color at the same time? Is there a way to display only the students from the first table with "heels"?
 
What if they don't have to have a style and a color at the same time? Is there a way to display only the students from the first table with "heels"?

It would be easy to create two separate Queries that each get the required information from one of the Tables.

A standard Query has three parts, the third of which is optional and used as required. Research the three parts and determine how to use them in your Queries. Get back to us with any further questions.
  1. SELECT { Field(s) that you want to display }
  2. FROM { Table that contains the Field(s) }
  3. {OPTIONAL} WHERE { Condition(s) for selection }
It would be more difficult to get all of it at the same time. As Pat said, A UNION Query would be one approach, but I would think that would be a more complex solution than your teacher would expect from a beginner.
 
Hm... I see.
Can I use a pivot table?

While a Pivot Table most certainly is a possibility to consider, it would also be more about presentation than content. It is not possible to say whether a Pivot Table would be the best approach until the required Query has been defined. You should start with a basic Query that defines your Dataset, and then worry about the presentation.
 

Users who are viewing this thread

Back
Top Bottom