You are designing a database that will store telephone numbers. You need to ensure that only phone
numbers that use a specific format are written to the database.
What should you create?
You are a database developer on an instance of SQL Server 2008.
You need to provide a custom function that will perform complex calculations on groups of data in one of
your tables. You want users to be able to reference the function directly from a query as if they were using a
built-in scalar function. Which type of object should you create?
You are a database developer on an instance of SQL Server 2008. Your Product table is defined as
follows:
Your company sells two types of products identified by the ProductType column: physical and virtual.
Physical products are stored in inventory locations. Virtual products, such as software downloads and
subscriptions, are not stored in physical inventory locations.
You are developing an Entity Data Model (EDM) using the Entity Framework. You want to create the EDM
to make virtual and physical products available while only exposing the necessary attributes for each.
Which data model should you create?
You are a database administrator on an instance of SQL Server 2008. You need to perform complex
processing on data from the OrderHistory
table in your database. You need the ability to scroll backward and forward through the rows in the table
and to perform specific actions on rows.
You always need to have access to the most up-to-date data.
Which construct should you use?
Your Prod database resides on an instance of SQL Server 2008. The Prod database contains a
SalesHeader table that is used by one of your applications. The SalesHeader table is defined as follows:
Currently, the SalesHeader table has a clustered index on the SalesOrderID column, and no other
indexes. You want to create indexes to provide best performance to your application.
Your application allows users to perform the following actions:
Searching for an order with a specified order number
Searching for orders within a specified order number range
Searching for orders that belong to specific customers
Searching for orders with a specified customer account number
The application will use the SalesOrderID and CustomerID columns in joins to retrieve data from other
tables. Which index or indexes should you create?
You are designing a table that will store transactions for an online retailer. You anticipate that the online
retailer will have an average of 500,000 transactions per day. You need to design a solution for data aging
and archiving. The solution must minimize the amount of time it takes to return query results for active data.
What should you implement?
You are a database developer on an instance of SQL Server 2008. You have a Prod database that
contains all inventory-related data for your company.
Your InvTransaction table is defined as follows:
You have a Transact-SQL script that is performing poorly, and you need to determine the cause of the
degraded performance. The script executes an initial SELECT query on the InvTransaction table and then
uses the retrieved data values as criteria in additional queries. You view the graphical execution plan.
Which indicator would you most likely investigate further?
You are a database developer on an instance of SQL Server 2008. You created the TestDetails table using
the following CREATE TABLE statement:
CREATE TABLE TestDetails (
TestID int IDENTITY(1,1) PRIMARY KEY,
TestName nvarchar(10) NULL UNIQUE,
TestType char(1) CHECK (TestType = 'A' OR TestType = 'B'),
TestAuthorID int SPARSE);
With default settings, which row would be successfully inserted into the TestDetails table?
You intend to use SQL Server 2008 to create a database solution.
There's a large table in the database.
The table is updated not very often. A query is executed against the table by users.
The execution of a complex calculation is required by the query.
The calculation involves multiple columns for a given row.
You notice that because the query is CPU intensive, the query has a bad performance.
So what should you do to minimize the effect of this query on the server?
You are a database developer on an instance of SQL Server 2008. You are developing a Transact-SQL
script that will be used by developers. The
script uses multiple DML statements, but does not use transactions. You want to ensure that each DML
statement is treated as a separate transaction, but not automatically committed when executed. You must
also ensure that all DML statements are explicitly committed or all are rolled back.
You want to accomplish this with minimum effort. What should you do?