select version();
//查看日期
select date();
//查看時間
select time();
//添加主鍵
alter table ta add primary key(id);
//將文本中的數據導入MYSQL數據庫
load data local infile "E:/a.txt" into table tt;
//將數據導出到文本
select * from tt into outfile "E:/cc.txt";
//多表查詢
select tt.name,ta.pp,ta.yy from tt,ta where ta.id=tt.id and tt.name='aa';
//表裏面增加一列"sex"
alert table ta add column sex char(1);
//顯示服務器運行狀態
show status;
//創建索引
create index aa on tt(name);
//在另一個表中得到查詢條件
select * from score where event_id in (select event_id from event where type='T');