|
70-228 Вопрос из Testking 1.5 № 116
|
|||
---|---|---|---|
#18+
You are the administrator of a SQL Server 2000 computer at a doctor's office. The server contains a database named Medical. The database stores patient and treatment information and is configured as shown in the exhibit. Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32.
The office accountant needs access to the total number of treatments that have been performed in the office. The accountant should not have access to any other patient data and should not be able to change any information in the database. The accountnat has a SQL Server Authenticated login and database user account named AccountUser. You need to make the appropriate information available to the accountant, while protecting the other information in the database. Which batch of Transact-SQL statements should you execute? A. CREATE VIEW TotalTreatments AS SELECT COUNT(PatientID) AS Total FROM dbo.Patients GO GRANT ALL ON TotalTreatments TO AccountUser B. CREATE VIEW TotalTreatments AS SELECT COUNT(*) AS Total FROM dbo.Patients GO GRANT ALL ON TotalTreatments TO AccountUser C. CREATE PROCEDURE TotalTreatments AS SELECT COUNT(*) AS Total FROM dbo.Patients GO GRANT ALL ON TotalTreatments TO AccountUser D. CREATE PROCEDURE TotalTreatments AS SELECT COUNT(PatientID) AS Total FROM dbo.Patients GO GRANT ALL ON TotalTreatments TO AccountUser Testking предлагает следующий ответ С с объяснением Using a procedure is a good way of protecting from direct access to the user table. The users would only have to be granted acces to the procedure not to the underlined table. (Хотя в данном случае VIEW not updatable, и мое субьективное мнение, что пользователям из VIEW легче получить данные, чем из PROCEDURE ) We must use COUNT(*) since COUNT(*) returns the number of rows that math the search conditions specified in the query without eliminated duplicates. It counts each row separately, including rows that contain null values. COUNT(PatientID) would count distinct rows and would not include rows with NULL values in the PatientID column (Хотя в данном случае PatientID PRIMARY KEY Он не может содержать NULL и неуникальные значения. Следовательно COUNT(PatientID) =COUNT(*) и даже предпочтительнее, так как теоретически выполняется быстрее) НО самое главное, в вопросе требуется посчитать общее количество посещений, которое надо считать по таблице посещений Treatments, а не по таблице пациентов Patients СЛЕДОВАТЕЛЬНО : Все ответы НЕВЕРНЫ А Ваше мнение ? ... |
|||
:
Нравится:
Не нравится:
|
|||
29.04.2004, 16:52 |
|
70-228 Вопрос из Testking 1.5 № 116
|
|||
---|---|---|---|
#18+
Добрый день. chackНО самое главное, в вопросе требуется посчитать общее количество посещений, которое надо считать по таблице посещений Treatments, а не по таблице пациентов Patients я тоже так думаю, вероятно это просто ошибка в Testking. Там где одна ошибка может быть и две. Например в оригинале может быть SELECT COUNT(DISTINCT PatientID) или в C запрос к Treatments, а в D запрос к Patients. chack(Хотя в данном случае VIEW not updatable, и мое субьективное мнение, что пользователям из VIEW легче получить данные, чем из PROCEDURE ) это не так. Создавать VIEW содержащий одно скалярное значение странно. PROC здесь выглядит естественнее. Удачи ... |
|||
:
Нравится:
Не нравится:
|
|||
29.04.2004, 17:59 |
|
70-228 Вопрос из Testking 1.5 № 116
|
|||
---|---|---|---|
#18+
josia прав, здесь скорее несколько опечаток в условиях задачи. Варианты ответов могут звучать примерно так: A. CREATE VIEW TotalTreatments AS SELECT COUNT(PatientID) AS Total FROM dbo.Patients GO GRANT ALL ON TotalTreatments TO AccountUser B. CREATE VIEW TotalTreatments AS SELECT COUNT(*) AS Total FROM dbo.Patients GO GRANT ALL ON TotalTreatments TO AccountUser C. CREATE PROCEDURE TotalTreatments AS SELECT COUNT(*) AS Total FROM dbo.Treatments GO GRANT ALL ON TotalTreatments TO AccountUser D. CREATE PROCEDURE TotalTreatments AS SELECT COUNT(PatientID) AS Total FROM dbo.Treatments GO GRANT ALL ON TotalTreatments TO AccountUser Тогда ответ D (исключаем строки с PatientID is Null в dbo.Treatments) Кто сдавал 70-228 подскажите как звучат варианты ответов на самом деле? А может ли быть опечатка не в TestKing, а в самом экзамене? ... |
|||
:
Нравится:
Не нравится:
|
|||
05.05.2004, 13:16 |
|
|
start [/forum/topic.php?fid=34&fpage=58&tid=1551932]: |
0ms |
get settings: |
7ms |
get forum list: |
12ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
64ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
42ms |
get tp. blocked users: |
2ms |
others: | 233ms |
total: | 383ms |
0 / 0 |