Summary

MySQL is a relational database management system. Logically, data is structured into tables, which are related to each other by means of a common field. Tables consist of rows (or records), and records consist of columns (or fields). Fields can be of differing types: a numeric type, a string type, or a date type. (This chapter merely introduces SQL. You will build your skills in the language throughout this book.)

The MySQL server is what stores the data and runs queries on it. To connect to the MySQL server, you need the MySQL client. This can be on the same machine as the server or a remote machine.

The power of a database management system comes from the capability to structure data and retrieve it for a wide variety of highly specific requirements. The industry standard for manipulating and defining data is SQL. Its most important commands are the following:

  • The CREATE statement creates databases and the tables within the database.

  • The INSERT statement places records into a table.

  • The SELECT statement returns the results of a query.

  • The DELETE statement removes records from a table.

  • The UPDATE statement modifies the data in a table.

  • The ALTER statement changes the structure of a table, utilizing clauses such as ADD to add a new column, CHANGE to change the name or definition of an existing column, RENAME to rename a table, or DROP to remove a table.

Functions add to the power of MySQL. You can recognize a function by the parentheses immediately following it. There are many MySQL functions—mathematical ones such as SUM() to calculate the total of a result set, date and time functions such as YEAR() to extract the year portion of a date, and string functions such as RIGHT() to extract part of a string starting on the right side of that string.

Armed with this basic information, you are now ready to learn the crucial intricacies of structuring data, move on to more advanced SQL, and encounter the various types of tables MySQL uses for different kinds of solutions.



Mastering MySQL 4
Mastering MySQL 4
ISBN: 0782141625
EAN: 2147483647
Year: 2003
Pages: 230
Authors: Ian Gilfillan

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net