Section 4.3 MySQL Fundamentals
Learning Objectives
After you have completed this section, you should be able to
- install MySQL on a computer.
- work with MySQL to create and manipulate databases.
Activities
- Carefully read the learning objectives.
- Download MySQL and install it on your computer. Read the manual on the MySQL web page if necessary.
- Become familiar with the MySQL manual at https://dev.mysql.com/doc/
- See the tutorial at https://www.analysisandsolutions.com/code/mysql-tutorial.htm
- Watch the related section of the presentation for Chapter 18;
- Read section 18.5, MySQL of Chapter 18
- Find answers to the study questions below.
- Log into MySQL server and create the database and tables for the library you designed in previous unit. It should have at least two tables: book and borrower.
Study Questions
- What is MySQL?
- Where can you download MySQL for your system?
- How do you configure your web server so that it can work with MySQL?
- How does a web server work with MySQL?
- How do you set up a user for MySQL to run as?
- How do you set up your path for MySQL?
- How do you set the root password?
- Why do you need to delete the anonymous user?
- How do you start the MySQL server?
- How do you set the MySQL server up to run automatically?
- How do you log in to MySQL?
- How do you create databases in MySQL?
- What is MySQL’s privilege system?
- What are privileges?
- How do you use the GRANT command to set up a user’s privilege?
- How many levels of privilege are there in MySQL’s privilege system?
- How do you take away a privilege from a user using the REVOKE command?
- Which privileges are for users?
- Which privileges are for administrators?
- What are special privileges in MySQL?
- How do you choose the right database to use?
- How do you create database tables in MySQL?
- When creating a database table, how do you set a primary key in MySQL?
- When creating a database table, how do you set the type for a column?
- How do you view the tables in a database?
- What are the differences between the SHOW and DESCRIBE commands?
- What are MySQL identifiers?
- How are databases and tables mapped to the underlying file structure?
- What data types can a column have?
- How do you insert data into a database in MySQL?
- How do you retrieve data from a database in MySQL?
- How do you retrieve data from a database with specific criteria?
- How do you retrieve data from multiple tables in MySQL?
- What is the left join in MySQL?
- How do you find rows/records that don’t match?
- What is a Cartesian product or full join?
- What is a cross-join?
- What is an inner join?
- What is an equi-join?
- How do you retrieve data in a particular order?
- What functions are provided in MySQL for aggregating data?
- How do you group retrieved data?
- How do you choose which rows to return from retrieved data?
- How do you update data in a database?
- Can you alter tables after creation? If yes, how?
- How do you delete records from a database?
- How do you drop tables in MySQL?
- How do you drop a whole database in MySQL?
Summary
Read the questions and answers you find at http://dev.mysql.com/doc/refman/5.1/en/faqs.html and http://www.mysqlfaqs.net/