Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 Site Related Discussions
 sql server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-02-01 : 08:00:01
ashwin writes "1>You are a database developer for your company's SQL Server 2000 online transaction processing database. Many of the tables have 1 million or more rows. All tables have a clustered index. The heavily accessed tables have at least one nonclustered index. Two RAID arrays on the database server will be used to contain the data files. You want to place the tables and indexes to ensure optimal I/O performance. You create one filegroup on each RAID array. What should you do next?
A. Place tables that are frequently joined together on the same filegroup. Place heavily accessed tables and all indexes belonging to those tables on different filegroups.
B. Place tables that are frequently joined together on the same filegroup. Place heavily accessed tables and the nonclustered indexes belonging to those tables on the same filegroup.
C. Place tables that are frequently joined together on different filegroups. Place heavily accessed tables and the nonclustered indexes belonging to those tables on different filegroups.
D. Place tables that are frequently joined together on different filegroups. Place heavily accessed tables and the nonclustered indexes belonging to those tables on the same filegroup.
Ans:C
Just explain me how C is the answer?
_____________________________________________________________________________________________
2> A>You are a database developer for a container manufacturing company. The containers produced by your company are a number of different sizes and shapes. The tables that store the container information are shown in the Size, Container, and Shape Tables exhibit:
Size <-------- Container -------->Shape
SizeID ContainerID ShapeID
SizeName ShapeID ShapeName
Height SizeID Measurements
A sample of the data stored in the tables is shown below:
Size Table
SizeID SizeName Height
1 Small 40
2 Medium 60
3 Large 80
4 Jumbo 100
Shape Table
ShapeID ShapeName Measurement
1 Triangle 10
2 Triangle 20
3 Triangle 30
4 Square 20
5 Square 30
6 Square 40
7 Circle 15
8 Circle 25
9 Circle 35
Periodically, the dimensions of the containers change. Frequently, the database users require the volume of a container. The volume of a container is calculated based on information in the shape and size tables.
You need to hide the details of the calculation so that the volume can be easily accessed in a SELECT query with the rest of the container information. What should you do?
A. Create a user-defined function that requires ContainerID as an argument and returns the volume of the container.
B. Create a stored procedure that requires ContainerID as an argument and returns the volume of the container.
C. Add a column named volume to the container table. Create a trigger that calculates and stores volume in this column when a new container is inserted into the table.
D. Add a computed column to the container table that calculates the volume of the container.
Ans: A
Here my choice was B but the answer is A,my logic was that since stored procedure is pre-compiled it would execute very qiuckly.
Tell me what is the difference between user-defined function and stored procedure ?
Tell me when to make the correct choice between them?
_____________________________________________________________________________________________
3> B>You are a database developer for an online book retailer. Customers use the company's web site to place orders for books. As orders are entered, they are inserted into a database named BookOrders. During a nightly batch process, the order information is transferred to a database named Reports.
The Reports database includes a table named orders and a table named LineItem. The Order table contains basic information about the orders. The LineItem table contains information about the individual items in the orders. The order and LineItem tables

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-02-01 : 08:03:18
quote:
Just explain me how C is the answer?
C is always the answer, in life, love, and databases.
quote:
Here my choice was B but the answer is A
Which you wouldn't know unless this is a practice test, or an answer posted on a brain-dump site.
quote:
my logic was that since stored procedure is pre-compiled it would execute very qiuckly.
Well, if this was a practice exam, it would explain the reasoning. Otherwise you got this from a brain dump site. Go there if you want the answer.
quote:
Tell me what is the difference between user-defined function and stored procedure ?
Look in Books Online. Oh shit, I forgot, that's too difficult for ya.
quote:
Tell me when to make the correct choice between them?
I'd actually study for the exam instead of mooching a free ride off of people who take their education seriously and put real effort into learning.
Go to Top of Page
   

- Advertisement -