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
51
CASE WHEN table_type = 'STANDARD' THEN 'table'
52
WHEN table_type = 'FUNCTION' then 'function'
55
CASE WHEN IS_USED_IN_PRIMARY = 'TRUE' THEN 'primary'
56
WHEN IS_INDEXED = 'TRUE' THEN 'indexed'
58
FROM data_dictionary.tables INNER JOIN
59
data_dictionary.columns USING(table_schema, table_name) limit 20;
60
table_schema table_name CASE WHEN table_type = 'STANDARD' THEN 'table'
61
WHEN table_type = 'FUNCTION' then 'function'
62
ELSE 'misc' END column_name CASE WHEN IS_USED_IN_PRIMARY = 'TRUE' THEN 'primary'
63
WHEN IS_INDEXED = 'TRUE' THEN 'indexed'
66
data_dictionary CHARACTER_SETS function CHARACTER_SET_NAME indexed
67
data_dictionary CHARACTER_SETS function DEFAULT_COLLATE_NAME indexed
68
data_dictionary CHARACTER_SETS function DESCRIPTION indexed
69
data_dictionary CHARACTER_SETS function MAXLEN indexed
70
data_dictionary COLLATIONS function CHARACTER_SET_NAME indexed
71
data_dictionary COLLATIONS function COLLATION_NAME indexed
72
data_dictionary COLLATIONS function DESCRIPTION indexed
73
data_dictionary COLLATIONS function ID indexed
74
data_dictionary COLLATIONS function IS_DEFAULT indexed
75
data_dictionary COLLATIONS function IS_COMPILED indexed
76
data_dictionary COLLATIONS function SORTLEN indexed
77
data_dictionary COLUMNS function TABLE_SCHEMA indexed
78
data_dictionary COLUMNS function TABLE_NAME indexed
79
data_dictionary COLUMNS function COLUMN_NAME indexed
80
data_dictionary COLUMNS function COLUMN_TYPE indexed
81
data_dictionary COLUMNS function ORDINAL_POSITION indexed
82
data_dictionary COLUMNS function COLUMN_DEFAULT indexed
83
data_dictionary COLUMNS function COLUMN_DEFAULT_IS_NULL indexed
84
data_dictionary COLUMNS function COLUMN_DEFAULT_UPDATE indexed
85
data_dictionary COLUMNS function IS_NULLABLE indexed
86
select AVG(`col_int_key`) + AVG(`col_int`) AS average1,
87
(SUM(`col_int_key`) + SUM(`col_int`)) / COUNT(*) AS average2,
88
COUNT(*) AS count FROM t1;
89
average1 average2 count
91
select collation_name,character_set_name FROM data_dictionary.collations;
92
collation_name character_set_name
93
utf8_general_ci utf8_general_ci
94
utf8_bin utf8_general_ci
95
utf8_unicode_ci utf8_general_ci
96
utf8_icelandic_ci utf8_general_ci
97
utf8_latvian_ci utf8_general_ci
98
utf8_romanian_ci utf8_general_ci
99
utf8_slovenian_ci utf8_general_ci
100
utf8_polish_ci utf8_general_ci
101
utf8_estonian_ci utf8_general_ci
102
utf8_spanish_ci utf8_general_ci
103
utf8_swedish_ci utf8_general_ci
104
utf8_turkish_ci utf8_general_ci
105
utf8_czech_ci utf8_general_ci
106
utf8_danish_ci utf8_general_ci
107
utf8_lithuanian_ci utf8_general_ci
108
utf8_slovak_ci utf8_general_ci
109
utf8_spanish2_ci utf8_general_ci
110
utf8_roman_ci utf8_general_ci
111
utf8_persian_ci utf8_general_ci
112
utf8_esperanto_ci utf8_general_ci
113
utf8_hungarian_ci utf8_general_ci
114
utf8_sinhala_ci utf8_general_ci
116
select COUNT(*) from data_dictionary.tables;