Not exactly sure if my Article Title fits my question, I'm new to using SQL. so sorry if this is a nooby question

I'm working on filling out a DB.

I have a table called Gamer, that has a primary key named Username,
in my other table Character, Username is a foreign key to it.

When I'm inserting values into character, for instance like INSERT INTO CHARAC VALUES ('blahblahblah') and lets say that blahblahblah is the username, is there anyway I can leave that field empty and enter some sort of constraint that will reference gamer, and find the username so I wouldn't have to enter it again? I want to eliminate redundancy if possible.

Depending on how your tables look, this is usually done by referencing the user id column. In character store the user id, and have it point to the gamer id.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.