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
select SQL_BIG_RESULT table_schema,
48
CASE WHEN table_type = 'STANDARD' THEN 'table'
49
WHEN table_type = 'FUNCTION' then 'function'
52
CASE WHEN IS_USED_IN_PRIMARY = 'YES' THEN 'primary'
53
WHEN IS_INDEXED = 'YES' THEN 'indexed'
55
FROM data_dictionary.tables INNER JOIN
56
data_dictionary.columns USING(table_schema, table_name) ORDER BY table_schema, table_name limit 20;
57
table_schema table_name CASE WHEN table_type = 'STANDARD' THEN 'table'
58
WHEN table_type = 'FUNCTION' then 'function'
59
ELSE 'misc' END column_name CASE WHEN IS_USED_IN_PRIMARY = 'YES' THEN 'primary'
60
WHEN IS_INDEXED = 'YES' THEN 'indexed'
63
DATA_DICTIONARY CATALOGS misc CATALOG_NAME indexed
64
DATA_DICTIONARY CATALOGS misc CATALOG_CREATION_TIME indexed
65
DATA_DICTIONARY CATALOGS misc CATALOG_UPDATE_TIME indexed
66
DATA_DICTIONARY CATALOGS misc CATALOG_UUID indexed
67
DATA_DICTIONARY CATALOGS misc CATALOG_VERSION indexed
68
DATA_DICTIONARY CATALOG_CACHE misc CATALOG_NAME indexed
69
DATA_DICTIONARY CHARACTER_SETS misc CHARACTER_SET_NAME indexed
70
DATA_DICTIONARY CHARACTER_SETS misc DEFAULT_COLLATE_NAME indexed
71
DATA_DICTIONARY CHARACTER_SETS misc DESCRIPTION indexed
72
DATA_DICTIONARY CHARACTER_SETS misc MAXLEN indexed
73
DATA_DICTIONARY COLLATIONS misc CHARACTER_SET_NAME indexed
74
DATA_DICTIONARY COLLATIONS misc COLLATION_NAME indexed
75
DATA_DICTIONARY COLLATIONS misc DESCRIPTION indexed
76
DATA_DICTIONARY COLLATIONS misc ID indexed
77
DATA_DICTIONARY COLLATIONS misc IS_DEFAULT indexed
78
DATA_DICTIONARY COLLATIONS misc IS_COMPILED indexed
79
DATA_DICTIONARY COLLATIONS misc SORTLEN indexed
80
DATA_DICTIONARY COLUMNS misc TABLE_SCHEMA indexed
81
DATA_DICTIONARY COLUMNS misc TABLE_NAME indexed
82
DATA_DICTIONARY COLUMNS misc COLUMN_NAME indexed
84
CREATE SCHEMA randgen_query_test;
85
USE randgen_query_test;
86
CREATE TABLE t1 (a INT);
87
CREATE TABLE t2 LIKE t1;
88
CREATE TABLE t3 LIKE t1;
89
CREATE TABLE t4 (b CHAR(500));
90
CREATE TABLE t5 LIKE t4;
91
select SQL_BIG_RESULT table_schema,
93
CASE WHEN table_type = 'STANDARD' THEN 'table'
94
WHEN table_type = 'FUNCTION' then 'function'
97
CASE WHEN IS_USED_IN_PRIMARY = 'YES' THEN 'primary'
98
WHEN IS_INDEXED = 'YES' THEN 'indexed'
100
FROM data_dictionary.tables INNER JOIN
101
data_dictionary.columns USING(table_schema, table_name) WHERE table_schema NOT IN ('DATA_DICTIONARY','INFORMATION_SCHEMA')
102
ORDER BY table_schema, table_name limit 20;
103
table_schema table_name CASE WHEN table_type = 'STANDARD' THEN 'table'
104
WHEN table_type = 'FUNCTION' then 'function'
105
ELSE 'misc' END column_name CASE WHEN IS_USED_IN_PRIMARY = 'YES' THEN 'primary'
106
WHEN IS_INDEXED = 'YES' THEN 'indexed'
109
randgen_query_test t1 misc a indexed
110
randgen_query_test t2 misc a indexed
111
randgen_query_test t3 misc a indexed
112
randgen_query_test t4 misc b indexed
113
randgen_query_test t5 misc b indexed
114
test t1 misc col_bigint indexed
115
test t1 misc col_text indexed
116
test t1 misc col_char indexed
117
test t1 misc col_enum indexed
118
test t1 misc col_int indexed
119
test t1 misc col_char_not_null indexed
120
test t1 misc col_int_not_null_key indexed
121
test t1 misc col_text_not_null indexed
122
test t1 misc col_enum_not_null_key indexed
123
test t1 misc col_int_key indexed
124
test t1 misc col_char_key indexed
125
test t1 misc col_enum_not_null indexed
126
test t1 misc col_text_not_null_key indexed
127
test t1 misc pk primary
128
test t1 misc col_bigint_key indexed
130
DROP SCHEMA randgen_query_test;
132
select AVG(`col_int_key`) + AVG(`col_int`) AS average1,
133
(SUM(`col_int_key`) + SUM(`col_int`)) / COUNT(*) AS average2,
134
COUNT(*) AS count FROM t1;
135
average1 average2 count
137
select collation_name,character_set_name FROM data_dictionary.collations;
138
collation_name character_set_name
140
utf8_bin utf8_general_ci
141
utf8_czech_ci utf8_general_ci
142
utf8_danish_ci utf8_general_ci
143
utf8_esperanto_ci utf8_general_ci
144
utf8_estonian_ci utf8_general_ci
145
utf8_general_ci utf8_general_ci
146
utf8_hungarian_ci utf8_general_ci
147
utf8_icelandic_ci utf8_general_ci
148
utf8_latvian_ci utf8_general_ci
149
utf8_lithuanian_ci utf8_general_ci
150
utf8_persian_ci utf8_general_ci
151
utf8_polish_ci utf8_general_ci
152
utf8_roman_ci utf8_general_ci
153
utf8_romanian_ci utf8_general_ci
154
utf8_sinhala_ci utf8_general_ci
155
utf8_slovak_ci utf8_general_ci
156
utf8_slovenian_ci utf8_general_ci
157
utf8_spanish2_ci utf8_general_ci
158
utf8_spanish_ci utf8_general_ci
159
utf8_swedish_ci utf8_general_ci
160
utf8_turkish_ci utf8_general_ci
161
utf8_unicode_ci utf8_general_ci
162
select COUNT(*) from data_dictionary.tables;