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...
-
Sabre Corporation, a public company, has the following investments at November 30, 2014: 1. Trading investments: common shares of National Bank, carrying value $25,000, fair value $26,000, and five...
-
Complete the following table by indicating whether a debit or credit is used to increase or decrease the balance of the following accounts. The appropriate debit/credit terminology has been...
-
What was the Tirailleurs Sngalais and what was its political role?
-
Suppose that a gift shop in Myrtle Beach has an annual demand for 15,000 units for a souvenir kitchen magnet that it buys for $0.50 per unit. Assume that it costs $10 to place an order and the...
-
Rickety Company purchased 1,000 widgets and has 200 widgets in its ending inventory at a cost of $91 each and a current replacement cost of $80 each. The ending inventory under...
-
Wright Industries needs to raise capital for a factory expansion. The board of directors has just concluded negotiations with an underwriter to issue $2,500,000 of 8%, 15-year callable bonds dated...
-
CoursHeroTranscribedText Prepare journal entries to record items (a) through (f) above [ignore item (g) for the moment]. (If no entry is required for a transaction/event, select "No journal entry...
-
Contributing factors to low employee pay vary. Employee compensation can be evaluated on location, job classification, skill and demand. While economic conditions can play a factor I would closely...
-
The tHREE most popular contactless payment systems are apple pay, google pay and Samsung pay. Each has advantages and disadvantages. Using internet research, these three different systems. Create a...
-
Suppose the velocity of money (V) is constant. Money supply (M) is growing at 5% per year, output (Y ) is growing at 2% per year and interest rate (r) is 4%. Using the knowledge of the quantity...
-
We have examined and discussed many of the current economic issues trending out. All the issues that were critical, few of them turn out to be very hawkish related to financial world and few bringing...
-
MoneyBeast Co. has 357 million shares outstanding which are currently trading at 50.75 USD, a book equity of $ 1762 million, and the following long-term liabilities (the debt rating is AAA, i.e., the...
-
As you rewrite these sentences, replace the cliches and buzzwords with plain language (if you don't recognize any of these terms, you can find definitions online): a. Being a jack-of-all-trades, Dave...
-
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?
-
Consider a binary equimolar mixture of acetone and chloroform at \(300 \mathrm{~K}\) and \(1 \mathrm{~atm}\). Because this mixture forms a binary azeotrope, methyl- \(n\)-pentyl ether solvent is used...
-
A system of three parallel reactions (Trambouze and Piret, 1959) involves the following reaction scheme: \[\mathrm{A} \xrightarrow{k_{1}} \mathrm{~B} \quad \mathrm{~A} \xrightarrow{k_{2}} \mathrm{C}...
-
When the third tPA cultivator in Example 2.3 is added to the cultivators in Example 7.6, as shown in Figure 7.27a, a significant time strain is placed on the process because the combined feed,...
Study smarter with the SolutionInn App