Read "MySQL must know will be," What have I learned?

Foreword

Recently found himself some basic SQL weak, then Sounds almost MYSQL keyword query, pointing to expect some high praise answer at the time of writing projects, and thus be found

https://www.zhihu.com/question/34840297/answer/272185020 recommended reading list of the man, according to his proposal first have read "MYSQL will surely must know" this book, talking about the whole very basic, a total of 253 pages is not much for weak foundation of the students were eating. Then step by step, deeper reading books self-improvement. The following describes some of the key elements of his own record in the process of reading, for everyone to share. PDF books can get to know almost in the link above, or click http://www.notedeep.com/note/38/page/282 go to my brother's depth notes download.

Reading experience

SQL statements and case

SQL statements are not case sensitive, and in the Windows environment, after the 4.1.1 version (now commonly used are 5.6 / 5.7 / 8.0 +), MYSQL table names, field names is not case-sensitive, so we named when the proposed use of a single word _ a single word in the form of names, such as: mysql_crash_course user_role

Here Ali attach code specifications of a mandatory requirement:

[Mandatory] table names, field names must be lowercase letters or numbers, start with a number banned, prohibited only the middle two numbers appear underlined. Modify the cost of a large database field names, because they can not carry out a pre-release, so the field names need to be carefully considered.
Description: MySQL is not case sensitive in Windows, but by default in Linux is case sensitive. Therefore, the database names, table names, field names, do not allow any uppercase letter, to avoid any further complications.

You can not partially use DISTINCT

  • DISTINCT keyword is applied to all columns, not just its front row. If given SELECT DISTINCT vend_id, prod_price, unless specified two columns are different, otherwise all the rows are retrieved.
  • DISTINCT will not return to its back with all the fields are the same column. That is, any field in a SELECT query of two lines of the same will be de-emphasis. DISTINCT can not parentheses () to re-like manner to a single field.

For example, there is such a demand for the project:

Paged queries tied to certain charges houses, because housing is a list of queries, we default to the same house ID occurs only once, the SQL error as follows:

Property listing

1573986248201

Fees table

1573986284763

SELECT DISTINCT h.id, h.num, s.name 
FROM house h 
LEFT JOIN standard s 
ON h.id = s.room_id 
WHERE s.name = '物业费' OR s.name = '暖气费';

This statement does not return the desired results, that is, each house only once, because of different charges is not the same name, DISTINCT can not go heavy on the part of the query. We can see the room number is 1-001 record appears twice.

1573986349142

But in fact, as described here, I need only query information homes, homes for the query result is the same record information is certainly exactly the same, and therefore meet the requirements of DISTINCT in my business. And there are other business needs time for this keyword, please use caution, remember not to use the keyword section

Case and sort order

When the text of the sort the data, A and a the same right? B is located located before a Z after?

Field can be specified when creating character sets, generally used utf8mb4, this case can select the appropriate collation.

  1. utf8mb4_general_ci ci i.e., case-insensitive, ignore case when sorting, regarded as the same as A a
  2. utf8mb4_bin / cs i.e. case sensitive tape, corresponding ascending order, then, A ~ Z first, small after a ~ z
    corresponding, after setting case sensitive, query where cs = 'a' can find this field is a table of the 'a row. Not sensitive, i.e. ci, A, a query may be out.

BETWEEN keyword Precautions

When the query interval, our primary concern should not be able to be matched to within range, because that's for sure. The zone boundaries can be matched what we should pay attention to the knowledge, when BETWEEN AND keyword matching interval contains about boundary conditions . The following SQL execution results are as follows:

SELECT prod_name, prod_price 
FROM products p
WHERE p.`prod_price` BETWEEN 5.99 AND 10

1573990863960

NULL does not match

By selecting filtration in a row does not have a specific value, you might want to return rows with NULL values. But, no. Common errors occur on is_xxx field, I always have this problems,

1573991122233

For is_delete field, I think it is null or 0 is not deleted houses, so when I use

