Open Side Menu Go to the Top
Register
Help with foreign keys Help with foreign keys

08-18-2022 , 05:52 AM
Hello,

This is for an Access project. I am unable to find a foreign key between tables to set up a relational database. So I ended up having the same primary keys for all the tables, which didn't work well when creating queries. here are the tables details, feel free to adjust the tbls orders:

tblDatabaseinfo: ProductBarcode Title Author Price Currency discount etc..

TblStock: ProductBarcode (as primary key as above) Stock Sales Jan Sales Feb etc...

TblOrders: ProductBarcode OrdersJan Ordersfeb etc...

How can I link these tables, will the barcode be the primary key for them and not create problems when my database gets larger?

I'm not an expert in access so I would appreciate any tip.

Thank you..
Help with foreign keys Quote
08-18-2022 , 08:22 AM
it shouldn't be a problem as described
Help with foreign keys Quote
08-19-2022 , 04:50 AM
That should work perfectly, make sure you understand how to create queries with JOINs between multiple tables.

https://www.w3schools.com/sql/sql_join.asp
Help with foreign keys Quote

      
m