Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««1234»»

Few tricky Questions about SQL Server 2008 that I came across... Expand / Collapse
Author
Message
Posted Tuesday, January 10, 2012 9:22 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 7:35 PM
Points: 22,992, Visits: 31,471
I have a question, where is this employer located? Notice, I'm not asking who they are, just where they are located.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1233707
Posted Monday, March 18, 2013 4:44 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 10:37 AM
Points: 182, Visits: 65
these are an online assessment test questions called proveit
Post #1432395
Posted Monday, March 18, 2013 8:37 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 11:06 PM
Points: 36,711, Visits: 31,160
beginner_dk (3/18/2013)
these are an online assessment test questions called proveit


Yowch! You should alert the company that made you go through the "Proveit" gambit and then show them Gail's answers. As a bit of a side bar, this is why I refuse to go through such testing for any company.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1432441
Posted Monday, March 18, 2013 8:48 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 18, 2013 8:43 PM
Points: 19, Visits: 93
I agree. They hired me anyway and I told them about it. Proveit needs to fix this mess otherwise it is hurting lots of people. I was lucky but not everybody.....

Thanks

Jag Walia
Post #1432443
Posted Monday, March 18, 2013 8:49 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 10:37 AM
Points: 182, Visits: 65
the company or the recruiter is unaware of the questions and the answers. He will just receive the score card with the percentile of the candidate.
Post #1432444
Posted Monday, March 18, 2013 10:18 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 10:37 AM
Points: 182, Visits: 65
Hi Everyone,

I have few questions regards to Gila Monster's answers can anyone of you please help me in finding the right ones as i am new to SQL Server

Q: Which of the following allows for the truncation of a transaction log?
A. Transaction logs are truncated when you use SQL Profiler.
B. Transaction logs are truncated when you use the following syntax: truncate table A
C. Transaction logs are truncated when you backup your database.
D. You can not backup transaction log.

A: I guess C is a possible answer as the transactions logs are automatically truncated with back up

Q: Which of the following statements about unique Constraints are TRUE?
A. You can have only one unique constraint applied to a table.
B. Unique constraints can be used to establish a link between two tables.
C. You can only have one column assigned to a unique constraint.
D. If a primary key was already assigned to a table, the unique constraint would identify a special column used for indexing,

A: I am guessing B as the answer as "a link between tables" can also be a FK (FOREIGN KEY) and UC are used for FK's

Q: Which of the following is an improved performance feature that uses bitmap filters for selecting minimal rows with queries?
A. Table partitions
B. Star Join
C. Where clause
D. Outer Join

A: Star Join uses bitmap filters for performance in SQL SERVER 2008

Q. Which of the following statements can be used to provide sorted result set based in the CustomerName column?
A. SELECT ROW_NUMBER() AS RN, CustomerName from Customers order by CustomerName
B. SELECT ROW_NUMBER() OVER (ORDER BY CustomerName) AS RN, CustomerName FROM Customers
C. SELECT ROW_NUMBER() (ORDER BY CustomerName) AS RN, from Customers
D. SELECT ROW_NUMBER() AS RN, CustomerName from Customers

A: B as it is not mandatory to specify the partition by in over clause
If PARTITION BY is not specified, the function treats all rows of the query result set as a single group.

Q: Full text indexes can be backed up and restored with the rest of the database due to the ...
A. ...new index organization system
B. ...overall size of the index getting smaller.
C. ...index becoming a part of the transaction logs.
D. ...indexes no longer being stored outside of the database.

A: D as coming from SQL SERVER 2008 Full text indexes are stored in databases unlike the previous versions where they are stored on disks structured outside the database

Any Help is Greatly Appreciated!

Thanks and Regards!
Post #1432467
Posted Monday, March 18, 2013 11:06 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 11:06 PM
Points: 36,711, Visits: 31,160
beginner_dk (3/18/2013)
the company or the recruiter is unaware of the questions and the answers. He will just receive the score card with the percentile of the candidate.


