3
I created a dummy bank with the following structure:
Below are also the numbered SQL Server scripts for database creation, if necessary.
Now, what I want to do is make an appointment where they’re shown:
- The limit of an additional holder - present in the table Titres_additional
- The name of this client - present in the table Client
- The degree of kinship of this client - also in Titres_additional
- Who this holder depends on - also in the table Client, referenced in the table Bill
It is difficult to understand, write the structure of the tables and how you want the result. There are things there that do not seem to make sense. If you want you can even use http://www.sqlfiddle.com/ to assemble the whole structure, put data and we assemble the query for you.
– Maniero
@bigown edited the post, I had to reduce the scheme of this bank to post, but now it became much clearer - I believe.
– Ezequiel Barbosa
I may be wrong because the modeling is a little confusing but it seems to me that you do not want a query but several, it does not seem that there is direct relationship at least between some of this information. It seems strange these relationships. And a hint, just put as number what really needs to be number. http://answall.com/q/47871/101 I remembered that I need to tweak the answer in another question of yours. They taught you to do something confusing there and it seems you liked the confusion :) Don’t zip, make a fiddle. http://www.sqlfiddle.com/#! 6/dd4e4
– Maniero
Yes of course, I will test and I tell you, I could not use SQL Fiddle, when I was going to run the script to insert the data it gave error - I checked the code and ran on MS SQL Server normally. Anyway, thanks for the reply and the tips, I will definitely take note :)
– Ezequiel Barbosa
I have executed your scripts without changing a single comma :)
– Maniero
Oh yes now I saw, I just put the tables on the left side where you build the schema, and I tried to do the rest on the right side, and looking here at the way you did the scripts are all in the schema construction. Interesting...
– Ezequiel Barbosa