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

Song Aankhen Khuli Ho lyrics notation

Song : Aankhen Khuli Ho Movie: Mohabbatein Notes used : W=>Western - C D E F G- A- B-/ H=>Hindustani - S R G M P- D- N- ( Here for western, G=G-, A=A-, & B=B- ) ( For hindustani, P=P-, D=D-, & N=N- ) Song I : Aankhen Khuli...Ho Ya.. Ho Bandh W=> A.... C... B..C.. E.. E...... A... A.... H=> D... S... N..S.. G G....... D... D.... Deedaar Un Ka Ho.o.taa Hai.. W=> A...B....A....D.BAG....ADB... H=> D...N...D.....R.NDP...DRN... Kaise Kahoon Main O..Yaaraa W=> B..D.. D....E.... D.....C..C..C... H=> N..R.. R....G... R.....S..S..S..... Ye Pyaar Kaise Hota Hai W=> E...B.....DB...AG...B..AA H=> G...N....RN...DP...N...DD (Tururu ru ru, ru ru rururu ru......) W=> AA...GA...BCE..., B...DB..GA H=> DD...PD...NSG..., N..RN.. PD Song II: Aa.aj He Kisi..par Yaa.ro.on..., Marke De..Khe..gein Hum W=> E....FEDCBABC.D.. D D......., G A B C.... E.......D...D..... H=> G....MGRSNDNS.R. R R......., P D N S.....G........R...R.... Pyaar Ho