Professional Documents
Culture Documents
Lab Chapter 3
Lab Chapter 3
3. MySQL DATABASE
Learning Objectives: After completing this chapter, you will be able to do the following:
• MySQL queries
• Create the new database
• Drop database
• Rename database
• USE database
• Select database function
Summary
You create a database with the CREATE DATABASE database_name command. Each database
name in MySQL server must be unique. Each table name in a database must be unique. You use a
database with the USE database_name command then the database is changed. Also, you can
drop/delete/remove a MySQL database easily with the DROP DATABASE databse_name
command. When you drop a database be careful because all the data in the database is removed.
In addition, you can find out which database is currently selected by using SELECT DATABASE()
function and you can rename the database in MySQL.
Review Questions
1. Discuss the difference between DDL, DML, TCL and DCL?
2. What is database?
3. How do you create, drop, rename and use database in MySQL?
4. What problem will occur when you drop a database?
5. Can you create a table without use a specific database? Why?
6. List and describe MySQL database objects?
7. What is query?