-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,54 @@ | ||
INITIALIZATION | ||
CREATE TABLE insert_table(id int, t_name char, col1 int, col2 int); | ||
CREATE TABLE INSERT_TABLE(ID INT, T_NAME CHAR, COL1 INT, COL2 INT); | ||
SUCCESS | ||
CREATE TABLE INSERT_TABLE2(ID INT, T_NAME CHAR(6), COL1 INT, COL2 INT); | ||
SUCCESS | ||
|
||
1. INSERT | ||
INSERT INTO insert_table VALUES (1,'N1',1,1); | ||
INSERT INTO INSERT_TABLE VALUES (1,'N1',1,1); | ||
SUCCESS | ||
INSERT INTO INSERT_TABLE VALUES (1,'N123',1,1); | ||
SUCCESS | ||
INSERT INTO INSERT_TABLE VALUES (2,'N123',1,1),(3,'N32',2,1); | ||
SUCCESS | ||
|
||
INSERT INTO INSERT_TABLE2 VALUES (1,'N1',1,1); | ||
SUCCESS | ||
INSERT INTO INSERT_TABLE2 VALUES (1,'N123',1,1); | ||
SUCCESS | ||
INSERT INTO insert_table VALUES (2,'N2',1,1),(3,'N3',2,1); | ||
INSERT INTO INSERT_TABLE2 VALUES (2,'N1233',1,1),(3,'N3211',2,1); | ||
SUCCESS | ||
INSERT INTO INSERT_TABLE2 VALUES (4,'','',''); | ||
SUCCESS | ||
|
||
2. ERROR | ||
INSERT INTO insert_table VALUES (4,'N4',1,1),(1,1,1); | ||
INSERT INTO INSERT_TABLE VALUES (5,'N4',1,1),(1,1,1); | ||
FAILURE | ||
INSERT INTO INSERT_TABLE VALUES (5,'N4',1,1),(1,1,1,1,1); | ||
FAILURE | ||
INSERT INTO insert_table VALUES (4,'N4',1,1),(1,1,1,1,1); | ||
INSERT INTO INSERT_TABLE VALUES (5,'12345',1,1); | ||
FAILURE | ||
|
||
INSERT INTO INSERT_TABLE2 VALUES (5,'N412',1,1),(1,1,1); | ||
FAILURE | ||
INSERT INTO INSERT_TABLE2 VALUES (5,'N41',1,1),(1,1,1,1,1); | ||
FAILURE | ||
INSERT INTO INSERT_TABLE2 VALUES (5,'1234567',1,1); | ||
FAILURE | ||
INSERT INTO INSERT_TABLE2 VALUES (5,'12345678910',1,1); | ||
FAILURE | ||
|
||
3. SELECT | ||
SELECT * FROM insert_table; | ||
SELECT * FROM INSERT_TABLE; | ||
1 | N1 | 1 | 1 | ||
1 | N123 | 1 | 1 | ||
2 | N123 | 1 | 1 | ||
3 | N32 | 2 | 1 | ||
ID | T_NAME | COL1 | COL2 | ||
SELECT * FROM INSERT_TABLE2; | ||
1 | N1 | 1 | 1 | ||
2 | N2 | 1 | 1 | ||
3 | N3 | 2 | 1 | ||
1 | N123 | 1 | 1 | ||
2 | N1233 | 1 | 1 | ||
3 | N3211 | 2 | 1 | ||
4 | | 0 | 0 | ||
ID | T_NAME | COL1 | COL2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
-- echo initialization | ||
CREATE TABLE insert_table(id int, t_name char, col1 int, col2 int); | ||
CREATE TABLE insert_table2(id int, t_name char(6), col1 int, col2 int); | ||
|
||
-- echo 1. insert | ||
INSERT INTO insert_table VALUES (1,'N1',1,1); | ||
INSERT INTO insert_table VALUES (2,'N2',1,1),(3,'N3',2,1); | ||
INSERT INTO insert_table VALUES (1,'N123',1,1); | ||
INSERT INTO insert_table VALUES (2,'N123',1,1),(3,'N32',2,1); | ||
|
||
INSERT INTO insert_table2 VALUES (1,'N1',1,1); | ||
INSERT INTO insert_table2 VALUES (1,'N123',1,1); | ||
INSERT INTO insert_table2 VALUES (2,'N1233',1,1),(3,'N3211',2,1); | ||
INSERT INTO insert_table2 VALUES (4,'','',''); | ||
|
||
-- echo 2. error | ||
INSERT INTO insert_table VALUES (4,'N4',1,1),(1,1,1); | ||
INSERT INTO insert_table VALUES (4,'N4',1,1),(1,1,1,1,1); | ||
INSERT INTO insert_table VALUES (5,'N4',1,1),(1,1,1); | ||
INSERT INTO insert_table VALUES (5,'N4',1,1),(1,1,1,1,1); | ||
INSERT INTO insert_table VALUES (5,'12345',1,1); | ||
|
||
INSERT INTO insert_table2 VALUES (5,'N412',1,1),(1,1,1); | ||
INSERT INTO insert_table2 VALUES (5,'N41',1,1),(1,1,1,1,1); | ||
INSERT INTO insert_table2 VALUES (5,'1234567',1,1); | ||
INSERT INTO insert_table2 VALUES (5,'12345678910',1,1); | ||
|
||
-- echo 3. select | ||
-- sort SELECT * FROM insert_table; | ||
-- sort SELECT * FROM insert_table2; |