首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
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
42
问题
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://www.kaotiyun.com/show/iuhZ777K
本试题收录于:
微软70228题库微软认证分类
0
微软70228
微软认证
相关试题推荐
[A]Marketforglasscraftsisgrowing[B]Dependenceofcomputerdevelopmentonglass[C]Behindtheadaptabilityofglass[D]
Directions:Inthissection,youareaskedtowriteanessaybasedonthefollowinginformation.Makecommentsandexpressy
Inthissection,youareaskedtowriteanessaybasedonthefollowinginformation.Makecommentsandexpressyourownopinion.
Twomonthsago,yougotajobasaconsultantforHumanResourceServiceCompany.Butnowyoufindthattheworkisnotwhatyou
Supposeyouwanttoapplyforajobinacompanyasanofficesecretary.Writeanapplicationemailto1)introduceyourself
EricHansenwritesabouttravelasaparticipatingenthusiastratherthanamereobserver.【T1】Itgivesthesenineessays,based
In2016,manyshoppersoptedtoavoidthefreneticcrowdsanddotheirholidayshoppingfromthecomfortoftheircomputer.But
"Thisisareallyexcitingtime—aneweraisstarting,"saysPeterBazalgette,thechiefcreativeofficerofEndemol,thetelev
MusicfanshaveoftenviewedMicrosoftassomethinglikeabadcoverband,onethatpumpedoutuninvitingfacsimilesofApple’s
Writealettertorecommendyourstudent,LiXu,forapositionofadministratorinacompany.Youshouldincludethedetailsyo
随机试题
在设计组织结构时,大型的钢铁企业适用于()
肺炎链球菌肺炎患者咳铁锈色痰主要见于哪一病理分期
用治寒凝血瘀,月经不调,少腹冷痛,当选的性味是
现金流量折现法与传统方法的主要区别()。
某钻井平台设置了逃生装置,包括两组钢丝绳;每组钢丝绳的一端固定在井架平台上,另一端连接到安全区域的沙坑内锚定,则该钻井平台采取的技术手段属于()。
当某企业的产量为2个单位时,其总成本、总固定成本、总可变成本、平均成本分别是2000元、1200元、800元和1000元;当产量为3个单位时,其总成本、总固定成本、总可变成本、平均成本分别是2100元、1200元、900元和700元,则该企业的边
在一个支付公司所得税的世界里,财务困境成本与代理成本的存在如何影响MM理论。
被判处管制的犯罪分子和在缓刑考验期内的犯罪分子应当共同遵守的规定包括()。
国务院总理李克强2013年10月9日下午在文莱首都斯里巴加湾市出席第十六次中国一东盟(10+1)领导人会议。李克强总理在会议上发表讲话,指出中国与东盟关系已进入成熟期,中国与东盟合作步人快车道,双方应把握机遇,推动中国——东盟宽领域、深层次、高水平、全方位
A、Lossofawareness.B、Lossofmemory.C、Excessiveanxiety.D、Lowspirits.B讲座提到,阿尔茨海默病(Alzheimer’s)不仅对那些遭受记忆丧失(sufferfrommemo
最新回复
(
0
)