Sei sulla pagina 1di 2

Assignment 1:

Invoice
Order No.: 001 Company Name Date: 21/12/07
Customer ID: AG01
Customer Name________________________________
Address:___________________________________________________
Contact No.____________________________________

Sr.No. Item No. Item Description Rate/ Unit Qty Amount

Total

Create optimal database design by looking at above invoice of XYZ Ltd. stationary store, also show all possible tables including
relationships.

Assignment 2:

Past 6 months usage report of 3 production servers having MSSQL 2008 R2 Standard, is as follows.
Server Number of Databases CPU Trend (min max) CPU Trend (min max)
Server A 500 1% - 10% 64GB
Server B 150 1% - 10% 64GB
Server C 400 1% - 10% 64GB

You have been asked by management to bring down licensing cost without compromising performance. What things you will
take in to considerations before making any decision. Justify your decision to management.

Assignment 3:

Past 6 months usage report of 3 production servers having MSSQL 2008 R2 Standard, is as follows.
Item_code Item_description Item_Number Item_Category
Abc Xyz 100 HR
Abc Xyz 100 HR
Qpr Mno 300 BR
Stp Roi 300 BR

This table contains more that million records. One of your colleague has notices duplicate records in table as shown with
example of Abc. What could be the possible reasons of getting duplicate records from application. What will be your suggestion
to avoid duplicate records? Can you also suggest query to remove duplicate records?

Assignment 4:

Xyz production database server contains 100 customer specific databases of particular ABC product. ABC product is web based
and accessed by these 100 customer over internet. Out of these 100 customers suddenly 4 customers start reporting severe
performance issues. Upon investigation monitoring team has found everything is fine at application and web end but all
requests are taking time on given database server. You have SQL Server 2008 R2 Standard edition installed on given server. How
youll go about solving this problem?
Answers:
Assignment 1:

Assignment 2:
Reducing the license cost by the way of analysis of the server performance. Here I mentioned main parameters to consider in
this scenario CPU, Memory, DISK I/O, Read %, and Write %, Transaction per Second. Using this parameter we can create the
average score using that score, we can combine those servers.

For my suggestion to management, Already "Server A" working with 500 Databases, So kindly merge "Server B & Server C". So
definitely it will not create performance issue.
Assignment 3:
Reason for Getting Duplicates from input Application was there is no specific constraint in table. If you want filter those
duplicate values you have to create primary key for that unique column or else create the unique constraint for those columns.
Here I mentioned the query Details for that unique constraint
-----Method 1 ----
USE TestDB
GO

ALTER TABLE ItemDetails


ADD CONSTRAINT Cons_UniqueItemCode UNIQUE (Item_Code)
GO
--Method 2----
----Here I mentioned if duplicate already in table, so using this query we can delete those duplicate records.
---Another method for duplicate deletion was using SELF JOIN or else using DISTINCT
; WITH ItemDetailsCTE AS
(
SELECT *, ROW_NUMBER () OVER (PARTITION BY Item_Code ORDER BY Item_Code) AS Row_Num
)
DELETE FROM ItemDetailsCTE WHERE Row_Num > 1
Assignment 4:
The most common SQL Server performance Parameters are CPU, memory, network, and I/O bottlenecks, and slow running
queries. Performance Issues are mainly caused by poorly designed database, insufficient disk space, excessive query compilation
and recompilation, bad execution plans due to missing or outdated statistics, and queries or stored procedures that have long
execution times due to improper design.

Using performance monitor, we can analyse the following counters Average Disk Queue Length, Average Disk Sec/Read, Average
Disk Sec/Write, %Disk Time, Average Disk Reads/Sec, and Average Disk Writes/Sec

Querying the sys.dm_os_waiting_tasks dynamic management view (DMV) gives the information about currently-executing
requests that are waiting for resources.

Potrebbero piacerti anche