The following questions are intended to reinforce key information presented in this appendix and Appendixes D, E, and F. If you are unable to answer a question, review the appropriate lesson and then try the question again.
You are the database administrator for a health care plan. The Physicians table was created with the following statement:
CREATE TABLE dbo.Physicians ( PhysicianNo int IDENTITY (100, 2) NOT NULL , FirstName varchar (25) NOT NULL , LastName varchar (25) NOT NULL , Street varchar (50) NULL , City varchar (255) NULL , State varchar (255) NULL , PostalCode varchar (7) NULL , CoPay money NOT NULL CONSTRAINT PhysCoPay DEFAULT (10) ) |
Write a SELECT statement with a WHERE clause of the following type:
WHERE State = 'NY' OR State = 'WA' OR State = 'VA' OR State = 'CA' |
Or, use a WHERE clause that includes the IN keyword:
WHERE State in ('NY', 'WA', 'VA', 'CA') |
Use the DISTINCT keyword as part of the SELECT statement.
Use a computed column in the select list and use an alias for the column name as follows:
(CoPay + 5) AS AmtDue |
You must supply data for at least two columns. At a minimum, the INSERT statement contains values for FirstName and LastName. All other columns allow null values or have defaults generated for them.
Use an UPDATE statement as follows:
UPDATE Physicians SET CoPay = (CoPay * 1.12) |
Use a DELETE statement that has no WHERE clause or a TRUNCATE TABLE statement.