初级SQL Server开发人员面试题

Junior SQL Server Developer Interview Questions
Written By: Jeremy Kadlec

 

from: http://www.mssqltips.com/tip.asp?tip=1644

 

Problem
We are in the process of trying to hire a Junior SQL Server Developer to work on a few of our projects.  What expectations should we have on their skill set?  What are some fair questions to ask them during the interview process?  With a junior level developer, what should be the depth and breadth of the questions?

Solution
Hiring a Junior SQL Server Developer is a good way to grow your team and bring some new blood, enthusiasm and ideas to the team.  Hopefully you will also have the time for the junior team member to grow on their own and with the senior team members.  In terms of expectations, it really depends on the candidate and your needs.  For example, with SQL Server Integration Services (SSIS), if they have it listed on their resume as being able to build, deploy and maintain SSIS packages, they should be able to easily know how to create a project, work with the data flow, control flow and event handlers as well as some of the SSIS widgets in the toolbox.  With that being said the depth and breadth of questions should be balanced between the candidate's resume and your needs.  Let's jump into some questions to see if we can get the ball rolling for you in a few core SQL Server Developer areas.

Data Modeling

  • Question 1 - What is the importance of primary keys and foreign keys in a SQL Server OLTP database design?
    • Primary Keys
    • Foreign Keys
      • They physically define the relationship between tables by preventing data integrity issues in your database (e.g. The database prevents line items from being created without an existing order header).
      • They logically document the relationships between tables by showing how all data relates to each other. To someone new to your organization, this allows him/her to get a good understanding of how the business works (e.g. Every order taken must have a valid customer assigned).
      • Foreign Keys are native to SQL Server and are designed to prevent data integrity issues. Business logic developers should not be in the business of verifying table relationships.
      • If defined and indexed correctly, they can be leveraged by the SQL Server query engine to generate extremely efficient query plans.
  • Question 2 - What is an identity?  What is the value?  How can you capture the last identity value per column?
    • An identity is a property of a column where an seed and increment are defined.  The seed is the value that the column starts with and the increment is the value by which the identity grows.  In many circumstances the seed and increment values are 1 which means that the initial value is 1 and the identity grows by 1.
    • The value of the identity column is that the relational engine manages the values so you do not have to write logic to manage the identity values in multiple locations in the programming logic.
    • SQL Server provides three different functions for capturing the last generated identity value on a table that contains an identity column:

 

T-SQL Coding

 

SQL Server Functions

  • Question 1 - Name 3 or more aggregate functions and the value they provide in your coding.
    • Average - Returns the average of the values in the select list ignoring the NULL values.
    • BINARY_CHECKSUM - The checksum as a binary value for a single row or for particular columns in a table.
    • CHECKSUM - The checksum as a integer value for a single row or for particular columns in a table.
    • CHECKSUM_AGG - Returns the checksum of the values in a table as an integer.
    • COUNT - Returns the number of items in the select list as an integer data type including NULL and duplicate values.
    • COUNT_BIG - Returns the number of items in the select list as a big integer data type including NULL and duplicate values.
    • DISTINCT - Not include duplicate values in the SELECT list.
    • GROUPING - The GROUPING aggregate is always used with a GROUP BY and either the ROLLUP or CUBE function to calculate the group's value.
    • MAX - The highest value in the SELECT list.
    • MIN - The lowest value in the SELECT list.
    • SUM - The sum of all the values in the SELECT list which are numeric data types ignoring the NULL values.
    • STDEV - The standard deviation for all of the values in the SELECT list.
    • STDEVP - The standard deviation for the population for all values in the SELECT list.
    • VAR - The variance of the population for all values in the SELECT list.
    • VARP - The variance of the population for all values in the SELECT list.
  • Question 2 - What are some options to randomly capture a value from a column in a table?

 

