The master key fits everything, door locks, ignition, glove box lock, and rear hatch lock.
Master keys have the code series (# on Key) M6001-7000 and M7001-8000.
The submaster key fits the Doors and the Ignition, not the glove box or rear hatch. This is also known as a “valet” key. Submaster keys have the code series (# on Key) M4001-5000 and M5001-6000.
For more information go to Datsun 240z 260z 280z Key and Lock Reference Materials