Tuesday, June 12, 2018

Chapter 4 Synopsis

Chapter Four:
  • MySQL is the world's most popular open-source data application and is commonly used with PHP.
  • The MySQL software itself comes with the database server (stores actual data), different client applications (for interacting with the database server) and several utilities.
  • When creating databases and tables, one must come up with names (identifiers) that are clear, meaningful, and easy to type.
    • Identifiers should only contain letters, numbers, and the underscore (no spaces).
    • Should not be the same as an existing keyword.
    • Case sensitive.
    • <64 Characters
    • Unique within its realm.
      • This rule means that a table cannot have two columns with the same name and a database cannot have two tables with the same name. (Same column name in two different tables in the same database, however, is allowed.
  • When creating a table, MySQL requires that you explicitly state what sort of information each column will contain.
    • Text (strings)
    • Numbers
    • Dates and times
  • If length attribute is defined, any characters beyond the allotted amount will be truncated.
  • ENUM - a column that stores only one value of a possible several thousand.
  • SET - a columns that allows storing for several of up to 64 possible values.
  • CHAR will always be stored as a string the length of the column.
  • VARCHAR only requires as much as space as the string itself.
  • NULL value is stating that the field has no known value. Since most should, to force a field to have a valuer, add NOT NULL to the description of it's column type.
  • Primary keys must always have:
    • a value
    • a value that never changes
    • a unique value for each record in the able.
  • Unsigned (number type) limits the stored data to positive numbers and 0.
  • A client is necessary to communicate with MySQL's server, such as mysql client.
  • phpMyAdmin is one of the most popular applications written in PHP and it's sole purpose is to provide an interface to a MySQL server.

1 comment: