在sql中编写存储过程 [英] Write a stored procedure in sql

查看:107
本文介绍了在sql中编写存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai ....



在SQL员工中编写一个存储过程,工作超过8个。每一个人都给这个

工资是正常的两倍(每日工作的狂热者是8个人)



创建三个表:1.Shifts, 2.employee,3 timesheet

插入移位值(emp_code int,shift_name varchar(),shift_time time);

插入员工值(emp_code int,emp_name varchar (),等级varchar(),dept varchar(),salary int);

插入时间表值(emp_code int,date _in date,time_in time,time_out time,date_out date);



使用以上三表和写SP



例如:



每天正常工作的人是:8个怎么样? />
每个工人工资100卢比

每日工资= 8 * 100 = 800

花费额外1 hower = 1 * 100(正常工资)+工资双倍

= 1 * 100 + 100 = 200

花2支额外费用= 2 * 100(正常工资)+工资双倍

= 2 * 100 = 200 + 200(工资双倍)= 400

Plz在SQL中发送存储过程((使用以上三个表))



谢谢并且考虑的是



Venkatesh D



我尝试了什么:



对不起,我知道sp的基本知识,所以我不尝试

Hai....

Write a Stored procedure in SQL Employee working more then 8 howers. Every one hower this
Salary is double than normal howers (Daily working howers is 8 howers)

create three tables: 1.Shifts,2.employee,3.timesheet
Insert into shift values(emp_code int,shift_name varchar(),shift_time time);
Insert into employee values(emp_code int,emp_name varchar(),grade varchar(),dept varchar(), salary int);
Insert into timesheet values(emp_code int,date _in date,time_in time,time_out time,date_out date);

"Using above Three table and write SP"

Example:

Per day normal working howers is :8 howers
per howers salary 100 rupes
Daily salary =8*100=800
Spend extra 1 hower =1*100 (normal salary)+salary double
=1*100+100=200
Spend extra 2 howers=2*100 (normal salary)+salary double
=2*100=200+200(salary double)=400
Plz Send Stored procedure in SQL ((Using above Three Tables))

Thanks and regard's

Venkatesh D

What I have tried:

Sorry I know the basic of sp so i don't try

推荐答案

对不起我知道sp的基本所以我不知道试试



对不起,我们不是为你做功课,特别是如果你不想尝试,或者学习任何东西。

这种态度不会让你走得太远 - 或者是一份好工作。所有你要做的就是惹恼别人,生气的人也没多大帮助。

所以从这里开始: Sql Server - 如何在SQL Server中编写存储过程 [ ^ ]在这里:https://msdn.microsoft.com/en-GB/library/ms345415.aspx ?f = 255& MSPPError = -2147217396 [ ^ ]

并尝试一下。

如果您遇到特定问题,请询问我们会尽力帮助。但我们不打算为你做这一切!
"Sorry I know the basic of sp so i don't try"

Sorry, but we aren't here to do your homework for you, particularly if you can't be bothered to try, or learn anything.
That kind of attitude will not get you very far - or a good job. All you will do is annoy people, and annoyed people don't help much.
So start here: Sql Server - How To Write a Stored Procedure in SQL Server[^] and here: https://msdn.microsoft.com/en-GB/library/ms345415.aspx?f=255&MSPPError=-2147217396[^]
And give it a try.
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!


这篇关于在sql中编写存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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