That's actually a major part of the problem.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1432470
Posted Tuesday, March 19, 2013 3:38 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 4:54 PM
Points: 42,434, Visits: 35,488
beginner_dk (3/18/2013)
A: I guess C is a possible answer as the transactions logs are automatically truncated with back up


No they're not.

A: I am guessing B as the answer as "a link between tables" can also be a FK (FOREIGN KEY) and UC are used for FK's


They can be, but they're not required (either of the other 2 unique-guaranteeing structures is fine too). Still, a UQ does not in any way provide a link between tables, so no, B is wrong too.

A: B as it is not mandatory to specify the partition by in over clause
If PARTITION BY is not specified, the function treats all rows of the query result set as a single group.


B does not necessarily provide an ordered resultset. It provides row numbers ordered by the customer name, the resultset however is not necessarily ordered that way. The only one that has an ORDER BY clause (required for guaranteeing an ordered resultset) has a syntax error.

Don't confuse 'will usually work the way you want' with 'is guaranteed to work the way you want'. No order by clause, no guarantee of order.

For B to be correct, it needs ORDER BY CustomerName added at the end.

A: D as coming from SQL SERVER 2008 Full text indexes are stored in databases unlike the previous versions where they are stored on disks structured outside the database


Outside the DB doesn't mean they're not backed up with the DB. Fulltext indexes have always been backed up with the DB, that they're now in the DB files doesn't suddenly change that.

From Books Online (SQL 2005 entry)
Backup and restore treat full-text catalogs the same as database files. If the database that is being copied contains tables that have been defined for full-text indexing, then the destination computer must also have Full-Text Search installed before the full-text catalogs can be re-created and repopulated. If the Microsoft Full-Text Engine for SQL Server (MSFTESQL) service is not installed, the full-text catalog will be offline after restore.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1432535
Posted Tuesday, March 19, 2013 6:40 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 10:37 AM
Points: 182, Visits: 65
Hi GilaMonster,

Thanks a lot for taking time to review them. The test says if you don't find correct answer in the given options, guess /choose the one which is more near to the correct answer and i was trying to do that. so it might help me if i had to take the test again.

I went through few BOL topics (Transaction Log Truncation, Over Clause, Create Login, etc) and books to find these answers and thought they might be an option near to right one.

Regarding sorting order, i went through the BOL over clause and tested on a table created my self and it worked. so i thought it might be true.

Coming to full text indexes there is a book "Mastering SQL Server 2008 By Michael Lee, Gentry Bieker" on page 626, chapter 21, second para of the new alter feature box, it is stated that FTI's are backed up with every SQL Server Back up processes because they are included in the standard catalog
so again with minimal knowledge about it, i assumed it to be true.

your help is greatly appreciated and thanks for your tip Don't confuse 'will usually work the way you want' with 'is guaranteed to work the way you want'., will keep it in mind

Thanks and Regards
DK
Post #1432961
Posted Wednesday, March 20, 2013 1:46 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 4:54 PM
Points: 42,434, Visits: 35,488
beginner_dk (3/19/2013)
Regarding sorting order, i went through the BOL over clause and tested on a table created my self and it worked. so i thought it might be true.


"It worked for me once" != "It's guaranteed to work". No order by, no guarantee of order, end of story.
Now, a simple query like that will probably come back in the correct order, but that's a side effect of how the query execution engine works, not a guaranteed behaviour

Coming to full text indexes there is a book "Mastering SQL Server 2008 By Michael Lee, Gentry Bieker" on page 626, chapter 21, second para of the new alter feature box, it is stated that FTI's are backed up with every SQL Server Back up processes because they are included in the standard catalog
so again with minimal knowledge about it, i assumed it to be true
.

It is true, but that quote in no way implies that prior to SQL 2008 FTIs were not backed up with the database because they're not included in the database.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1433036
« Prev Topic | Next Topic »

Add to briefcase «««1234»»

Permissions Expand / Collapse