How could I deploy database (table structure and data) from database A to database B?
The table structures are all within the meta-data so when you create a package file, all you need is the .pkg file that was created to deploy both structures and data. If you are referring to pulling data from a server so you can deploy to another, this is just a Deployment Package. You can refer to the documentation on how to create a deployment package. It is farily straight forward.
How could I deploy it to StrataframeSample database?
Well, it is best not to change the StrataFrameSample database, but to do this, you just need to create a DDT profile and use the Deployment Data Wizard to bring in the Security data structures and create the associated data packages.
There is in-depth documentation on how to do this in the DDT Help.
How does DDT detect table relationship?
I don't really understand your question. The DDT has full relationship support. If you are referring to importing an existing SQL Server database, then yes, at the moment the relationships are not imported. This feature will be implemented and is on our "to-do" list.