1
drop table if exists t1;
2
show variables like 'version';
15
`col_enum` enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
17
`col_char_not_null` char (1) not null,
18
`col_int_not_null_key` int not null,
19
`col_text_not_null` text not null,
20
`col_enum_not_null_key` enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') not null,
22
`col_char_key` char (1),
23
`col_enum_not_null` enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') not null,
24
`col_text_not_null_key` text not null,
25
pk integer auto_increment,
26
`col_bigint_key` bigint,
27
`col_int_not_null` int not null,
28
`col_bigint_not_null` bigint not null,
29
`col_bigint_not_null_key` bigint not null,
30
`col_char_not_null_key` char (1) not null,
32
`col_enum_key` enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
34
key (`col_int_not_null_key` ),
35
key (`col_enum_not_null_key` ),
37
key (`col_char_key` ),
38
key (`col_text_not_null_key` (255)),
40
key (`col_bigint_key` ),
41
key (`col_bigint_not_null_key` ),
42
key (`col_char_not_null_key` ),
43
key (`col_text_key` (255)),
44
key (`col_enum_key` )) ENGINE=innodb;
46
Warning 1071 Specified key was too long; max key length is 767 bytes
47
Warning 1071 Specified key was too long; max key length is 767 bytes
52
# CASE WHEN table_type = 'STANDARD' THEN 'table'
53
# WHEN table_type = 'VIEW' THEN 'view'
54
# WHEN table_type = 'FUNCTION' then 'view'
57
CASE WHEN IS_USED_IN_PRIMARY = 'TRUE' THEN 'primary'
58
# WHEN column_key = 'MUL' THEN 'indexed'
59
# WHEN column_key = 'UNI' THEN 'indexed'
61
FROM data_dictionary.index_parts;
62
table_schema table_name STANDARD column_name CASE WHEN IS_USED_IN_PRIMARY = 'TRUE' THEN 'primary'
63
# WHEN column_key = 'MUL' THEN 'indexed'
64
# WHEN column_key = 'UNI' THEN 'indexed'
67
test t1 STANDARD pk primary
68
test t1 STANDARD col_int_not_null_key indexed
69
test t1 STANDARD col_enum_not_null_key indexed
70
test t1 STANDARD col_int_key indexed
71
test t1 STANDARD col_char_key indexed
72
test t1 STANDARD col_text_not_null_key indexed
73
test t1 STANDARD col_bigint_key indexed
74
test t1 STANDARD col_bigint_not_null_key indexed
75
test t1 STANDARD col_char_not_null_key indexed
76
test t1 STANDARD col_text_key indexed
77
test t1 STANDARD col_enum_key indexed
78
select AVG(`col_int_key`) + AVG(`col_int`) AS average1,
79
(SUM(`col_int_key`) + SUM(`col_int`)) / COUNT(*) AS average2,
80
COUNT(*) AS count FROM t1;
81
average1 average2 count
83
select collation_name,character_set_name FROM data_dictionary.collations;
84
collation_name character_set_name
85
utf8_general_ci utf8_general_ci
86
utf8_bin utf8_general_ci
87
utf8_unicode_ci utf8_general_ci
88
utf8_icelandic_ci utf8_general_ci
89
utf8_latvian_ci utf8_general_ci
90
utf8_romanian_ci utf8_general_ci
91
utf8_slovenian_ci utf8_general_ci
92
utf8_polish_ci utf8_general_ci
93
utf8_estonian_ci utf8_general_ci
94
utf8_spanish_ci utf8_general_ci
95
utf8_swedish_ci utf8_general_ci
96
utf8_turkish_ci utf8_general_ci
97
utf8_czech_ci utf8_general_ci
98
utf8_danish_ci utf8_general_ci
99
utf8_lithuanian_ci utf8_general_ci
100
utf8_slovak_ci utf8_general_ci
101
utf8_spanish2_ci utf8_general_ci
102
utf8_roman_ci utf8_general_ci
103
utf8_persian_ci utf8_general_ci
104
utf8_esperanto_ci utf8_general_ci
105
utf8_hungarian_ci utf8_general_ci
106
utf8_sinhala_ci utf8_general_ci
108
select COUNT(*) from data_dictionary.tables;