Microsoft Access Tips Relationships - by Lisa Friedrichsen

  Рет қаралды 113,122

Lisa Friedrichsen

Lisa Friedrichsen

Күн бұрын

Microsoft Access Tips by Lisa Friedrichsen
Table Relationships, One-to-Many relationships with referential integrity. Thanks for watching and happy coding!
All of my KZfaqs can be found at:
learncs.w3spac...
Thanks, Lisa Friedrichsen

Пікірлер: 66
@FirstLast-cb2jr
@FirstLast-cb2jr Жыл бұрын
Eleven years later and I’ll say thanks for this video: it’s a really clear explanation.
@lfriedrichsen
@lfriedrichsen Жыл бұрын
Ty! See all of my KZfaqs organized at learncs.w3spaces.com
@kelv52
@kelv52 6 жыл бұрын
I have struggled with this concept for such a long time, I should say I am a novice, and a self taught one at that, but your explanation, more than most others I have listened to or read previously has made something click and I feel a bit more confident about what a relationship is and what i need to do to make it work, thank you for a very simple explanation.
@lfriedrichsen
@lfriedrichsen 6 жыл бұрын
Thanks Kevin. I've had such a great response to this video. My next effort is to make a series of youtubes on relational database concepts. Properly setting up the relationships between the tables is fundamental to the success of the rest of the application. Take care.
@nasmo1001
@nasmo1001 10 жыл бұрын
@Jonathan Cutting What you are looking at is called the Foreign Key which is the primary key it the originating table. There is one instance where you do see the same primary keys in two tables, thats called a Join Table and that is something different in regards to creating tables with data.
@socialplayground1
@socialplayground1 10 жыл бұрын
I love how clear u speak!
@lfriedrichsen
@lfriedrichsen 4 ай бұрын
You are welcome! See a listing of all of my KZfaqs at learncs.w3spaces.com
@muhammadtariqali8
@muhammadtariqali8 2 жыл бұрын
Superb
@lfriedrichsen
@lfriedrichsen 2 жыл бұрын
Thanks!
@Modhumitamondal
@Modhumitamondal 5 жыл бұрын
very helpful
@lfriedrichsen
@lfriedrichsen 4 ай бұрын
You are welcome! See a listing of all of my KZfaqs at learncs.w3spaces.com
@florasdad1
@florasdad1 3 жыл бұрын
I now understand thank you
@lfriedrichsen
@lfriedrichsen 5 ай бұрын
You are welcome! See all of my KZfaqs organized at learncs.w3spaces.com
@ab.normal.
@ab.normal. 7 жыл бұрын
This Video is Timeless!
@lfriedrichsen
@lfriedrichsen 7 жыл бұрын
Thank you. It is by far my most popular youtube given the relational model to manage data still rules the world. And no matter if you're working in a little Access database or a large-scale Oracle enterprise system the basic concepts of one-to-many relationships still apply.
@hapemokenela7388
@hapemokenela7388 4 жыл бұрын
The downloadable zipfile is fantastic. Thank you!
@lfriedrichsen
@lfriedrichsen 4 жыл бұрын
You're welcome!
@learning6126
@learning6126 10 жыл бұрын
never before got it so clear Thanks a lot
@lfriedrichsen
@lfriedrichsen 4 ай бұрын
You are welcome! See a listing of all of my KZfaqs at learncs.w3spaces.com
@2SHOTDAVE
@2SHOTDAVE 11 жыл бұрын
HOLY CRAP!!!! I took this course last semester, and I needed a refresh of everything and as soon as you said think of it as parent and child, it all made sense!!! Thank you so much!
@lfriedrichsen
@lfriedrichsen 4 ай бұрын
You are welcome! See a listing of all of my KZfaqs at learncs.w3spaces.com
@officeadmin544
@officeadmin544 9 жыл бұрын
Nice and simplistic to understand...thanks!
@lfriedrichsen
@lfriedrichsen 4 ай бұрын
You are welcome! See a listing of all of my KZfaqs at learncs.w3spaces.com
@lfriedrichsen
@lfriedrichsen 8 жыл бұрын
But in general, if you see duplicated information in any other field of a table, you probably have an opportunity to improve the database by making a one-to-many relationship. The table with the duplicate values is always on the "many" or child side of the relationship. Pretty hard to clarify this well without a concrete example though.
@chilicious7154
@chilicious7154 8 жыл бұрын
Perfectly explained! Thanks for sharing
@lfriedrichsen
@lfriedrichsen 4 ай бұрын
You are welcome! See a listing of all of my KZfaqs at learncs.w3spaces.com
@lfriedrichsen
@lfriedrichsen 10 жыл бұрын
@Ryan&@Jonathan-- in the Order Details table the OrderID and ProductID fields individually are foreign key fields that help establish one-to-many relationships. The key symbol by BOTH means that the values in the two fields taken together must be unique, a composite primary key situation. Individually, OrderID and ProductID in the Order Details table are not primary key fields. The issue of a combination key is separate from the issue of a join table. Orders is also a join table but it has a single field primary key, OrderID.
@hiyayoutube3702
@hiyayoutube3702 3 жыл бұрын
This was so helpful, thank you
@lfriedrichsen
@lfriedrichsen 5 ай бұрын
You are welcome! See all of my KZfaqs organized at learncs.w3spaces.com
@SteveMartinUSA
@SteveMartinUSA 3 жыл бұрын
This is good and simple, but how do you create the actual relationship in Access...? Do you drag from primary key to foreign or the other way around, how do you reverse the relationship, etc? For me it's easy to just write the DDL but maintaining the runtime of Oracle or SQL Server would be way overkill. So I'm trying to go waaaaaaaaaaay back and figure out this Access tool, where you have a table, relationships, forms, reports, etc. all in one file...weird, but very cool for small and simple.
@lfriedrichsen
@lfriedrichsen 3 жыл бұрын
Yes, drag the primary key field to the foreign key field to create a one-to-many relationship between two tables in the Relationships window (actually it works the other way around too, but logically, it makes more sense to start with the primary key field, the field on the "one" side of the relationship).
@lfriedrichsen
@lfriedrichsen 3 жыл бұрын
I wrote an Access A to Z playlist this spring where I touch upon relationships and the purpose for tables, queries, forms and reports in an Access application in a much more thorough manner. You may want to check it out: kzfaq.info/get/bejne/fLBgY62cu5aoY4E.html
@lfriedrichsen
@lfriedrichsen 10 жыл бұрын
To get the data files -- search for the ISBN number of the book at the publisher's web site, cengage.com. The data files are a free download.
@moose1618
@moose1618 10 жыл бұрын
I wish you would show the end result so I can see what this actually accomplishes. It would help me out a lot with the project I am doing.
@lfriedrichsen
@lfriedrichsen 10 жыл бұрын
Thanks, but when speaking of the one-to-many relationships, the OrderID and ProductID fields in the Order Details table function as foreign key fields, not as primary key fields. The primary key field is always on the one side of a one-to-many relationship, never on the many side. The key symbols beside those fields in the Order Details table indicate that together, they create a combination key for that table. The values in both fields considered together must be unique for every record.
@vincentanthonyanthony3418
@vincentanthonyanthony3418 4 жыл бұрын
I am new to access , working on supplier and inventory model is there any links that I can auto transfer data in table 1 and table 2.
@lfriedrichsen
@lfriedrichsen 4 жыл бұрын
Yes. Go to the External Data tab on the Ribbon. You will see many options to import data into Access in various file formats. Making sure your data is clean and consistent before you import it into Access is very helpful too.
@lakkimsun1690
@lakkimsun1690 9 жыл бұрын
make it easy to understand . thanks for this good idea.
@lfriedrichsen
@lfriedrichsen 4 ай бұрын
You are welcome! See a listing of all of my KZfaqs at learncs.w3spaces.com
@HeyIFoundACamera
@HeyIFoundACamera 10 жыл бұрын
You said the primary key field is never on the "many side" of a relationship. I see two such instances in the table "Order Details." In fact, BOTH of those key fields are on the "many side" of a relationship, and neither of them are on the "one side."
@lfriedrichsen
@lfriedrichsen 6 жыл бұрын
The two fields you are referring to in the Order Details field are NOT "primary key fields" consistent with the other one-field "primary key fields" in all of the other one-to-many relationships. It is only when the TWO fields considered together create "the primary key" for the Order Details table. Considered individually, they are merely fields, and in this case, they are on the "many" side of the relationship. Considered individually, they are the foreign key fields to their respective parent tables. Again, a single primary key field is NEVER on the "many side" of a relationship. A single primary key field is ALWAYS on the "one side" of a relationship.
@delphi7696
@delphi7696 6 жыл бұрын
hi im hoping you can help me. ive created 2 tables on my database on ms access. one is 'customer details' etc and one is 'completed' sales/deals. what i want to do is keep all records of customers for cars in the main big 'customer details' table and any completed deals from that table automatically added to the 'completed' table. i want to have a button or option like completed on the end of the table maybe like a yes or no column. by which i could click and it would automatically add the relevant fields i want to the completed table. i would like to know how i can go about that.
@lfriedrichsen
@lfriedrichsen 6 жыл бұрын
It sounds like you have a one-to-many relationship between the Customer and Sales tables. So first, link these two tables in a one-to-many relationship. To do this you will use the primary key field in the Customer table, perhaps named CustomerID, and add it to the Sales table as the foreign key field. Then, if you build a form/subform on these two tables (use the Form Wizard), I think you will achieve the results you are desiring. In a form/subform, the foreign key field of the Sales table in the subform is automatically filled in with the correct CustomerID from the Customer record in the main form. This all goes back to properly designing and understanding the one-to-many relationships between tables prior to starting your application development. When the relationships are completed properly, the development of everything else in the application including queries, forms, and reports is sooooo much faster and simpler. When the relationships are not established first, the rest of the work is extremely difficult and error prone.
@emilzaman9462
@emilzaman9462 7 жыл бұрын
helps alot. Thanks
@lfriedrichsen
@lfriedrichsen 4 ай бұрын
You are welcome! See a listing of all of my KZfaqs at learncs.w3spaces.com
@lfriedrichsen
@lfriedrichsen 9 жыл бұрын
You're describing a classic many-to-many relationship. One inmate can be related to many families. But one family can be related to many inmates too. The solution to this is a junction table that sits between the Inmates and Families tables and is on the "many" side of a one-to-many relationship back to your two original tables (Inmates and Families). You might call it the Connections table (for lack of a better name). In the Connections table you place the TDCJ number as a foreign key field to the Inmates table. So one inmate now has many Connections. You also place the FamilyID field as a foreign key field in the Conections table (or whatever field you've designated as the primary key field in the Families table). So one Family can also have many connections which solves your original problem. Now one inmate can be related to many families and one family can be related to many inmates. Post again if you have questions on this. PS: The Order Items table is a sample in Northwind. It is the junction table between Orders and Products given Orders and Products have a many-to-many relationship.
@shaksa911
@shaksa911 8 жыл бұрын
Hi Lisa, great video.. Now what if the unique ID or the primary key has duplicates in one table and duplicates in multiple columns not all of the fields, what do you recommend to do?
@lfriedrichsen
@lfriedrichsen 8 жыл бұрын
If a field is designated as the primary key field in a table, it will never have duplicate values. Access prevents that possibility. So if you want to make a field a primary key field, but it already has duplicates, you first have to scrub (fix) the data so that each value is unique before Access will allow you to set it as the primary key field. To do that, I recommend using a query to find the duplicate values. Add the field you want to turn into the primary key twice to the query grid. Click the Totals button which adds Group By to each field in the grid. Leave the first field as a Group By field. Count the second field. Set a descending order on the second field. Run the query. The field values that have duplicates, or a value of 2 or more will display at the top so you can figure out which field values need to be scrubbed in the original table.
@soudaninphengkhammy2713
@soudaninphengkhammy2713 4 жыл бұрын
Thank you :)
@lfriedrichsen
@lfriedrichsen 4 ай бұрын
You are welcome! See a listing of all of my KZfaqs at learncs.w3spaces.com
@Augusto5191
@Augusto5191 4 жыл бұрын
is there a way i can make something like a "conditional relationship"? .... i mean, if one field says "A" then the external key y linked to tableA and if it says "B" the external key y linked to tableB Thanks!!
@lfriedrichsen
@lfriedrichsen 4 жыл бұрын
No, but you can have two one-to-many relationships set on key y at the same time to both tableA and tableB. Then using queries, you could add criteria for the field value "A" and if "A", select related records from tableA. if "B" select related records from tableB. In other words, solve the logic problem in your queries, in SQL.
@lfriedrichsen
@lfriedrichsen 8 жыл бұрын
"if the unique ID or the primary key has duplicates in one table" -- this is not possible. By definition, a primary key field may not have duplicate values in multiple records.
@dacb-ue9xq
@dacb-ue9xq 7 жыл бұрын
what version of msaccess do you use at this video? i am very interested to this interface. it is cool
@lfriedrichsen
@lfriedrichsen 7 жыл бұрын
I made this youtube using Access 2010. Since then Microsoft has released Access 2013 and 2016, and of course there's the perpetually updated version called Access 365, part of the Office 365 suite. But truly, they are all so similar in functionality that my students have no trouble moving between them. So what you see in my Access 2010 tips series is 99% applicable to the latest version of Access.
@dacb-ue9xq
@dacb-ue9xq 7 жыл бұрын
+Lisa Friedrichsen thanks very much for so quick answer i appreciate this
@rangerlive3072
@rangerlive3072 7 жыл бұрын
Do you have this file for download and practice?
@lfriedrichsen
@lfriedrichsen 7 жыл бұрын
I'll post the Northwind sample database at my web site: students.jccc.edu/lisalfri
@lfriedrichsen
@lfriedrichsen 7 жыл бұрын
I've posted the Northwind sample database at my home page: students.jccc.edu/lisalfri I've learned a lot about relational databases in general from this sample database and it has many great examples of queries, forms, and reports that you can "reverse engineer" and use in your own application.
@kamranmirzakhel5362
@kamranmirzakhel5362 8 жыл бұрын
Please somebody help me how to create a relationship between the following..... Project Province Employee Thanks please help me i am very in need.
@lfriedrichsen
@lfriedrichsen 8 жыл бұрын
Here are some potential relationships... One Province is related to many Projects. One Province is related to many Employees. One Employee is related to many Projects.
@kamranmirzakhel5362
@kamranmirzakhel5362 8 жыл бұрын
Thank you so much for Reply. what i mean is that I have one project and this project has many branches (provinces) and each Branches (provinces) has many Employees, like Project --> Province-->Employee. please help me
@vuducanh81
@vuducanh81 7 жыл бұрын
your voice is so nice!
@lfriedrichsen
@lfriedrichsen 7 жыл бұрын
Thank you.
@anthonygonzales7718
@anthonygonzales7718 4 жыл бұрын
I imagine Jodie Foster talking.
Differentiating between Access labels and text boxes
6:18
Lisa Friedrichsen
Рет қаралды 12 М.
How to use Microsoft Access - Beginner Tutorial
31:07
Kevin Stratvert
Рет қаралды 3,1 МЛН
OMG what happened??😳 filaretiki family✨ #social
01:00
Filaretiki
Рет қаралды 13 МЛН
لااا! هذه البرتقالة مزعجة جدًا #قصير
00:15
One More Arabic
Рет қаралды 52 МЛН
КТО ЛЮБИТ ГРИБЫ?? #shorts
00:24
Паша Осадчий
Рет қаралды 3,6 МЛН
ISSEI & yellow girl 💛
00:33
ISSEI / いっせい
Рет қаралды 24 МЛН
Microsoft Access Relationship Types
14:44
DeLisa Lee
Рет қаралды 49 М.
Microsoft Access 2013/2016 pt 4 (Table Relationship)
30:28
Amir Parmar
Рет қаралды 105 М.
An Access Subform Based on a Many-to-many Relationship
14:10
Dr. Gerard Verschuuren
Рет қаралды 93 М.
Microsoft Access A to Z: Designing Table Relationships
10:40
Lisa Friedrichsen
Рет қаралды 66 М.
MS Access - Relationships Part 1: Relationships with tables
12:04
Mr Long Education - IT & CAT
Рет қаралды 25 М.
Microsoft Access Relationships Explained
8:25
Simon Sez IT
Рет қаралды 9 М.
Creating and Managing Table Relationships in Microsoft Access
8:30
Pharos Technology
Рет қаралды 264
OMG what happened??😳 filaretiki family✨ #social
01:00
Filaretiki
Рет қаралды 13 МЛН