Danh mục

Mysql your visual blueprint for creating open source databases- P2

Số trang: 20      Loại file: pdf      Dung lượng: 721.16 KB      Lượt xem: 8      Lượt tải: 0    
tailieu_vip

Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Mysql your visual blueprint for creating open source databases- P2: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.
Nội dung trích xuất từ tài liệu:
Mysql your visual blueprint for creating open source databases- P2 INTRODUCING MYSQL 1SHOW TABLES DELETE The SHOW TABLES command displays a list of The DELETE command deletes one or more rows tables available in the currently selected database. of data within an existing table. The WHERE clause You can use this command when you are unsure of should be used to specify the rows that will be the exact name of a table within the database. deleted. Use this command with care: If you omit the WHERE clause, all rows of data within the table Example: are deleted. See Chapter 4 for further information SHOW TABLES; about the DELETE command. Example: DELETE FROM address WHERE name = John Smith;INSERT The INSERT command inserts a new row of data SELECT into an existing table within the currently selected database. You can specify a list of fields in the INSERT command along with values for each field. The SELECT command retrieves one or more rows The INSERT command is described in detail in from a database. You can specify the columns to be Chapter 4. returned or use the wildcard * to return values for all columns in the order they appear in the table Example: definition. You can use a WHERE clause to specify INSERT INTO address(name, address, phone) one or more conditions that rows must match in VALUES (John Smith,321 Elm Street, order to be returned. If you do not use a WHERE 804-555-1234); clause, the specified columns from all of the rows in the database are returned. Example:UPDATE SELECT name, address, phone FROM address WHERE name like %Smith; The UPDATE command alters one or more existing rows of data within a table. The WHERE keyword can be used with this command to specify one or more rows to alter. The command specifies new values for one or more of the fields within each row. These values can be based on existing fields or constant values specified within the command. If you do not specify a WHERE clause, this command will update all of the rows in the table. While you will sometimes want to update all of the rows, using UPDATE without a WHERE clause can cause loss of data if you are not careful. Update queries are described in detail in Chapter 5. Example: UPDATE address SET phone = 801-555-1234 WHERE name = John Smith; 7 MySQLDOWNLOAD MYSQL The download for Red Hat Linux and other versions thatB efore you can use MySQL, you need a working MySQL server. If you do not already have access to support RPM packages is also simple. MySQL is divided one, you can download the MySQL software from into several packages for its different components: serverthe MySQL Web site, www.mysql.com/, and install it on a software, client software, shared libraries, developmentcomputer running UNIX, Windows, or another supported files, and benchmarking utilities. You can install these usingoperating system. MySQL is freely available for non- the rpm command.commercial use. If you have a different version of Linux or UNIX, the nextTo access the downloadable files, click the Download link alternative is to download the binary distribution. These arefrom the MySQL Web site and then click the link for the stored as tar.gz files, one for each of the five components.version of MySQL to install. At this writing, the current The installation process for these is slightly more complex,stable release is MySQL 3.23. Under this sites Download but easier than install ...

Tài liệu được xem nhiều:

Tài liệu cùng danh mục:

Tài liệu mới: