ImriNew

       
      name = ImriNew
      exam = 70-029

      ---Hi, I've accomplished the following goals:
      ---a) Updated, Upgraded and Aggregated questions from previous dumps, 
      namely: Frodo, Toastman, Abdul, Gabio, XXX man, Cirix, Florian and others. 

      ---b) Performed research and added explanations (Thanks to A.R. my SQL 
      instructor, and BOL.)
      ---c) Removed a lot of useless and incorrect crap.
      ---d) Emphasized the duplicity in some of the questions.
      ---e) Added key words.
      ---f) Adapted the dump for Transcender and Trandumper test engines. just 
      copy the text on this web page to the appropriate folder inside your 
      engine (the one where all the text files are stored, usually named after 
      the exam number, in this case- 70-029).

      [MOST IMPORTANT: This test is a real b*tch. i passed with a 900 score. 
      this time for you, it's not enough just to memorize letters and associate 
      them to questions on the braindump, what was A in the dump can be D in the 
      real exam, so u MUST know the right answer, furthermore, u must remember 
      than in the real exams you have long exhibited and non-exhibited 
      questions, some questions are so long and full of details, it's impossible 
      to copy them word from word while taking the exam, what i'm saying is, not 
      ALL the data in the real exam is in the dump, and some questions in this 
      dump often are A LOT bigger in the exam, so try to understand the general 
      idea behind every question. 

      [NOTE: If you're interested in more explanations than those I've provided, 
      review the Frodo dump. I did not include Frodo's explanations in this 
      dump, I saw no need to. 

      [REMEMBER: This dump WILL get you through the 70-029. If you only want to 
      pass the exam, this is all you'll need. HOWEVER, this dump is NOT a 
      substitute for real knowledge of SQL blah blah blah...

      [Have fun,
      [Imri.


      1. Your database includes a table that is defined as follows: 
      CREATE TABLE Orders ( OrderID Int IDENTITY(1,1) NOT NULL, RegionID Int NOT 
      NULL, SalesPersonID Int NOT NULL, OrderDate Datetime NOT NULL, OrderAmount 
      Int NOT NULL) 
      The sales manager wants to see a report that shows total sales by region 
      as well as a grand total of sale. Which query can you use to create the 
      report? 

      A. SELECT salespersonID, regionID, SUM(orderamount) FROM orders GROUP BY 
      salespersonID,RegionID 
      B. SELECT salespersonID, regionID, SUM(orderamount) FROM orders ORDER BY 
      regionID 
      COMPUTE SUM(orderamount) 
      C. SELECT salespersonID, regionID, orderamount FROM orders ORDER BY 
      RegionId 
      COMPUTE SUM(OrderAmount) BY regionID 
      COMPUTE SUM(OrderAmount) 

      Answer: C 

      2. You are building a new database for the Human Resources Department of a 
      company. There are 10 departments within the company and each department 
      contains multiple employees. In addition, each employee might work for 
      several departments. How should you logically model the relationship 
      between the department entity and the employee entity? 

      A. A mandatory one-to-many relationship between department to employee 
      B. A optional one-to-many relationship between department to employee 
      C. Create a new entry, create a one-to-many relation from the employee to 
      the new entry, and create a one-to-many relation from the department entry 
      to the new entry.
      D. Create a new entry, create a one-to-many relation from the new entry to 
      the employee entry and, then create a one-to-many relationship from the 
      entry to the department entry

      Answer: C

      3. Your database includes a table named Sales. You monitor the disk I/O on 
      your Sales table, and you suspect that the table indexes are fragmented. 
      The Sales table has a clustered index named C_Sales on the primary key and 
      two non-clustered indexes named nc_sales1 and nc_sales2. You want to 
      rebuild the indexes on the Sales table by using a method that consumes the 
      fewest resources. How should you rebuild the indexes? 

      A. DBCC DBREINDEX (sales) 
      B. Create clustered index with drop-existing, create non-clustered index 
      with drop-existing 
      C. ALTER the clustered index, alter the non-clustered index with drop 
      existing 
      D. Three DROP INDEX statements, then three CREATE INDEX statements 

      Answer: A 

      4. You have a table sales with one CLUSTERED INDEX on sales_id and 3 
      NON-CLUSTERED INDEX on Custumer_Id, Date, Amount. Users are complaining 
      because it takes to much time to insert or update data. You want to 
      rebuild the indexes. 

      A. DBCC DBREINDEX sales.dbo.sales_id DBCC DBREINDEX sales.dbo.customer_id 
      DBCC DBREINDEX sales.dbo.date DBCC DBREINDEX sales.dbo.amount 
      B. DBCC DBREINDEX sales.dbo.sales_id DBCC DBREINDEX sales.dbo.customer_id, 
      sales.dbo.amount, sales.dbo.date 
      C. DROP INDEX on sales_id CREATE INDEX on sales_id
      D. DBCC DBREINDEX sales.dbo.sales_id 

      Answer: D 

      5. You need to create two new tables for your Purchasing database. The new 
      tables will be named PurchaseOrderHeader and PurchaseOrderLine. The 
      PurchaseOrderHeader table will have the PurchaseOrderHeaderID column as 
      the Primary Key. A PurchaseOrderLine row must not exist without a 
      corresponding PurchaseOrderHeader row. How can you create the table? 

      A. Something with CHECK Constraint
      B. Some other thing with CHECK Constraint
      C. Create the PurchaseOrderHeader table, and then create the 
      PurchaseOrderLine table that has a FOREIGN KEY constraint referencing the 
      PurchaseOrderHeader table.
      D. Create both tables, then create a FOREIGN KEY Constrain from 
      PurchaseOrderHeader referencing the PurchaseOrderLine table.

      Answer: C 

      6. You need to produce a sales report listing all salesperson 
      identification numbers, sales amounts, and order dates. You want the 
      report sorted from most recent sales to oldest sales for each day. You 
      want the sales amounts sorted from highest to lowest. You will be 
      selecting this information from a table that is defined as follows: 
      CREATE TABLE SalesInformation ( SalesInformationId Int IDENTITY (1,1) NOT 
      NULL PRIMARY KEY NONCLUSTERED, SalesPersonID Int NOT NULL, RegionID Int 
      NOT NULL, ReceiptID Int NOT NULL, SalesAmount Money NOT NULL, OrderDate 
      Datetime NOT NULL) 
      Which query will accurately produce the report? 

      A. SELECT salepersonID, saleamount, orderdate FROM salesinformation ORDER 
      BY orderdate DESC, saleamount DESC 
      B. SELECT salepersonID, saleamount, orderdate FROM salesinformation ORDER 
      BY orderdate, saleamount DESC 
      C. Others with various combinations of Max(salesamount), with DESC etc 
      D. Others with various combinations of Max(salesamount), without DESC etc 

      Answer: A 

      7. USE Sales DELETE FROM backorder FROM backorder bk INNER JOIN orders od 
      ON bk.order_id = od.order_id WHERE CONVERT(CHAR(10), ship_date) = 
      CONVERT(CHAR(10), GETDATE()) 
      What will this statement delete? 

      A. All records from BackOrders table entered today 
      B. Records from Orders table for orders that are backordered 
      C. Records from BackOrder table for orders that are shipped today 
      D. None because statement will cause a syntax error 

      Answer: C 

      8. You work for a telemarketing company. The company's telemarketing 
      application is a purchased application that allows minimal enhancements. 
      The application dials a telephone number and displays the last name of the 
      customer from the Customers table. The telemarketer wants to see the first 
      name of the customer as quickly as possible. You write the following 
      stored procedure: 
      CREATE PROCEDURE GetCustomerFirstName @Lastname Varchar (50) 
      AS 
      SELECT LastName, FirstName FROM Customers 
      WHERE LastName = @LastName 
      You create a NONCLUSTERED index on the LastName column. You set the 
      SHOWPLAN_TEXT option to ON and execute the stored procedure. The output is 
      as follow: 
      I--Bookmark Lookup (BOOKMARK:([Bmkl000]), 
      OBJECT:([Bank].[dbo].[Customer])) 
      I?Index Seek(OBJECT: ([Bank].[dbo].[Customer].[LastNameLDX1]), 
      SEEK:([Customer].[Lastname]=[@LastName]) ORDERED).
      What can you do to make the query more efficient? 

      A. Make LastName the PRIMARY KEY of the Customer table 
      B. Add FirstName to the NONCLUSTERED index on the Customers table 
      C. SELECT Lastname, Firstname FROM Customer(index=0) WHERE lastername 
      =@lastname 
      D. SELECT firstname, lastname FROM Customer WHERE lastname=@lastname 

      Answer: A

      once was B. B would not make that query more efficient. it's a lovely 
      solution, but for a different query. 

      9. You are creating a table named Recruit to track the status of potential 
      new employees. The SocialSecurityNo column must not allow null value. 
      However, a value for a potential employee's Social Security Number is not 
      always known at the time of initial entry. You want the database to 
      populate the SocialSecurityNo column with a value of "UNKNOWN" when a 
      recruiter enters the name of a new potential employee without a Social 
      Security Number. How can you accomplish this task? 

      A. Create a CHECK constraint 
      B. Create a rule and bind it to the column 
      C. Create a DEFAULT definition on the SocialSecurityNo column. 

      Answer: C 

      10. You are developing an application for a worldwide furniture 
      wholesaler. You need to create an inventory table on each of the databases 
      located in New York, Chicago, Paris, London, San Francisco, and Tokyo. In 
      order to accommodate a distributed environment, you must ensure that each 
      row entered into the inventory table is unique across all location. How 
      can you create the inventory table? 

      A. Use the identity function. At first location use IDENTITY(1,4), at 
      second location use IDENTIY(2,4), and so on.
      B. Use the identity function. At first location use IDENTITY(1,1), at 
      second location use IDENTITY(100000,1), and so on.
      C. Use TIMESTAMP data type.
      D. CREATE TABLE inventory ( Id Uniqueidentifier NOT NULL DEFAULT NEWID(), 
      ItemName Varchar(100) NOT NULL, ItemDescription Varchar(255) NULL, 
      Quantity Int NOT NULL, EntryDate Datetime NOT NULL) 

      Answer: D

      11. It is time for the annual sales awards at your company. The awards 
      include certificates awarded for the five sales of the highest dollar 
      amounts. You need to produce a list of the five highest revenue 
      transactions from the Orders table in the Sales database. The Orders table 
      is defined as follow: 
      CREATE TABLE Orders ( OrderID Int IDENTITY (1,1) NOT NULL, SalesPersonID 
      Int NOT NULL, RegionID Int NOT NULL, OrderDate Datetime NOT NULL, 
      OrderAmount Int NOT NULL) 
      Which statement will produce the report? 

      A. SELECT TOP 5 OrderAmount, SalesmanID FROM orders 
      B. SELECT TOP 5 OrderAmount, SalesmanID FROM orders ORDER BY OrderAmount 
      DESC 
      C. SELECT TOP 5 WITH TIES OrderAmount, SalesmanID From Orders ORDER BY 
      SalesmanID DESC 
      D. SELECT TOP 5 WITH TIES OrderAmount, SalesmanID From Orders ORDER BY 
      OrderAmount 

      Answer: B 

      the WITH TIES caluse:Specifies that additional rows be returned from the 
      base result set with the same value in the ORDER BY columns appearing as 
      the last of the TOP n (PERCENT) rows. TOP ...WITH TIES can only be 
      specified if an ORDER BY clause is specified (BOL). (it probably would be 
      wise to use this clause in this situation, but both C & D are wrong). 

      12. You plan to create two SQL Server 7 databases. One will be used for 
      Online Transaction Processing (OLTP), the other for Decision Support 
      Services (DSS). A client application is designed to capture production 
      information from the DSS database in real time. The application must 
      report product results, trends in a timely fashion, so you are charged 
      with maximizing the performance of the DSS database. What arrangement will 
      ensure the maximum performance for the DSS without significantly degrading 
      the performance of the OLTP database? 

      A. Create both databases on the same computer, and add additional indexes 
      to support both the OLTP and DSS databases. 
      B. Install the OLTP and DSS database each on its own server. Use 
      transactional replication making the OLTP database the publisher, and the 
      DSS database being both the distributor and subscriber. 
      C. Install the OLTP and DSS database each on its own server. Backup the 
      transaction log from OLTP database and restore it on the DSS database 
      routinely. 
      D. Create both databases on the same computer. Create distributed 
      transactions on the OLTP server to keep the DSS server synchronized. 

      Answer: B 

      13. You have two SQL servers supporting two separate applications on your 
      network. Each application uses stored procedures for all data 
      manipulation. You need to integrate parts of the two applications. The 
      changes are limit to a few stored procedures that need to make calls to 
      remote stored procedures. What should you do to implement calls to remote 
      stored procedure? 

      A. Add the remote server as linked server. Fully qualify the remote 
      procedure name. 
      B. Configure SQL by setting REMOTE_PROC_TRANSACTION to 1 (ON)

      Answer: B

      SET REMOTE_PROC_TRANSACTIONS {ON | OFF}: When ON, a Transact-SQL 
      distributed transaction is started when a remote stored procedure is 
      executed from a local transaction. When OFF, calling a remote stored 
      procedures from a local transaction does not start a Transact-SQL 
      distributed transaction (BOL)

      14. You increase the number of users of your customer service application 
      from 20 to 120. With the additional users, the response time when 
      retrieving and updating has slowed substantially. You examine all the 
      queries and indexes and discover that they are all fully optimized. The 
      application seems to run properly as long as the number of users is less 
      than 50. What can you do to solve the problem? 

      A. Ensure table hint are used in key queries 
      B. Increase lock_timeout 
      C. Free up dirty pages in memory with a short recovery interval 
      D. Ensure application is using optimistic locking strategy instead of a 
      pessimistic locking strategy. 

      Answer: D

      15. Your users report that your database application takes an excessive 
      amount of time to complete an operation. Over time, with the addition of 
      new rows and changes to existing rows, the situation has worsened. You 
      suspect that the tables are not optimally indexed. You plan to use the SQL 
      Server Profiler Create Trace Wizard to find out the cause of the problem. 
      What should you use the Create Trace Wizard to do? (Choose all that apply) 


      A. Find the worst performing query 
      B. Identify scans of large tables 
      C. Identify the cause of a Deadlock 
      D. Trace T-SQL activity by application 
      E. Trace T-SQL activity by user 

      Answer: A, B 

      16. You issue an UPDATE statement and then run a SELECT query to verify 
      that the update was accurate. You find out that the UPDATE statement was 
      executed properly. However, the next time you log on to the SQL Server 
      computer, it appears that your UPDATE statement was not executed. What is 
      the most likely problem? 

      A. The FMTONLY Option is set to ON.
      B. The SHOWPLAN_ALL Option is set to ON.
      C. The PARSEONLY Option is set to ON. 
      D. The IMPLICIT_TRANSACTIONS Option is set to ON.

      Answer: D 

      SET PARSEONLY (T-SQL): Checks the syntax of each Transact-SQL statement 
      and returns any error messages without compiling or executing the 
      statement (BOL). this means that if this option were set to ON, we would 
      not be able to execute anything, including the SELECT statement.

      SET FMTONLY (T-SQL): Returns only metadata to the client (BOL). this 
      statement would cause the query to return only data from culomns, and no 
      data from rows. this is not the case here.

      SET IMPLICIT_TRANSACTIONS {ON | OFF}: Sets implicit transaction mode for 
      the connection. When a connection is in implicit transaction mode and the 
      connection is not currently in a transaction, executing any of the 
      following statements start a transaction:

      ALTER TABLE FETCH REVOKE 
      CREATE GRANT SELECT 
      DELETE INSERT TRUNCATE TABLE 
      DROP OPEN UPDATE 

      If the connection is already in an open transaction, the statements do not 
      start a new transaction.
      Transactions that are automatically opened as the result of this setting 
      being ON must be explicitly committed or rolled back by the user at the 
      end of the transaction. Otherwise, the transaction and all the data 
      changes it contains are rolled back when the user disconnects. After a 
      transaction is committed, executing one of the statements above starts a 
      new transaction.

      17. You want to increase product prices in database in the following 
      manner: Up to $50 increase by 5%, between 50 & 100 increase by 10%, over 
      $100 increase by 15%. How can you accomplish this and minimize performance 
      hit on the database? 

      A. Update Inventory
      Set Price = Price *1.05
      WHERE Inventory <= 50
      Update Inventory
      Set Price = Price *1.10
      WHERE Inventory Between 50 And 100
      Update Inventory
      Set Price = Price *1.15
      WHERE Inventory >100
      B. Update Inventory = Case 
      When Price < 50 Then Price *1.05 
      When Price Between 50 And 100 Then Price 1.10 
      Else Price 1.15 END
      C. TSQL using cursors 
      D. TSQL using cursors 

      Answer: A

      news flash: you CANNOT update a table with CASE. that's a main difference 
      between CASE and IF... THEN. B might work if you put it in a C++ program. 
      too bad you're studying SQL and in T-SQL CASE has two formats: The simple 
      CASE function compares an expression to a set of simple expressions to 
      determine the result. The searched CASE function evaluates a set of 
      Boolean expressions to determine the result (BOL).

      18. You are testing a marketing application that gathers demographic 
      information about each household in the country. The demographic table in 
      the application contains more that 1,000 columns. Users report problems 
      regarding the performance of the application. As part of your 
      investigation into these reports, you are reviewing how the logical data 
      model was implemented. Most of the reports relate too long response times 
      when users are updating or retrieving data from the demographic table. 
      Nearly 90 percent of the users search or update 20 of the columns. The 
      remaining columns are seldom used, but they are important. What should you 
      do to improve data retrieval and update the performance when accessing the 
      information in the demographic table? 

      A. Create clustered index on the Demographic over the most accessed 
      columns 
      B. Create a VIEW based on Demographic table which selects the 20 most 
      accessed columns 
      C. Divide the data in Demographic table into two new tables with one table 
      containing the 20 most accessed columns and the other containing the 
      remaining columns 
      D. Create a series of stored Procedures that select or update the 
      Demographic table according to user needs 

      Answer: C 

      19. Your users report slow response time when they are modifying data in 
      your transaction processing application. Response time is excellent when 
      users are merely retrieving data. The search criteria used for modifying 
      data are the same as the search criteria for retrieving data. All 
      transactions are short and follow standard guidelines for coding 
      transactions. You monitor blocking locks, and you find out that they are 
      not causing the problem. What is the most likely cause of the slow 
      response time when modifying data? 

      A. The transaction log is placed on an otherwise busy disk drive 
      B. The transaction log is nearly full 
      C. The checkpoint process is set too short 
      D. The tempDB database is too small 
      E. The tempDB database is on the same physical disk drive as the database 

      Answer: A 

      20. You have a database that is accessed by many different applications 
      written with different development tools. Many applications were 
      originally written to work against any relational database system that 
      complies with ANSI 92. Each application uses a different mechanism for 
      accessing the database. ODBC, DB-Library, and ADO are all used 
      simultaneously. Transaction processing is not uniform across all your 
      application. How can you ensure that all applications handle transactions 
      in the same fashion? 

      A. Program all application to issue the SET ANSI_DEFAULTS ON command 
      immediately after establishing a user connection. 

      Answer: A

      SET ANSI_DEFAULTS {ON | OFF} (T-SQL): When enabled (ON), this option 
      enables the following SQL-92 settings:

      SET ANSI_NULLS SET CURSOR_CLOSE_ON_COMMIT 
      SET ANSI_NULL_DFLT_ON SET IMPLICIT_TRANSACTIONS 
      SET ANSI_PADDING SET QUOTED_IDENTIFIER 
      SET ANSI_WARNINGS 

      Together, these SQL-92 standard SET options define the query processing 
      environment for the duration of the user's work session, a running 
      trigger, or a stored procedure (BOL).

      21. Your database application includes a complex stored procedure that 
      display status information as it processes transactions. You obtain 
      unexpected results in the status information when you run the stored 
      procedure with certain input parameters. You want to use SQL Server 
      Profiler to help find the problem in your stored procedure. Which four 
      events should you track? 
      (Choose four) 

      A. SQL:BatchStarting
      B. SP:StmtCompleted 
      C. SP:StmtStarting 
      D. SQL:BatchCompleted

      Answer: A,B,C,D

      This is a problem question and no one seems to remember which 4 events 
      should be tracked. this is my just my theory (i did NOT have this question 
      on my exam). I based it on the following:

      When an application sends a Transact-SQL batch for execution, a generic 
      packet for executing SQL is used that shows up in the SQL Server Profiler 
      trace as SQL:BatchStarting and SQL:BatchCompleted events (BOL).

      By monitoring the SP:Starting, SP:StmtStarting, SP:StmtCompleted, and 
      SP:Completed event classes and all the TSQL event classes, the execution 
      of a stored procedure can be monitored (BOL).

      22. (batch job version 1) Your database includes a job_cost table that 
      typically holds 100,000 rows but can grow or shrink by as much as 75,000 
      rows at a time. The job_cost table is maintained by a batch job that runs 
      at night. During the day, the job_cost table is frequently joined to other 
      tables by many different queries. Your users report that their initial 
      queries are very slow, but then response time improves for subsequent 
      queries. How should you improve the response time of the initial queries? 

      A. Run sp_createstats as part of the nightly batch job 
      B. Run sp_updatestats as part of the nightly batch process 
      C. Set the auto update statistics Database option to be true 
      D. Can't remember but some weird Database option 

      Answer: B 

      sp_updatestats (T-SQL): Runs UPDATE STATISTICS against all user-defined 
      tables in the current database. sp_updatestats displays messages 
      indicating its progress. When the update is completed, it reports that 
      statistics have been updated for all tables (BOL). 

      23. (batch job version 2) A table with 100,000 rows. Each night a 
      scheduled job transfers data in/out of it and reduces it to 30,000 rows. 
      Each morning users complain that from 8AM till 8:30AM their application is 
      working slowly. How to prevent this behavior?

      A. Run sp_createstats as part of the nightly batch job 
      B. Run sp_updatestats as part of the nightly batch process 
      C. Set the auto update statistics Database option to be true 
      D. Can't remember but some weird Database option 

      Answer: B 

      sp_updatestats (T-SQL): Runs UPDATE STATISTICS against all user-defined 
      tables in the current database. sp_updatestats displays messages 
      indicating its progress. When the update is completed, it reports that 
      statistics have been updated for all tables (BOL).

      24. You need to create a 6GB online transaction processing (OLTP) 
      database. Your SQL Server computer has two disk controllers, and each 
      controller has four 6GB hard disk drives. Each hard disk drive is 
      configured as a separate NTFS partition. Microsoft Windows NT, the Windows 
      NT swap file, and SQL Server are all installed on drive C. The remaining 
      drives, which are labeled as drive D through J, are empty. How should you 
      create the OLTP database? 

      A. 6GB on D log on E 
      B. 4 2Gb files on D-G disks, 3 log file H-J 
      C. Create the data portion of the database as six separate files on drives 
      D through I, with one file on each drive. Create the transaction log as a 
      single file on drive J 
      D. something wrong 24 files on drives D to I 

      Answer: C 

      25. You have a table with a clustered primary key. The table is used 
      frequently for both queries and data modification. As part of a review of 
      data storage and disk utilization, you run the DBCC SHOWCONTIG statement. 
      The statement provides the following output: 
      Pages Scanned 158 
      Extents Scanned 21 
      Extent Switches 20 
      Avg. pages per extent 7.5 
      Scan Density 95.24% [20:21] 
      Extent Scan Fragmentation 4.76% 
      Avg. Bytes Free per Page 408.4 
      Avg. Page Density (full) 94.95% 
      What does this output tell you about how the data is stored? (Choose all 
      that apply) 

      A. The table is not externally fragmented. 
      B. The table is not internally fragmented. 
      C. The number of Extent Switches is excessive. 
      D. The row size does not efficiently fit on a page. 
      E. The IAM page does not reflect the actual extent usage. 

      Answer: A, B 

      the number of extent switches is optimally equal to the number of extent 
      scans. in this case they are very close to each other (20:21) and that's 
      good. it rules out C as an option. 
      Scan Density-The number in scan density is 100 if everything is 
      contiguous; if it is less than 100, some fragmentation exists (BOL). in 
      this case, Scan density is 95.24% which is ok. It should not fall below 
      90.00%. The 4.76 remaining percents (Extent scan fragmentation) indicate 
      that there is not too much external fragmentation, so A is correct.
      Avg. bytes free per page-Average number of free bytes on the pages 
      scanned. The higher the number, the less full the pages are. Lower numbers 
      are better. This number is also affected by row size; a large row size can 
      result in a higher number.(BOL). in this case there are 408.4 (out of 
      8000) Avg. free bytes per page, which is quite good. it also rules out D.
      Avg. page density (full)-This value takes into account row size, so it is 
      a more accurate indication of how full your pages are. The higher the 
      percentage, the better (BOL). in this case it's 94.95%, it shows that 
      there's not too much internal fragmentation, so B is correct.

      26. You have a table with a clustered primary key. The table is used 
      frequently for both queries and data modification. As part of a review of 
      data storage and disk utilization, you run the DBCC SHOWCONTIG statement. 
      The statement provides the following output: 
      Pages Scanned: 158 Extents scanned: 20 
      Extent Switches: 21 
      Scan Density: 20:21 (Best Count : ActualCount) 
      Extent scan Fragmentation: 4.83% 
      Avg. bytes free per page: 284.7 
      Avg. Page density(full): 94.83% 
      What does this output tell you about how the data is stored? (Choose all 
      that apply) 

      A. The Table is not internally fragmented 
      B. The table is not Externally fragmented 
      C. The Extent Switches are too high 
      D. The pages fit well on the page 

      Answer: A, B, D 

      the number of extent switches is optimally equal to the number of extent 
      scans. in this case they are very close to each other (20:21) and that's 
      good. it rules out C as an option.
      Scan Density-The number in scan density is 100 if everything is 
      contiguous; if it is less than 100, some fragmentation exists (BOL). in 
      this case, Scan density is 95.27% which is ok. It should not fall below 
      90.00%. The 4.83 remaining percents (Extent scan fragmentation) indicate 
      that there is not too much external fragmentation, so B is correct.
      Avg. bytes free per page-Average number of free bytes on the pages 
      scanned. The higher the number, the less full the pages are. Lower numbers 
      are better. This number is also affected by row size; a large row size can 
      result in a higher number.(BOL). in this case there are 408.4 (out of 
      8000) Avg. free bytes per page, which is quite good. it suggests that D is 
      correct.
      Avg. page density (full)-This value takes into account row size, so it is 
      a more accurate indication of how full your pages are. The higher the 
      percentage, the better (BOL). in this case it's 94.95%, it shows that 
      there's not too much internal fragmentation, so A is correct. (Also, D 
      again).

      27. In the last year, your users have inserted or updated over 200,000 
      rows in a table named Sales. The Sales table has a clustered primary key. 
      Response times were good, but users report that response times have become 
      worse when queries are running against the Sales table. You run the DBCC 
      SHOWCONTIG statement on the Sales table and receive the following output: 
      Pages Scanned: 1657 
      Extents scanned: 210 
      Extent Switches: 1528 
      Avg. Page per extent: 7.9 
      Scan density: 13.60% [208:1529] 
      Logical Scan fragmentation: 91.43 
      Extent scan fragmentation: 1.43 
      Avg. bytes free per page: 2843.5 
      Avg. Page density(full): 64.87 What should you do to improve the response 
      times for queries? 

      A. Update the statement on the sales table 
      B. Create addition statement on the sales table 
      C. Run DBCC checktable statement on sales table 
      D. Run DBREINDEX statement on sales table 

      Answer: D 

      28. You have a table: 
      CREATE TABLE Employee( Employee_id int identity (1,1), Fname varchar (30), 
      Lname varchar (30), Phone int , Address varchar (30), Salary money) 
      The phone number is an int but you want to show it like (999)-999-9999. 
      Choose the correct SELECT query. 
      A. Select Employee_id , Fname, Lname, '(' + 
      substring(convert(char(3),phone),3,0) + ')-' + sub 
      string(convert(char(3),phone),3,5) + '-' + 
      'substring(convert(char(3),phone),3,6) from employee 
      B. Select Employee_id , Fname, Lname, '(' + 
      substring(convert(char(3),phone),0,3) + ')-' + sub 
      string(convert(char(3),phone),3,3) + '-' + 
      'substring(convert(char(3),phone),6,3) from employee 
      C. Select Employee_id , Fname, Lname, '(' + 
      substring(convert(char(3),phone),3,1) + ')-' + 
      substring(convert(char(3),phone),3,4) + '-' + 
      'substring(convert(char(3),phone),3,7) from employee 
      D. Select Employee_id , Fname, Lname, '(' + 
      substring(convert(char(3),phone),1,3) + ')-' + sub 
      string(convert(char(3),phone),4,3) + '-' + 
      'substring(convert(char(3),phone),7,4) from employee 

      Answer: D

      29. Your Orders table is defined as follow: 
      CREATE TABLE Orders ( OrderID Int IDENTITY (1,1) NOT NULL, SalesPersonID 
      Int NOT NULL, RegionID Int NOT NULL, OrderDate Datetime NOT NULL, 
      OrderAmount Int NOT NULL) 
      The table is becoming too large to manage. You must delete all sales that 
      are more than three years old. Which query will accomplish the desired 
      result? 

      A. Delete from Orders Where OrderDate < DATEADD(YY,-3,GETDATE()) 
      B. Delete from Orders Where OrderDate < DATEADD(YY,3,GETDATE()) 
      C. Delete from Orders Where OrderDate < GETDATE(), -3 
      D. Delete from Orders Where OrderDate < GETDATE(), +3 

      Answer: A 

      30. A stored procedure is created and a Visual Basic user with SQL 
      authentication is trying to execute it but can't. Windows NT security is 
      not used. 

      A. Give the user rights on the stored procedure 
      B. Make user part of NT group that has access to store procedure 
      C. Make user part of the SA role 
      D. Make user part of domain administrator 

      Answer: A 

      31. Want to export data to Pivot table in Excel spreadsheet from SQL. Data 
      changes frequently. Want to automate the process of updating the Excel 
      spreadsheet and use SQL Server Agent to schedule Job to automate. 

      A. Bulk copy script tabbed delimited textfile 
      B. Bulk copy script to populate the spreadsheet 
      C. Data Transformation Services to export package to tab delimited 
      textfile 
      D. Data Transformation Services to populate the spreadsheet 

      Answer: D 

      for more information about delimited objects, see: delimited text file, 
      exporting data to a text file example, both in BOL.

      32. How do you add constraint to an existing table? 
      CREATE TABLE sample (Field1 int, Field2 int, Field3 int) 
      You want your Fields 1, 2 and 3 to be unique. 

      A. ALTER TABLE sample ADD CONSTRAINT fieldconst UNIQUE 
      NONCLUSTERED(field1, field2, field3) 
      B. ALTER TABLE sample ADD CONSTRAINT fieldconst1 UNIQUE NONCLUSTERED 
      field1 
      C. ALTER TABLE sample ADD CONSTRAINT fieldconst2 UNIQUE NONCLUSTERED 
      field2 
      D. ALTER TABLE sample ADD CONSTRAINT fieldconst3 UNIQUE NONCLUSTERED 
      field3 

      Answer: B, C, D

      33. You are implementing a transaction-based application for a credit card 
      company. More that 10 million vendors accept the company's credit card, 
      and more than 100 million people regularly use the credit card. Before 
      someone can make a purchase by using the credit card, the vendor must 
      obtain a credit authorization from your transaction-based application. 
      Vendors around the world must be able to authorize purchase in less than 
      30 seconds, 24 hours a day, 7 days a week. Additionally, the application 
      must be able to accommodate more vendors in more locations in the future. 
      What should you do to implement the application to meet all of the 
      requirements? 

      A. Implement a Client/Server Architecture in which Vendors obtain an 
      authorized code from Centralized SQL SERVER that has enabled fall back 
      support. 
      B. Implement a Client/Server Architecture in which Vendors obtain an 
      authorized code from Centralized SQL SERVER that uses Microsoft Windows NT 
      Clustering service. 
      C. Implement an n-tier in which Vendors make calls to a single Microsoft 
      Transaction Server (MTS), which will obtain an authorization code from a 
      centralized SQL SERVER. 
      D. Implement an n-tier in which Vendors make calls to geographically 
      dispersed MTS application, which will obtain an authorization code from 
      geographically dispersed SQL SERVER. 

      Answer: D 

      34. A credit card company serves many customers all over the world, you 
      are developing an app to authorize the use of credit cards? What do you 
      need? 

      A. one SQL server 
      B. one SQL server, one MTS 
      C. n SQL server, one MTS 
      D. n SQL server, n MTS 

      Answer: D 

      35. You have a database that is used for storing the text of speeches 
      given by certain government officials. The text of each speech is stored 
      in the Speeches table that is defined as follows: CREATE TABLE Speech 
      (SpeechID Char(32) Speechtext Text AuthorID Char(32)) GO. A fulltext index 
      exists for all columns in the Speech table. You want to search for a 
      speech that includes the phrase "Fore Score and only". Which query should 
      you use to perform this search? 

      A. WHERE SpeechID like '%Fore Score and only%' 
      B. WHERE SpeechText Like '%Fore Score and only%'
      C. WHERE FREETEXT(SpeechID, 'Fore Score and only')
      D. WHERE FREETEXT(Speechtext, 'Fore score and only')

      Answer: D 

      36. The WHERE clause of query includes Search on Column A, Column B, 
      Column C. Column A is nearly identical in all row. Column B is identical 
      in about 50% of the row, Column C is identical in about 10% of the row. 
      How should you create indexes? 

      A. Create composite clustered index on Column A, Column B, Column C. 
      B. Create composite clustered index on Column C, Column B, Column A. 
      C. Create composite nonclustered index on Column A, Column B, Column C. 
      D. Create composite nonclustered index on Column C, Column B, Column A. 
      E. Create composite clustered index on Column A, separated nonclustered 
      index on Column B & Column C. 
      F. Create separated nonclustered index on each column. 

      Answer: B

      37. Your company has a HQ offices and 3 Regional offices (RG1, RG2, RG3). 
      Each office have a employee tables with the following columns: emp_id, 
      salary, hire_date, department, s_number, jod_id 
      You want to write view that gives the following form of results: 
      Office emp_id department hire_date 
      ------------- --------------- ----------------- ----------------- 
      What of the following do you use to with the create view? 

      A. SELECT 'HQ' Office, emp_id, department, hire_date FROM HQ SELECT 'RG1' 
      Office, emp_id, department, hire_date FROM RG1 SELECT 'RG2' Office, 
      emp_id, department, hire_date FROM RG2 SELECT 'RG3' Office, emp_id, 
      department, hire_date FROM RG3 
      B. SELECT *FROM HQ SELECT *FROM RG1 SELECT *FROM RG2 SELECT '*FROM RG3 
      C. SELECT 'HQ', emp_id, department, hire_date FROM HQ Union ALL SELECT 
      'RG1', emp_id, department, hire_date FROM RG1 Union ALL SELECT 'RG2', 
      emp_id, department, hire_date FROM RG2 Union ALL SELECT 'RG3', emp_id, 
      department, hire_date FROM RG3 (in real exam it is like this) 
      D. SELECT Office='HQ', emp_id, department, hire_date FROM HQ Union ALL 
      SELECT Office='RG1', emp_id, department, hire_date FROM RG1 UNION ALL 
      SELECT Office='RG2', emp_id, department, hire_date FROM RG2 Union ALL 
      SELECT Office='RG3', emp_id, department, hire_date FROM RG3 

      Answer: D 

      38. A question asking how to implement cascade deleting? 

      A. Create a trigger and do not use referential integrity 
      B. Create a trigger and use referential integrity 

      Answer: A

      referential integrity (RI): An integrity mechanism ensuring vital data in 
      a database, such as the unique identifier for a given piece of data, 
      remains accurate and usable as the database changes. Referential integrity 
      involves managing corresponding data values between tables when the 
      foreign key of a table contains the same values as the primary key of 
      another table (BOL).

      39. Your company's customers table has 1,000,000 records, and will be 
      increased by 20% EACH YEAR. The table is updated every night, and during 
      daytime some queries are performed on it. You want to increase the 
      performance of the queries. What fill factor will you set? 

      A. Use the default fill factor 
      B. 25% 
      C. 75% 
      D. 100% 

      Answer: C

      missing key words: 'heavily updated'. that's why we'll choose C and not B.

      40. You are recreating the customers database and you want to create the 
      index, The table has 1,000,000 records and is heavily updated. The table 
      is expected to increase by 20% over two years. Choices given: 

      A. Use the default fillfactor 
      B. 100% fillfactor 
      C. 75% fillfactor 
      D. Use a fillfactor 25% 
      E. Do nothing 

      Answer: D

      key words: 'heavily updated'. suggests that an especially low fillfactor 
      should be used.

      41. You have a database that contains information about publication for 
      sales. You want to write a full-text search query that will search through 
      all columns in one table enabled for full-text querying. The table 
      includes a column named Titles, a column named Price, and a column named 
      Notes. The Titles and Notes columns are full-text enabled. You want to 
      find all publications that deal with French gourmet cooking. Which 
      CONTAINS statement should you use? 

      A. WHERE CONTAINS (*, '"French gourmet"') 
      B. WHERE CONTAINS (notes, '"French gourmet"') 
      C. WHERE CONTAINS (titles, '"French gourmet"') 
      D. WHERE CONTAINS (price, '"French gourmet"') 

      Answer: A 

      42. You have an accounting application that allows users to enter 
      information into a table named Staging. When data entry is complete, a 
      batch job uses the rows in the Staging table to update a table name 
      Production. Each user's rows in the Staging table are identified by the 
      user's SQL Server process ID number in a column named SpID. The code for 
      the batch job that updates the Production table is: 
      DECLARE @Count Int 
      BEGIN TRAN 
      SELECT @Count = COUNT(*) FROM Production p JOIN Staging s 
      ON p.account = s.account WHERE s.SpID = @@SpID 
      UPDATE p SET Amount = s.Amount FROM Production p JOIN Staging s 
      ON p.account = s.account WHERE s.SpID = @@SpID 
      IF @@ROWCOUNT <> @COUNT ROLLBACK TRAN 
      ELSE COMMIT TRAN 
      You find out that there have been locking problems when two users run the 
      batch job at the same time. What should you do to solve the problem? 

      A. Set transaction isolation level to SERIALIZABLE before running batch 
      job. 
      B. Set transaction isolation level to READ UNCOMMITTED before running 
      batch job. 
      C. Set deadlock priority to normal before run. 
      D. Set deadlock priority to low before run. 
      E. Include the table hint with rowlock, UPDLOCK when counting the rows in 
      the production table. 
      F. Include the table hint with TABLOCKX when counting the rows in the 
      production table. 

      Answer: E

      the UPDLOCK lock hint: Use update locks instead of shared locks while 
      reading a table, and hold locks until the end of the statement or 
      transaction. UPDLOCK has the advantage of allowing you to read data 
      (without blocking other readers) and update it later with the assurance 
      that the data has not changed since you last read it (BOL).


      43. You are implementing a logical data model for a decision support 
      system (DSS) database. Two of the tables in the model have a parent/child 
      relationship. The parent table is expected to have more than 1 millions 
      rows. The child table is expected to have more than 100 million rows. Most 
      reports present aggregate child information grouped according to each 
      parent row. Reports containing detailed child table information are 
      occasionally needed. How should the tables be implemented? 

      A. Create the parent table and child table as described in the logical 
      data model 
      B. Create the parent table that includes aggregate child information. Do 
      not create child table 
      C. Create the parent table that includes aggregate child information. 
      Create the child table as it exists on the logical data model 
      D. On the child table, create a non-clustered index that includes any 
      columns that are aggregate and the foreign key referenced to the parent 

      Answer: D

      That's right, D. this is not a typo. 

      44. The sales database contains a customer table and an order table. For 
      each order there is one and only one customer, and for each customer there 
      can be zero or many orders. How should primary and foreign key fields be 
      placed into the design of this database? 

      A. A primary key should be created for the customer_id field in the 
      customer table and also for the customer_id field in the order table. 
      B. A primary key should be created for the order_id field in the customer 
      table and also for the customer_id field in the order table. 
      C. A primary key should be created for the customer_id field in the 
      customer table and a foreign key should be created for the customer_id 
      field in the order table. 
      D. A primary key should be created for the customer_id field in the 
      customer table and a foreign key should be created for the order_id field 
      in the order table. 

      Answer: C

      45. If you attempt to create a stored procedure using the name of an 
      existing stored procedure in the database you will get an error. 
      Therefore, when writing a script to create a stored procedure it is 
      important to check for an existing stored procedure with the same name and 
      drop it if it exists. Assuming that you are the database owner, which of 
      the following SQL batches will drop a stored procedure named 
      sp_myprocedure from the current database? 

      A. SELECT *FROM sysprocedures WHERE name = 'dbo.sp_myprocedure' IF 
      @@ROWCOUNT >= 1 THEN DROP PROCEDURE dbo.sp_myprocedure 
      B. SELECT *FROM sysobjects WHERE name = object_name() IF @@ROWCOUNT = 1 
      THEN DROP PROCEDURE dbo.sp_myprocedure 
      C. IF EXISTS (SELECT *FROM sysprocedures WHERE id = 
      object_id('dbo.sp_myprocedure')) DELETE PROCEDURE dbo.sp_myprocedure FROM 
      sysobjects 
      D. IF EXISTS (SELECT *FROM sysobjects WHERE id = 
      object_id('dbo.sp_myprocedure')) DROP PROCEDURE dbo.sp_myprocedure 

      Answer: D 

      46. In your results you want to display the character string 'The name of 
      this product is' immediately before the product name. Which of the 
      following SQL SELECT statements could you use? 

      A. SELECT 'The name of this product is', prodname FROM products 
      B. SELECT 'The name of this product is ' & prodname FROM products 
      C. SELECT 'The name of this product is ' + prodname FROM products 
      D. SELECT (The name of this product is), prodname FROM products 

      Answer: C 

      The string concatenation operator allows string concatenation with the 
      addition sign (+), which is also known as the string concatenation 
      operator. All other string manipulation is handled through string 
      functions such as SUBSTRING (BOL).

      47. Your database includes tables that are defined as follow: 
      CREATE TABLE Salesperson ( SalespersonID Int IDENTITY (1,1) NOT NULL 
      PRIMARY KEY NONCLUSTERED, RegionID Int NOT NULL, LastName varchar(30) 
      NULL, FirstName varchar(30) NULL, MiddleName varchar(30) NULL, AddressID 
      Int NULL) 
      CREATE TABLE Orders ( OrderID Int IDENTITY (1,1) NOT NULL PRIMARY KEY 
      NONCLUSTERED, SalespersonID Int NOT NULL, RegionID Int NOT NULL, OrderDate 
      Datetime NOT NULL OrderAmount Money NOT NULL) 
      You need to produce a list of the highest sale for each salesperson on 
      September 15, 1998. 
      The list is to be printed in the following format: 
      Last Name First Name Order Date Order Amount 
      ------------------------------------------------------------ 
      Which query will accurately produce the list? 

      A. SELECT lastname, firstname, orderdate, MAX(orderamount) FROM 
      salesperson s LEFT OUTER join Orders os on s.salesPersonID = 
      o.salespersonid AND orderdate = '9/15/98' group by lastname, firstname, 
      orderdate 
      B. SELECT lastname, firstname, orderdate, MAX(orderamount) FROM 
      salesperson s LEFT OUTER join Orders os on s.salesPersonID = 
      o.salespersonid WHERE orderdate = '9/15/98' group by lastname, firstname, 
      orderdate 
      C. SELECT lastname, firstname, orderdate, MAX(orderamount) FROM 
      salesperson s INNER JOIN Orders o on s. salesPersonID = o.salespersonid 
      AND orderdate = '9/15/98' group by lastname, firstname, orderdate 
      D. SELECT lastname, firstname, orderdate, MAX(orderamount) FROM 
      salesperson s RIGHT OUTER JOIN Orders o on s. salesPersonID = 
      o.salespersonid AND orderdate = '9/15/98' GROUP BY lastname, firstname, 
      orderdate 

      Answer: A

      48. Your database includes a table named SalesInformtion that tracks sales 
      by region. The table is defined as follows: 
      CREATE TABLE SalesInformation ( SalesInformationID Int IDENTITY(1,1) NOT 
      NULL PRIMARY KEY NONCLUSTERED, SalesPersonID Int NOT NULL, RegionID Int 
      NOT NULL, ReceiptID Int NOT NULL, SalesAmount Money NOT NULL) 
      Your database also includes a table named SalesPerson that is defined as 
      follows: 
      CREATE TABLE SalesPerson ( SalesPersonID Int IDENTITY(1,1) NOT NULL 
      PRIMARY KEY NONCLUSTERED, RegionID Int NOT NULL, LastName Varchar(30) 
      NULL, FirstName Varchar(30) NULL, MiddleName Varchar(30) NULL, AddressID 
      Int NULL) 
      You want to ensure that each salesperson enter sales only in the 
      salesperson's own region. Which of the following actions can you perform 
      to accomplish this task? 

      A. Create a foreign key on SalesInfo (regionId) which references 
      SalesPerson table 
      B. Create a foreign key on SalesPerson (regionId) which references 
      SalesInfo table 
      C. Create a trigger on SalesInformation table that will verify that the 
      region for the sale is the same as the region for the salesperson 
      D. Create a trigger on SalesPerson which will check if regionId is same as 
      SalesInfo RegionId 

      Answer: C

      49. You have an Accounting application that captures batches of 
      transactions into a staging table before being processed. Processing can 
      be performed on individual batches or on the whole staging table. 
      Processing includes many validations before updating any of the production 
      tables. You want to accomplish the following goals: 
      - Avoid deadlocks, or ensure the deadlocks are handled appropriately. 
      - Ensure that each batch of transactions is accepted or rejected. 
      - Allow other users to access the production tables while accounting 
      transactions are being processed. 
      - Minimize reuse locking. 
      You take following actions: 
      - Begin a transaction. 
      - Validate each rows into production tables as appropriate by using 
      INSERT... SELECT statement. 
      - Update and delete existing producing tables as appropriate by joining 
      production tables to the staging tables. 
      - Commit the transaction. - Roll back the transaction if any errors are 
      encountered. (Choose all that apply)

      A. Deadlocks are avoided or handled appropriately 
      B. Each batch of transaction is accepted or rejected 
      C. Users can access the production tables with accounting transaction are 
      being precede 
      D. Resource locking is minimized 

      Answer: B, C, D

      50. Your shipping company has a database application that maintains an 
      inventory of items on each vessel. When each vessel is unloaded at its 
      destination, the inventory is counted, and the Arrived_Quantity column is 
      updated in the database. There can be thousands of vessels en route at any 
      one time. Each shipment is identified by a Shipment_ID. Each vessel can 
      carry thousands of items. Each item in a shipment is identified by an 
      item_number. You want to make sure the update of the arrived_quantity is 
      fast as possible. What should you do? 

      A. Create nonclustered index on the Shipment_ID column, the Item_Number 
      column & Arrived_Quantity column 
      B. Create clustered index on the Shipment_ID column, the Item_Number 
      column & Arrived_Quantity column 
      C. Create clustered index on the Shipment_ID column & the Item_Number 
      column 
      D. Create nonclustered index on the Shipment_ID column, & the Item_Number 
      column 

      Answer: C

      51. You are designing a data model for a DSS system containing two tables 
      (parent child relationship). The child table holds thousands more rows 
      than the parent. The fields in the parent table will be queried the most. 
      How do you implement the design? 

      A. One table (the parent) 
      B. One table: the parent that includes the aggregate fields from the child 

      C. Two tables as designed 
      D. Two tables, include in the Parent aggregates from the child 

      Answer: D 

      52. You are designing a logical model for database that will be used by an 
      employment agency. The agency accepts applications from individuals who 
      are looking for the jobs. In an attempt to increase their chances of being 
      hired, some applicants may use multiple aliases & submit multiple 
      applications for different jobs. The employment agency's recruiters can 
      identify some of the aliases by aliases by address & phone number. Some 
      recruiters try to find suitable jobs for registered applicants. When a 
      match is found the applicant is provided with employer's contact 
      information. You take the following steps: 
      - Design a table named JOBS that lists all available positions job 
      descriptions & salaries. 
      - Design a table named RECRUITERS that lists all recruiters. 
      - Design a table named EMPLOYERS that list all employers. 
      - Create a FK on RecruiterID cl. to reference the RECRUITERS tb. 
      - Design a table named APPLICANTS that lists all applicants, their desired 
      positions & salaries, & description of each applicant's skills. 
      - Create FK on the RecruiterID cl. to reference the RECRUITERS tb. 
      - Design a table named ALIASES. Include in each record 2 applicant IDs 
      that are associated with 2 different names used by same applicant. 
      - Create a FK on each of theses columns to reference the AplicantID cl. in 
      the APPLICANTS tb. 
      Which results? (Choose all that apply)

      A. Each applicant can be matched to all employers who offer suitable 
      positions 
      B. Each available position can be associated with employer 
      C. Each applicant can be associated with all corresponding aliases 
      D. The data does not contain redundant data 
      E. All applicants & employers whom a recruiter has registered can be 
      identified 

      Answer: C, D, E 

      53. You have an application that captures real time stock market 
      information and generates trending reports. In the past, the reports were 
      generated after the stock markets closed. The reports now need to be 
      generated on demand during trading hours. What can you do so that the 
      reports can be generated without affecting the rest of the application? 
      (Choose all that apply)

      A. Program the application to issue the following command before 
      generating a report: set transaction isolation level read uncommitted 
      B. Program the application to issue the following command before 
      generating a report: set transaction isolation level serializable 
      C. Require the application to include the NOLOCK table hint while 
      generating a report 
      D. Require the application to include TABLOCKX while generating a report 
      E. On the stock transaction tables, create triggers that update summary 
      tables instead of performing a data analysis each time a report generated 
      F. Declare global scrollable cursors on the stock transaction tables 

      Answer: A, E 

      the NOLOCK locking hint: Do not issue shared locks and do not honor 
      exclusive locks. When this option is in effect, it is possible to read an 
      uncommitted transaction or a set of pages that are rolled back in the 
      middle of a read. Dirty reads are possible. Only applies to the SELECT 
      statement

      the TABLOCKX locking hint: Use an exclusive lock on a table. This lock 
      prevents others from reading or updating the table and is held until the 
      end of the statement or transaction
      (BOL)

      54. You would like to create a view of a table for users to input data. 
      The view must restrict the maximum entry to 100,000. How can this be done 
      without the use of a trigger? 

      A. Create and bind a rule 

      Answer: A

      55. Your Sales database is accessed by a Microsoft Visual Basic 
      client/server application. The application is not using the Microsoft 
      Windows NT Authentication security model. The Orders table has a primary 
      key consisting of an identity column named OrderID. When a customer 
      cancels an order, the row for that order is deleted from the Orders table. 
      Sometimes, a customer who cancelled an order will ask that order to be 
      reinstated. 
      You must write a stored procedure that will insert the order back into the 
      database with the original OrderID. 
      You write the following stored procedure to be called by the Visual Basic 
      application: 
      CREATE PROCEDURE InsertReinstatedOrder @OrderID Int, @SalesPersonID Int, 
      @RegionID Int, @OrderDate Datetime, @OrderAmount Money, @CustomerID Int AS 
      SET IDENTITY_INSERT Orders ON INSERT Orders (OrderID, SalesPersonID, 
      RegionID, OrderDate, OrderAmount, CustomerID) VALUES (@OrderID, 
      @SalesPersonID, @RegionID, @OrderDate, @OrderAmount, @CustomerID) SET 
      IDENTITY_INSERT Orders OFF RETURN GO 
      GRANT EXECUTE ON InsertReinstateOrder TO Sales GO 
      You test the procedure and it is implemented with Visual Basic 
      application. A user named Andrew is assigned to the Sales role. Andrew 
      reports that he is receiving an error message indicating that he is having 
      a permission problem with the procedure. What must you do to solve the 
      problem? 

      A. Give user exclusive rights 
      B. Grant access to NT user 
      C. Grant access to NT Group 
      D. Give user db-owner 

      Answer: A

      56. Your database includes an Orders table that is defined as follows: 
      CREATE TABLE Orders ( OrderID Int IDENTITY (1,1) NOT NULL, SalesPersonID 
      Int NOT NULL, RegionID Int NOT NULL, OrderDate Datetime NOT NULL, 
      OrderAmount Int NOT NULL) 
      You have written a stored procedure name GetOrders that reports on the 
      Orders table. The stored procedure currently creates a list of orders in 
      order by SalesPersonID. You must change the stored procedure to produce a 
      list of orders in order first by RegionID and then by SalesPersonID. 
      Permissions have been granted on the stored procedure, and you do not want 
      to have to grant them again. How must you change the stored procedure? 

      A. Something with ALTER, but ORDER missing or incorrect.
      B. ALTER PROCEDURE GetOrders As 
      SELECT SalesPersonID, RegionID, OrderID, OrderDate, OrderAmount 
      FROM Orders 
      ORDER BY RegionID, SalesPersonID
      C. Something with DROP procedure, and then add it.
      D. Something other with DROP procedure, and then add it.

      Answer: B

      ALTER PROCEDURE (T-SQL): Alters a previously created procedure (created by 
      executing the CREATE PROCEDURE statement) without changing permissions and 
      without affecting any dependent stored procedures or triggers (BOL).
      that's a difference between the CREATE PROCEDURE statement and the ALTER 
      PROCEDURE statement.

      57. You are building a decision support system (DSS) database for your 
      company. The new database is expected to include information from existing 
      data sources that are based on Microsoft Excel, dbase III, Microsoft 
      Access and Oracle. You want to use SQL Server Agent to run a scheduled job 
      to extract information from the existing data sources into a centralized 
      database on SQL Server 7. You do not want to perform any additional 
      programming outside the SQL environment. How must you extract the 
      information from the existing data sources? 

      A. Create a Data Transformation Services (DTS) package to import data from 
      each data source. 

      Answer: A

      58. There is a join between table A and table B by a clustered index. Now, 
      you are moving tables to a new database. You want to increase the 
      performance of queries made by join. 
      As it was seen earlier (before moving to the new database) that when both 
      the tables were placed on the different filegroups the performance as 
      increased. 

      A. Create two filegroups FGA and FGB on separate disk. Place TA and its 
      indexes on FGA, TB and its indexes on FGB 
      B. Create three filegroups FGA, FGB, FGC on three separate disks. Place TA 
      on FGA, TB on FGB, and index of two table on FGC 
      C. Create one RAID 5 disk and place TA, TB, and their index from both 
      tables on the RAID 5 disk 
      D. Something like this: RAID 10 (1 & 0) on 2 controllers, create TA, TB 
      and their index. 

      Answer: B 

      59. CREATE TABLE ( Product_ID IDENTITY PRIMARY KEY, Description 
      NONCLUSTERED, product_type, ...) You often query description and 
      product_type, how to improve performance? 

      A. Enterprise Manager to create NONCLUSTERED INDEX on each referenced 
      column 
      B. Enterprise Manager to generate sp for product table 
      C. Use index tuning 
      D. Profiler to monitor performance statistics of query 

      Answer: C 

      60. You have an application that makes four connections to the SQL servers 
      at the same time. The connections are used to execute SELECT, INSERT, 
      UPDATE, and DELETE statements. Each connection is used to execute one of 
      these four statements. The application occasionally stops responding when 
      a user is trying to update or delete rows, and then the user must close 
      the application. The problem occurs when a user attempts to execute an 
      UPDATE or DELETE statement after submitting a SELECT statement that 
      retrieves a result set of more than 10,000 rows. What can you do to 
      prevent the problem? 

      A. On the select session, set deadlock priority low 
      B. On the update/delete session, set deadlock priority low
      C. On the connection for the SELECT statement, set the isolation level to 
      READ UNCOMMITTED
      D. Set query wait option to 50,0000 

      Answer: C 

      61. How do you minimize deadlocking? 

      A. Set deadlock_priority to low 
      B. Issue a BEGIN DISTRIBUTED TRANSACTION statement. 
      C. Modify all transactions in the same order
      D. Ensure that the table has indexes on his PRIMARY and FOREIGN keys.

      Answer: C 

      62. You are the database administrator for your company. You receive 
      reports that your Sales application has very poor response time. The 
      database includes a table that is defined as follows: 

      CREATE TABLE dbo.Orders 
      ( OrderID Int IDENTITY(1,1) NOT NULL, 
      SalesPersonID Int NOT NULL, 
      RegionID Int NOT NULL, 
      OrderDate Datetime NOT NULL, 
      OrderAmount Int NOT NULL, 
      CustomerID Int NULL) 

      The OrderID column is the primary key of the table. There are also indexes 
      on the RegionID and OrderAmount columns. You decide to run a showplan on 
      all queries in the application. The following query, which access this 
      table, is used to list total average sales by region: 

      SELECT t1.RegionID, 
      AVG(t1.SalesTotal) AS RegionAverage 
      FROM (SELECT RegionID, SalesPersonID, 
      SUM(OrderAmount) AS SalesTotal 
      FROM Orders GROUP BY RegionID, 
      SalesPersonID) AS t1 GROUP BY t1.RegionID 

      You set the SHOWPLAN_TEXT option to ON and execute the query. The showplan 
      output is as follows:

      I--Compute Scalar(DEFINE:([Exprl003]=If[Exprl006]=0) then NULL else 
      ([Exprl007]/[Exprl006]))) I--Stream Aggregate(GROUP 
      BY:([Orders].[RegionID]) 
      DEFINE:([Exprl006]=COUNT([Exprl002]),[Exprl007]=SUM([Exprl002]))) 
      I--Compute Scalar(DEFINE:([Exprl002]=If[Exprl004]=0) then NULL else 
      ([Exprl005]))) I--Stream Aggregate(GROUP BY:([Orders].[RegionID], 
      [Orders].[SalesPersonID])DEFINE:([Exprl004]=COUNT(*), 
      [Exprl005]=SUM([Orders].[OrderAmount]))) I--Sort(ORDER 
      BY:([Orders].[RegionID] ASC, [Orders].[SalesPersonID] ASC)) I--Table 
      Scan(OBJECT:([ServerA].[dbo].[Orders]) 

      You suspect that this query is part of the problem because the showplan 
      indicates that the query is performing a table scan operation. What is the 
      most likely reason that this query is performing a table scan? 

      A. Because the Order table has no CLUSTERED INDEX.
      B. Because the SELECT has no WHERE clause.
      C. Because the Order table has no PRIMARY KEY.
      D. ??

      Answer: B

      63. (version 1) Multinational company with offices in NY, London, Nairobi 
      and Cairo tracks sales. Sales are in local currency. Nairobi and Cairo 
      have value added tax. HQs want reports in $$$ at the end of the month. 
      They have monthly replication set up. Currency rates fluctuations are the 
      reason that the total of a sale in $$$ for a particular date is not the 
      same in the end of the month. You have a tables: 

      ConversionRate: (PK)Currency, (PK)Ratevaliddate, Rate, Check to reject 
      later date than current date 

      Sales: (PK)SalesID with uniqueidentifier, default Newid(), SalesAmount, 
      TaxAmount, SalesDate 
      (Choose all that apply)

      A. Can you report sales for today in US$ 
      B. Can you report sales in US$$$ at the end of the month 
      C. Can you generate a report for the whole month 
      D. Can you see tax information 
      E. Can you tell the difference at the end of the month 
      F. Can you compare sales in US$ for any two days 

      Answer: C, D 

      64. (version 2) Multinational company with offices in NY, London, Nairobi 
      and Cairo tracks sales. Sales are in local currency. Nairobi and London 
      have value added tax. Cairo doesn't have Value added tax. HQs want reports 
      in $$$ at the end of the month. Currency rates fluctuations are the reason 
      that the total of a sale in $$$ for a particular date is not the same in 
      the end of the month. You have a table that stores rates for all dates. 
      This table has constrain that doesn't allow you enter effective date to be 
      later then today. You have sales table with only one field for: 
      SALESID defaults NEWID(), SALESAMOUNT NOT NULL and TAXAMOUNT NOT NULL 
      field (Choose all that apply)

      A. Can you report sales for the date in $$$? 
      B. Can you report sales in $$$ at the end of the month? 
      C. Can you tell the difference at the end of the month? 
      D. Nairobi and London track tax, Cairo doesn't 

      Answer: B, C 

      65. You have a database with full-text index. A nightly job backs it up 
      then restores it. Next you run a full-text query against a table you're 
      sure contains a word. Incorrect result returned. What to do? 

      A. Issue repopulate full-text catalog as part of the job. 

      Answer: A

      66. You must reconcile the Checking account for your company. You have a 
      CheckRegister table, an InvalidCheck table, and a ClearedCheck table. The 
      ClearedCheck table lists checks that have cleared the bank. You must 
      update the ClearedDate column of the CheckRegister table for any checks 
      that are on the ClearedCheck table. If the check is in the ClearedCheck 
      table but not on the CheckRegister table, you must insert a row into the 
      InvalidCheck table. If the amount shown for a check in the ClearedCheck 
      table is different from the amount shown for the same check in the 
      CheckRegister table, you must insert a row into the InvalidCheck table. 
      Each row must be deleted from the ClearedCheck table after it has been 
      evaluated for accuracy. 
      Which statement group should you use to accomplish this task in the 
      shortest time? 

      A. DECLARE @CheckNumber int, @CheckAmount money, @ClearedDate datetime 
      DECLARE CheakRegisterCursor Cursor SCROLL FOR SELECT CheckNumber, 
      CheckAmount, ClearedDate FROM ClearedCheck FOR UPDATE 
      OPEN CheckRegisterCursor FETCH NEXT FROM CheckRegisterCursor INTO 
      @CheckNumber, @CheckAmount, @ClearedDate 
      WHILE @@Fetch_Status = 0 
      BEGIN 
      IF EXISTS (SELECT *FROM CheckRegister WHERE CheckNumber = @CheckNumber and 
      CheckAmount = @CheckAmount) 
      BEGIN 
      UPDATE CheckRegister SET ClearedDate = @ClearedDate 
      DELETE ClearedCheck WHERE Current of CheckRegisterCursor 
      END 
      ELSE 
      BEGIN 
      INSERT InvalidCheck (CheckNumber,CheckAmount, ClearedDate) VALUES 
      (@CheckNumber, @CheckAmount, @ClearedDate.) 
      DELETE ClearedCheck WHERE Current of CheckRegisterCursor 
      END 
      FETCH NEXT FROM CheckRegisterCursor INTO @CheckNumber, @CheckAmount, 
      @ClearedDate 
      END 
      CLOSE CheckRegisterCursor
      DEALLOCATE CheckRegisterCursor 
      B. DECLARE @CheckNumber int, @CheckAmount money, @ClearedDate datetime 
      DECLARE CheckRegisterCursor Cursor LOCAL FORWARD_ONLY FOR SELECT 
      CheckNumber, CheckAmount, ClearedDate FROM ClearedCheck FOR UPDATE OPEN 
      CheckRegisterCursor FETCH NEXT FROM CheckRegisterCursor INTO @CheckNumber, 
      @CheckAmount, @ClearedDate WHILE @@Fetch_Status = 0 BEGIN IF EXISTS 
      (SELECT *FROM CheckRegister WHERE CheckNumber=@CheckNumber and CheckAmount 
      = @CheckAmount) UPDATE CheckRegister SET ClearedDate = @ClearedDate ELSE 
      INSERT InvalidCheck (CheckNumber, CheckAmount, ClearedDate ) VALUES 
      (@CheckNumber, @CheckAmount,@ClearedDate) DELETE ClearedCheck WHERE 
      Current of CheckRegisterCursor FETCH NEXT FROM CheckRegisterCursor INTO 
      @CheckNumber, @CheckAmount, @ClearedDate END CLOSE CheckRegisterCursor 
      DEALLOCATE CheckRegisterCursor 
      C. UPDATE CheckRegister 
      SET CheckRegister.ClearedDate = ClearedCheck.ClearedDate 
      FROM CheckRegister JOIN ClearedCheck ON CheckRegister.CheckNumber = 
      clearedCheck.CheckNumber AND 
      CheckRegister.CheckAmount=ClearedCheck.CheckAmount 
      DELETE ClearedCheck FROM ClearedCheck JOIN CheckRegister ON 
      CheckRegister.CheckNumber = ClearedCheck.CheckNumber AND 
      CheckRegister.CheckAmount = ClearedCheck.CheckAmount 
      INSERT InvalidCheck (CheckNumber, CheckAmount, ClearedDate) SELECT 
      CheckNumber,CheckAmount, ClearedDate FROM ClearedCheck 
      DELETE ClearedCheck 
      D. DECLARE @ClearedDate datetime SELECT @ClearedDate = ClearedDate FROM 
      ClearedCheck IF EXISTS (SELECT *FROM CheckRegister WHERE CheckNumber IN 
      (SELECT CheckNumber FROM ClearedCheck)) UPDATE CheckRegister SET 
      ClearedDate = @ClearedDate ELSE INSERT InvalidCheck SELECT *FROM 
      ClearedCheck DELETE ClearedCheck

      Answer: C

      67. You are using a Data Transformation Services (DTS) package to import 
      data from a dbase III table to your SQL server database. The DTS package 
      creates a destination table based on the source table then imports the 
      data into the newly created table. The source table contains order 
      information from your international sales department. You want the 
      destination table to have the following structure: 
      CREATE TABLE Order 
      ( Order Int, 
      CustNo Int, 
      OrderDate Smalldatetime, 
      Foreign Bit) 
      GO 

      The import process fails every time you run the DTS package. You have 
      filled in all required portions of the DTS Import Wizard. What should you 
      do to eliminate the importation error?

      A. Use bcp instead of DTS 
      B. Customize the transformation script to rename the Order column and the 
      Foreign column
      C. Change keywords in the source data 
      D. Write a DBaseIII program to import directly into SQL server 

      Answer: B 

      if you encounter this question in a multiple choice format, choose D as 
      well.

      68. (fish version 1) You are designing a table to track purchases for a 
      fish canning company. All transactions occur on fishing vessels that are 
      not required to handle coins, and therefore all purchases must be rounded 
      to the nearest whole dollar amount. Purchases are made once a day, and 
      fish must be purchased in multiples of 100 for tuna, and multiples of 50 
      for salmon. The Government limits the purchase of salmon to 150 daily. 
      Each month, your company must report to the Government the kind, quantity, 
      and supplier for each lot of tuna or salmon purchased. You want to 
      accomplish the following goals: 
      - Ensure that all purchase amounts are rounded to the nearest whole 
      dollar. 
      - Ensure that records for tuna purchased must be in multiple of 100, and 
      that records for salmon purchased must be in multiples of 50. 
      - Ensure that the daily total quantity of salmon purchased does not exceed 
      150. 
      - Ensure that the required monthly Government report can be produced 
      reporting the kind, quantity, and supplier for each lot of tuna or salmon 
      purchased. 
      You take the following actions: 
      - Create the data model as shown in the exhibit. 
      Table1: Company CompanyID (PK) 
      Table2: Purchase CompanyID, PurchaseID (PK), PurchaseDate 
      Table3: PurchaseDetail PurchaseID (PK), LineNo (PK), FishName, Quantity, 
      Price, etc. 
      Table4: FishName FishName (PK) 
      - Add a CHECK constraint to the PurchaseDetailTable on the FishQuantity 
      column rejecting values not equal to 50 or 100. 
      - Add a trigger to the PurchaseDetail table rejecting values greater than 
      150 when FishName is salmon. 
      - Add a trigger to the PurchaseDetail table rounding the PurchaseAmount to 
      the nearest whole dollar amount. Which result or results do these actions 
      produce? (Choose all that apply) 

      A. All PurchaseAmount are rounded to the nearest whole dollar 
      B. Records for tuna purchased must be in multiples of 100, and records for 
      salmon purchased must be in multiples of 50 
      C. The daily total Quantity of salmon purchased cannot exceed 150 
      D. The monthly government report can be produced. Kind, Qty, Supplier for 
      each lot of tuna or salmon purchased. 

      Answer: A, D 


      69. (fish version 2) You are the SQL Administrator for a fish canning 
      company. Each day, fish purchases are made. Tuna must be bought in lots of 
      100; Salmon in lots of 50. Cannot exceed 150 Salmon in any given day due 
      to government restrictions. Every month, a report must be submitted to the 
      government listing kind, quantity and supplier of the purchased fish. The 
      lots in the report must be integer form. You design your model as follows: 

      Table1: Company CompanyID 
      Table2: Purchase CompanyID, PurchaseID, PurchaseDate 
      Table3: PurchaseDetail PurchaseID, FishName, Quantity, Price, etc. 
      Table4: FishName FishName 
      You then create the following triggers: 
      (A) A Trigger on inserts to PurchaseDetail that only allows purchases in 
      lots of 50 or 100. 
      (B) A Trigger on inserts to PurchaseDetail that does not accept purchases 
      of 150 salmon. 
      (C) A Trigger that return the value of lots in a integer form. 
      Does this implementation satisfy the objectives? 

      A. Salmon can only be in lots of 150/day 
      B. Tuna is bought in lots of 100 and Salmon in lots of 50 
      C. The lots are stored as integer 
      D. The tuna and the salmon lots are not more then 150/day 

      Answer: C 

      one additional trigger in this version.

      70. (student assessment version 1) You are designing a data model that 
      will record standardized student assessments for a school district. The 
      school district wants assessments to be completed online. The school 
      district also wants each student's responses and scores to be stored 
      immediately in the database. Every year, each student will complete a 
      behavior assessment and an academic assessment. The school district needs 
      to prevent changes to assessment responses after the assessment is 
      complete, but students should be allowed to change their responses during 
      the course of the assessment. The school district wants to require each 
      student to answer all items on each assessment. When a student indicates 
      completion, the score for the entire assessment must be computed and 
      recorded. You design a student table and an assessment table. 
      You want to accomplish the following goals: 
      - Ensure that there is no redundant or derived data. 
      - Ensure that an assessment response cannot be change after the assessment 
      is complete and the score is entered. 
      - Ensure that all assessment items have responses when the assessment is 
      completed and the score is entered. 
      - Ensure that an assessment score is computed and stored when the 
      assessment is completed and the score is entered. 
      You take the following steps: 
      - Create a table name BehaviorAssessment and a table named 
      AcademicAssessment. Each with a primary key consisting of AssessmentID. 
      Include a column in each table for the text of each assessment item. 
      - Create a StudentBehavior table with a foreign key referencing the 
      Student table, a foreign key referencing the BehaviorAssessment table and 
      a primary key consisting a StudentID and AssessmentID. Include a 
      nonnullable column in the StudentBehavior table for each assessment 
      response, as well as an AssessmentScore column. 
      - Create a StudentAcademic table with a foreign key referencing the 
      Student table a foreign key referncing the AcademicAssessment table, and a 
      primary key consisting of StudentID and AssessmentID. Include a 
      nonnullable column in the StudentAcademic table for each assessment 
      response, as well as an AssessmentScore column. 
      - Add an INSERT trigger on the StudentBehavior table computing a value for 
      the AssessmentScore column when a row is inserted. 
      - Add an INSERT trigger on the StudentAcademic table computing value for 
      the AssessmentScore column when a row is inserted. 
      - Add an INSERT trigger on the StudentBehavior table preventing changes in 
      the assessment response if the AssessmentScore column is not null. 
      - Add an INSERT trigger on the StudentAcademic table preventing changes in 
      the assessment response if the AssessmentScore column is not null. 
      Which result or results do these actions produce? (Choose all that apply) 

      A. There is no redundant or derived data 

      B. An assessment response cannot be changed after the assessment is 
      complete and the score in entered 
      C. All assessment items have a response when the assessment is complete 
      and the score in entered 
      D. An assessment score is computed and stored when the assessment is 
      complete and the score in entered 

      Answer: C, D 

      71. (student assessment version 2) You are designing a data model that 
      will record standardized student assessments for a school district. The 
      school district wants the assessments to be completed online. The school 
      district also wants each student's responses and scores to be stored 
      immediately in the database. Every year, each student will complete a 
      behavior assessment and an academic assessments. The school district needs 
      to prevent changes to assessments responses after the assessment is 
      completed but student should be allowed to change their responses during 
      the course of the assessment. The school district wants to request each 
      student to all items on each assessment. When a student indicate 
      completion of the score for the entire assessment must be computed and 
      recorded. 
      You design a Student table and an Assessment table. 
      You want to accomplish the following goals: 
      - Ensure that there is no redundant or derived data. 
      - Ensure that an assessment response cannot be change after the assessment 
      is complete and the score is entered. 
      - Ensure that all assessment item have responses when the assessment is 
      completed and the score is entered. 
      - Ensure that an assessment score is computed and stored when the 
      assessment is completed and the score is entered. 
      You take the following steps: 
      - Create a subtype table name BehaviorAssessment and a subtype table named 
      AcademicAssessment. Each with a primary key consisting of AssessmentID. 
      Include a column in each table for the text of each assessment item. 
      - Create a StudentBehavior table with a foreign key referencing the 
      Student table, a foreign key referencing the BehaviorAssessment table and 
      a primary key consisting a StudentID and AssessmentID. Include a 
      nonnullable column in the StudentBehavior table for each assessment 
      response, as well as a AssessmentScore column. 
      - Create a StudentAcademic table with a foreign key referencing the 
      Student table a foreign key referncing the AcademicAssessment table, and a 
      primary key consisting of StudentID and AssessmentID. Include a 
      nonnullable column in the StudentAcademic table for each assessment 
      response, as well as an AssessmentScore column. 
      - Add an INSERT trigger on the StudentBehavior table computing a value for 
      the AssessmentScore column when a row is inserted. 
      - Add an INSERT trigger on the StudentAcademic table computing value for 
      the AssessmentScore column when a row is inserted. 
      Which result do these actions produce? 

      A. There is no redundant or derived data. 
      B. An assessment response cannot be changed after the assessment is 
      completed and the score is entered. 
      C. An assessment item having response. When the assessment is computed and 
      the score is entered. 
      D. An assessment score is completed and stored when the assessment is 
      completed and the score is enter. 

      Answer: D 

      remember 2 insert trigers; jeff and other good dumpers choose A also 
      (REMEMBER: if question lets you choose all that apply, choose D & A)

      72. (student assessment version 3) You are designing a data model that 
      will record standardized student assessments for a school district. The 
      school district wants assessments to be completed online. The school 
      district also wants each student's responses and scores to be stored 
      immediately in the database. Every year, each student will complete a 
      behavior assessment and an academic assessment. The school district needs 
      to prevent changes to assessment responses after the assessment is 
      complete, but students should be allowed to change their responses during 
      the course of the assessment. The school district wants to require each 
      student to answer all items on each assessment. When a student indicates 
      completion, the score for the entire assessment must be computed and 
      recorded. You design a student table and an assessment table. 
      You want to accomplish the following goals: 
      - Ensure that there is no redundant or derived data. 
      - Ensure that an assessment response cannot be change after the assessment 
      is complete and the score is entered. 
      - Ensure that all assessment item have responses when the assessment is 
      completed and the score is entered. 
      - Ensure that an assessment score is computed and stored when the 
      assessment is completed and the score is entered . 
      You take the following steps: 
      - Create a subtype table named BehaviorAssessment and a subtype table 
      named AcademicAssessment. Each with a primary key consisting of 
      AssessmentID. Include a column in each table for the text of each 
      assessment item. 
      - Create a StudentBehavior table with a foreign key referencing the 
      Student table, a foreign key referencing the BehaviorAssessment table and 
      a primary key consisting a StudentID and AssessmentID. Include a 
      nonnullable column in the StudentBehavior table for each assessment 
      response, as well as an AssessmentScore column. 
      - Create a StudentAcademic table with a foreign key referencing the 
      Student table a foreign key referncing the AcademicAssessment table, and a 
      primary key consisting of StudentID and AssessmentID. Include a 
      nonnullable column in the StudentAcademic table for each assessment 
      response, as well as an AssessmentScore column. 
      - Add an INSERT trigger on the StudentBehavior table computing a value for 
      the AssessmentScore column when a row is inserted. 
      - Add an INSERT trigger on the StudentAcademic table computing value for 
      the AssessmentScore column when a row is inserted. 
      - Add an UPDATE trigger on the StudentBehavior table preventing changes in 
      the assessment response if the AssessmentScore column is not null. 
      - Add an UPDATE trigger on the StudentAcademic table preventing changes in 
      the assessment response if the AssessmentScore column is not null. 
      Which result or results do these actions produce? (Choose all that apply) 

      A. There is no redundant or derived data 
      B. An assessment response cannot be changed after the assessment is 
      complete and the score in entered 
      C. All assessment items have a response when the assessment is complete 
      and the score in entered 
      D. An assessment score is computed and stored when the assessment is 
      complete and the score in entered 

      Answer: B, C, D 

      remember 2 insert and 2 update triggers

      73. A table with three columns. You want in composite index. Column A has 
      about 10% unique values, Column B about 50%, Column C about 90%. Which 
      index enables the fastest query? 

      A. CLUSTERED(A, B, C) 
      B. NON-CLUSTERED(A, B, C) 
      C. CLUSTERED(C, B, A) 
      D. NON-CLUSTERED(C, B, A) 
      E. CLUSTERED on C, NONCLUSTERED on A, B 

      Answer: C 

      74. You have A, B, C columns with 100 %, 50 % and 10 % cardinality 

      A. Create Clustered Index A, B, C 
      B. Create nonclustered index A, B, C 
      C. Create A clustered B & C nonclustered 
      D. other choices which I don't remember 

      Answer: A 

      75. You have a database to keep track of sales information. Many of your 
      queries calculate the total sales amount for a particular salesperson. You 
      are working with a nested procedure that will pass an parameter back to 
      the calling procedure containing the total sales as follows: 

      CREATE PROCEDURE GetSalesPersonData @SalesPersonID Int, 
      @RegionID Int, 
      @SalesAmount Money 
      OUTPUT AS SELECT @SalesAmount = SUM(SalesAmount) FROM SalesInformation 
      WHERE @SalesPersonID = SalesPersonID 

      Which statement will accurately execute the procedure and receive the 
      required result? 

      A. EXECUTE GetSalesPersonData 1, 1, @SalesAmount OUTPUT

      Answer: A

      2 OUTPUT are needed in both DECLARE and EXEC. 

      76. Your server named Corporate has a Sales database that stores sales 
      data for a software distribution company. Two remote servers named New 
      York and Chicago each store sales data in a SalesOrder table relative only 
      to their respective sales territories. The SalesOrder table on the 
      Corporate server are updated once a week with data from the remote 
      servers. The SalesOrder table on each server, including Corporate, is 
      defined as follows: 

      CREATE TABLE SalesOrders 
      ( Number Char(10) NOT NULL, 
      CustomerName VarChar(100) NOT NULL, 
      TerritoryName VarChar(50) NOT NULL, 
      EntryDate Datetime NOT NULL, 
      Amount Money NOT NULL) 

      You need to create a view that shows a current list of all sales from the 
      New York and Chicago sales territories, and the list should have the 
      following format: 
      Territory Customer Date Amount 
      ----------------------------------------- 
      Which view can you create to show all sales from the New York and Chicago 
      sales territories in the required format? 

      A. CREATE VIEW SalesSummaryView (Territory, Customer, Date, Amount) AS 
      SELECT TerritoryName, CustomerName, EntryDate, Amount FROM 
      NewYork.Sales.dbo.SalesOrder UNION ALL SELECT TerritoryName, CustomerName, 
      EntryDate, Amount FROM Chicago.Sales.dbo.SalesOrder 

      Answer: A

      77. You have a query that run frequently and had a lot of overhead. What 
      could you do to increase performance? 

      A. Make it a stored procedure. 

      Answer: A

      Stored procedures can also improve performance. Many tasks are implemented 
      as a series of SQL statements. Conditional logic applied to the results of 
      the first SQL statements determines which subsequent SQL statements are 
      executed. If these SQL statements and conditional logic are written into a 
      stored procedure, they become part of a single execution plan on the 
      server. The results do not have to be returned to the client to have the 
      conditional logic applied; all of the work is done on the server (BOL).

      78. Two tables - Processing and Accounting. Users enter info in processing 
      and info batch transferred to Acting once a day using (something like): 
      Begin Tran 
      Check Batch files for errors 
      Update Accounting Table 
      Delete info from Process 
      Commit Tran 
      Rollback Tran (if info contains error(s)) -9 
      Does tran minimize locking? 
      Does tran prevent deadlocks 
      Does tran prevent access to Processing table 
      Select all that apply:

      A. tran minimize locking
      B. tran prevent deadlocks
      C. tran prevent access to Processing table

      Answer: C

      I don't get this one, I think the wording is wrong. I included it anyway

      79. Evaluate this trigger: 
      USE sales GO CREATE TRIGGER inventory_update ON inventory FOR UPDATE AS IF 
      UPDATE(product_id) BEGIN ROLLBACK TRANSACTION END 
      Which result will this trigger provide? 

      A. Allows a user to update the inventory table 
      B. Prevents a user from modifying product_id values 
      C. Allows a user to update the product_id column 
      D. Prevents a user from updating the inventory table 
      E. Prevents a user from accessing the product_id column 

      Answer: B 

      80. A table design suggests a parent/child relation. Parent table will 
      have 1 million records, Child will have 100 million. Aggregate data is 
      contained in the child table, Detailed child reporting is occasionally 
      used. What to do? 

      A. Implement the design as is 
      B. Create additional columns in parent 
      C. Create aggregate data columns in parent 
      D. Create constraints to foreign keys in child 
      E. Create indexes to foreign keys in child. 

      Answer: C 

      81. In the Pubs database the TitleAuthor table is used to define the 
      many-to-many relationships between authors and books. Which of the 
      following SQL SELECT statements will show which books (titles) have more 
      than one author? 

      A. SELECT DISTINCT au_id, title_id FROM titleauthor WHERE title_id = 
      title_id AND au_id <> au_id 
      B. SELECT DISTINCT title_id FROM titleauthor WHERE title_id(1) = 
      title_id(2) AND au_id(1) <> au_id(2) 
      C. SELECT DISTINCT au_id, title_id FROM titleauthor t1, titleauthor t2 
      WHERE t1.title_id = t2.title_id AND t1.au_id <>t2.au_id 
      D. SELECT DISTINCT t1.title_id, t2.title_id FROM titleauthor t1, 
      titleauthor t2 WHERE t1.title_id = t2.title_id AND t1.au_id <> t2.au_id 

      Answer: D

      82. (photo reseller version 1) You are DBA at photo-reseller shop. Your 
      shop buys photographs from organizations, individual photographers and 
      occasionally from your customers. You also have photographers on staff. 
      From time to time individual independent photographers become your 
      employees and sometimes leave for independent careers. You create the 
      following tables: 
      INDIVIDUAL with IndividualID as Indentity - Primary Key, and with Employee 
      as boolean 
      ORGANIZATION with OrganizationID as Indentity - Primary Key 
      INDIVIDUALORGANIZATION with IndividualID - foreign key references 
      INDIVIDUALS.IndividualID, and OrganizationID - foreign key references 
      ORGANIZATIONS.OrganizationID 
      (Choose all that apply)

      A. You can track Individual as Employee, Customer or Independent 
      Photographer 
      B. IndividualID can never be equal to OrganizationID 
      C. No data redundancy 
      D. Individual may be related to one or more organizations 
      E. Individual can be related to another individual 

      Answer: C, D 

      83. (photo reseller version 2) You are DBA at photo-reseller shop. Your 
      shop buys photographs from organizations, individual photographers and 
      occasionally from your customers. You also have photographers on staff. 
      From time to time individual independent photographers become your 
      employees and sometimes leave for independent careers. You create the 
      following tables: 
      INDIVIDUAL with IndividualID as Indentity - Primary Key, and with Employee 
      as boolean 
      ORGANIZATION with OrganizationID as Indentity - Primary Key 
      INDIVIDUALORGANIZATION with IndividualID - foreign key references 
      INDIVIDUALS.IndividualID, and OrganizationID - foreign key references 
      ORGANIZATIONS.OrganizationID 
      (Choose all that apply)

      A. Can you say which individual belongs to which organization?
      B. Can you identify if an individual is a salesman or a customer?
      C. Can an individual have many organizations, and an organization many 
      individuals?

      Answer: A, C

      84. (Scientists version 1) You are designing a data model to track 
      research projects. A project might be undertaken in one research 
      institution or in multiple institutions, some research institutes are part 
      of a university or a large research institutes. Each project is assigned a 
      group of Scientists who might perform different jobs in each project. A 
      scientist who is a member of the staff at one institute might also be 
      assigned to a project that is being undertaken at another institute. 
      Exhibit : 
      Project: (PK) projectID Institutes: instituteID 
      Projectinstitution : (PK) instituteID, projectID 
      ScientistProject: (PK) scientistID, projectID, jobname Scientist: (PK) 
      scientistID 
      Job: (PK) jobID 
      - No self join on Institution table 
      - No direct relation between Scientist and Institution Projectinstitution 
      TB: projectid, institutionID ----> Institution TB: instituteID 
      Projectinstitution TB: projectID, institutionID ----> Project TB: 
      projectID Projectscientist TB: projectID, scientistID, jobname ----> 
      Project TB: projectID Projectscientist 
      TB: projectID, scientistID, jobname ----> Job TB: jobID 
      Projectscientist TB: projectID, scientistID, jobname ----> Scientist TB: 
      scientistID You want to accomplish the following goals: 
      - Ensure that all the scientist conducting research for any specific 
      project can be reported. 
      - Ensure that a scientist's job for a specific project in a specific 
      institute can be reported. 
      - Ensure that all of the institute participating in any specific project 
      can be reported. - Ensure that the institute at which a scientist is a 
      staff member can be tracked. 
      - Ensure that an institute can be identified as part of another institute. 
      What task will be achieved (Choose all that apply) 

      A. All of the scientists conducting research for any specific project can 
      be reported 
      B. A scientist job for a specific project in a specific institution can be 
      reported 
      C. All of the institutes participating in any specific project can be 
      reported 
      D. The institute at which a scientist is a staff member can be tracked 
      E. An institute can be identified as part of another institute 

      Answer: A, B, C 

      85. (Scientists version 2) Scientists in a research institute: 
      Exhibit: 
      Project: (PK) projectID, instituteID 
      Institute: (PK) instituteID, scientistID, InstituteName, etc. 
      Scientist: (PK) scientistID, jobID 
      Job: (PK) jobID 
      (Choose all that apply) 

      A. Can you trace scientists who work for a particular project? 
      B. Can you tell which scientist belongs to which institute? 
      C. Can an institute belong to another institute? 
      D. Can you identify how many jobs a particular project consists of? 

      Answer: A, B, D 

      86. (Scientists version 3) Scientists in a research institute, Institute 
      may have parent organization/institute. Scientists might work for more 
      than one institute. 
      Exhibit: 
      Project: (PK) projectID, instituteID 
      Institutes: instituteID, instituteID2 
      InstituteScientist: (PK) instituteID, scientistID 
      ScientistProject: (PK) scientistID, projectID 
      Scientist: (PK) scientistID, jobID 
      Job: (PK) jobID, jobdescr 
      (Choose all that apply)

      A. Can you trace scientists who work for a particular project? 
      B. Can you tell which scientist belongs to which institute? 
      C. Can an institute relate to another institute? 
      D. Can you identify how many jobs a particular project consists of? 

      Answer: B, C, D 

      87. Your database is used to store information about each employee in your 
      company and the department in which each employee works. An employee can 
      work in only one department. The database contains two tables, which are 
      named Department and Employee. The tables are modeled as shown in the 
      exhibit: 
      Department: DepartmentId, DepartmentName, EmployeeId 
      Employee: EmployeeId, SSN, DepartmentId, DepartmentName, blah, blah 
      You want to ensure that all data stored is dependent on the whole key of 
      the table in which the data is stored. What should you do? 

      A. Add EmployeeId to Department table 
      B. Remove SSN from Employee table 
      C. Remove DepartmentName from Employee table 
      D. Remove DepartmentName from Department table 

      Answer: C

      88. You are designing the data model to maintain information about 
      students living in a group home. A student might be known under many 
      aliases, and the data model needs to associate each student with aliases 
      and other descriptors such as hair color, weight, religion, physical 
      handicaps, and ethnicity. Some students have siblings or other relatives 
      who are also in the group home, and these family relationships need to be 
      tracked. Multiple addresses might be associated with an individual 
      student, such as the current address, a school address, and addresses of 
      significant relatives. You can also need to track significant events in a 
      student's life, which might include attendance at a special training 
      session, medical treatment, a graduation, or a death in the family. 
      You want to accomplish the following goals: 
      - Ensure that any kind of descriptor can be associated with a student. 
      - Ensure that multiple addresses can be associated with multiple students, 
      and that the address usage can be reported. 
      - Ensure that any family relationship with another student can be 
      reported. 
      - Ensure that all known aliases for a student can be reported. 
      - Ensure that significant events in a student's life can be reported. You 
      design the logical model as shown in the exhibit. 

      Table A - Student: StudentId Table B - Family Relationship: StudentId1, 
      StudentId2 (composite) Table C ? StudentEvent: StudentId, EventName 
      (composite) Table D - StudentAlias: StudentId, Alias (composite) Table E - 
      Address: StudentId, Address StudentId in B-D reference StudentId in table 
      A as foreign key 

      Which result or results does this model produce? (Choose all that apply) 

      A. Any kind of descriptor can be associated with a student. 
      B. Multiple addresses can be associated with multiple students, and the 
      address usage can be reported. 
      C. All family relationship with another student can be reported. 
      D. All known aliases for a Student can be reported. 
      E. Significant events in a student's life can be reported. 

      Answer: C, D, E 

      89. You must write a stored procedure to perform cascading deletes on 
      HomeLoan database. The client application will pass a parameter containing 
      the CustomerID of the customer to be deleted. A customer might have any 
      number of pending loans. Each pending loan has one or more inspections and 
      one or more appraisals associated with it. The diagram in the exhibit 
      shows the relationship of the tables. 
      Table(customer) Table(loan) Table(inspection) Table(appraisal) PK: 
      customerid PK: loanid PK: inspectionid PK: appraisalid lastname R loandate 
      R loanid loanid firstname loanstatusid inspectionresultid appraisalamount 
      addressid appraisaldate inspectiondate appraisalid statusid 
      appraisalamount inspectiontypeid country loanamount customerid 
      Which stored procedure should you use? 

      A. CREATE PROCEDURE loancascadedelte 
      @customerid int AS 
      DELETE FROM appraisal 
      FROM appraisal JOIN LOAN 
      ON appraisal.loanid=loan.loanid 
      WHERE customerid=@customerid
      DELETE FROM inspection 
      FROM inspection JOIN LOAN 
      ON inspection.loanid=loan.loanid 
      WHERE customerid=@customerid
      DELETE FROM loan 
      WHERE customerid=@customerid 
      DELETE FROM customer 
      WHERE customerid=@customerid 
      B. CREATE PROCEDURE loancascadedelte 
      @customerid int 
      as 
      DELETE FROM appraisal 
      FROM appraisal JOIN customer 
      ON loan.customerid=customer.customerid 
      DELETE FORM inspection FROM inspection 
      JOIN customer ON loan.customerid=customer.customerid 
      JOIN customer on loan.customerid=customer.customerid 
      DELETE FROM customer 
      WHERE customerid=@customerid 

      C. Create procedure loancascadedelete @customerid int as declare @loanid 
      int declare @loan_cur cursor local For select loanid from loan where 
      custoemrid=@customerid for read only open loan_cur fetch next from 
      loan_cur into @loanid while @@fetch_status=0 Begin Delete appraisal where 
      loanid=@loanid Delete inspection where loanid=@loanid delete loan where 
      loanid=@loandid fetch next from laon_cur Into @loanid End Delete customer 
      where customerid=@customerid close loan_cur deallocate loan_cur 
      D. Create procedure loancascadedelete @customerid int as declare @loanid 
      int declare @loan_cur cursor For select loanid from loan where 
      custoemrid=@customerid for read only open loan_cur fetch next from 
      loan_cur into @loanid while @@fetch_status=0 Begin Delete appraisal where 
      loanid=@loanid Delete inspection where loanid=@loanid delete loan where 
      loanid=@loandid fetch next from laon_cur Into @loanid End Delete customer 
      where customerid=@customerid close loan_cur deallocate loan_cur 

      Answer: A

      options C & D declare a cursor with an attribution of read only which 
      makes it useless to our purpose. option B is incorrect because it does not 
      join the appraisal table, for which the JOIN is created.

      cascading delete: A delete that deletes all related database rows or 
      columns. 
      cascading update: An update that updates all related database rows or 
      columns. 
      (BOL)

      90. You are building an Invoicing system for your company. On each 
      invoice, you want to show the following information: Customer Number, 
      Customer Name, Customer Address, Customer City, Customer Territory, 
      Customer Postal Code, Part Number, Part Description, Part shipping weight, 
      Current cost, Current price, Quantity on hand, Order Number, Order Date, 
      Part Number, Quantity There can be multiple parts on one invoice. Cost and 
      information comes from a master list, but the history stored for each 
      invoice should show the cost and price at time of sale. You want to make 
      sure your database is properly normalized. 
      You want to accomplish the following: 
      - Every table must have a primary key. 
      - All non-key columns must depend on the whole primary key. 
      - All columns must contain exactly one value. 
      - Each column in a table must be independent of any non-key column in the 
      same table. You create the logical model as shown in exhibit: 
      Customers: CustomerNo(PK), CustomerName, etc?K 
      Part: PartNo(PK), PartDescription, UnitWeight, etc?K 
      Orders: OrderNo(PK), OrderDate 
      OrderDetail: OrderNo(PK), ItemNo(PK), CustomerNo(FK), PartNo(FK), 
      PartDescription, QuantitySold, UnitWeight, etc... Which result or results 
      does this model produce? (Choose all that apply) 

      A. Every table has a primary key 
      B. All non-key columns depend on the whole primary key 
      C. All columns contain exactly one value 
      D. Each column in a table is independent of any non-key column in the same 
      table 

      Answer: A, C 

      91. You are developing a Personnel database for your company. This 
      database includes an employee table that is defined as follows: 
      CREATE TABLE Employee ( Id int IDENTITY NOT NULL, Surname varchar(50) NOT 
      NULL, FirstName varchar(50) NOT NULL, SocialSecurityNo char(10) NOT NULL, 
      Extension char(4) NOT NULL, EmailAddress varchar(255) NOT NULL) 
      Your company provides each employee with a telephone extension number and 
      an e-mail address. Each employee must have a unique telephone extension 
      and a unique e-mail address. In addition, you must prevent duplicate 
      SocialSecurityNo from being entered into the database. 
      How can you alter the table to meet all of the requirements? 

      A. ALTER TABLE Employee ADD CONSTRAINT u_nodups UNIQUE NONCLUSTEDRED( 
      SocialSecurityNo, Extension, EmailAddress) 
      B. ALTER TABLE Employee ADD CONSTRAINT u_nodupssn UNIQUE NONCLUSTERED 
      (SocialSecurityNo) ALTER TABLE Employee ADD CONSTRAINT u_nodupext UNIQUE 
      NONCLUSTERED (Extension) ALTER TABLE Employee ADD CONSTRAINT u_nodupemail 
      UNIQUE NONCLUSTERED (EmailAddress) 
      C. ALTER TABLE Employee ADD CONSTRAINT u_nodupssn CHECK 
      (SocialSecurityNo='UNIQUE') ALTER TABLE Employee ADD CONSTRAINT u_nodupext 
      CHECK (Extension='UNIQUE') ALTER TABLE Employee ADD CONSTRAINT 
      u_nodupemail CHECK (EmailAddress='UNIQUE') 

      Answer: B 

      92. You have a database that keeps track of membership in an organization. 
      Tables in this database include the Membership table, the Committee table, 
      the Address table, and the Phone table. When a person resigns from the 
      organization, you want to be able to delete the membership row and have 
      all related rows be automatically removed. What can you do to accomplish 
      this task? 

      A. Create DELETE trigger on Membership table that deletes any rows in 
      Committee table, Address table and Phone tables that reference the Primary 
      Key in the Membership table. Do not place a FOREIGN KEY constraint on the 
      ommittee, Address & Phone tables. 
      B. Create delete trigger on MemberShip table that deletes any rows in 
      Committee table, Address & Phone table that reference the Foreign Key on 
      Committee, Address & Phone. 
      C. Place a PK CONTAINS on MemberShip table with FK CONTAINS on Committee, 
      Address & Phone. 
      D. Place PK on MemberShip. Place FK on Committee, Address & Phone that 
      reference the PK in Member_Ship table. Create delete trigger on Committee, 
      Address & Phone will fire when FK CONTAINS are violated. 

      Answer: A 

      about A, remember you can only reference a PRIMARY KEY, that's also why B 
      is incorrect. 

      93. Evaluate this statement: 
      USE hr SELECT department_id, SUM(salary) FROM employee GROUP BY 
      department_id HAVING emp_id > 2001 Which clause will cause the statement 
      to fail? 

      A. SELECT department_id, SUM(salary) 
      B. FROM employee 
      C. GROUP BY department_id 
      D. HAVING emp_id > 2001 

      Answer: D

      A tricky question about aggregate function with SUM in the select 
      statement. All choices had the WHERE clause, but only one used a subquery 
      (correct answer). You can only use the WHERE clause on a aggregate 
      function if it is in a subquery, if it is not in a subquery you need to 
      have the HAVING clause. 

      94. You are designing an Insurance database. The Policy table will be 
      accessed and updated by several additional applications. In the Policy 
      table, you need to ensure that the value entered into the 
      Beginning_Effective_Date column is less than or equal to the value entered 
      into the Ending_Effective_Date olumn. What should you do? 

      A. Process each application to compare the values before updating the 
      POLICY table 
      B. Create a CHECK CONSTRAINTS on POLICY table that compares the value 
      C. Create a rule & bind the rule to the Beginning_effective_date column 
      D. Create Insert & Update triggers on the POLICY table that compare the 
      values 

      Answer: B 

      95. Company uses an application named Z that runs daily after business 
      hours. As company expands, data becomes more dynamic, and management wants 
      the report to be produced every 2 hours. Multiple applications 
      concurrently access SQL Server during the day. Which TWO modifications to 
      Application Z should you implement to produce the reports more quickly 
      without preventing other SQL Server applications from performing their 
      tasks? (Choose all that apply)

      A. Create more indexes on the columns that Application Z uses to calculate 
      aggregates 
      B. Implement trigger to recalculate aggregates each time the appropriate 
      columns updated 
      C. Specified the NOLOCK hint in the SELECT statements 
      D. Specify the LOW deadlock priority for App. Z 
      E. Set the SERIALIZABLE Transaction isolation level 

      Answer: B, C 

      96. You are troubleshooting a process that makes use of multiple complex 
      stored procedures that operate on a table. The process is producing 
      unexpected update to the table. You want to identify the specific stored 
      procedure and statement that are causing the problem. What should you do? 

      A. Use SQL profiler to create and replay a trace by using single stepping 
      B. Place trigger on table to send email message when column is set to 
      specific value. 
      C. Execute stored procedure, create process statement to verify syntax is 
      valid. 
      D. Examine transaction log to locate the statement that made the 
      unexpected update 

      Answer: A 

      Single stepping is useful for debugging the events captured in a trace. 
      For example, you can create a trace monitoring the execution of all 
      batches submitted. By replaying the events in the trace one at a time 
      (single stepping), you can determine the effects of each batch as they 
      occur, allowing you to debug your code. This is much more effective than 
      placing large amounts of debug code between batches. Debug code generally 
      creates more output that needs to be separated from the actual results 
      generated, and that must be correctly removed when debugging is complete 
      (BOL).

      97. You are developing a sales database for a company that has a 
      100-person sales staff. The company's policy requires that any sales 
      orders in excess of $100,000 be approved and entered into the database by 
      the sales manager. Your database includes a SalesOrder table that is 
      defined as follws: 

      CREATE TABLE SalesOrder ( Number Char(10) NOT NULL, 
      SalesPerson VarChar(50) NOT NULL, 
      Amount Money NOT NULL) 

      You need to create a view on the SalesOrder table that will prevent the 
      sales staff from entering a sales order in excess of $100,000. Which view 
      should you write? 

      A. CREATE VIEW SalesOrderLimit AS 
      SELECT Number, SalesPerson, Amount 
      FROM SalesOrder 
      WHERE Amount<=100000 
      WITH CHECK OPTION 
      B. CREATE VIEW SalesOrderLimit AS 
      SELECT Number, SalesPerson, Amount 
      FROM SalesOrder 
      WHERE Amount<=100000
      C. CREATE VIEW SalesOrderLimit AS 
      SELECT Number, SalesPerson, Amount 
      FROM SalesOrder 
      HAVING Amount<=100000
      D. Some silly thing with TOP

      Answer: A

      the WITH CHECK option: Forces all data modification statements executed 
      against the view to adhere to the criteria set within select_statement. 
      When a row is modified through a view, the WITH CHECK OPTION guarantees 
      that the data remains visible through the view after the modification has 
      been committed. 

      98. Table has a primary key and full textsearch enabled. They give you the 
      names of all the columns but you want to be able to search for a string in 
      all columns. 

      A. Freetext or Contain 

      Answer: A

      99. You want to create a development database that will hold 20MB of data 
      and indexes and a 4MB transaction log. There are no concerns regarding 
      query performance or log placement with this database. The SQL Server was 
      installed on drive E of the server computer, and there is plenty of disk 
      space on drive E. How would you create the database? 

      A. ?
      B. ??
      C. CREATE DATABASE development ON PRIMARY ( name = development1, filename 
      = 'e:\mssql7\data\development1.mdf', size = 20MB) LOG ON ( name = 
      developmentlog1, filename = 'e:\mssql7\data\developmentlog1.ldf', size = 
      4MB)
      D. CREATE DATABASE development (??,size = 24MB)

      Answer: C

      CREATE DATABASE database_name
      [ ON [PRIMARY]...

      ON- Specifies that the disk files used to store the data portions of the 
      database (data files) are defined explicitly. The keyword is followed by a 
      comma-delimited list of <filespec> items defining the data files for the 
      primary filegroup. The list of files in the primary filegroup can be 
      followed by an optional, comma-delimited list of <filegroup> items 
      defining user filegroups and their files.

      PRIMARY- Specifies that the associated <filespec> list defines the primary 
      file. The primary filegroup contains all of the database system tables. It 
      also contains all objects not assigned to user filegroups. The first 
      <filespec> entry in the primary filegroup becomes the primary file, which 
      is the file containing the logical start of the database and its system 
      tables. A database can have only one primary file. If PRIMARY is not 
      specified, the first file listed in the CREATE DATABASE statement becomes 
      the primary file. 
      (BOL)

      100. A table in the third normal form contains a PK column, 6 foreign 
      keys, and 3 numeric columns. How to implement? 

      A. Make 2 tables, one with PK and 3 numeric columns, one 6 foreign keys 
      B. Implement as it is 
      C. Add all related information to the 6 foreign keys to the table 
      D. some stupid constraint 

      Answer: B 

      101. You are implementing a logical data model for an online processing 
      (OLTP) application. One entity from the logical model in 3rd normal form 
      currently has 10 attributes. 
      - One attribute is the primary key. 
      - Six of the attributes are foreign key referencing into six other 
      entities. 
      - The last three attributes representing columns that hold Numeric values. 

      How should this entity from the logical model be implemented? 

      A. Create table by denormalizing the entity. Add the information from the 
      six foreign key referencing as additional column of the table. 
      B. Create two tables by denormalizing the entity add three primary key & 
      three numeric values as column of the one table. At the primary key & the 
      information from the six foreign key as column of the other table. 
      C. Create the table as described in the logical data model. 
      D. Create a view that the six foreign keys referenced. 

      Answer: C

      denormalize: To introduce redundancy into a table in order to incorporate 
      data from a related table. The related table can then be eliminated. 
      Denormalization can improve efficiency and performance by reducing 
      complexity in a data warehouse schema (BOL).

      102. Your database includes a table that is defined as follows: 

      CREATE TABLE SalesInformation 
      ( SalesInformation_ID Int IDENTITY (1,1) NOT NULL, 
      SalesPerson_ID Int NOT NULL, 
      Region_ID Int NOT NULL, 
      Receipt_ID Int NOT NULL, 
      Salesamount Money NOT NULL)

      You want to populate the table with data from an existing application that 
      has a numeric primary key. In order to maintain the referential integrity 
      of the database, you want to preserve the value of original primary key 
      when you convert the data. What can you do to populate the table? 

      A. Set IDENTITY_INSERT option to OFF & then insert the data by using a 
      SELECT statement that has a column list 
      B. Set IDENTITY_INSERT option to ON & then insert the data by using a 
      SELECT statement that has a column list 
      C. Insert data by using a SELECT statement that has a column list, and 
      then ALTER TABLE to add Foreign Key 
      D. Insert data by using a SELECT statement that has a column list, and 
      then ALTER TABLE to add Primary Key 

      Answer: B 

      SET IDENTITY_INSERT (T-SQL): Allows explicit values to be inserted into 
      the identity column of a table (BOL) .
      key words: numeric primary key.

      103. You are designing an INVENTORY database application for a national 
      automobile sales registry. This new database application will keep track 
      of automobiles available at a participating dealerships, and will allow 
      each dealership to sell automobiles from the inventories of other 
      dealerships. Many makes and models of automobiles will be shown from each 
      dealership. 
      - You want to be able to track information about each automobile. 
      - You want to normalize your database. Which table should be included in 
      database application? 
      (Choose all that apply) 

      A. A table containing the list of all dealership along with the address 
      and identification number for each dealership. 
      B. A table containing contact information for each automobile Manufacturer 
      along with the name of each Model manufactured by each Manufacturer. 
      C. A table containing the name & address of each dealership along with 
      automobile information. 
      D. A table containing an identification number for each automobile, the 
      owning dealership's identification number and other information specific 
      to each automobile 

      Answer: A, D 

      104. You automate the backup and recovery process for your database 
      application. After the database is restored, you discover that the queries 
      that use the FREETEXT & CONTAINS keywords no longer return the expected 
      rows. What should you do? 

      A. After query to use the LIKE keyword instead of the FREETEXT & CONTAINS 
      keyword 
      B. After query to use the FREETEXTTABLE & CONTAINSTABLE keyword instead of 
      the FREETEXT & CONTAINS keyword 
      C. Add the database FULLTEXT catalog to backup job & recovery job 
      D. Add the job to the restoration process to recreate and populate the 
      full-text catalog 

      Answer: D 

      105. You database includes a table named Product. The Product table 
      currently has clustered index on the primary key of the product_id column. 
      There is also a nonclusted index on the Description column. You are 
      experiencing very poor response times when querying the Product table. 
      Most of the queries against the table include search arguments on the 
      description and product_type columns. Because there are many values in the 
      Size columns for any product, query result set usually contain between 200 
      and 800 rows. You want to improve the response times when querying the 
      product table. What should you do? 

      A. Use SQL Server Enterprise Manager to create nonclustered index on each 
      column being referenced by each SELECT statement 
      B. Use SQL Server Enterprise Manager to generate stored procedures for the 
      product table 
      C. Use the Index Tuning Wizard to identify and build any missing indexes 
      D. Use SQL Server Profiler to capture performance statistics of queries 
      against the product table 

      Answer: C 

      106. You have a table with 10,000 rows, it grows by 10 % every year. There 
      is a nightly batch that updates the table with data. The following 
      morning, users are complaining the the queries they run are really slow 
      the first time they run but they speed up the second time. What can you do 
      to speed up the performance of queries? 

      A. Run sp_createstats as part of the nightly batch job 
      B. Run sp_updatestats as part of the nightly batch process 
      C. Set the auto update statistics Database option to be true 
      D. Can't remember but some wierd Database option 

      Answer: B 

      107. Your database includes a SalesPerson table that tracks various data, 
      including the sales goal and actual sales for individual salespeople. The 
      sales manager wants a report containing a list of the five least 
      productive salespeople, along with their goal and their actual sales 
      production. You will use an ascending sort to order the information in the 
      report by actual sales production. What should you do to produce this 
      report? 

      A. Issue a set Rowcount 5 statement before issuing a select statement 
      against the sales person table 
      B. Include a top 5 clause in the select list against the salesperson table 

      C. Issue a set query_governor_cost_limit 5 statement before issuing a 
      select statement against the salesperson table 
      D. Cost the rows returned by using a *** count(*) < 5 

      Answer: B 

      108. You add new functionality to an existing database application. After 
      the upgrade, users of the application report slower performance. The new 
      functionality executes multiples stored procedure and dynamic SQL 
      statements. You want to identify the specific queries that are 
      encountering excessively long execution time. What you should do? 

      A. Run the SQL Server Tuning Wizard 
      B. Create a SQL Profiler trace that uses minimum execution time and 
      application 
      C. Use the Current activity Dialog Box of the SQL Server EM to list 
      current user tasks and objects blocks 
      D. Use SP_Monitor stored procedure to monitor the CPU Busy and to-Busy 
      Columns before and after adding new functionality 

      Answer: B 

      109. Evaluate this statement: USE sales SELECT manufacturer_id, 
      SUM(unit_price) FROM inventory GROUP BY manufacturer_id If the inventory 
      table contains 350 unit_price values and there are 125 different 
      manufacturers, how many unit_price values will be displayed? 

      A. one 
      B. 350 
      C. one for each record in the inventory table 
      D. one for each manufacturer_id value in the result set 

      Answer: D 

      110. Your table of medical information includes a table named Experiment 
      that is defined as follows: 
      CREATE TABLE Experiment ( ExperimentID char(32), Description Text, Status 
      Integer, Results Text) 
      You write the following: 
      SELECT *FROM Experiment WHERE CONTAINS (Description, 'angina') 
      You are certain that there are matching rows, but you receive an empty 
      result set when you try to run the query. What should you do? (Choose all 
      that apply) 

      A. Ensure that there is a nonunique index on Description column of 
      Experiment table 
      B. Ensure that there is a clustered index on Results column of Experiment 
      table 
      C. Create FULLTEXT catalog that includes the Experiment table 
      D. Create a scheduled job to populate the FULLTEXT catalog 

      Answer: C, D 

      111. What does the following do? disk resize name='payroll_log', 
      size=15560 

      A. Size increased by 15MB 
      B. Increased to 15MB 
      C. Increased to 30MB 
      D. Error message 

      Answer: D 

      112. Want to inform users of the correct syntax if they don't enter all 
      the necessary parameters. How? 

      A. Batch 
      B. Rule 
      C. Stored procedure 
      D. Trigger 

      Answer: D 

      113. You have an inventory db with the log on a separate device. Want to 
      increase log by 20MB. You have created device invlogdev2 of 40MB. Is the 
      following correct? 
      alter database inventory on invlogdev2=20 exec sp_logdevice inventory, 
      invlogdev2 

      A. Yes 
      B. No, only increased by 10MB 
      C. No, trans. log moved instead of increased 
      D. No, need DBCC CHECKALLOC to determine errors 
      E. Cannot determine based on the info 

      Answer: A 

      sp_logdevice: sp_logdevice puts syslogs (contains the transaction log) on 
      a separate database device (BOL).


      114. You have a Decision Support System (DSS) database that allows users 
      to create and submit their own ad hoc queries against any of the DSS 
      tables. The users report that the response times for some queries are too 
      long. Response times for other queries are acceptable. What should you do 
      to identify long running queries? 

      A. SQL Server Enterprise Manager 
      B. SQL Server Profiler 
      C. SQL Server Query Analyser 
      D. Microsoft Windows NT Performance Monitor 

      Answer: B 

      115. You have a table with a clustered primary key. New records are added 
      by a batch job that runs at night. The table grows by 20 percent per year. 
      During the day, the table is used frequently for queries. Queries return 
      ranges of rows based on the primary key. Response times for queries have 
      become worse over time. You run the DBCC SHOWCONTIG statement. The 
      statement provides the following output: 
      Pages Scanned 354 
      Extents Scanned 49 
      Extent Switches 253 
      Avg. pages per extent 7.2 
      Scan Density 17.79% [45:94] 
      Extent Scan Fragmentation 82.21% 
      Avg. Bytes Free per Page 485.2 
      Avg. Page Density (full) 94.01% 
      How to improve the query performance? 

      A. Update statistics on clustered index 
      B. Change the row size to fit efficiently on a page 
      C. Rebuild clustered index with fill factor 100 
      D. Rebuild clustered index with fill factor 25 
      E. Rebuild clustered index with fill factor 75 

      Answer: E

      missing key words: 'heavily updated'. that's why we'll choose E and not D.

      116. You are working on a data conversion effort for a Sales database. You 
      have successfully extracted all of the existing customer data into a 
      tab-delimited flat file. The new Customer table is defined as follows: 
      CREATE TABLE Customer ( Id Int IDENTITY NOT NULL, Lastname Varchar(50) NOT 
      NULL, Firstname Varchar(50) NOT NULL, Phone Varchar(15) NOT NULL, Email 
      Varchar(255) NULL) 
      You need to populate this new table with the customer information that 
      currently exists in a tab-deliminated flat file with the following format: 
      Name Phone E-mail Adam Barr 555-555-1098 abarr@adatum.om Karen Berge 
      555-555-7868 kberg@woodgrovebank.com Amy Jones 555-555-0192 
      ajones@treyresearch.com 
      How can you transfer the data to accurately populate the Customer table? 

      A. Import the data by using Data Transformation Services with the 
      Transform information as it's copied to the destination option button 
      selected. 

      Answer: A

      Transform information as it is copied to the destination - Specify that 
      each source column should be transformed, based on the VBScript or JScript 
      provided, as it is copied to the destination (BOL).

      117. You have a database to kep track of sales information. Many of your 
      queries calculate the total sales amount for a particular salesperson. You 
      must write a nested procedure that will pass a parameter back to the 
      calling procedure. The parameter must contain the total sales amount from 
      the table that is defined as follows: 
      CREATE TABLE SalesInformation ( SalesInformationID Int IDENTITY(1,1) NOT 
      NULL PRIMARY KEY NONCLUSTERED, SalesPersonID Int NOT NULL, RegionID Int 
      NOT NULL, ReceiptID Int NOT NULL, SalesAmount Money NOT NULL) 
      Which statement can you execute to create the procedure? 

      A. CREATE PROCEDURE GetSalesPersonData @SalesPersonID Int, @RegionID Int, 
      @SalesAmount Money OUTPUT AS SELECT 
      @SalesAmount = SUM(SalesAmount) 
      FROM SalesInformation 
      WHERE @SalesPersonID = SalesPersonID 
      B. CREATE PROCEDURE GetSalesPersonData @SalesPersonID Int, @RegionID Int, 
      @SalesAmount INT=OUTPUT AS SELECT 
      @SalesAmount = SUM(SalesAmount) 
      FROM SalesInformation 
      WHERE @SalesPersonID = SalesPersonID
      C. CREATE PROCEDURE GetSalesPersonData @SalesPersonID Int, @RegionID Int, 
      @SalesAmount Money AS 
      SELECT 
      @SalesAmount = SUM(SalesAmount) 
      FROM SalesInformation 
      WHERE @SalesPersonID = SalesPersonID
      D. Some other alternative with OUTPUT missing.

      Answer: A

      118. You are implementing a logical data model for an online processing 
      (OLTP) application. One entity from the logical model in 3rd normal form 
      currently has 10 attribute. One attribute is the primary key. Six of the 
      attribute are foreign key referencing into six other entities. The last 
      three attributes representing columns that holds Numeric values. How 
      should this entity from the logical model be implemented? 

      A. Create table by denormalizing the enity. Add the information from the 
      six foreign key referencing as additional column of the table. 
      B. Create two tables by denormalizing the entity add three primary key & 
      three numeric values as column of the one table. At the primary key & the 
      information from the six foreign key as column of the other table. 
      C. Create the table as described in the logical data model. 
      D. Create a view that the six foreign keys referenced 

      Answer: C 

      119. Your database includes a Supplier table that contains 20 rows, a 
      Products table that contain 80 rows, an Orders table that contains 50,000 
      and an OrderDetails table that contains 150,000 rows. There are clustered 
      indexes on the primary keys for each table, and the statistics are up to 
      date. You need to analyse the following query for performance 
      optimization: 
      SELECT DISTINCT s.CompanyName FROM Suppliers S JOIN Products p ON 
      s.SupplierID = p.SupplierID JOIN OrderDetails od ON p.ProductID = 
      od.ProductID SET SHOWPLAN ON 
      Which graphical execution plan might be generated by SQL Server Query 
      Analyser? 

      A. Not sure, the diagram for the answers is impossible to replicate, I 
      chose B.

      Answer: A

      120. You are designing a distributed data model for an international 
      importing and exporting company. The company has sales offices in London, 
      Nairobi, and Cairo, with headquarter in New York. Sales are recorded in 
      the local currency in the local database, but the United States dollars is 
      used as a common currency. London and Nairobi have a value-added tax, but 
      Cairo does not. The company's New York headquarter credit a sale to the 
      local office in US$ at the time of the sale, but reports its monthly sales 
      in US$ converted at the end of the month. Because of fluctuations in the 
      exchange rate, there can be differences in the US$ value of a sale between 
      the date of the sale and the date of the monthly report. You want to 
      accomplish the following goals: 
      - Ensure that all sales record primary keys are unique throughout the 
      distributed database. 
      - Ensure that a sales record created in London or Nairobi includes a 
      value-added tax, but that a sales record created in Cairo does not. 
      - Ensure that the local sales amounts can be calculated in US$ at the time 
      of the sale. 
      - Ensure that the local sales amounts can be calculated in US$ at the end 
      of the month. 
      - Ensure that the difference between the value of a sale in US$ at the 
      time of the sale and the value at the end of the month can be calculated. 
      You take the following actions: 
      - Create a ConversionRate table with a currency column, a Rate column, and 
      a RateValidDate column. 
      - Add PRIMARY KEY constraint to the ConversionRate table on the Currency 
      column and the RateValidDate column. 
      - Add a CHECK constraint to the ConversionRate table rejecting a 
      RateValidDate date that is later than the current date. 
      - Create a Sales table with a uniqueidentifier column named SalesID, a 
      SalesAmount column, a nonnullable TaxAmount column and a SalesDate column. 

      - Add a DEFAULT constraint to the Sales table on the SalesID column that 
      uses the NEWID function. 
      - Add a PRIMARY KEY constraint to the Sales table on the SalesID column. 
      Which result or results do these actions produce? (Choose all that apply) 

      A. Ensure that all sales record primary keys are unique throughout the 
      distributed database. 
      B. Ensure that a sales record created in London or Nairobi includes a 
      value-added tax, but that a sales record created in Cairo does not. 
      C. Ensure that the local sales amounts can be calculated in US$ at the 
      time of the sale. 
      D. Ensure that the local sales amounts can be calculated in US$ at the end 
      of the month. 
      E. Ensure that the difference between the value of a sale in US$ at the 
      time of the sale and the value at the end of the month can be calculated. 

      Answer: A, C, D, E

      121. You are implementing a logical data model. All of the tables in your 
      logical data model are normalized to at least third normal form. There are 
      no surrogate primary keys in any of the tables. Some tables relationships 
      involve up to eight levels of parent, child, grandchild and so forth. In 
      the model the primary key of each descendant table inherits the primary 
      key of all ancestor tables. You want to accomplish the following goals: 
      - Allow table at any level in the hierarchy to be joined to any other 
      table in the hierarchy. 
      - Ensure that tables are joined on a single column. 
      - Limit the index length of primary key to 10 bytes or less. 
      - Ensure that key column are always compared on a binary basis regardless 
      of which options where selected during the installation of SQL server. 
      You do the following: 
      - Implement the data model as is. 
      - Create indexes on all foreign keys. 
      Which result or results do these actions produce? (Choose all that apply) 

      A. Tables in data model hierarchy can be joined to any other table in the 
      hierarchy 
      B. Tables are joined on a single column 
      C. The index length of all primary keys is 10 bytes or less 
      D. Key column are always compared on a binary basis regardless of which 
      options selected during the installation of SQL server 

      Answer: A, B, D 

      122. You have to convert legacy database to SQL 7. Legacy database has: 
      Name as Last & First (one column containing both names) SQL has: 
      EmployeeID IDENTITY LastName, FirstName (2 separate columns with the 
      names) Select the best option: 

      A. DTS, transfer as is without preprocessing 
      B. BCP with /E 
      C. BCP, but before preprocess text legacy file and split name into two: 
      Last and First 
      D. DTS, transfer with option to allow identity insert 
      E. Something outside of normal people understanding, not related to both 
      DTS and BCP 

      Answer: A

      SET IDENTITY_INSERT (T-SQL): Allows explicit values to be inserted into 
      the identity column of a table (BOL) .
      in this case, nothing is inserted into the IDENTITY culomn of the SQL 
      table, so there's no need to use IDENTITY_INSERT

      123. The user wants to find out all those, which had some sales. The SQL 
      command given is: SELECT title_id FROM titles WHERE title_id = (SELECT 
      title_id FROM sales) The above SQL is: 

      A. Outstanding 
      B. Adequate 
      C. Seems to be ok will not work 
      D. It is wrong and will not work 

      Answer: D

      some people think A. oh well...

      124. (Shown:xhibit: )
      Table1 (Company): CompanyID(PK), CompanyName 
      Table2 (Employee): EmployeeID(PK), FirstName, LastName,?K 
      SocialInsurance#, CompanyName?K 
      Asked for optimizing data design (something like that) 

      A. Add EmployeeID to Company Table 
      B. Remove SocialInsurance# from Employee table 
      C. Remove CompanyName from Employee table 
      D. Remove CompanyName from Company table 

      Answer: C

      125. You are designing a database that will be used to store information 
      about tasks assigned to various employees. Each task is assigned to only 
      one employee. The database contains a table named Task that is modeled as 
      shown in the exhibit. You want to use a PRIMARY KEY constraint to uniquely 
      identify each row in the Task table. 
      On which column or columns should you define the PRIMARY KEY constraint? 
      (Choose all that apply)

      A. TaskNo
      B. EmployeeNo
      C. Status

      Answer: A, B 

      If this question is given in a multiple choice format, you might want to 
      choose B as well. (just because multiple choice questions always have 2 or 
      more correct answers in microsoft exams).

      126. You are building a database for the human resource department of your 
      company. You want to eliminate duplicate entry and minimize data storage 
      wherever possible. You want to track the following information for each 
      employee: First name Middle name Last name Employee identification number, 
      Address Date of hire ,Department ,Salary, Name of manager. Which table 
      should you use? 

      A. First table: employeeID, ManagerID, firstname, middlename, lastname, 
      address, dateofhire, department, salary Second table: ManagerID, 
      firstname, middlename, lastname 
      B. First table: employeeID, firstname, middlename, lastname, address, 
      dateofhire, department, salary Second table: ManagerID, firstname, 
      middlename, lastname Third table: EmployeeID, ManagerID 
      C. Only one table: EmployeeID, ManagerID, firstname, middlename, lastname, 
      address, dateofhire, department, salary 
      D. Employee Table / Manager Table / ManagerEmployee Table 

      Answer: C 

Submit your own braindump through our submission form



Have a question about a braindump? Don't understand why the answer is the 
answer? Think the answer might be wrong? Ask it on the discussion forum

If you see any braindumps with copyrighted information please email the 
webmaster



