1

Topic: Question on

There are two tables where there can be any data. Without restrictions. Within the limits of typification it is clear. id in and - primary key, in b - id - foreign key on and create table a (id int, name varchar (100)) create table b (id int, someval varchar (100)) 1) select a.id from an inner join b on b.id = a.id 2) select a.id from a right join b on b.id = a.id generally what request returns more records?

2

Re: Question on

2/20/2018 13:01, Kaifa writes:> generally what request returns more records? Announce all list of questions, ! Posted via RSDN NNTP Server 2.1 beta

3

Re: Question on

4

Re: Question on

Hello, Kaifa, you wrote: a picture with a product of sets did not see? The second

5

Re: Question on

T> a picture with a product of sets did not see? T> here such questions set the second on interview))) and answered as you but since right join I use extremely rarely, began to doubt) a little), he stated that on the contrary. Though what  on the contrary if in b are admissible null. By the way on remaining questions at me jambs did not find

6

Re: Question on

Hello, Kaifa, you wrote: K> b - id - foreign key on and K> K> create table b (id int, someval varchar (100)) K> Where constraint, asked at ?

7

Re: Question on

Hello, Kaifa, you wrote: K> there are two tables where there can be any data. Without restrictions. Within the limits of typification it is clear. id in and - primary key, in b - id - foreign key on and K> K> create table a (id int, name varchar (100)) K> create table b (id int, someval varchar (100)) K> 1) select a.id from an inner join b on b.id = a.id K> 2) select a.id from a right join b on b.id = a.id K> K> generally what request returns more records? On idea if Foreign key it is made correctly, it constraint so that will be identical because in b.id there can not be the values which are distinct from a.id. And here LEFT JOIN could give more values. However, if constraint is not present, in b.id it is admissible NULL and then the second request can return more.

8

Re: Question on

M> On idea if Foreign key it is made correctly it constraint, FK does not forbid to have NULL.

9

Re: Question on

2/20/2018 23:32, Milena writes:> On idea if Foreign key it is made correctly, it constraint so that will be identical because in b.id there can not be the values which are distinct from a.id. And here LEFT JOIN could give more values.> however if constraint is not present in b.id it is admissible NULL and then the second request can return more. BOL in the help! Bosh what... Posted via RSDN NNTP Server 2.1 beta