I am looking to build my own bike and was wondering whether the bike and the drivetrain would work better with matching parts or not. I work at a bike coop and it would be much cheaper to be able to use random parts. I want to know if that would be smart or if I should by the parts in a set from the manufacturer (with a price tag if possible). Thank you! If you need me to be a little bit clearer feel free to ask.
There are many groups of parts that will work together just fine, and many that will not. You can mix and match brands in any number of ways and have it work fine.
Buying everything together is an expensive way to guarantee that everything will Just Work.
You can put something together for much, much less money using random bin parts from your co-op. But, you will still have to pay for it with your own research work, in learning all the different ways that the components have to fit together.
The good news is, putting a bike together isn't rocket science. There is detail that you will need to learn, but you can learn it.
The answer is "it depends". Some parts are cross compatible, some are not and some can be made to work with adapters, non-standard cable routing etc.
If you have access to the parts, you can measure most dimensions yourself. Calculating cable and derailleur movement and actuation ratios takes some simple math, otherwise you are fine with just measuring.
A great resource for looking up compatibility is Sheldon Brown's crib sheets. Actually, reading through entire site will answer a lot of questions.