Csa 1
Csa 1
MySQL
MODULE II
Database Server:
Rows
MySQL Introduction
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
12
Basic Queries
16
Basic Queries
You can also enter multiple statements on a single line. Just end
each one with a semicolon:
18
Multi-Line Commands
mysql> SELECT
-> USER()
-> ,
-> CURRENT_DATE;
+--------------------+--------------+
| USER() | CURRENT_DATE |
+--------------------+--------------+
| joesmith@localhost | 1999-03-18 |
+--------------------+--------------+
19
Canceling a Command
If you decide you don't want to execute a command that you are in the
process of entering, cancel it by typing \c
mysql> SELECT
-> USER()
-> \c
mysql>
20
Using a Database
To get started on your own database, first check which databases currently
exist.
Use the SHOW statement to find out which databases currently exist on the
server:
22
Creating a Table
23
Creating a Table
24
Creating a Table
25
Showing Tables
26
Describing Tables
To view a table structure, use the DESCRIBE
command:
27
Loading Data
28
More data… 29
31