0% found this document useful (0 votes)
50 views7 pages

1920 Sem 1

Past Paper

Uploaded by

anson232323
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
50 views7 pages

1920 Sem 1

Past Paper

Uploaded by

anson232323
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
Instructions (2) This paper has a total of SEVEN pages Including the cover page. 1) @ Note:The result of this assessment will not be This paper contains FOUR questions. Answer ALL questions. counted if you do not meet the minimum attendance requirement (if any) governed by the general academic regulations of your programme/course unless approval of the ‘campus principal has beén granted, IVE Information Technology Information & Communications Technology Programme Board INFORMATION AND NETWORK SECURITY (T114104) ‘SOFTWARE ENGINEERING (r114105) GAME SOFTWARE DEVELOPMENT (rataio7) CLOUD AND DATA CENTRE ADMINISTRATION ari4it5) DATA SCIENCE AND ANALYTICS ari4116) DATABASE PRINCIPLES [MODULE Cove: P4903, SEMESTER ONE MAIN EXAMINATION 2 JANUARY, 2020 41:30 PM TO 4:00 PM (2.5 hours) Infomation Tecnology ising Page Lot CouseProgeamn/You T1110, TF11410/, 7114107, T1411), ‘This paper contains FOUR questions. Answer yuestions. QL Given the following relations ofa Medical Appointment System and te database schema ‘with sample data found inthe Appendix on pages 5 and 6: Patient Patient, PationtName, Gender, MobileNo, HKId, DB) Doctor (Dostrld, DoctorName, MabileNo) Appointment (Appoinmentld. ADate, Time, ReomNum, Patient, Doctors) Deu (Deuld, DrugName, Category, UoM) reseription (Appoint, Drgld. Dosage) ‘where the underlined atrbutes are the primary key atebutes, Assume that tables Patient, Doctor, Appointment and Drug have bean crested with ‘primary keys and foreign keys inthe database. Given the following specification of the Prescription table: Prescription (Coun Name [Type Tal [Ke ‘Appoinimentid | Character: S| No | (1) Composite primary key aisbule 2) Foreign key, refers to Appointment table Droeid Charasien 6 [No [(1) Composite primary key atrbute Foreign key refers to Drug table Des Numbers | Yer Waite a SINGLE SQL statement for each ofthe following questions (@) Create the table Preseription using the above table specification with preseription_pk, prescription_fkt and preseription_f42 asthe constant names ‘or the primary key and the two Foreign keys respectively (7 marks] (©) Add a new column named Remark tothe Prescription table to record any comment on ‘he presription. The column shouldbe able to hold a maximum of 20 characters [2 marks} () Change the column Remark crested in Q1() to hold @ maximum of 50 characters marks) (@) Add a constraint named dosage_ce to the Preseription table so that the value for column Dosage must be greater than 0 and less then or equal to 10 [3 marks} (@) Set the default value of column RoomNum inthe Appointment ible to Hall [2 marks] (Create an index named appt_room on the column RoomNum ofthe Appointment table in descending order [2 marks] (@) Remove the constraint that was created inthe QU(@) (2 marks} ‘Dba rile TPO) ‘an Eaninnton Infrnation Tetentogy Discipline Page 06 (Cousurogeammn/ Ven 171141041 1711410, 7114107, FTUALIS, FELD Q2.__ Given the following relations ofa Medical Appointment System and te database schema ‘with sample data found in the Appendix on pages 5 and 6: Patient Paint PatienName, Gender, MobileNo Doctor (Dost, DostorName, MobileNo) Appointment (Appointment, ADate,ATime, Room Num, Patient, Doctoeld) Drug (Druld, DripName, Category, Uo) Prescription (Appointment, Drgld, Dosage) ‘where the underlined attributes are the primary key atebutes. 1, DoB) Assume that tables Patient, Doctor, Appointment, Drug and Preseription have been ‘created with primary keys and foreign key in the database. Given the following specification ofthe Patient table: Patient Conor Name [Tp Leg a Ra Patintld ‘Character: 6 [No _| Primary key atibate [PatientName [Character 30 | No Gender ‘Character-1___| No MobileNo | Character. 8 | Yes - Kid Character: 10 [ No. Dob Date No. Write a SINGLE SQL statement for each ofthe following questions: (@) Add anew record tothe Patient table with the following information. The mobile |__number is currently unknown, [masks] Patientd | PatientName | Gender | MobileNo | HRT Dob. 03627 _| Chan Tai Man [Mt ‘A982456(7) | 7 JUNG (6) Room A204 will start repair work on or afer 21-NOV-19, Change the room number to ‘A249 forall appointments scheduled in room A204 after 20-NOV-19. (8 matis) (6) Remove all Prescriptions with Dosage smaller than or equal to 5. [2 marks) (@) For all doctors with scheduled appointments in November 2019, display the diferent, Doctor's, name and mobile number. [5 marks] (©) For patients with mobile sumber provided and more than I scheduled appointment, display the patient's 1d, name, mobile and number of appointents scheduled forthe patient [8 masks] (Display the patient name, drug name and total numberof dosage received for their drugs in all appointments. Sort the result ftst in descending order of tal umber of dosage per drugs, followed by ascending order of drug name. [10 marks] “Dass Pipes TTP) an amination Sener O13) tnfamation Tecnology Dipine aged of oars Progra Vee 11041 IFL4101, 17114107, FFAS, FFL 03 Consider the following APPSUBJECT table with sample data ofthe IVE Admission System that maintains DSE results of applicants ‘APPSUBJECT (apone [co [Name [wobie [Subcace[Subjoa [race [sano Schoo! 25070 |MSEESHD Jou Ka ezaaHT2| ENG Jena angige | + |S 1067] hg Yur Sx Sol Ht lontanguage | 3 tis |e saes | 3 wats |itabanates | coset [eam Somce | U sne_|ipesetamg,|_2 Toes TARE |CaLa | ATBRGD| ENG Erg Language [1 |S aT Cope Ht fonLanguage | 2 tis |e snes | 2 ata |stanates | 3 Where AppNo = unique applicant umber, KID = HKID of he applian Name ~ name ofthe applicants Mobile phone no ofthe applicant; ‘SubCode = unigue code of DSE subject Subjet = DSE sutoet name, Gade = subject sade; SehNo = unique shoo! number, School appliant’s secondary school Assumptions 1. Each applicant is assigned a unique applicant number. 2. ach applicant has at leat four DSE subject grades 3. Although not likely, some DSE subject may not be studied by any applicant 4. Each applicant graduated from a secondary school (@) Name the THREE types of database anomalies that may happen nthe APPSUBJECT relation [3 marks] (©) Hei and describe the database anomaly that will cur when the subject name “Japanese Lang” is changed ‘Jap. Language’ [3 marks) (©) With reference tothe atibutes inthe APPSUBVJECT relation, explain what repeating group is. [marks] (©) @ State the unnormalized form (UNF) for the APPSUBJECT reltion, {1 mark] (ii) Normalize the APPSUBJECT relation to the third normal fort (3NF). ‘Show ALL your steps from INF to NF by listing all the relations in INF, 2NP and NP. Underline the primary ey attibute(s) and state the foreign key(s), if any, foreach relation in your answer [13 racks] (©) Draw an entity relationship diagram to represent the normalized lations in 3NF based ‘on the given assumptions. Make sure tht al entities must be labelled and relationships ‘ust be drawn with the comect symbols (8:maris] Data rips (TPR Wain Exaninaion Information Tetaooay Diiptine Page tor ‘Gi Given the following eations of Stok Record S ‘SHOCK (Suc WHowselD,ParsiD,Guatig) Porch STOCK PsiD ees PARTS PD PARTS (PutlD, Parsbese, Untice) ‘where the undeslined attributes are the primary key tebutes, Assume a parts can have more than one stock. But a stock can only belong to one pars ‘Sample data ofthe STOCK relation: ‘StockID | WHouselD — | PartsiD Quantity S001 Woot 0 som woos serio S005 woos a Sample ata of the PARTS reltion: iz PartsDese —[ Unitrice PaDl Tne cr CPU [TR Pom ‘icaRAW [500 — Pans other Boa —[ 1200 Por? [Power Saply [700 (@) Define the following database tem, and give ONE example forthe term with suitable attibutes) in the STOCK relation © Superkey; [marks] (©) With eference tothe above PARTS relation: (Define the term attribute domain. marks] ) (1) Define the term metadata. 1 mack {@) Give FOUR examples of metadata forthe attribute UntPrice in the PARTS. relation, [marks] i) Deseribe the meaning ofthe following database terms and give a value for each of ‘them using the above sample data in the PARTS relation: (1) Degree; [2marks] 2) Attribute [2 marks] (©) (@ Describe how the Entity Integrity rule canbe enfored in the PARTS relation. marks) ) Describe how the Referential Integrity cule can be enforcedin the STOCK relation, (2 marks} i) Explain why the tuple with PartsID POO7 in the PARTS relation cannot be sdirecily delete. Brclly describe how this tuple canbe deleted. [3 marks) (@) In ANSL-SPARC three-level architecture, describe ONE. differnce between External level and Internal level. P2marks] sete END OF PAPER **#*4 “Database Paces TPG) Mian amino Saas @OTO0007- Infomation Tecnology Disp Page sors ‘Cou Proane/Yexe ITH, T1410, 11141071, FISH 6 APPENDIX Database schema ofthe Medical Appointment System with sample datas follows Patent (Pais FatenNane, Gender, Mobile, HK, DaB) Doctor (Dasa Dacorane MobieNo) Appaiment (Appointment, ADate, ATi, RooNun, Fae, Doc) ‘Drug (Dru, DopNane, Cate, Lo) Prescription (Anpoininend, Dal, Doses) ‘here the underlined atibutes are the primary key atibutes an: ard Do Pate Decor =I of Doce, PrrNume = Name of Pat, Doctrine ‘Name af Doct, Gender = Gender of Patt. ‘Appoinmentd “ID of Apposninent, MaleNo= Mobile Phone uber, ‘Nowe Date of Anocmet HLS HongKong D, ‘sine = Te of Appt Dob Dare Bi of Pent Room = Room amber of Appoint Dnigld 1D of Dap VoM=Uni of Mesomment of Dra DragNane = Name of Drag Donage= Doge ofa eserption Catone = Capo of Dr Patient Patent Pane | Gender Molen — [RTE Ta OUEST [chant — [w= [aespioes LASSI) —[IaNCoD 726544 | Wong Pak Tin —[M_—[ 6231452 [oni — [28.18 555 — [bas ak Kwong —[M_——[ stbas002 | austsl(s)—[30NOV-S os5—[ Ming We [PF ——[oesniesa—[ porrzz) —[12.aR-18 —] poise [ts Wotteng | F 2485450) [21-APRB 75350 [Kam Ching Var [F | 507 —[ Ron) —[O-NOV98 —| voads3 [Latin Shin [TM irapraah) —[EDECAE 1001 —| Foon Kin —[W 12928) [HULA P3070 [ RvokeFu Kin [Wns | Gorranyay —[1sAUG97 Doctor ‘Dectrld | Doctor Name [ob DoDtt —— [Gary Wong | 211555 ora —[PeterMa eases 0100 — [Willan Fung [90548377 Dior — [Owen Ma 011 320i —| Casey Lang 51785, 12001 | Slenes Ching | 96145822 Dadri [ark Chan [37100123 —] Appendix ~to be continued on the next page) Dati nips (TPO) Nai Baminaion——~Senesar GOT90357 Infomation Tecnology Disipine Page 6086 \SourserProgranme/V eu T1410, 11 1410S, 144107, FTLAHS,FTESLI6 Appointment [Avpoinomenstd[ADaie [Aime | RoomNumt—| Pilentld | Dor ‘A022 TLOCEIS_| 1000 [C40 poiasT | Dis0 ‘A002 BENOV-19[ 0930 A123 2i001 | Disoo A311 BLNoV.19_ [12:15 [A204 o4o3s__ | bos ASsal TEDEC.I9 [1045 BIS 34070 | Do100 ARSAI ao.pec-19 | 1430 R208 75350 D2001 Drug. a [Deugll [Drom Category Tout (094821 [Paracetamol Pain Kile pila 103383 | Savion Cream | Atisepie tube 3 00090 Toaprofen ‘Ataflammaiogy [ube Sg 233000 | Lorstadine ‘Anallegic | pll02 mp sa901 [Ranitidine Antacids syrup 100 i Prescription Drug Dosage ‘Anza 094821 2 ‘ADD 100000 ia ABST 235000. 3 | ‘AGSAT 333000 [1 ABIL 105353 3 “8008 END OF APPENDIX **4** aaa ips TPO) — ai Eainaion

You might also like