Skip to main content

SQL Queries from Multiple tables and Questions

Question -Employee_Details
EmpID
NVARCHAR(10)
Emp_FirstName
NVARCHAR(100)
Emp_LastName
NVARCHAR(100)
DateOfJoining
Datetime
Employee_Salary
EmpID
NVARCHAR(10)
Refers to Employee Details
PayPeriodId
INT
Refers to Master_PayPeriod
SalaryAmount
Money

DateofSalaryCreditedtoAccount
Datetime


Master_PayPeriod


PayPeriodID
INT

PayMonthYear
Datetime


Employee Details
Sample Data



000001
ABC
XYZ
01-Jan-2000

000002
Rahul
Y
13-Dec-2000

000003
Amit
S
12-Apr-2000

000004
Shobit
K
01-Jan-2000

000005
Harshit
J
13-Dec-2001

000006
Amrit
C
12-Apr-2002


Employee_Salary




000001
1
20000
02-May-12

000002
1
25000
02-May-12

000003
1
12000
02-May-12

000004
1
90000
02-May-12

000005
1
27000
02-May-12

000006
1
23000
02-May-12


Master_PayPeriod
Sample Data

1
Apr-12

2
May-12

3
Jun-12

4
Jul-12

5
Aug-12

6
Sep-12

7
Oct-12

8
Nov-12

9
Dec-12

10
Jan-13

11
Feb-13


12
Mar-13


a) Write a query to show salary of each employee for Month September ‘12
b) Write a query to show every Employees’ total Earned Salary for Financial Year 2012-13
c) Write a query to show Rahul’s monthly Earned Salary for Financial Year 2012-13

d) Write a query to show names of employees who has drawn annual salary more than 25000/-



1. What is SQL Server Agent?
2. How do you refresh a database?
3. Which TCP/IP port does SQL Server run on? How can it be changed?
4. What are the main requirements to install SQL Server 2012?
5. What are the authentication modes in SQL Server? How can it be changed?
6. How does the database recovery model impact database backups?
7. Is the native SQL Server 2005 backups are in clear text or in encrypted?
8. How can I verify that backups are occurring on a daily basis?
9. How do you know if your database backups are restorable?
10. How do you migrate a database from SQL Server 2005 to 2008 R2?
11. What are some common reasons why database restores fail?
12. What are the permissions required to perform backup and Restore?
13. How can you be notified if a native SQL Server database backup or restore fails via the native tools?
14. What are some common post restore processes?
15. How can full backups be issued without interrupting the LSN’s?
16. What is the database that has the backup and restores system tables?  
17. What are the backup and restore system tables?
18. How is a point in time recovery performed?
19. What are your recommendations to design a backup and recovery solution? Simply what is Backup Check list?
20. What options/arguments can be specified in a BACKUP LOG statement to keep inactive log records from being truncated?
21. What are all of the backup options?
22. What are all of the Restore options?
23. How much time does it take for full backup and restore of 500 GB database?
24. What are the issues you faced in backup and restore process?
25. How to perform the tail log backup?
26. What is piecemeal Restore?


Popular posts from this blog

Resolved : Power BI Report connection error during execution

Getting Below Power BI Report connection error during execution . Error: Something went wrong Unable to connect to the data source undefined. Please try again later or contact support. If you contact support, please provide these details. Underlying error code: -2147467259 Table: Business Sector. Underlying error message: AnalysisServices: A connection cannot be made. Ensure that the server is running. DM_ErrorDetailNameCode_UnderlyingHResult: -2147467259 Microsoft.Data.Mashup.ValueError.DataSourceKind: AnalysisServices Microsoft.Data.Mashup.ValueError.DataSourcePath: 10.10.10.60;T_CustomerMaster_ST Microsoft.Data.Mashup.ValueError.Reason: DataSource.Error Cluster URI: WABI-WEST-EUROPE-redirect.analysis.windows.net Activity ID: c72c4f12-8c27-475f-b576-a539dd81826a Request ID: dfb54166-c78f-4b40-779f-e8922a6687ad Time: 2019-09-26 10:03:29Z Solution: We found report connection not able to connect to SQL Analysis service so tried below option. Re

Song- Khamoshiyan Piano keyboard Chord,Notation and songs Lyrics

All songs notation and chords at one place

Song : O Saathi Re Film : Mukhathar Ka Sikkandhar Uses : C D D# E G A Note : The numbers at the end of the lines indicate line numbers. Pallavi: O saathi re, tere binaa bhi kya jina, tere binaa bhi kya jina A- C D D#....,D D C DD E...C..CA-...,D D C DD E...CC.......1 Play line 1 again phulon men khaliyon men sapnom ki galiyon men GGG...GAGE.. GGG G A G E.................................................2 tere bina kuchh kahin naa E A G E D C D D#.......................................................................3 tere binaa bhi kya jina, tere binaa bhi kya jina D D C DD E....C..CA-..., D D C DDE....CC.............................4 Charanam: har dhadkan men, pyaas hai teri, sanson men teri khushboo hai CCC C D C A-, CCC C D C A-, DDD DED CD EE.. CCCC......................5 is dharthi se, us ambar tak, meri nazar men tu hi tu hai CCC C D C A-, CCC C D C A-, DDD DED CD EE.. CCCC......................6 pyaar yeh tute naa GGG... GAG D#......E.........................