Question: SUBJECT : Database QUESTION 1 (10 MARKS) Instruction: Construct SQL statements for the following questions. Consider the following tables: DOCTOR DocID FirstName LastName Specialization 101

 SUBJECT : Database QUESTION 1 (10 MARKS) Instruction: Construct SQL statements

SUBJECT : Database

QUESTION 1 (10 MARKS) Instruction: Construct SQL statements for the following questions. Consider the following tables: DOCTOR DocID FirstName LastName Specialization 101 Muhammad Fateh Surgery 102 Maryam Mazlan Neurology 103 Sumayyah Idris Dermatology HireDate 15/05/2000 21/03/2001 07/02/2003 PATIENT PatientID 111 222 333 FirstName Khai Haqiem Siti Nurhaliza Last Name Bahar Rusli Taruddin DocID 101 102 101 The tables show the data for PATIENT and DOCTOR. Each patient will be treated by only one doctor and each doctor will treat many patients. Answer the following questions. a) Create table for PATIENT with these constraints: PatientID is a primary key and unique. DocID is the foreign key which referring to DocID in DOCTOR table. PatientID cannot be null. (5 marks) b) Admin wants to insert a new doctor named Ali bin Abu (DocID = 101). State its possibility of the insertion according to entity integrity constraint rules. (2 marks) c) Find the list of doctors who start working between 2000 until 2019 and his/her specialization is surgery

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!