質問編集履歴
4
半角を全角になおした
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
すでに一つテーブルは作成しており、新たに作成したmst_usersテーブルにINSERTさせたいです。
|
15
15
|
|
16
16
|
MYSQL
|
17
|
-
|
17
|
+
```
|
18
18
|
create table todos2 (
|
19
19
|
id int not null auto_increment
|
20
20
|
is_done bool default false,
|
@@ -42,5 +42,5 @@
|
|
42
42
|
|
43
43
|
select * from todos2;
|
44
44
|
select * from mst_users;
|
45
|
-
|
45
|
+
```
|
46
46
|
|
3
半角に変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -15,32 +15,32 @@
|
|
15
15
|
|
16
16
|
MYSQL
|
17
17
|
```
|
18
|
-
|
18
|
+
create table todos2 (
|
19
|
-
id
|
19
|
+
id int not null auto_increment
|
20
|
-
is_done
|
20
|
+
is_done bool default false,
|
21
|
-
title
|
21
|
+
title text,
|
22
|
-
createnow
|
22
|
+
createnow datetime,
|
23
|
-
|
23
|
+
primary key (id)
|
24
24
|
);
|
25
25
|
|
26
|
-
|
26
|
+
create table mst_users (
|
27
|
-
user_id
|
27
|
+
user_id int not null,
|
28
|
-
password
|
28
|
+
password varchar(8) not null,
|
29
|
-
user_name
|
29
|
+
user_name varchar(16) not null,
|
30
|
-
login_kbn
|
30
|
+
login_kbn int not null,
|
31
|
-
|
31
|
+
primary key (user_id)
|
32
32
|
);
|
33
33
|
|
34
|
-
|
34
|
+
insert into todos2 (title) values ('aaa');
|
35
|
-
|
35
|
+
insert into todos2 (title, is_done) values ('bbb', true);
|
36
|
-
|
36
|
+
insert into todos2 (title) values ('ccc');
|
37
|
-
|
37
|
+
insert into todos2 (createnow) values (current_time);
|
38
|
-
|
38
|
+
insert into todos2 (title,is_done,createnow) values ('eee',true,current_time);
|
39
39
|
|
40
|
-
|
40
|
+
insert into mst_users (user_id,password,user_name,login_kbn) values (99999,'tanaka','田中太郎', 0);
|
41
|
-
|
41
|
+
insert into mst_users (user_id,password,user_name,login_kbn) values (11111,'yamada','山田花子',1);
|
42
42
|
|
43
|
-
|
43
|
+
select * from todos2;
|
44
|
-
|
44
|
+
select * from mst_users;
|
45
45
|
```
|
46
46
|
|
2
コードの編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,6 +13,8 @@
|
|
13
13
|
|
14
14
|
すでに一つテーブルは作成しており、新たに作成したmst_usersテーブルにINSERTさせたいです。
|
15
15
|
|
16
|
+
MYSQL
|
17
|
+
```
|
16
18
|
CREATE TABLE todos2 (
|
17
19
|
id INT NOT NULL AUTO_INCREMENT,
|
18
20
|
is_done BOOL DEFAULT false,
|
@@ -37,3 +39,8 @@
|
|
37
39
|
|
38
40
|
INSERT INTO mst_users (user_id,password,user_name,login_kbn) VALUES (99999,'tanaka','田中太郎', 0);
|
39
41
|
INSERT INTO mst_users (user_id,password,user_name,login_kbn) VALUES (11111,'yamada','山田花子',1);
|
42
|
+
|
43
|
+
SELECT * FROM todos2;
|
44
|
+
SELECT * FROM mst_users;
|
45
|
+
```
|
46
|
+
|
1
画像ではなくテキストで入力した
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,4 +12,28 @@
|
|
12
12
|
初心者のためわかりやすくご指導いただきたいです。よろしくお願いいたします。
|
13
13
|
|
14
14
|
すでに一つテーブルは作成しており、新たに作成したmst_usersテーブルにINSERTさせたいです。
|
15
|
+
|
16
|
+
CREATE TABLE todos2 (
|
17
|
+
id INT NOT NULL AUTO_INCREMENT,
|
18
|
+
is_done BOOL DEFAULT false,
|
19
|
+
title TEXT,
|
20
|
+
createnow DATETIME,
|
21
|
+
PRIMARY KEY (id)
|
22
|
+
);
|
23
|
+
|
24
|
+
CREATE TABLE mst_users (
|
25
|
+
user_id INT NOT NULL,
|
26
|
+
password VARCHAR(8) NOT NULL,
|
27
|
+
user_name VARCHAR(16) NOT NULL,
|
28
|
+
login_kbn INT NOT NULL,
|
29
|
+
PRIMARY KEY (user_id)
|
30
|
+
);
|
31
|
+
|
32
|
+
INSERT INTO todos2 (title) VALUES ('aaa');
|
33
|
+
INSERT INTO todos2 (title, is_done) VALUES ('bbb', true);
|
34
|
+
INSERT INTO todos2 (title) VALUES ('ccc');
|
35
|
+
INSERT INTO todos2 (createnow) VALUES (CURRENT_TIME);
|
36
|
+
INSERT INTO todos2 (title,is_done,createnow) VALUES ('eee',true,CURRENT_TIME);
|
37
|
+
|
38
|
+
INSERT INTO mst_users (user_id,password,user_name,login_kbn) VALUES (99999,'tanaka','田中太郎', 0);
|
15
|
-
|
39
|
+
INSERT INTO mst_users (user_id,password,user_name,login_kbn) VALUES (11111,'yamada','山田花子',1);
|