数据库
--查询结果 多表查询--
select a.XH,a.XM,c.BMDM,c.BMMC,f.ZYDM,f.ZYMC,b.BJDM,b.BJMC,a.RXND,a.SFZH from PXSDM a join PBJDM b on a.BJDM=b.BJDM join PBMDM c on a.BMDM=c.BMDM join PZYDM f on a.ZYDM=f.ZYDM;
--查询视图v_xsdm_xxs--
select * from v_xsdm_xxs;
--创建视图v_xsdm_xxs--
create view v_xsdm_xxs as select a.XH,a.XM,c.BMDM,c.BMMC,f.ZYDM,f.ZYMC,b.BJDM,b.BJMC,a.RXND,a.SFZH from PXSDM a join PBJDM b on a.BJDM=b.BJDM join PBMDM c on a.BMDM=c.BMDM join PZYDM f on a.ZYDM=f.ZYDM;
--创建学生缴费情况视图--
create view V_WSYH_YSJE as select a.XH,a.SFQJDM,b.SFQJMC,a.SFXMDM,c.SFXMMC,a.YJJE as YSJE,a.JMJE,a.TFJE,a.SJJE,(a.YJJE-a.JMJE-a.SJJE+a.TFJE) as QFJE from SF_ZZ a join PSFQJ b on a.SFQJDM=b.SFQJDM join PSFXM c on a.SFXMDM=c.SFXMDM;