1. Create the database by using SQL DDL commands and fill the tables with at least...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Create the database by using SQL DDL commands and fill the tables with at least 3 rows. (5marks) 2. Add a new column to the Blood bank table and name it as bloodBankName with varchar(25) as data type. (1marks) 3. Code solutions to the following problems as a relational- algebraic expression: (2mar ks) a. Retrieve the phone number of Blood Bank located in Suhar. b. Retrieve the donor's first name and last name that has blood type "A-". Section B: DML (4marks) 1. Code the following problems as sql commands: (2 marks) a. Retrieve the type of the blood which is highly requested by the hospitals. b. Retrieve the total number of donors according to the gender. 2. Assume that the following data are used to be inserted: Hospital( 'H123', 'Suhar hospital', 'Albatinah Governate', '+96884270911') Albatinah Governate','+96844442222','11233345') BloodRequest(222, '1-1-2020', 'AB', 'H123','BB1') Explain what would be violated by executing the following SQL statement: (2 BloodBank('BB1', marks) a. UPDATE BloodRequest set reqDate=112020; b. Delete from Hospital where hospitalld='H123'; Section C: PL/SQL (8marks) 1. Create a trigger to check the donor's dateOfBirth to be "before 1-1-2002 and not after the current date" before inserting or updating the values in Donor's table. marks ) 2. Create a cursor to hold the first name, last name and the role of Blood Bank Employees. (4 marks) is for PK Blood Sample bloodID:char(15) BloodAmount decimal(92) donationDate:date bloodType:char(3) FK1 donoriD char(5) FK2 bloodBankID char(5) PK Receptionist recepID:char(5) recepFirstName varchar(25) recepLastName: varchar(25) address: varchar(50) phone: varchar(14) has donates deals with has PK Donor donoriD:char(5) donorFirstName varchar(25) donorLastName varchar(25) dateOfBirth date gender varchar(7) address varchar(50) address varchar(50) phone:varchar(14) FK1 recep/D char(5) BloodBank PK blood BankID:char(5) address varchar(50) phone varchar(14) faxvarchar(14) receives has BloodRequest PK BloodReaID:char(9) regDate:date bloodType char(3) FK1 hospitallD char(5) FK2 bloodBankID char(5) BloodBankEmployee PK BBEID:char(5) 68EFirstName: varchar(25) BBELastName: varchar(25) address varchar(50) phone varchar(14) role varchar(50) FK1 bloodBankID char(5) hospital PK hospitallD:char(5) name varchar(50) address varchar(50) phone varchar(14) phone varchar(14) sends 1. Create the database by using SQL DDL commands and fill the tables with at least 3 rows. (5marks) 2. Add a new column to the Blood bank table and name it as bloodBankName with varchar(25) as data type. (1marks) 3. Code solutions to the following problems as a relational- algebraic expression: (2mar ks) a. Retrieve the phone number of Blood Bank located in Suhar. b. Retrieve the donor's first name and last name that has blood type "A-". Section B: DML (4marks) 1. Code the following problems as sql commands: (2 marks) a. Retrieve the type of the blood which is highly requested by the hospitals. b. Retrieve the total number of donors according to the gender. 2. Assume that the following data are used to be inserted: Hospital( 'H123', 'Suhar hospital', 'Albatinah Governate', '+96884270911') Albatinah Governate','+96844442222','11233345') BloodRequest(222, '1-1-2020', 'AB', 'H123','BB1') Explain what would be violated by executing the following SQL statement: (2 BloodBank('BB1', marks) a. UPDATE BloodRequest set reqDate=112020; b. Delete from Hospital where hospitalld='H123'; Section C: PL/SQL (8marks) 1. Create a trigger to check the donor's dateOfBirth to be "before 1-1-2002 and not after the current date" before inserting or updating the values in Donor's table. marks ) 2. Create a cursor to hold the first name, last name and the role of Blood Bank Employees. (4 marks) is for PK Blood Sample bloodID:char(15) BloodAmount decimal(92) donationDate:date bloodType:char(3) FK1 donoriD char(5) FK2 bloodBankID char(5) PK Receptionist recepID:char(5) recepFirstName varchar(25) recepLastName: varchar(25) address: varchar(50) phone: varchar(14) has donates deals with has PK Donor donoriD:char(5) donorFirstName varchar(25) donorLastName varchar(25) dateOfBirth date gender varchar(7) address varchar(50) address varchar(50) phone:varchar(14) FK1 recep/D char(5) BloodBank PK blood BankID:char(5) address varchar(50) phone varchar(14) faxvarchar(14) receives has BloodRequest PK BloodReaID:char(9) regDate:date bloodType char(3) FK1 hospitallD char(5) FK2 bloodBankID char(5) BloodBankEmployee PK BBEID:char(5) 68EFirstName: varchar(25) BBELastName: varchar(25) address varchar(50) phone varchar(14) role varchar(50) FK1 bloodBankID char(5) hospital PK hospitallD:char(5) name varchar(50) address varchar(50) phone varchar(14) phone varchar(14) sends
Expert 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 databases questions
-
Loss Carryforward The Bookbinder Company had $380,000 cumulative operating losses prior to the beginning of last year. It had $80,000 in pre-tax earnings last year before using the past operating...
-
What are the major resource dependencies for high-end restaurants? Who do they depend on most for the critical resources needed to survive? 2) The high-end restaurants appear almost helpless at the...
-
The joint shown is welded all around. All welds are 3/8" and use E70 electrodes. What is the allowable load P that the joint can carry based on the weld? P What is the total length of weld L? Length...
-
j) Assume that one of these portfolio's is the Market Portfolio and all portfolios, except Portfolio G, are fairly priced according to the CAPM. Derive the Treynor Measure for these fairly priced...
-
Discuss the motion of a particle described by Equation 3.34 in the event that b < 0 (i.e., the damping resistance is negative).
-
How to connect the Medicine wheel for an organization. what are positive aspects in terms of organization for Spiritual, Mental, Emotianal, Physical part? What are Challenges in terms of organization...
-
Consider the simple linear regression model fit to the steam plant data in Problem 2.12. Problem 2.12 The number of pounds of steam used per month at a plant is thought to be related to the average...
-
Research CaseGovernmental or Not-for-Profit Entity? In partnership with Jefferson County and the Mound City Visitors Bureau, Mound City recently established a Native American Heritage Center and...
-
Richards Corporation had net income of $238,707 and paid dividends to common stockholders of $47,500. It had 56,700 shares of common stock outstanding during the entire year. Richards Corporation's...
-
Larsen Company makes fertilizer v. a Midwestern state. The company has nearly completed a new plant that will produce twice as much as the old plant which is being scapped. Swen Larsen, the owner,...
-
After taking this course do you believe your interpersonal communication will improve or remain the same?
-
Legal & General, with the equity account as described in E14-3, announces its plans to issue an additional 58,710 shares of common stock as part of its stock dividend plan. The current market price...
-
Antonio is considering renovating his apartment in Milan. He visits Meridiani and looks at different bedroom furniture sets. The bedroom sets are generally very expensive, and even though he has the...
-
Uneblej.com is an online retail company, which operates in Albania. It has daily cash receipts of L150,000. Its CFO is analyzing the time it takes for the collection of the customers payment to clear...
-
Brembo, an Italian automotive braking-systems supplier, announced that it was going to split the stock 5-for-1. Brambilla Fumagalli owns 100 shares of the company, which he had purchased for 40 per...
-
The Motor Corporation sold vehicles for $500,000 to one specific dealer during the year. At the end of the financial year, the dealer still owed The Motor Corporation $350,000. The cost of the...
-
The area of a rectangular plot 24 feet long and 16 feet wide will be doubled by adding an equal distance to each side of the plot. What is the distance added to each side?
-
After Theorem 1.5 we note that multiplying a row by 0 is not allowed because that could change a solution set. Give an example of a system with solution set S0 where after multiplying a row by 0 the...
-
Using data from the TAL Distributors database, define a view named TopLevelCust. It consists of the number, name, address, balance, and credit limit of all customers with credit limits that are...
-
You need to delete the Order Line table from the TAL Distributors database. Will the following command work? Why or why not?
-
How do you use an AND criterion to combine criteria in an Access query? How do you use an OR criterion to combine criteria?
-
A fertilizer producing company purchases nitrates, phosphates, potash, and an inert chalk base and produces four different fertilizers A, B,C, and D. The cost of these nitrates, phosphates, potash,...
-
We are interested to produce $P$ in the reaction $A ightarrow P$ using a continuous reactor at $v=240$ liters/ hr with $C_{A_{0}}=3$ moles/liter. However, it is noticed that there is a second...
-
Heavy fuel oil, initially semisolid at $15^{\circ} \mathrm{C}$ is to be heated and pumped through a $15 \mathrm{~cm}$ diameter (inside) pipe at the rate of $20000 \mathrm{~kg} / \mathrm{h}$. The pipe...
Study smarter with the SolutionInn App