Let’s create a database using MySQL command line (I prefer this instead of GUI since we will practice our SQL syntax more)
1. to create database names “smsegov”:
CREATE DATABASE smsegov;
to check whether we have succeeded to create this database or not
SHOW DATABASES;
2. To use a particular database (‘smsegov’)
use smsegov;
use command is used when you have more than one database on a MySQL server and need to switch between them.
3. Now, create the table names ‘survey1’
CREATE TABLE survey1 (
id int auto_increment,
sex text
);
To close MySQL command line, type QUIT
Advertisements
Leave a Reply