課程
/數(shù)據(jù)庫
/MySQL
/MySQL開發(fā)技巧(一)
這個(gè)老師的數(shù)據(jù)表什么的 在哪下載啊。。。好參照學(xué)習(xí)啊
2017-03-16
源自:MySQL開發(fā)技巧(一) 2-8
正在回答
各位,現(xiàn)提供該課程建庫建表腳本代碼共享如下。
--?注意自己是否需要建庫 --?create?database?if?not?exists?mysqldv1; --?新建?user1?表 create?table?if?not?exists?user1?( ??id?smallint?unsigned?primary?key?auto_increment, ??user_name?varchar(40), ??over?varchar(40) ); --?新建?user2?表 create?table?if?not?exists?user2?( ??id?smallint?unsigned?primary?key?auto_increment, ??user_name?varchar(40), ??over?varchar(40) ); --?新建?user_kills?表 create?table?if?not?exists?user_kills?( ??id?smallint?unsigned?primary?key?auto_increment, ??user_id?smallint?unsigned, ??timestr?timestamp?default?CURRENT_TIMESTAMP, ??kills?smallint?unsigned ); --?插入?user1?表數(shù)據(jù) insert?into?user1(user_name,over)?values?('唐僧',?'旃檀功德佛'); insert?into?user1(user_name,over)?values?('豬八戒',?'凈壇使者'); insert?into?user1(user_name,over)?values?('孫悟空',?'斗戰(zhàn)勝佛'); insert?into?user1(user_name,over)?values?('沙僧',?'金身羅漢'); --?插入?user2?表數(shù)據(jù) insert?into?user2(user_name,over)?values?('孫悟空',?'成佛'); insert?into?user2(user_name,over)?values?('牛魔王',?'被降服'); insert?into?user2(user_name,over)?values?('蛟魔王',?'被降服'); insert?into?user2(user_name,over)?values?('鵬魔王',?'被降服'); insert?into?user2(user_name,over)?values?('獅駝王',?'被降服'); --?插入?user_kills?表數(shù)據(jù) insert?into?user_kills(user_id,?timestr,?kills)?values?(2,?timestamp('2013-01-10'),?10); insert?into?user_kills(user_id,?timestr,?kills)?values?(2,?timestamp('2013-02-01'),?2); insert?into?user_kills(user_id,?timestr,?kills)?values?(2,?timestamp('2013-02-05'),?12); insert?into?user_kills(user_id,?timestr,?kills)?values?(4,?timestamp('2013-01-10'),?3); insert?into?user_kills(user_id,?timestr,?kills)?values?(4,?timestamp('2013-02-11'),?5); insert?into?user_kills(user_id,?timestr,?kills)?values?(2,?timestamp('2013-02-06'),?1); insert?into?user_kills(user_id,?timestr,?kills)?values?(3,?timestamp('2013-01-11'),?20); insert?into?user_kills(user_id,?timestr,?kills)?values?(2,?timestamp('2013-02-12'),?10); insert?into?user_kills(user_id,?timestr,?kills)?values?(3,?timestamp('2013-02-07'),?17);
#自己手動(dòng)敲的,供參考
?#創(chuàng)建表CREATE TABLE im_user( ?id INT PRIMARY KEY AUTO_INCREMENT COMMENT '編號(hào)', ?use_name NVARCHAR(10) NOT NULL COMMENT '名稱', ?over NVARCHAR(10) COMMENT '等級(jí)');CREATE TABLE im_friend(?id INT PRIMARY KEY AUTO_INCREMENT COMMENT '編號(hào)',?use_name NVARCHAR(10) NOT NULL COMMENT '名稱',?over NVARCHAR(10) COMMENT '等級(jí)'); ?#插入表語句DELETE FROM im_user;INSERT INTO im_userVALUES(NULL,'唐僧','玉檀功德佛'),(NULL,'豬八戒','凈壇使者'),(NULL,'孫悟空','斗戰(zhàn)神佛'),(NULL,'沙僧','金沙羅漢'); ?#im_friendINSERT INTO im_friendVALUES(NULL,'孫悟空','齊天大圣'),(NULL,'牛魔王','朋友'), ?(NULL,'白骨精','情人'),(NULL,'獅駝王','笨蛋');
自己敲唄
舉報(bào)
DBA和開發(fā)人員都必備的技能,SQL技巧一個(gè)好程序員必備技能
2 回答數(shù)據(jù)表是啥啊
3 回答表結(jié)構(gòu)與數(shù)據(jù)
2 回答西天取經(jīng)四人組和悟空的朋友們數(shù)據(jù)表
3 回答視頻的數(shù)據(jù)表結(jié)構(gòu)能帖出來嗎
2 回答兩張 表的字段和數(shù)據(jù)可否提供
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-03-28
各位,現(xiàn)提供該課程建庫建表腳本代碼共享如下。
2017-03-18
#自己手動(dòng)敲的,供參考
?#創(chuàng)建表
CREATE TABLE im_user(
?id INT PRIMARY KEY AUTO_INCREMENT COMMENT '編號(hào)',
?use_name NVARCHAR(10) NOT NULL COMMENT '名稱',
?over NVARCHAR(10) COMMENT '等級(jí)'
);
CREATE TABLE im_friend(
?id INT PRIMARY KEY AUTO_INCREMENT COMMENT '編號(hào)',
?use_name NVARCHAR(10) NOT NULL COMMENT '名稱',
?over NVARCHAR(10) COMMENT '等級(jí)'
); ?#插入表語句
DELETE FROM im_user;
INSERT INTO im_user
VALUES(NULL,'唐僧','玉檀功德佛'),(NULL,'豬八戒','凈壇使者'),
(NULL,'孫悟空','斗戰(zhàn)神佛'),(NULL,'沙僧','金沙羅漢');
?#im_friend
INSERT INTO im_friend
VALUES(NULL,'孫悟空','齊天大圣'),(NULL,'牛魔王','朋友'),
?(NULL,'白骨精','情人'),(NULL,'獅駝王','笨蛋');
2017-03-18
自己敲唄