首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
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
17
问题
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
微软认证
相关试题推荐
Thenewaircraftrepresentsa$250mbetbyBombardierthatMexicocouldprovidenotjustroutinelabourbutmanufacturingthat
Writealettertooneofyourfriends,apologizingtohim/herforyourmakinghis/hercomputerstopworking.Youshouldwrite
Writeanessaybasedonthefollowingoutline.Youshouldwriteabout150wordsontheANSWERSHEET.1.Differentopinio
Directions:Inthissection,youareaskedtowriteanessaybasedonthefollowinginformation.Makecommentsandexpressy
Themethodsoftestingaperson’sknowledgeandabilityremainasprimitiveasevertheywere.Afteralltheseyears,education
Theideaisasaudaciousasitaltruistic:provideapersonallaptopcomputertoeveryschoolchild—particularlyinthepoorestp
Thehumanbraincontains10thousandmillioncellsandeachofthesemayhaveathousandconnections.Suchenormousnumbersused
Manypeopletalkedofthe288,000newjobstheLaborDepartmentreportedforJune,alongwiththedropintheunemploymentrate
Insectsaredisappearing.Theworldhas25percentfewerterrestrialinsectsnowthanin1990.Thisincludesthosewerelyon
对MSN常规选项进行设置,使登录到Windows时自动运行Messenger(R),联系人联机时显示通知,收到电子邮件时通知我。
随机试题
患者,男性,46岁。发现口渴、多饮、消瘦3个月,突发昏迷2日。血糖30mmol/L,血钠132mmol/L,血钾4.0mmol/L,尿素氮9.8mmoL/L,CO2结合力18.3mmoL/L,尿糖、尿酮体强阳性。护士应首先采取的护理措施是
颞颌关节的组成不包括()
抗渗混凝土每一工程每()m3混凝土取样不得少于一次,取样不得少于2组。
()REITs是以收益性物业的出租、经营管理和开发为主营业务,主要收入是房地产出租收入。
《简明标准施工招标文件》适用的项目有()。
下列关于计提固定资产折旧或无形资产摊销的说法中,不正确的有()。
采用直接标价法条件下,汇率的上升意味着()。
企业集团从各子公司选拔优秀人才进人集团公司工作属于()。
设有学生表S(学号,姓名,性别,年龄)、课程表C(课程号,课程名,学分)和学生选课表SC(学号,课程号,成绩),检索学号、姓名和学生所选课程的课程名和成绩,正确的SQL命令是( )。
A、同事B、恋人C、夫妻D、上下级C根据“好,只要我们肯努力,我相信咱俩的日子会越过越好的”这句话,可以判断两人是夫妻关系,选C。
最新回复
(
0
)