Indexing

  • Question 1 - What are the different indexing options available and what columns do you typically index?  What is the value of indexing columns?
    • From a simple standpoint SQL Server offers two types of indexes clustered and non-clustered. In its simplest definition a clustered index is an index that stores the actual data and a non-clustered index is just a pointer to the data. A table can only have one Clustered index and up to 249 Non-Clustered Indexes. If a table does not have a clustered index it is referred to as a Heap.
    • To further clarify this lets take a look at what indexes do and why they are important. The primary reason indexes are built is to provide faster data access to the specific data your query is trying to retrieve. This could be either a clustered or non-clustered index. Without having an index SQL Server would need to read through all of the data in order to find the rows that satisfy the query. If you have ever looked at a query plan the difference would be an Index Seek vs a Table Scan as well as some other operations depending on the data selected.
    • Indexes are typically on these columns:
      • Primary keys
      • Foreign keys
      • Columns in WHERE, GROUP BY, ORDER BY, etc.
        • Single value, range of values, etc.
  • Question 2 - Can tables be over indexed?  What are the performance implications?

 

Business Intelligence

  • Question 1 - Name the three main tabs in the Visual Studio interface for SSIS Packages and the associated purpose.
    • Control flow - Logical flow from one piece of the package to the next.
    • Data flow - Database source and destination as well as data manipulation objects such as Merge, Lookup, Copy Column, Sorting, Pivot, etc.
    • Event handlers - Event based error handling.
    • Additional information - Category (SQL Server Integration Services)
  • Question 2 - What are some of the Reporting Services best practices that you follow?
    • Report Property options:
      • SnapToGrid - For finer control of object sizes, set the SnapToGrid property to False. Once done, you can resize rows, columns, textboxes, etc. to more exact dimensions.
      • InteractiveSize – To achieve one long scrollable web page, change height property (expanc InteractiveSize) to 0. Note: With reports that are very long, this can adversely affect report rendering times. Experiment, use judgement, and obtain feedback from users. Educate your users as to the pros and cons of this.
      • PageSize – The default is 8.5in, 11in. This is a standard portrait letter size page size. For landscape printing, swap the width and height (to 11in, 8.5in). Coordinate these changes with the InteractiveSize. (i.e. If you want to print landscape, but see one long scrollable page in the web browser before printing, set the InteractiveSize to a width of 11in, and a height of 0.)
      • Description – With Reporting Services (RS) in Native mode (not Sharepoint Integration mode), text you write in this property is displayed in the Report Manager and the WSS2 Reporting Services report viewer web part. For RS in Sharepoint Integration mode the entry has no affect. (For Sharepoint Integrated installations, you can add a field to the reporting document library and put the description there.)
    • Table properties:
      • DataSetName – Got have one, even if you are doing something creative like displaying some sort of header table. Almost every report I create has a dataset called ‘header’. I use this with a table to display the report logo graphic and some identifying fields (i.e. report runtime, username, report title, etc). This dataset is just a placeholder without any real content. Sometimes I use select statements like “Select getdate()” or “Select 1”.
      • NoRows – Depending on data selection criteria and/or parameters chosen by users, your report may yield no results (no rows). (Or your backend server might be down…yikes!) This option allows you to display a custom message to users in the event there is no data to display. (i.e. “The parameters you chose contains no data…please change your parameter choices and try rerunning the report”.)
      • FixedHeader – Set to “True”, this is the same as the “Header should remain visible while scrolling” checkbox in the Table Properties pop up window. It’s really a slick feature.
    • Textbox properties within a table:
      • BackgroundColor – Background color of the textbox
      • BorderStyle – I prefer “Solid” most of the time
      • Color – Means font color
      • Format – Used for various number, percentage, date, text formatting. For Dates without time use ‘d’. For integers, use ‘N0’. For fixed decimals use N and then a number. ‘N4’ is a number with 4 decimals. Use ‘P1’ for a percentage with 1 decimal place. Check BOL for more formatting codes.
      • Visibility – Another favorite, but deserves it’s own tip. Another day…
      • CanGrow – ‘True’ most of the time, but I like to use ‘False’ if I don’t want lines to wrap. In that event, I add the field to the Tooltip in the properties window of the textbox.
    • In the Properties section:

Next Steps

  • If you are preparing for an interview as either an interviewer or interviewee, consider these questions as building blocks for the process.
  • As is the case with all interviews, be sure to balance your needs with the candidates experience.  If you are looking to hire a junior level professional, be sure to keep that in mind as you conduct the technical interview.
  • Make sure to balance the technical responses that a candidate provides with their intangible skills such as communication, aptitude to learn and dedication.  The candidates current skills may not always meld completely, but they may have the aptitude to learn and reap long term benefits for the team.  They just may need the opportunity to shine.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值