Sei sulla pagina 1di 3

Programming: ASP.

NET, C# and Sql Server


Duration: 60 mins

SQL SERVER
EmployeeDetail table:

ProjectDetail table:

Write queries for the following questions considering the schema of above
mentioned tables.
Q1. Write a query to insert a new employee into EmployeeDetail table after
checking if there is a user already existing with same name working under the
same department.
Ans: insert into EmployeeDetail
(EmployeeId,FirstName,LastName,Salary,JoiningDate,Department,Gend
er)
values(@EmployeeId,@FirstName,@LastName,@Salary,@JoiningDate,@D
epartment,@Gender) where not exists (select FirstName,Department
from EmployeeDetail where FirstName=@FirstName and
Department=@Department)
Q2. Write down the query to print first letter of a Name in Upper Case and all
other letter in Lower Case. (EmployDetail table)
Ans: select upper(left(FirstName,1))
+lower(substring(FirstName,2,len(FirstName))) from EmployeeDetails
Q3. Write a query to get all employees whose joining date falls in the last 3
months and currently not assigned to any project.

Q4. Write down the query to display all employee name in one cellseprated by ','
ex: -"Vikas, nikita, Ashish, Nikhil ,anish"(EmployDetail table)

Programming: ASP.NET, C# and Sql Server


Duration: 60 mins
Q5. Write down query to get ProjectName and respective EmployeeName
(firstname) which are working on the project. If more than one employee is
working on the same project, get a comma separated list of them. Example: Task
Tracker :Vikas, Ashish

ASP.NET and C# Program

Consider uploading payslips for all the employees in the EmployeeDetail table.
Write code for designing the above grid in a aspx page and implementing the
below functionality in c#.

Point1: All employees should be displayed in the grid on page load with
playslip data displayed for the current month and year by default.
Point2: Upload option should be available for all employees to upload
payslip. Open a javascript popup window which will ask for file upload for
selected employee on clicking Upload link.
Point3: On uploading payslip Paycheck for the month of link should be
displayed under the View column in grid which will download the
uploaded payslip document.
Point4: If payslip is uploaded View column will be filled with the link to
the document else View column will be empty as shown for second
employee in the above grid.
Point5: On clicking Delete link error message should be shown if payslip
is still not uploaded for that employee. If payslip exists delete that and
refresh the grid which will show empty data in View column after deleting
the payslip.
Point6: On clicking Upload if payslip is already uploaded for that
employee, display the link to download the document in the popup also.

Note: Please make sure you handle all validations and exceptions while
programming.

Programming: ASP.NET, C# and Sql Server


Duration: 60 mins

Potrebbero piacerti anche