mysql -u root -ppassword
show databases
create database mangerie;
use mangerie;
show tables;
create table pet(name varchar(20),owner varchar(20),species varchar(20),sex char(1),birth date,death date);
describe pet;
load data local infile 'd:\\pet.txt' into table pet
lines terminated by '\r\n';
select * from pet where name like 'b_%';
select * from pet where name regexp '^b';
select * from pet where name regexp binary 'n$';
select * from pet where name regexp 'a';
select * from pet where name regexp '^....$';
select * from pet where name regexp '^.{4}$';
select database();
mysql -u root -p menagerie d:\\queryout.txt
--auto-increment
create table person(
id smallint unsigned not null auto_increment
,name char(60) not null
,primary key(id));
insert into person values(NULL,'Antonio Paz');
select @last := LAST_INSERT_ID();