?? 2.test
字號:
## Index creation test## OK : Create simple and compound indices for all types and combinationscreate index idx1 on staff (first_name, last_name)\p\gcreate index idx2 on staff (dept)\p\gcreate index idx3 on staff (height, dept)\p\gcreate unique index idx4 on staff (staff_id)\p\gcreate unique index idx5 on staff (first_name, last_name, dept)\p\gcreate unique index idx1 on contact (staff_id)\p\g# ERROR : Create bogus data and post-create indexinsert into users values (1, 'bambi')\p\ginsert into users values (2, 'fred')\p\ginsert into users values (3, 'bill')\p\ginsert into users values (4, 'tom')\p\ginsert into users values (3, 'mike')\p\gcreate unique index idx1 on users (staff_id)\p\gcreate index idx2 on users (uname)\p\gcreate index idx3 on users (uname, staff_id)\p\gcreate index idx1 on pay (staff_id, pay_amount)\p\gcreate unique index idx2 on pay (staff_id, pay_date, pay_amount)\p\gcreate index idx3 on pay (pay_date)\p\gcreate index idx4 on pay (pay_date, pay_time)\p\gdrop index idx1 from users\p\gdrop index idx2 from users\p\gdrop index idx3 from users\p\gdelete from users \p\g# OK : Create valid data and post-create indexinsert into users values (1, 'bambi')\p\ginsert into users values (3, 'bill')\p\ginsert into users values (5, 'mike')\p\ginsert into users values (4, 'tom')\p\ginsert into users values (2, 'fred')\p\gcreate unique index idx1 on users (staff_id)\p\gcreate index idx2 on users (uname)\p\gcreate index idx3 on users (uname, staff_id)\p\gcreate index idx1 on pay (pay_date)\p\gcreate index idx2 on pay (staff_id)\p\gcreate index idx3 on pay (staff_id, pay_date)\p\g# ERROR : index name clash with field and other indexcreate index idx1 on users (uname)\p\gcreate index uname on users (staff_id)\p\g# ERROR : index on text fieldcreate index fail on contact (address)\p\gcreate unique index fail on contact (staff_id, address)\p\g
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -