Coresets for Relational Data and The Applications