I have a scenario which needs to be handled in Oracle SQL – that is a requirement. This is a book lending scenario which I am trying to create. Each student is entitled only so many number of books which is based on a credit system. In this sample Student ID ‘100’ is entitled for 4 books. Need to generate