Question 1 (Marks: 60) This question relates to creating and altering tables and implementing constraints and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Question 1 (Marks: 60) This question relates to creating and altering tables and implementing constraints and referential integrity. Answer all the questions below by creating the necessary script. Q.1.1 You are required to create the following tables in a database named (20) StudentNumber_DATA6212_ExamQ1: EMPLOYEES EMPLOYEE ID EMPLOYEE NAME EMPLOYEE SURNAME DATE OF BIRTH DOCTORS DOCTOR_ID DOCTOR NAME EMPLOYEE SICKLEAVE EMPLOYEE ID START DATE DOCTOR ID VARCHAR(S) NOT NULL VARCHAR(30) NOT NULL VARCHAR(30) NOT NULL DATE NOT NULL VARCHAR(5) NOT NULL VARCHAR(30) NOT NULL VARCHAR(5) NOT NULL DATE NOT NULL VARCHAR(S) NOT NULL NUMBER OF DAYS SMALLINT NOT NULL PRIMARY KEY PRIMARY KEY PRIMARY KEY FOREIGN KEY REFERENCES EMPLOYEES EMPLOYEE_ID) PRIMARY KEY Q.1.2 Populate the tables created in Q.1.1 with the following data: EMPLOYEES EMPLOYEE ID 10001 10002 10003 10004 10005 DOCTORS DOCTOR_ID D0001 D0002 D0003 D0004 DO005 10001 10002 10003 EMPLOYEE_NAME EMPLOYEE DATE OF BIRTH SURNAME Woolridge Baird 0003 10001 10005 Dominique Nico Derek Neo Andrew EMPLOYEE SICKLEAVE EMPLOYEE ID DOCTOR_ID START DATE DOCTOR_NAME Thabo Ntlali Deon Coetzee Kwezi Mbete Trevor January Julia Robins D0004 Moore D0001 Petlele Crouch 00003 D0002 D0001 00001 2021-01-25 2021-05-14 2021-06-07 2021 06 29 2021 08-01 2021 10 22 1993-04-19 1991-11-19 1992-06-24 1993-12-29 1994-01-30 NUMBER OF DAYS 2 1 5 3 Question 1 (Marks: 60) This question relates to creating and altering tables and implementing constraints and referential integrity. Answer all the questions below by creating the necessary script. Q.1.1 You are required to create the following tables in a database named (20) StudentNumber_DATA6212_ExamQ1: EMPLOYEES EMPLOYEE ID EMPLOYEE NAME EMPLOYEE SURNAME DATE OF BIRTH DOCTORS DOCTOR_ID DOCTOR NAME EMPLOYEE SICKLEAVE EMPLOYEE ID START DATE DOCTOR ID VARCHAR(S) NOT NULL VARCHAR(30) NOT NULL VARCHAR(30) NOT NULL DATE NOT NULL VARCHAR(5) NOT NULL VARCHAR(30) NOT NULL VARCHAR(5) NOT NULL DATE NOT NULL VARCHAR(S) NOT NULL NUMBER OF DAYS SMALLINT NOT NULL PRIMARY KEY PRIMARY KEY PRIMARY KEY FOREIGN KEY REFERENCES EMPLOYEES EMPLOYEE_ID) PRIMARY KEY Q.1.2 Populate the tables created in Q.1.1 with the following data: EMPLOYEES EMPLOYEE ID 10001 10002 10003 10004 10005 DOCTORS DOCTOR_ID D0001 D0002 D0003 D0004 DO005 10001 10002 10003 EMPLOYEE_NAME EMPLOYEE DATE OF BIRTH SURNAME Woolridge Baird 0003 10001 10005 Dominique Nico Derek Neo Andrew EMPLOYEE SICKLEAVE EMPLOYEE ID DOCTOR_ID START DATE DOCTOR_NAME Thabo Ntlali Deon Coetzee Kwezi Mbete Trevor January Julia Robins D0004 Moore D0001 Petlele Crouch 00003 D0002 D0001 00001 2021-01-25 2021-05-14 2021-06-07 2021 06 29 2021 08-01 2021 10 22 1993-04-19 1991-11-19 1992-06-24 1993-12-29 1994-01-30 NUMBER OF DAYS 2 1 5 3
Expert Answer:
Answer rating: 100% (QA)
The questions in the images involve creating database tables and populating them with data Below I have provided SQL code snippets that create the spe... View the full answer
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date:
Students also viewed these programming questions
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
BP is one of the largest international companies in the oil & gas industry. The company has transactions denominated in several currencies. Being a British company, the domestic currency used for...
-
Sophia Enterprises manufactures two products, Maroon and Gold, for which the following information is available. The company uses a traditional costing system, with total estimated manufacturing...
-
Give examples of legal but irresponsible business behaviours.
-
Pileri Industries shipped goods to Consolidated Industries, Inc., via a common carrier. The goods were lost in transit. Pileri claimed that the sale was a shipment contract, thus putting the risk of...
-
Comprehensive variance analysis, responsibility issues (CMA, adapted) Styles, Inc. manufactures a full line of well-known sunglasses frames and lenses. Styles uses a standard costing system to set...
-
How did you apply active listening to seek information and confirm your understating as you interacted with a child or group of children?
-
1. After examining financial data for a monthly period, the owner of a small business expressed surprise that the firms cash balance had decreased during the month even though there was substantial...
-
What sources of power do the relevant stakeholders have?
-
What methods are available to management to signal the quality of their accounting information?
-
2. What would be the output of the following pseudocode? values [] = (1, 3, 5, 7, 9, 11, 13, 15, 17, 19 } Stacks createStack() for (int i = 1; i < values.length; i++) s.push(values [ i ] ) int n=25;...
-
Rocket Racer builds 200,000 go-carts a year and purchases the motors for these carts for $850 each. Ordering costs are $1,040, and Rocket Racer's inventory carrying costs average 15% of the inventory...
-
What is the equivalent expression to the following code using array bracket notation: *(x+10) = 'g'?"
-
You are a U.S.-based treasurer with $1,000,000 to invest. The dollar-euro exchange rate is quoted as $1.40 = 1.00 and the dollar-pound exchange rate is quoted at $1.65 = 1.00. If a bank quotes you a...
-
Jasper Ltd adopts the revaluation model for measuring buildings. As of 30 June 2021, Jasper Ltd has one building. The following information relating to the building is available: Purchased on 2 July...
-
Nate prepares slides for his microscope. In 1 day he prepared 12 different slides. Which equation best represents y, the total number of slides Nate prepares in x days if he continues at this rate? A...
-
What are the characteristics of OLTP systems?
-
What three types of actions do users typically perform when they use OLAP software?
-
Assume that you need to withdraw $100 from your checking account using your banks ATM machine. What set of steps does the DBMS need to perform to complete your transaction?
-
John bought 1,000 shares of Intel stock on October 18, 2015, for $30 per share plus a $750 commission he paid to his broker. On December 12, 2019, he sells the shares for $42.50 per share. He also...
-
Laura Li, a U.S. resident, worked for three months this summer in China. What type of tax authority may be especially useful in determining the tax consequences of her foreign income?
-
Aishwaryas husband passed away in 2018. She needs to determine whether Jasmine, her 17-year-old stepdaughter, who is single, qualifies as her dependent in 2019. Jasmine is a resident but not a...
Study smarter with the SolutionInn App