This is the table structure

```
CREATE TABLE Book_Tag (id INT, Book_Id INT, tag varchar(20))

CREATE TABLE Book_Master (Book_Id INT, Book_title VARCHAR(50), price INT)

```

And the data looks like this :

```
INSERT INTO Book_Master
SELECT 1, 'Good Profit', 28 UNION ALL
SELECT 2, 'The Secret', 20 UNION ALL
SELECT 3, 'The One Minute Manager', 9 UNION ALL
SELECT 4, 'The 7 Habits of Highly Effective People', 35 UNION ALL
SELECT null, 'Who Moved My Cheese?', 15 UNION ALL
SELECT null, 'Blink: The Power of Thinking Without Thinking', 40

INSERT INTO Book_Tag
SELECT 1, 1, 'Management' UNION ALL
SELECT 2, 1, 'Profit' UNION ALL
SELECT 3, 2, 'Mind' UNION ALL
SELECT 4, 3, 'Management' UNION ALL
SELECT 5, 3, 'Efficiency' UNION ALL
SELECT 6, 3, 'Success' UNION ALL
SELECT 7, 4, 'Success' UNION ALL
SELECT 8, null, 'Time' UNION ALL
SELECT 9, 6, 'SelfHelp' UNION ALL
SELECT 10, 6, 'Motivation' UNION ALL
SELECT 11, 8, 'Mind'

```

`select * from Book_Master`

```
Book_Id Book_title                                      price
1           Good Profit                                     28
2           The Secret                                      20
3           The One Minute Manager                          9
4           The 7 Habits of Highly Effective People         35
NULL        Who Moved My Cheese?                            15
NULL        Blink: The Power of Thinking Without Thinking   40

```

`select * from Book_Tag`

```
id  Book_Id tag
1   1       Management
2   1       Profit
3   2       Mind
4   3       Management
5   3       Efficiency
6   3       Success
7   4       Success
8   NULL    Time
9   6       SelfHelp
10  6       Motivation
11  8       Mind

```

I dont know why the following is working and also why the result is that.

```
select BT.* from Book_Tag BT
where BT.Book_Id in (select id)

id  Book_Id tag
1   1       Management

```

or this

```
select BT.* from Book_Tag BT
where BT.Book_Id not in (select id)

id  Book_Id tag
2   1       Profit
3   2       Mind
4   3       Management
5   3       Efficiency
6   3       Success
7   4       Success
9   6       SelfHelp
10  6       Motivation
11  8       Mind

```