Questions
for you.
1.
You are the database developer for a leasing company. Your leasing
database includes a Lessee table that is defined as follows:
CREATE TABLE Lessee ( Id Int IDENTITY NOT NULL CONSTRAINT
pk_lesse_id PRIMARY KEY NONCLUSTERED, Surname varchar(50) NOT
NULL, FirstName varchar(50) NOT NULL, SocialSecurityNo char(9) NOT
NULL, CreditRating char(10) NULL, Creditlimit money NULL) Each
SocialSecurityNo must be unique. You want the data to be
physically stored in order by SocialSecurityNo. Which constraint
should you add to the SocialSecurityNo column on the Lessee table?
A. a UNIQUE CLUSTERED constraint
B. a UNIQUE UNCLUSTERED constraint
C. a PRIMARY KEY CLUSTERED constraint
D. a PRIMARY KEY UNCLUSTERED constraint
Answer: A
2. 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
3. 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
4.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 |