如何使用下表并获得所需的输出 [英] how to use the following tables and get the required output

查看:64
本文介绍了如何使用下表并获得所需的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

教师表如下;





Facid Faculty



1 Sekar

2 Vinoth

3 Ramesh





Bthfac表格如下;





Bfid Bthid Facid



1 1 1,2

2 2 2,3

3 3 1,3





Facfeedback表格如下



Bfid评分



1优秀

2好

3公平





批量表格如下



Bthid Examdate



1 1/5/2013

2 2/5/2013

3 2013年3月5日





从使用上述四个表格,我想得到以下输出如下



教师考试不含税率



Sekar 1/5/2013 1优秀

Vinoth 2/5 / 2013 2好

Ramesh 3/5/2013 3公平





f或获得以上输出我如何使用sql server编写查询。





请帮助我。



问候,

Narasiman P.

Faculty table as follows;


Facid Faculty

1 Sekar
2 Vinoth
3 Ramesh


Bthfac table as follows;


Bfid Bthid Facid

1 1 1,2
2 2 2,3
3 3 1,3


Facfeedback table as follows

Bfid Rate

1 Excellent
2 Good
3 Fair


Batch table as follows

Bthid Examdate

1 1/5/2013
2 2/5/2013
3 3/5/2013


From using the above four tables i want to get the below output as follows

Faculty Examdate Bfid Rate

Sekar 1/5/2013 1 Excellent
Vinoth 2/5/2013 2 Good
Ramesh 3/5/2013 3 Fair


for getting a above output how can i write the query using sql server.


please help me.

Regards,
Narasiman P.

推荐答案

SELECT F.faculty, 
       BA.examdate, 
       FD.bfid, 
       FD.rate 
FROM   faculty F 
       JOIN bthfac B 
         ON F.facid = B.facid 
       JOIN feedback FD 
         ON FD.bfid = B.bfid 
       JOIN batch BA 
         ON BA.bthid = B.bthid 


这篇关于如何使用下表并获得所需的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