1

Say I have a table with columns mobile phone models and their ram/rom. The table can have two rows with same models but with different ram/rom, different models with same ram/rom but not same models with same ram/rom. Do you know about any special primary key or something to do this?

Thanks for any help.

1 Answer 1

1

You could add a unique index covering both the phone model and memory storage columns, e.g.

ALTER TABLE yourTable ADD UNIQUE u_idx (model, memory);
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your reply Tim Biegeleisen i will try it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.