質問編集履歴
4
ソースコードの誤字訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -55,7 +55,6 @@
|
|
55
55
|
`parent_tweet_id` int not null,
|
56
56
|
`tweet_id` int not null,
|
57
57
|
PRIMARY KEY (`parent_tweet_id`),
|
58
|
-
PRIMARY KEY (`tweet_id`),
|
59
58
|
FOREIGN KEY (`parent_tweet_id`) REFERENCES tweets(`tweet_id`),
|
60
59
|
FOREIGN KEY (`tweet_id`) REFERENCES tweets(`tweet_id`)
|
61
60
|
);
|
3
ソースコードの誤字訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -53,7 +53,7 @@
|
|
53
53
|
|
54
54
|
CREATE TABLE parent_relations(
|
55
55
|
`parent_tweet_id` int not null,
|
56
|
-
`tweet_id` int not null
|
56
|
+
`tweet_id` int not null,
|
57
57
|
PRIMARY KEY (`parent_tweet_id`),
|
58
58
|
PRIMARY KEY (`tweet_id`),
|
59
59
|
FOREIGN KEY (`parent_tweet_id`) REFERENCES tweets(`tweet_id`),
|
2
ソースコードの誤字訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -42,8 +42,7 @@
|
|
42
42
|
`tweet_id` int not null,
|
43
43
|
`user_id` int not null,
|
44
44
|
`content` varchar(1000) not null,
|
45
|
-
PRIMARY KEY (`tweet_id`)
|
45
|
+
PRIMARY KEY (`tweet_id`)
|
46
|
-
FOREIGN KEY (`parent_tweet_id`) REFERENCES tweets(`tweet_id`)
|
47
46
|
);
|
48
47
|
INSERT INTO tweets
|
49
48
|
(`tweet_id`, `user_id`, `content`)
|
1
ソースコードの誤字を訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -31,7 +31,7 @@
|
|
31
31
|
(`tweet_id`, `user_id`, `parent_tweet_id`, `content`)
|
32
32
|
VALUES
|
33
33
|
(1, 1, 0, '元気ですか?'),
|
34
|
-
(
|
34
|
+
(2, 2, 999, '元気です') #999は存在しないのにエラーにならない?
|
35
35
|
;
|
36
36
|
```
|
37
37
|
###考えた処理方法
|
@@ -49,7 +49,7 @@
|
|
49
49
|
(`tweet_id`, `user_id`, `content`)
|
50
50
|
VALUES
|
51
51
|
(1, 1, '元気ですか?'),
|
52
|
-
(
|
52
|
+
(2, 2, '元気です')
|
53
53
|
;
|
54
54
|
|
55
55
|
CREATE TABLE parent_relations(
|
@@ -61,7 +61,7 @@
|
|
61
61
|
FOREIGN KEY (`tweet_id`) REFERENCES tweets(`tweet_id`)
|
62
62
|
);
|
63
63
|
INSERT INTO parent_relations
|
64
|
-
(`parent_tweet_id`, `tweet_id)
|
64
|
+
(`parent_tweet_id`, `tweet_id`)
|
65
65
|
VALUES
|
66
66
|
(999, 2)
|
67
67
|
;
|