TAILIEUCHUNG - Mysql your visual blueprint for creating open source databases- P7

Mysql your visual blueprint for creating open source databases- P7:The show tables command displays a list of tables available in the currently selected database. You can use this command when you are unsure of the exact name of a table within the database. | UPDATE DATA IN TABLES PKtSïfï L 5 If you are working with a table that has a timestamp column this column is automatically updated with the current date and time in each row modified by any UPDATE query. If you want to update a row and preserve the current value of the timestamp column you must explicitly set the column to its original value. For example if you were to add a second address to the address table and perform a similar update you may want to avoid updating the timestamp in the updatetime column. The following query accomplishes this Example UPDATE address SET address2 address city2 city state2 state updatetime updatetime While setting a column to its own value normally has no effect in a timestamp column this prevents the MySQL server from automatically updating the field. You can also set the timestamp column explicitly to a different value. For example the following UPDATE query sets all rows to a specified updatetime value Example UPDATE address SET address2 address city2 city state2 state updatetime 20030101120000 L-0 Type UPDATE mail SET address2 address and press Enter. You are prompted for the next line. Ln Type SELECT name address address2 FROM mail and press Enter. Type city2 city state2 state postal2 postal and press Enter. Th is completes the UPDATE query. All of the rows of the table are updated. The values of the columns you specified are displayed for all rows. Verify that the address values were copied. 107 MySQL INCREMENT A COLUMN VALUE Often you will find it useful to update a column s value based on its existing value. The simplest example of this is to increment a numeric column s value. This is easy to do in an UPDATE query by referring to the column s current value. For example suppose you created a table to store exam statistics for students. The following CREATE TABLE query creates this simple table CREATE TABLE exams name VARCHAR 80 numtests INT totalscore INT avgscore TINYINT This creates a table called exams with four columns

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.