当前位置:网站首页>MySQL 10th job - View
MySQL 10th job - View
2022-06-26 10:28:00 【m0_ sixty-one million nine hundred and sixty-one thousand eight】
Create view “view_info”, Query the names of all employees 、 Employee contact number 、 Workshop address 、 Name of workshop director 、 Contact information of the director
create view view_info as select z.names,z.phones,c.address,c.name,c.phone from lingjinzheng_workshop c left join lingjinzheng_worker z on c.no=z.shop_no;![]()
see “view_info” View field information
select * from view_info;
Create view “view_ chisel”, Inquire about “Chisel” Names of all employees in the workshop 、 Employee contact number 、 Workshop address
create view view_chisel as select z.names,z.phones,c.address from lingjinzheng_workshop c left join lingjinzheng_worker z on c.no=z.shop_no where names like"Chisel";![]()
View all the tables in the library
show tables; 
Create view “view_ standard”, Query the product number of products with qualified quality 、 Employee name 、 Employee contact number ‘
create view view_standard as select cp.nos2,z.names,z.phones from lingjinzheng_worker z left join lingjinzheng_product cp on z.nos=cp.work_no ;
see “view_ standard” View creation statement
show create view view_standard\G;
Create view “view_ product”, Check the product number of all products 、 Qualified or not 、 Employee number 、 Employee name 、 Employee contact information 、 Workshop number 、 Workshop address
create view view_product as select cp.nos2,cp.IS_QUALIFIED,z.nos,z.names,z.phones,c.no,c.address from(lingjinzheng_workshop c left join lingjinzheng_worker z on c.no=z.shop_no)left join lingjinzheng_product cp on z.nos=cp.work_no;

View all the tables in the library
show tables;
Delete “view_ chisel” View
drop view view_chisel;
Create view “view_ leave”, Query the workshop number of resigned employees 、 Workshop director 、 Contact information of the director
create view view_leave as select cp.NOs2,c.name,c.phone from(lingjinzheng_workshop c left join lingjinzheng_worker z on c.no=z.shop_no)left join lingjinzheng_product cp on z.nos=cp.work_no where z.IS_ONWORK like"0";![]()
View all the tables in the library
show tables;
边栏推荐
猜你喜欢

Hcia-dhcp experiment

C中字符串基本操作

MySQL第六次作业-查询数据-多条件

Small example of SSM project, detailed tutorial of SSM integration

Based on Zeng Shen's explanation, the line segment tree is studied again one

Write data to local file

Appium automation test foundation - mobile end test environment construction (II)

利用foreach循环二维数组

Use of exec series functions (EXECL, execlp, execle, execv, execvp)

Under the double reduction, the amount of online education has plummeted. Share 12 interesting uses of webrtc
随机推荐
Control setting layout in linear layout_ Gravity doesn't work?
1. 两数之和(LeetCode题目)
開發者,微服務架構到底是什麼?
Mysql database operation commands (constantly updated)
Global and Chinese market of contemporary lampshade 2022-2028: Research Report on technology, participants, trends, market size and share
1. sum of two numbers (leetcode topic)
Differences between JVM, Dalvik and art
118. 杨辉三角
量化投资学习——经典书籍介绍
libmagic 介绍
MySQL第九次作业-连接查询&子查询
【無標題】
In the fragment, the input method is hidden after clicking the confirm cancel button in the alertdialog (this is valid after looking for it on the Internet for a long time)
Svn command
Leetcode intermediate node of linked list
How to start the learning journey of webrtc native cross platform development?
MySQL第十一作業-視圖的應用
leetCode-链表的中间结点
首批12家企业入驻!广州首个集中展销老字号产品专柜开张
The fourteenth MySQL operation - e-mall project