SELECT * FROM house WHERE is_delete = '0';

After recommended; query undeleted house, my house can only be found with id 3, which is obviously my expectations are inconsistent, the solution is back where plus or is_delete is null, or the column default value of 0 to is_delete By.

Here attach a manual Ali codes mandatory items:

Forced expression of [] is the concept of whether or not the field name must is_xxx manner, the data type is unsigned tinyint (1 is represented, 0 for No). Note: If any of the fields non-negative, must be unsigned.

Explain: tinyint corresponds to the Java byte, in the range -128 to 127, used to express whether sufficient length may be used to represent the person's age. Denotes unsigned and unsigned, to determine the field of non-negative, the unsigned range may be doubled.

Calculation order of AND and OR

For example: If you need All products listed price of $ 10 (or more) and is made from 1002 or 1003. The following SELECT statement using a combination of AND and OR operators in a WHERE clause established:

SELECT *
FROM products
WHERE vend_id = 1002 OR vend_id = 1003 AND prod_price >= 10;

Query results are as follows:

1573991836719

I have been marked with a red frame line very clearly not what we need in the line, why is this so? The reason is that the order computing. SQL (like most languages) OR operator prior to treatment, priority AND operator. When the SQL WHERE clause see above, it is understood to be any price suppliers manufacture 1003 it was $ 10 (or more) of the product, or any product manufactured by the vendor 1002, regardless of its price. In other words, since the higher priority in the AND calculation order, the operator is erroneously combined. The solution is to add (); correct SQL as follows:

SELECT *
FROM products
WHERE (vend_id = 1002 OR vend_id = 1003) AND prod_price >= 10;

Has recommended a WHERE clause AND and OR operators, use parentheses should explicitly grouping operator at any time. Do not over-rely on the default evaluation order, even if it really is what you want as well. Use parentheses to no harm, it can eliminate ambiguity.

UNION query combination

  • Using UNION, a plurality of SELECT statements can be given, the result of a combination thereof into a single result set.
  • The UNION each query must contain the same column, expression, or aggregate functions.
  • When using UNION, duplicate rows are automatically canceled. This is the default behavior UNION, but if you need to, you can change it. In fact, if you want to return all matching rows, use UNION ALL instead of UNION.
  • When a query using UNION, only use a ORDER BY clause, it must appear after the final SELECT statement

Always use an INSERT statement lists columns

Generally do not use not explicitly given list of columns of an INSERT statement. Use a column list SQL code can continue to function, even if the table structure has changed. There may be due to the actual development needs of business, to modify table structure, add / delete a column. Then if the SQL statement used in the code is no clear list of insert statements will throw an error. Of course, we generally use reverse engineering generated insertSelective (POJO) does not have this problem, because it corresponds to the generated SQL will generate a list of columns for us.

Be careful to use update and delete statements

MySQL is no Undo button, so when using UPDATE / DELETE must add WHERE conditions , and before performing the update / delete operations to be SELECT operation , open affairs. Check the impact of the implementation at the end of the same number of rows and number of rows SELECT query out before COMMIT;

In addition, the use of ALTER TABLE to be extremely careful, you should do during a full backup (backup schema and data) before the changes. Change the database table can not be revoked, if the increase in unwanted columns may not be able to remove them. Similarly, if you delete a column should not be deleted, you may lose all data in that column.

Rules and limitations views

  • Like tables, views must be uniquely named (or can not take another view of the same name to the list view).
  • There is no limit to the number of views can be created.
  • To create a view, you must have sufficient access rights. These limits are usually granted by the database administrator.
  • View can be nested, i.e., may be utilized to retrieve data from other views to construct a query view.
  • ORDER BY can be used in the view, but if also contains ORDER BY SELECT retrieves data from the view, then the view ORDER BY will be overwritten.
  • View can not be indexed, you can not have triggers or default values ​​associated with it.
  • It can be used with the table view. For example, write a SELECT statement link tables and views.

