首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
You are the administrator of a SQL Server 2000 computer. The server contains a database named MedicalRecords. The database table
You are the administrator of a SQL Server 2000 computer. The server contains a database named MedicalRecords. The database table
admin
2009-05-19
26
问题
You are the administrator of a SQL Server 2000 computer. The server contains a database named MedicalRecords.
The database tables are configured as shown in the exhibit.
The existing PatientID field is an identity field. According to a new government regulation, the patient IDs must include a three-character prefix before the numeric portion of the ID. The patient’s home address defines the prefix.
You want to comply the regulation while minimizing changes to the database. Which two actions should you take? (Each correct answer presents part of the solution. Choose Two)
A. Drop the FOREIGN KEY constraints. In each table, change the data type of the PatientID field to char.
B. Add an On Update constraints to the Patients table, and link it to the PatientID field. Update the field in the Patients table.
C. In the Patients table, add a new field named StatePatientID that has a data type of char. Populate the field with the prefix and the existing PatientID.
D. In each table, update the PatientID field. Re-create the FOREIGN KEY constraints.
E. In the Patients table, update the PatientID field.
F. Create a trigger that populates the StatePatientID field when a new patient is created.
选项
答案
C,F
解析
Explanation: The PatientID column currently holds an integer value. The new requirement demands that the patientID column includes the characters preceding the integer value. We want to implement this change with minimal change of the database. There are basically two approaches to this problem:
Method 1: add a new column StatePatientID:
1. Add the StatePatientID with data type char to the patients table. (C)
2. Populate the field with the three letters and the existing number from the PatientID column. (C)
3. Create a trigger that populates the StatepatientID field when a new patient is created. (F)
Method 2: change the PatientID column to char:
4. Drop foreign key constraints on the PatientID column. (A)
5. Change the data type of the PatientID column to char. (A)
6. Update the PatientID column in each table. We add the three letters to the integer value. (D)
7. Recreate the foreign key constraint. (D)
Method 1 only makes changes to one table meeting the requirement that changes to the database should be minimized. It would on the other hand introduce redundant data since the new StatePatientID column is derived from the PatientID column. It is no requirement to keep a normalized database so method 1 is the preferred solution.
Incorrect Answers:
A, D: Dropping all foreign and primary key constraints on the PatientID column, changing the column PatientID to char and then recreating all foreign and primary key constraints on the PatientID column throughout the database would not minimize changes to the database.
B: An ON UPDATE trigger on the PatientID field doesn’t make much sense. The PatientID field is an identity and wouldn’t be updated.
E: If the PatientID field is changed in the Patients table then it must be changed in all the other tables as well.
转载请注明原文地址:https://kaotiyun.com/show/iuhZ777K
本试题收录于:
微软70228题库微软认证分类
0
微软70228
微软认证
相关试题推荐
[A]Thefirststepinpreparingamarketingplanisthatofproducingtheinformationnecessaryfordecision-making.Usually,a
Thenewaircraftrepresentsa$250mbetbyBombardierthatMexicocouldprovidenotjustroutinelabourbutmanufacturingthat
Writealettertooneofyourfriends,apologizingtohim/herforyourmakinghis/hercomputerstopworking.Youshouldwrite
Directions:Wesometimeshearthesadnewsofsuicideinuniversities.Isthereanywaytopreventthisfromhappeningagain
WriteanessaywiththetitleofOnOfficeWorkers’Sub-health.Inyouressay,youshould;1.describethepresenthealthcondit
Youhavebeeninvitedtotakepartinaspeechbyyourfriend,Jerry.Unfortunately,youcannotaccepttheinvitation.Writehim
In2016,manyshoppersoptedtoavoidthefreneticcrowdsanddotheirholidayshoppingfromthecomfortoftheircomputer.But
Dreamsarestoriesandimagesthatourmindscreatewhilewesleep.Theycanbeentertaining,fun,romantic,disturbing,frighte
如果WindowsXP不能够识别网络适配器如何安装网络适配器。
在【安全中心】窗口中,设置windows防火墙,允许“文件和打印机共享”。
随机试题
A、脐疝B、腹股沟斜疝C、股疝D、腹股沟直疝E、切口疝患者男性,46岁,发现右腹股沟肿块2年,术中发现腹壁下动脉在疝囊颈外侧,应考虑为
患者女,44岁,左侧鼻塞,多清涕2年余,不伴鼻痒及打喷嚏,鼻腔检查见鼻中隔明显左偏,左中鼻道少许分泌物。鼻窦CT示:鼻中隔左偏,左侧上颌窦黏膜稍增厚,最适当的治疗是
下列肋骨中可称为假肋的是
孕妇,36岁。妊娠10周,休息时仍感胸闷、气急。查体:脉搏120次/分,呼吸22次/分,心界向左侧扩大,心尖区有Ⅱ级收缩期杂音,肺底有湿啰音,应采取的处理措施是
对工程项目进行全面管理的中心的是()
在民事诉讼程序中,下列情形可以缺席判决的有()。
在销售与收款循环的审计中,丙注册会计师确定的审计目标是“所有销售交易均已登记入账”,针对这一审计目标,下列说法中错误的是()。在生产与存货循环的审计中,丙注册会计师实施监盘程序,无法实现的审计目标是()。
一般资料:求助者,女性,35岁,已婚,工厂普通工人。案例介绍:有一次求助者上班时眼看就要迟到,就急匆匆地往车间里跑,不小心与公司男领导撞了个满怀,同事们顿时都笑起来,还有人吹起口哨,大家事后还总拿他们开玩笑。以后求助者每次去车间都会紧张,觉得同事
水仙(清)李渔水仙一花,予之命也。予有四命,各司一时:春以水仙兰花为命;夏以莲为命;秋以秋海棠为命;冬以腊梅为命。无此四花,是无命也。一季夺予一花,是夺予一季之命也。水仙以秣陵①为最,
[*]
最新回复
(
0
)