In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Index: a quick positioning technique that is equivalent to the catalog page of a book. Function: quickly query data conditions: data entries are more than 2000 create index id_index on info (id); / / create general index show index from info\ G / / View index drop index id_index from on info; / / delete index create unique index unique_id_index on info (id); / / create unique index alter table info add primary key (id) / / create a primary key index (the table has been created, no primary key is specified, then modify the table to add the primary key, the primary key index will be created automatically) alter table info change id id int (10) / / delete self-growing alter table info drop primary key;// delete main building alter table info add column age int; / / add column alter table info drop column age int; / / delete column create table infos (descript TEXT,FULLTEXT (descript)); / / create full-text index create index multi_index on info (name,address); / / create multi-column index transaction: a set of operations are performed together or not, and the results are consistent. Characteristics: atomicity, consistency, isolation, persistence. For example: bank transfer name balance condition: balance > 0Zhangsan100/lisi200/
Note: Zhangsan transfers 100 to to lisi
Transaction fixed format:
Begin start
Update bank set money=money+100 where name='lisi'
Update bank set money=money-100 where name='zhangsan'
Commit submission
Rollback rollback
Add: set autocommit = 1; / enable autocommit set autocommit = 0; / disable autocommit savepoint S2; / / define rollback point rollback to savepoint S2; / / rollback to S2 (equivalent to virtual machine restoring snapshot) view: view is a virtual table in the database. Function: the data in a table provides access to users with different permissions, for example: company employee performance salary check form: job name, age, post performance salary, 1Tom50 President / 1 million 2Jerry40 Director 90.2 million 3charry30 Cloud Computing engineer 80.12 million 4Jack24 Cloud Computing engineer 90.15 million Syntax: create view View name AS select statement create view scoreview as select from info where score > 80; / / create View (condition: score > 80) select * from score_view / / View view update score_view set score=88 where id=1; / / id1's score is updated to 88drop view if exists score_view; / / delete view summary: 1. Database index is divided into general index, unique index, primary key index, full-text index, multi-column index; 2. Database indexes can help quickly query the data in the table, but not every field needs to create an index; 3. ACID characteristics of database transactions: atomicity, consistency, isolation, persistence; 4.MySQL transaction commands include begin, rollback, commit, savepoint
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.