Skip to Content
Learning PHP, MySQL, JavaScript, and CSS, 2nd Edition
book

Learning PHP, MySQL, JavaScript, and CSS, 2nd Edition

by Robin Nixon
August 2012
Beginner
583 pages
16h 1m
English
O'Reilly Media, Inc.
Content preview from Learning PHP, MySQL, JavaScript, and CSS, 2nd Edition

Chapter 9 Answers

  1. The term relationship refers to the connection between two pieces of data that have some association, such as a book and its author, or a book and the customer who bought the book. A relational database such as MySQL specializes in storing and retrieving such relations.

  2. The process of removing duplicate data and optimizing tables is called normalization.

  3. The three rules of First Normal Form are: (1) there should be no repeating columns containing the same kind of data, (2) all columns should contain a single value, and (3) there should be a primary key to uniquely identify each row.

  4. To satisfy Second Normal Form, columns whose data repeats across multiple rows should be removed to their own tables.

  5. In a one-to-many relationship, the primary key from the table on the “one” side must be added as a separate column (a foreign key) to the table on the “many” side.

  6. To create a database with a many-to-many relationship, you create an intermediary table containing keys from two other tables. The other tables can then reference each other via the third.

  7. To initiate a MySQL transaction, use either the BEGIN or the START TRANSACTION command. To terminate a transaction and cancel all actions, issue a ROLLBACK command. To terminate a transaction and commit all actions, issue a COMMIT command.

  8. To examine how a query will work in detail, you can use the EXPLAIN command.

  9. To back up the database publications to a file called publications.sql, you would use a command such as:

    mysqldump -u ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Learning PHP, MySQL & JavaScript, 4th Edition

Learning PHP, MySQL & JavaScript, 4th Edition

Robin Nixon

Publisher Resources

ISBN: 9781449337452Errata Page