Where the view can not index it to be extra careful, encountered such a view in my development process: a few good links using UNION table query, the results of the query using the WHERE condition filtered, although here for the tables being joined after WHERE conditions for the establishment of index fields, but the use of temporary tables linked UNION generate views and can not have indexes. Therefore, the efficiency of the query will be very slow! It is proposed in the UNION query WHERE condition on each SELECT statement.

Some suggestions to improve performance

  • First, MySQL (like all DBMS) has specific hardware recommendations. In learning and research MySQL, using any old computer as a server can be. However,
    the server used in production, the hardware should adhere to follow these recommendations.

  • In general, the key production DBMS should run on its own dedicated server.

  • MySQL is a series of pre-configured default settings, starting with these settings are usually good. But after some time you may need to adjust memory allocation, buffer size. (See currently set, use SHOW VARIABLES; and showStatus;)

  • MySQL a multi-user multi-threaded DBMS, in other words, it is often perform multiple tasks simultaneously. If one of the slow implementation of these tasks, all requests will execute
    the line slowly. If you experience significant performance poor, you can use SHOW PROCESSLIST Show all active processes (and their thread ID and execution time). You can also use the KILL command to end a particular process (need to use this command to log in as an administrator).

  • There are always written in the same SELECT statement is more than one way. We should test links, and sub-query to find out the best way.

  • Use EXPLAIN statement MySQL to explain how it will execute a SELECT statement.

  • Generally, a stored procedure performed faster than the one in which the pieces MySQL statement. However, the storage and expansion process generally difficult to debug, and no transplant, which thus forcibly prohibited Ali codes stored procedure statute

  • You should always use the correct data type.

  • Never retrieve the data even more than demand. In other words, do not use SELECT * (unless you really need each column).

  • Some operations (including INSERT) supports an optional DELAYED keyword, if you use it, will return control to the caller immediately, and once it is possible to actually perform the operation.

    Delay is inserted, and when the query is inserted concurrently, the insertion is placed in a waiting queue. All queries execution until after completion of the insertion. MYSQL and returned directly to the client state information, also both the INSERT statement in the queue after receiving the interrupt request

  • When importing data, it should be closed automatically committed. You may also want to delete the index (including FULLTEXT index), and then rebuild them after the import is complete.

  • Must index the database table to improve the performance of data retrieval. What determines the index is not a trivial task, requiring analysis of the SELECT statement used to find duplicate WHERE and ORDER BY clauses. If a simple WHERE clause to return the results take too long, it can be concluded that the column (or several columns) is subject to index used therein.

  • Your SELECT statement with a series of complex conditions OR you? By using multiple SELECT statements and connects them UNION statement, you can see significant performance improvements.

  • The index to improve performance of data retrieval, but the damage data insert, delete and update performance. If you have some tables, they often are not searched to collect data, do not index them before it is necessary. (Indexes can add and delete.)

  • LIKE very slow. In general, it is best to use FULLTEXT rather than LIKE. But MYSQL FULLTEXT Chinese characters is not friendly, if you need to use the full-text index, it is recommended to use a search engine ES, I can refer to another blog: https://www.cnblogs.com/keatsCoder/p/11341835.html

  • The database is constantly changing entity. A good set of optimized table after a while probably unrecognizable. Since the change and use the table of contents, the ideal optimization and configuration will change.

  • The most important rule is that each rule under certain conditions will be broken.

The actual development process, we need based on business needs, to open slow query log, then for slow SQL, constantly EXPLAIN and modify SQL and indexes in order to achieve ref level, reaching at least level range. This requires a strong internal strength and support not always be solved by Baidu, you want to read this article and I keep practicing. Come on!

Commonly used functions

Text handling functions

1573992432663

The date and time handling functions

1573992462010

Numerical handler

1573992518509

Aggregate function

1573992537792

  • Although MAX () is generally used to find the maximum value or date value, but allows it to MySQL returns the maximum value in any column, including the text column returns the maximum value. When text data, if the data is sorted according to the corresponding column, the MAX () Returns the last row. MIN () function is similar to
  • MAX () functions ignore row column value is NULL. Similar MIN () function, SUM () is

