Data checking vs database

please share your attempt (code) with representative data in the form of a reprex.
FAQ: How to do a minimal reproducible example ( reprex ) for beginners