-
Display all the databases
show databases
-
select a database
use databaseName
-
view the tables in a database
show tables
-
make a database
create database database_name;
-
Creat a table
create table table_name (field_name field_type, field_name, field_type);
-
difference between char, varchar, and text types
char and varchar required a certain number about (e.g. varchar(20)), text does not. Text is for large text, char is for tiny and unvariable text (male, female), for a large variety in length of text use varchar. The difference is memory allocation or in other words, speed.
-
date format
year-month-date
-
When you want positive integers only
int(10) unsigned
-
View the table structure
describe table_name
-
put data in the table
insert into tablename values (value1, value2, etc)
-
insert only certain values
insert into tablename (value1, value3, etc) values (data1, data2, etc_data)
-
What is enum?
a data type where you define specific values (eg. enum('m','f');
|
|