appendix

Due to the number in the accompanying attachment content (ie the construction of the table statement to insert data into statements) required to access the external network, in order to facilitate use. Here I have downloaded this blog attached to the inside. If you do not need these statements, you can browse through the directory jump directly to the right of the page to the next chapter

Construction of the table statement

########################################
# MySQL Crash Course MYSQL必知必会建表语句
# http://www.forta.com/books/0672327120/
# 提供者博客园:后青春期的Keats 复制请注明出处
########################################


########################
# Create customers table
########################
CREATE TABLE customers
(
  cust_id      int       NOT NULL AUTO_INCREMENT,
  cust_name    char(50)  NOT NULL ,
  cust_address char(50)  NULL ,
  cust_city    char(50)  NULL ,
  cust_state   char(5)   NULL ,
  cust_zip     char(10)  NULL ,
  cust_country char(50)  NULL ,
  cust_contact char(50)  NULL ,
  cust_email   char(255) NULL ,
  PRIMARY KEY (cust_id)
) ENGINE=InnoDB;

#########################
# Create orderitems table
#########################
CREATE TABLE orderitems
(
  order_num  int          NOT NULL ,
  order_item int          NOT NULL ,
  prod_id    char(10)     NOT NULL ,
  quantity   int          NOT NULL ,
  item_price decimal(8,2) NOT NULL ,
  PRIMARY KEY (order_num, order_item)
) ENGINE=InnoDB;


#####################
# Create orders table
#####################
CREATE TABLE orders
(
  order_num  int      NOT NULL AUTO_INCREMENT,
  order_date datetime NOT NULL ,
  cust_id    int      NOT NULL ,
  PRIMARY KEY (order_num)
) ENGINE=InnoDB;

#######################
# Create products table
#######################
CREATE TABLE products
(
  prod_id    char(10)      NOT NULL,
  vend_id    int           NOT NULL ,
  prod_name  char(255)     NOT NULL ,
  prod_price decimal(8,2)  NOT NULL ,
  prod_desc  text          NULL ,
  PRIMARY KEY(prod_id)
) ENGINE=InnoDB;

######################
# Create vendors table
######################
CREATE TABLE vendors
(
  vend_id      int      NOT NULL AUTO_INCREMENT,
  vend_name    char(50) NOT NULL ,
  vend_address char(50) NULL ,
  vend_city    char(50) NULL ,
  vend_state   char(5)  NULL ,
  vend_zip     char(10) NULL ,
  vend_country char(50) NULL ,
  PRIMARY KEY (vend_id)
) ENGINE=InnoDB;

###########################
# Create productnotes table
###########################
CREATE TABLE productnotes
(
  note_id    int           NOT NULL AUTO_INCREMENT,
  prod_id    char(10)      NOT NULL,
  note_date datetime       NOT NULL,
  note_text  text          NULL ,
  PRIMARY KEY(note_id),
  FULLTEXT(note_text)
) ENGINE=MyISAM;


#####################
# Define foreign keys
#####################
ALTER TABLE orderitems ADD CONSTRAINT fk_orderitems_orders FOREIGN KEY (order_num) REFERENCES orders (order_num);
ALTER TABLE orderitems ADD CONSTRAINT fk_orderitems_products FOREIGN KEY (prod_id) REFERENCES products (prod_id);
ALTER TABLE orders ADD CONSTRAINT fk_orders_customers FOREIGN KEY (cust_id) REFERENCES customers (cust_id);
ALTER TABLE products ADD CONSTRAINT fk_products_vendors FOREIGN KEY (vend_id) REFERENCES vendors (vend_id);

Data Statement

########################################
# MySQL Crash Course MYSQL必知必会数据语句
# http://www.forta.com/books/0672327120/
# 提供者博客园:后青春期的Keats 复制请注明出处
########################################


