国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

多表查詢的練習(xí)

Original 2019-06-05 11:05:15 271
abstract:用戶表(user)     create table `user` (                                     `id` int auto_in

用戶表(user) 

   create table `user` (                                  

  `id` int auto_increment primary key,                

  `username` varchar(50)  -- 用戶姓名                                                

);

 

-- 訂單表(orders)

   create table `orders` (                                                  

  `id` int  auto_increment primary key,                                  

  `price` double,                                           

  `user_id` int                                       

);

-- 給訂單表添加外鍵約束

alter table orders add constraint user_fk foreign key (user_id) references user(id); 

 

-- 向user表中添加數(shù)據(jù)

insert into user values(3,'張三');

insert into user values(4,'李四');

insert into user values(5,'王五');

insert into user values(6,'趙六');

 

-- 向orders 表中插入數(shù)據(jù)

insert into orders values(1,1314,3);

insert into orders values(2,1314,3);

insert into orders values(3,15,4);

insert into orders values(4,315,5);

insert into orders values(5,1014,null);


--------------------- 

作者:如晴天-似雨天 

來(lái)源:CSDN 

原文:https://blog.csdn.net/puyu9714/article/details/82872984 

版權(quán)聲明:本文為博主原創(chuàng)文章,轉(zhuǎn)載請(qǐng)附上博文鏈接!


Correcting teacher:天蓬老師Correction time:2019-06-05 13:13:39
Teacher's summary:可以復(fù)制網(wǎng)上現(xiàn)成的代碼, 進(jìn)行參考 , 但你也太不小心了吧, 連對(duì)方的版本, 還在上面放著呢...... 如果你是給客戶做項(xiàng)目, 這樣的見(jiàn)容還在上面, 客戶看到會(huì)怎么看你..... --------------------- 作者:如晴天-似雨天 來(lái)源:CSDN 原文:https://blog.csdn.net/puyu9714/article/details/82872984

Release Notes

Popular Entries