Professional Documents
Culture Documents
SQL Basic Questions
SQL Basic Questions
A.
The SQL Server 2005 database engine hosts the .NET CLR, making it possible to develop database objects
using managed code written in a .NET programming language. The ability to develop database objects
in .NET code provides many advantages, including a managed security model, functionality that is
unavailable or difficult to implement in Transact-SQL, and greater choice of development language.
You can develop the following kinds of database objects in managed code:
Stored procedures
User-defined data types
User-defined functions
Triggers
User-defined aggregate functions
Developers can create database objects in the Visual Studio .NET environment and deploy them directly
to the database.
2. Which of the following kinds of database objects can you develop in managed code?
a) Stored procedures
b) Triggers
c) Notification Instances
d) Service Broker message identifiers
e) User-defined aggregate functions
A, b, e
a) You can use Service Broker to create queues for reliable, transactional, message-based
communication between software services.
b) You can use Service Broker to expose stored procedures as Web services.
c) You can use Service Broker to integrate CLR code within the SQL Server 2005 database
engine.
d) You can use Service Broker to build a subscription-based event notification application.
4. What is AWE and what is meant by Dynamic AWE capability in SQL Server 2005?
AWE support allows 32-bit applications to address physical memory beyond the limits of their
configured virtual memory address space. This switch is only needed for 32-bit application and not 64-
bit applications.
SQL Server 2005 has new capability called “Dynamic AWE”. This allows SQL Server 2005 to address
memory as seen by the Operating System.
5. What do you mean by Horizontal Partitioning of table and what are the advantages?
SQL Server 2005 provides support for partitioned tables. This allows a table to be spread across a
number of physical file groups, improving performance and making it easier to manage range-based
archiving procedures.
You can partition a table horizontally so that the rows are spread across multiple file groups. Implement
table partitioning to achieve the following results:
Partitioned tables can increase performance when you are querying large tables on a
system with eight or more processors. The SQL Server 2005 query optimizer can execute
queries across multiple partitions in parallel, reducing the processing time required.
A partitioned table allows easier management of data subsets, which you can group
together logically—by a date range, for example. A common data requirement is to
work with only the current month’s data.
You can specify the partitioning column, number of partitions, and the range of partitioning column
values for each partition. You can use only one column from the table to distinguish the range partitions.
One benefit of partitioning is that you can move data between partitioned tables very quickly relative to
performing an INSERT INTO SELECT FROM statement. This is because the data is not physically moved;
only the metadata concerning storage location is changed.
6. SQL Server 2005 allows you to partition a table horizontally so that the rows are spread across
multiple file groups. Implementing table partitioning can achieve which of the following results:
b, c
A.
The System Consistency Checker (SCC) is a feature of the SQL Server setup process. The SCC performs a
number of system checks and compares the settings it detects with those required for a successful SQL
Server 2005 installation. If any incompatibilities are detected, the SCC suggests actions to remedy the
problems. SCC checks are divided into five categories: system configuration, system availability, security
configuration, version configuration, and remote and cluster configuration. Understanding what the SCC
checks for during setup will help you prepare your computer for installation.
Operating System Ensure that the operating system Refer the user to the OS
Minimum Level (OS) is supported. requirement.
Requirement
Operating System Ensure that the required service Refer the user to the
Service Pack Level pack is applied to the operating Windows Update
Requirement system. Components for the
required service pack.
SQL Compatibility Ensure that the operating system Refer the user to the
with Operating is supported for the edition of OS/SQL Server edition
System SQL Server being installed. matrix.
32-bit or 64-bit Ensure that the user is Inform the user about the
Configuration attempting to install the 32-bit incompatibility, and then
Requirement release on a 32-bit platform or exit Setup.
the 64-bit release on a 64-bit
platform.
Windows Check that the WMI is installed. Inform the user that WMI
Management must be installed, and
Interface (WMI) then exit Setup.
Service Requirement
Minimum Hardware Ensure that the hardware meets Refer the user to the
Requirement the minimum requirements. hardware requirements
for the edition being
installed.
Operating System Ensure that the operating Refer the user to the OS
Minimum Level system (OS) is supported. requirement.
Requirement
Operating System Ensure that the required Refer the user to the
Service Pack Level service pack is applied to the Windows Update
Requirement operating system. Components for the
required service pack.
SQL Compatibility with Ensure that the operating Refer the user to the
Operating System system is supported for the OS/SQL Server edition
edition of SQL Server being matrix.
installed.
32-bit or 64-bit Ensure that the user is Inform the user about the
Configuration attempting to install the 32-bit incompatibility, and then
Requirement release on a 32-bit platform or exit Setup.
the 64-bit release on a 64-bit
platform.
Windows Management Check that the WMI is installed. Inform the user that WMI
Interface (WMI) Service must be installed, and
Requirement then exit Setup.
Minimum Hardware Ensure that the hardware Refer the user to the
Requirement meets the minimum hardware requirements
requirements. for the edition being
installed.
Exclusive Mutex Object Ensure that there are no Inform user that he or she must
other running instances wait for the existing setup
of Setup. process to complete and restart
Setup.
Pending Reboot Ensure that no files List the services, processes, or
Requirement required by Setup are applications that must be
locked by other services stopped. Users may also be
or processes. required to restart the computer
before running Setup.
Default Installation Check that the drive is Inform the user of the problem,
Path Permission not unformatted, read- and then exit Setup.
Requirement only, or compressed.
System Administrator Ensure that the user Inform the user that he or
Privilege running Setup has system she must log in as a
administrator privileges. system administrator.
SQL Server Version Check installed versions Refer the user to the
of SQL Server for upgrade service pack installation
eligibility when upgrading. files.
Enable Default Administrative Ensure that the administrative Prompt user and
Share Directory share (admin$) is enabled on the offer to enable
remote computer or cluster node. the share.
8. You have a customer who wants to implement encryption but if they choose Asymmetric
algorithm it may cause performance overhead. What could be other option that you can provide
to the customer
A.
In most real-world systems, the asymmetric algorithms used to encrypt data with a certificate cause
performance overhead, so a better approach that one can use in SQL Server 2005 is to generate a
symmetric key with which to encrypt the data and then encrypt the key with a certificate
We have 3 users
How will these users access the tables? Assume the server name as Server 1 and database as
AdventureWorks.
Scenario 1:
User: Rahul
T-SQL Queries
Scenario 2:
User: Ramesh
T-SQL queries
This is a new feature available in SQL 2005. This allows you to impersonate another user in order to
validate the necessary permissions that are required to execute the code without having to grant all of
the necessary rights to all the underlying objects and commands.
You can use the EXECUTE AS clause in a stored procedure or function to set the identity used in its
execution context.
With this you can control which user account the Database Engine uses to validate permissions on
objects that are referenced by the module. This provides additional flexibility and control in managing
permissions across the object chain that exists between user-defined modules and the objects
referenced by those modules. Permissions must be granted to users only on the module itself, without
having to grant them explicit permissions on the referenced objects. Only the user that the module is
running as must have permissions on the objects accessed by the module.
11. Which of the following options are valid for the syntax of the EXECUTE AS clause?
a) CALLER
b) OWNER
c) SELF
d) ADMINISTRATOR
a,b,c
12. When you create a certificate, where is it stored
13. A customer wants to move a user database from one server to another. Which all databases you
should also restore apart from user’s database so that certificate it uses can be moved?
You only need to move the user database as if you move a database, any certificates it uses are moved
with it.