##########################
# Populate customers table
##########################
INSERT INTO customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email)
VALUES(10001, 'Coyote Inc.', '200 Maple Lane', 'Detroit', 'MI', '44444', 'USA', 'Y Lee', '[email protected]');
INSERT INTO customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact)
VALUES(10002, 'Mouse House', '333 Fromage Lane', 'Columbus', 'OH', '43333', 'USA', 'Jerry Mouse');
INSERT INTO customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email)
VALUES(10003, 'Wascals', '1 Sunny Place', 'Muncie', 'IN', '42222', 'USA', 'Jim Jones', '[email protected]');
INSERT INTO customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email)
VALUES(10004, 'Yosemite Place', '829 Riverside Drive', 'Phoenix', 'AZ', '88888', 'USA', 'Y Sam', '[email protected]');
INSERT INTO customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact)
VALUES(10005, 'E Fudd', '4545 53rd Street', 'Chicago', 'IL', '54545', 'USA', 'E Fudd');


########################
# Populate vendors table
########################
INSERT INTO vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
VALUES(1001,'Anvils R Us','123 Main Street','Southfield','MI','48075', 'USA');
INSERT INTO vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
VALUES(1002,'LT Supplies','500 Park Street','Anytown','OH','44333', 'USA');
INSERT INTO vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
VALUES(1003,'ACME','555 High Street','Los Angeles','CA','90046', 'USA');
INSERT INTO vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
VALUES(1004,'Furball Inc.','1000 5th Avenue','New York','NY','11111', 'USA');
INSERT INTO vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
VALUES(1005,'Jet Set','42 Galaxy Road','London', NULL,'N16 6PS', 'England');
INSERT INTO vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
VALUES(1006,'Jouets Et Ours','1 Rue Amusement','Paris', NULL,'45678', 'France');


#########################
# Populate products table
#########################
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('ANV01', 1001, '.5 ton anvil', 5.99, '.5 ton anvil, black, complete with handy hook');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('ANV02', 1001, '1 ton anvil', 9.99, '1 ton anvil, black, complete with handy hook and carrying case');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('ANV03', 1001, '2 ton anvil', 14.99, '2 ton anvil, black, complete with handy hook and carrying case');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('OL1', 1002, 'Oil can', 8.99, 'Oil can, red');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('FU1', 1002, 'Fuses', 3.42, '1 dozen, extra long');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('SLING', 1003, 'Sling', 4.49, 'Sling, one size fits all');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('TNT1', 1003, 'TNT (1 stick)', 2.50, 'TNT, red, single stick');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('TNT2', 1003, 'TNT (5 sticks)', 10, 'TNT, red, pack of 10 sticks');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('FB', 1003, 'Bird seed', 10, 'Large bag (suitable for road runners)');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('FC', 1003, 'Carrots', 2.50, 'Carrots (rabbit hunting season only)');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('SAFE', 1003, 'Safe', 50, 'Safe with combination lock');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('DTNTR', 1003, 'Detonator', 13, 'Detonator (plunger powered), fuses not included');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('JP1000', 1005, 'JetPack 1000', 35, 'JetPack 1000, intended for single use');
INSERT INTO products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('JP2000', 1005, 'JetPack 2000', 55, 'JetPack 2000, multi-use');



#######################
# Populate orders table
#######################
INSERT INTO orders(order_num, order_date, cust_id)
VALUES(20005, '2005-09-01', 10001);
INSERT INTO orders(order_num, order_date, cust_id)
VALUES(20006, '2005-09-12', 10003);
INSERT INTO orders(order_num, order_date, cust_id)
VALUES(20007, '2005-09-30', 10004);
INSERT INTO orders(order_num, order_date, cust_id)
VALUES(20008, '2005-10-03', 10005);
INSERT INTO orders(order_num, order_date, cust_id)
VALUES(20009, '2005-10-08', 10001);


