I have a database table with almost 15000 rows of data, now I want to display questions randomly. User will enter number of question he want from each chapter, and according to that question should display. I am stuck about performance and way of doing this. If question is locked it should not display. here is my table structure. I am using .net core and sql server with EF Core.
QuestionId SubjectId ChapterId Question OptionA OptionB OptionC OptionD HasLocked(boolen)
Edit:
select * from table_name where HasLocked = false and ChapterId = '1' and ChapterId = '2';
Note: ChapterId will be dynamic.