Professional Documents
Culture Documents
1
SQL DATABASE
Learning Objectives:
After reading this information sheet, you should be able to:
1. Understand the Installation XAMPP and access the MySQL command
line.
2. Understand how to create Database and Table.
CD c:\xampp\mysql\bin
mysql.exe -u root --password
Log into your mysql server, and start typing your commands.
Example
CREATE DATABASE testDB;
Tip: Make sure you have admin privilege before creating any database. Once a
database is created, you can check it in the list of databases with the following
SQL command: SHOW DATABASES;
Example
DROP DATABASE testDB;
Tip: Make sure you have admin privilege before dropping any database. Once a
database is dropped, you can check it in the list of databases with the following
SQL command: SHOW DATABASES;
Tip: The empty "Persons" table can now be filled with data with the
SQL INSERT INTO statement.
Notice that the "DateOfBirth" column is now of type year and is going to hold a
year in a two- or four-digit format.