###########################
# Populate orderitems table
###########################
INSERT INTO orderitems(order_num, order_item, prod_id, quantity, item_price)
VALUES(20005, 1, 'ANV01', 10, 5.99);
INSERT INTO orderitems(order_num, order_item, prod_id, quantity, item_price)
VALUES(20005, 2, 'ANV02', 3, 9.99);
INSERT INTO orderitems(order_num, order_item, prod_id, quantity, item_price)
VALUES(20005, 3, 'TNT2', 5, 10);
INSERT INTO orderitems(order_num, order_item, prod_id, quantity, item_price)
VALUES(20005, 4, 'FB', 1, 10);
INSERT INTO orderitems(order_num, order_item, prod_id, quantity, item_price)
VALUES(20006, 1, 'JP2000', 1, 55);
INSERT INTO orderitems(order_num, order_item, prod_id, quantity, item_price)
VALUES(20007, 1, 'TNT2', 100, 10);
INSERT INTO orderitems(order_num, order_item, prod_id, quantity, item_price)
VALUES(20008, 1, 'FC', 50, 2.50);
INSERT INTO orderitems(order_num, order_item, prod_id, quantity, item_price)
VALUES(20009, 1, 'FB', 1, 10);
INSERT INTO orderitems(order_num, order_item, prod_id, quantity, item_price)
VALUES(20009, 2, 'OL1', 1, 8.99);
INSERT INTO orderitems(order_num, order_item, prod_id, quantity, item_price)
VALUES(20009, 3, 'SLING', 1, 4.49);
INSERT INTO orderitems(order_num, order_item, prod_id, quantity, item_price)
VALUES(20009, 4, 'ANV03', 1, 14.99);

#############################
# Populate productnotes table
#############################
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(101, 'TNT2', '2005-08-17',
'Customer complaint:
Sticks not individually wrapped, too easy to mistakenly detonate all at once.
Recommend individual wrapping.'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(102, 'OL1', '2005-08-18',
'Can shipped full, refills not available.
Need to order new can if refill needed.'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(103, 'SAFE', '2005-08-18',
'Safe is combination locked, combination not provided with safe.
This is rarely a problem as safes are typically blown up or dropped by customers.'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(104, 'FC', '2005-08-19',
'Quantity varies, sold by the sack load.
All guaranteed to be bright and orange, and suitable for use as rabbit bait.'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(105, 'TNT2', '2005-08-20',
'Included fuses are short and have been known to detonate too quickly for some customers.
Longer fuses are available (item FU1) and should be recommended.'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(106, 'TNT2', '2005-08-22',
'Matches not included, recommend purchase of matches or detonator (item DTNTR).'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(107, 'SAFE', '2005-08-23',
'Please note that no returns will be accepted if safe opened using explosives.'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(108, 'ANV01', '2005-08-25',
'Multiple customer returns, anvils failing to drop fast enough or falling backwards on purchaser. Recommend that customer considers using heavier anvils.'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(109, 'ANV03', '2005-09-01',
'Item is extremely heavy. Designed for dropping, not recommended for use with slings, ropes, pulleys, or tightropes.'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(110, 'FC', '2005-09-01',
'Customer complaint: rabbit has been able to detect trap, food apparently less effective now.'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(111, 'SLING', '2005-09-02',
'Shipped unassembled, requires common tools (including oversized hammer).'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(112, 'SAFE', '2005-09-02',
'Customer complaint:
Circular hole in safe floor can apparently be easily cut with handsaw.'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(113, 'ANV01', '2005-09-05',
'Customer complaint:
Not heavy enough to generate flying stars around head of victim. If being purchased for dropping, recommend ANV02 or ANV03 instead.'
);
INSERT INTO productnotes(note_id, prod_id, note_date, note_text)
VALUES(114, 'SAFE', '2005-09-07',
'Call from individual trapped in safe plummeting to the ground, suggests an escape hatch be added.
Comment forwarded to vendor.'
);

Guess you like

Origin www.cnblogs.com/keatsCoder/p/11878203.html