linux下Mysql基本語(yǔ)句_第1頁(yè)
linux下Mysql基本語(yǔ)句_第2頁(yè)
linux下Mysql基本語(yǔ)句_第3頁(yè)
linux下Mysql基本語(yǔ)句_第4頁(yè)
linux下Mysql基本語(yǔ)句_第5頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、# # sql 基本語(yǔ)句# # sql 基本語(yǔ)句交互方式演示10.28.8.59 連接mysql -uroot -p mysql h - or help 創(chuàng)建及刪除數(shù)據(jù)庫(kù)mysql create database test01; query ok, 1 row affected (0.02 sec) show- mysql show databases; 選擇數(shù)據(jù)庫(kù)mysql use hkmain; reading table information for completion of table and column names you can turn off this feature t

2、o get a quicker startup with -a database changed mysql show tables; +-+ | tables_in_hkmain | +-+ | fx_account_status_mail | | fx_affiliate | . | fx_withdrawal_trigger | | unique_id_generator | +-+ 221 rows in set (0.00 sec) 刪除數(shù)據(jù)庫(kù)mysql drop database test01; query ok, 0 rows affected (0.00 sec) 創(chuàng)建表mys

3、ql show create table fx_swap_point g; 修改成 test 進(jìn)行演示查看表定義desc 。 。查看更全面的表定義show create table 刪除表mysql drop table fx_swap_point_test; query ok, 0 rows affected (0.01 sec) (可以命令行演示,grep 過(guò)濾 ) #修改表進(jìn)行表結(jié)構(gòu)的更改fx_swap_point_test001 1 修改字段定義mysql alter table fx_swap_point_test001 modify front_date varchar(10);

4、query ok, 0 rows affected (0.01 sec) records: 0 duplicates: 0 warnings: 0 修改 front_date 字段,將 varchar(8)修改為 varchar(10) 2 增加表字段新增字段count ,類型 decimal(12,6) mysql alter table fx_swap_point_test001 add count decimal(12,6); query ok, 0 rows affected (0.02 sec) records: 0 duplicates: 0 warnings: 0 3 刪除上面添

5、加到字段mysql alter table fx_swap_point_test001 drop count; query ok, 0 rows affected (0.01 sec) records: 0 duplicates: 0 warnings: 0 4 modify 與 change 都可以修改表定義,change 需要后面寫兩次列名,可以修改列名。modify not 。mysql alter table fx_swap_point_test001 change count001 count002 decimal(8,6); query ok, 0 rows affected (0

6、.03 sec) records: 0 duplicates: 0 warnings: 0 5 first|after column 增加 count009字段decimal(8,6),位置在 front_date 之后mysql alter table fx_swap_point_test001 add count009 decimal(8,6) after front_date; query ok, 0 rows affected (0.02 sec) records: 0 duplicates: 0 warnings: 0 增加 first_001字段varchar(9)在整個(gè)表前面my

7、sql alter table fx_swap_point_test001 add first_001 varchar(9) first; query ok, 0 rows affected (0.02 sec) records: 0 duplicates: 0 warnings: 0 6 更改表名mysql alter table fx_withdrawal_trigger rename fx_withdrawal_trigger_bak; query ok, 0 rows affected (0.00 sec) mysql alter table fx_withdrawal_trigger

8、_bak rename to fx_withdrawal_trigger; query ok, 0 rows affected (0.01 sec) 插入數(shù)據(jù)例子hkmain.fx_product 初始化insert into fx_product (product_id, product_type, leverage_level_id, display_sort_order, currency_pair, max_quantity ,min_quantity ,lot_size,trade_deposit_usd,trade_deposit_hkd,open_buy_constraint,o

9、pen_sell_constraint,order_cancel_constraint,order_change_constraint,close_buy_constraint,close_sell_constraint,usable_flag,update_staff_id,input_staff_id,losscut_commission,active_flag,input_date,update_date ) values (a001, 0, 1 ,100,eur/usd,3000000,10000 ,10000 ,183220,60000 ,0,0,0,0,0,0,1,system,s

10、ystem,1,1,now(),now() ) , (a002, 0, 1 ,100,gbp/usd,3000000,10000 ,10000 ,183220,183220 ,0,0,0,0,0,0,1,system,system,1,1,now(),now() ) , (a003, 0, 1 ,100,usd/jpy,3000000,10000 ,10000 ,183220,183220 ,0,0,0,0,0,0,1,system,system,1,1,now(),now() ) , (a004, 0, 1 ,100,usd/chf,3000000,10000 ,10000 ,183220,

11、183220 ,0,0,0,0,0,0,1,system,system,1,1,now(),now() ) , (a005, 0, 1 ,100,aud/usd,3000000,10000 ,10000 ,183220,183220 ,0,0,0,0,0,0,1,system,system,1,1,now(),now() ) , (a006, 0, 1 ,100,nzd/usd,3000000,10000 ,10000 ,183220,183220 ,0,0,0,0,0,0,1,system,system,1,1,now(),now() ) , (a007, 0, 1 ,100,usd/cad

12、,3000000,10000 ,10000 ,183220,183220 ,0,0,0,0,0,0,1,system,system,1,1,now(),now() ) , (a008, 0, 1 ,100,eur/jpy,3000000,10000 ,10000 ,183220,183220 ,0,0,0,0,0,0,1,system,system,1,1,now(),now() ) , (a009, 0, 1 ,100,gbp/jpy,3000000,10000 ,10000 ,183220,183220 ,0,0,0,0,0,0,1,system,system,1,1,now(),now(

13、) ) , (a010, 0, 1 ,100,aud/jpy,3000000,10000 ,10000 ,183220,183220 ,0,0,0,0,0,0,1,system,system,1,1,now(),now() ) , (a011, 0, 1 ,100,cad/jpy,3000000,10000 ,10000 ,183220,183220 ,0,0,0,0,0,0,1,system,system,1,1,now(),now() ) , (a012, 0, 1 ,100,gbp/chf,3000000,10000 ,10000 ,183220,183220 ,0,0,0,0,0,0,

14、1,system,system,1,1,now(),now() ) , (a013, 0, 1 ,100,aud/nzd,3000000,10000 ,10000 ,183220,183220 ,0,0,0,0,0,0,1,system,system,1,1,now(),now() ) , (a014, 0, 1 ,100,usd/hkd,3000000,10000 ,10000 ,183220,183220 ,0,0,3,3,1,1,1,system,system,1,1,now(),now() ) ; 不指定字段名稱的時(shí)候,values 后面的順序應(yīng)該和字段的排列順序一樣。更新數(shù)據(jù)mysql update fx_customer set en_given_name1=test where customer_id=00000002; query ok, 1 row affected (0.01 sec) rows matched: 1 changed: 1 warnings: 0 * 1. row * customer_id: 00000002 account_type: 2 document_send_status: 1 region: 3 account_currency: hkd en_surname: zhenku

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論