powered by simpleCommunicator - 2.0.60     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Сертификация и обучение [игнор отключен] [закрыт для гостей] / Ошибки в ответах? Тест 70-229
5 сообщений из 5, страница 1 из 1
Ошибки в ответах? Тест 70-229
    #32827456
HelenFilatova
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Хотелось бы услышать мнение по следующим вопросам:
Вопрос 1
You are a database developer for a large travel company. Information about each of the company’s
departments is stored in a table named Department. Data about each of the company’s travel agents and
department managers is stored in a table named Employees. The SQLLogin column of the Employees table
contains the database login for the travel agent or department manager. The Department and Employees table
are shown in the exhibit.
Each department manager has been added to the Managers database role. You need to allow members of this
database role to view all of the data in the department table. Members of this role should be able to insert or
update only the row that pertains to their department.
You grant the Managers database role SELECT permissions on the Department table. What should you do
next?

Exhibit:

Department:
DepartmentId
DepartmentName
TotalB

Employees:
EmployeeId
EmployeeName
SQLLogin

A. Create a trigger on the Department table that checks whether the database login of the user performing the
insert or update operation belongs to a member of that department.
B. Create a view that includes all columns in the Department table and the SQLLogin column from the
Employees table.
C. Include the WITH CHECK OPTION clause in the view definition.
D. Grant INSERT and UPDATE permissions on the Department table.
E. Grant INSERT and UPDATE permissions on the SQLLogin column of the Employees table.

и Вопрос 2:
You are a database developer for a marketing firm. You have designed a quarterly sales view. This view joins
several tables and calculates aggregate information. You create a unique index on the view. You want to
provide a parameterized query to access the data contained in your indexed view. The output will be used in
other SELECT lists.
How should you accomplish this goal?
A. Use an ALTER VIEW statement to add the parameter value to the view definition.
B. Create a stored procedure that accepts the parameter as input and returns a rowset with the result set.
C. Create a scalar user-defined function that accepts the parameter as input.
D. Create an inline user-defined function that accepts the parameter as input.

Дело в том что UCertify и TestKing дают обсолютно разные ответы. Хотелось бы послушать ваши варианты ответов с объяснениями.
...
Рейтинг: 0 / 0
Ошибки в ответах? Тест 70-229
    #32828445
Iris_m
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
По поводу первого вопроса.
Тесткинг утверждает, что тригеры используют в самых крайних случаях, и что вью предпочтительнее. Я бы ответила А. По-моему, B не решает этот вопрос, т.к. придется либо создавать вью на каждый отдел и ставить with check option, но тогда они не увидят информацию, касающуюся всех отделов, либо использовать тригер.
В UCertify я такого вопроса не нашла, и не знаю, какой там ответ считается правильным, и какие аргументы..

По поводу второго вопроса. Я тоже обратила внимание, что UCertify предлагает ответ D, а TestKing - ответ С (остальные отбрасываем сразу). Только в данном случае я с тесткингом не согласна. В условии сказано "The output will be used in
other SELECT lists", то бишь не сама функция должна стоять в селекте, а ее результат. И наврят ли под агрегатной информацией понимается какое-то одно число, поэтому на мой взгляд должен быть ответ D.
...
Рейтинг: 0 / 0
Ошибки в ответах? Тест 70-229
    #32828828
HelenFilatova
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
По поводу первого вороса я тоже в начале отетила А. Однако есть прекрасная возможность реализовать представление :

CREATE VIEW Solution
AS
SELECT DepartmentID, DepartmentName, TotalBudget, SQLLogin
FROM Department INNER JOIN Employees
ON Department.DepartmentID = Emplyees.DepartmentID
WHERE SQLLogin = USER_NAME()
WITH CHECK OPTION

и тогда верен ответ B.
А насчет второго вопроса так я тоже ответила D. Однако там сказано именно SELECT list если это понимать как список значений в разделе SELECT то верен ответ С. Очень даже возможен вариант когда входным параметром для функции является какое-то поле таблицы. Так что тут можно и подумать.
...
Рейтинг: 0 / 0
Ошибки в ответах? Тест 70-229
    #32828897
Bigheadman
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
По второму вопросу.
Он в этом форуме уже обсуждался, кажется. Посмотрите архив.
ИМХО. SELECT lists - это:
SELECT dbo.function(param) FROM ....
а не
SELECT ... FROM dbo.function(param)

Так что ИМХО правильный ответ С.
...
Рейтинг: 0 / 0
Ошибки в ответах? Тест 70-229
    #32843405
Iris_m
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
HelenFilatovaПо поводу первого вороса я тоже в начале отетила А. Однако есть прекрасная возможность реализовать представление :

CREATE VIEW Solution
AS
SELECT DepartmentID, DepartmentName, TotalBudget, SQLLogin
FROM Department INNER JOIN Employees
ON Department.DepartmentID = Emplyees.DepartmentID
WHERE SQLLogin = USER_NAME()
WITH CHECK OPTION

и тогда верен ответ B.

если реализовать такое представление, то нарушится требование условия, что department manager-ы должны видеть информацию, касающуюся всех отделов, несмотря на то, что редактировать - только свою.
Вот еще аргументы в пользу А.

Analysis. Answer option A is correct.
Triggers are executed automatically whenever data in the table is inserted, deleted, or updated. For the above scenario, a trigger can be created which rejects data if a department manager inserts or updates data for the other departments.

The WITH CHECK OPTION clause is used with the CREATE VIEW statement. Creating a view with the WITH CHECK OPTION clause forces all data modification statements, executed against the view, to be cancelled, if they modified rows in a way that can cause them to disappear from the view. Thus, all data modification statements must adhere to the criteria set within the SELECT statement defining the view. As the filter condition for the view cannot be dynamically change, you have to create separate view for each department manager, which show data related to their own department. Although, you can create separate view for each department manager and assign appropriate permissions to view; this will increase administrative burden.
...
Рейтинг: 0 / 0
5 сообщений из 5, страница 1 из 1
Форумы / Сертификация и обучение [игнор отключен] [закрыт для гостей] / Ошибки в ответах? Тест 70-229
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]