database to cursor practice