IT 405 Saudi Electronic University E Portals Development Worksheet

User Generated

qr7zv

Computer Science

IT 405

Saudi electronic university

IT

Description

Unformatted Attachment Preview

College of Computing and Informatics E-Portals Development IT-405 Assignment 2 Deadline: Sunday 14/11/2021 @ 23:59 [Total Mark for this Assignment is 5] Student Details: Name: ### ID: ### CRN: ### Instructions: • • • • • • • • • • You must submit two separate copies (one Word file and one PDF file) using the Assignment Template on Blackboard via the allocated folder. These files must not be in compressed format. It is your responsibility to check and make sure that you have uploaded both the correct files. Zero mark will be given if you try to bypass the SafeAssign (e.g. misspell words, remove spaces between words, hide characters, use different character sets, convert text into image or languages other than English or any kind of manipulation). Email submission will not be accepted. You are advised to make your work clear and well-presented. This includes filling your information on the cover page. You must use this template, failing which will result in zero mark. You MUST show all your work, and text must not be converted into an image, unless specified otherwise by the question. Late submission will result in ZERO mark. The work should be your own, copying from students or other resources will result in ZERO mark. Use Times New Roman font for all your answers. Question One Pg. 01 Learning Outcome(s): Create web databases using MySQL. Question One 1.5 Marks By using MySQL, create a “Blood_Bank” database, the database has three tables: Donors, Blood, and Clinics. - The Donor relation has the following attributes: DID, Name, Email, Gender. - The Clinic relation has the following attributes: CID, Name, Location. - The Blood relation has the following attributes: BID, Type, DID, CID. Note: You should Include the SQL queries and the screenshots. Question Two Pg. 02 Learning Outcome(s): Question Two 1 Mark Insert data to all relations that you have created in the first question. Create web databases using MySQL. Note: You should insert at least 2 tuples in each table. Add the SQL queries and the screenshots. Question Three Pg. 03 Learning Outcome(s): Describe methods and tools in designing a creative and dynamic website. Question Three 1.5 Marks Use the technique you have learned in the class to debug the following code and correct the error. Explain your steps in details. PHP Excercise .error{ font-weight: bold; color: #C00; } Assignment 1 Enter your first and last name Font-wieght =22; Question Four Pg. 05 Learning Outcome(s): Build web applications using PHP and MySQL. Question Four 1 Mark You need to use PHP to connect the database you have created in the first question. You will need to enter the username and password for database. The default username is root and the password is empty string (leave it blank). Note: Include the code and the screenshots.
Purchase answer to see full attachment
Explanation & Answer:
4 Questions
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

View attached explanation and answer. Let me know if you have any questions.

SQL Assignment
Name Omitted
14th November 2021

Entity Relationship Diagram

QUESTION ONE
CREATE DATABASE
CREATE DATABASE Blood_Bank;
CREATE TABLES
CREATE TABLE Donor
(DID INT NOT NULL AUTO_INCREMENT,
Name VARCHAR(25),
Email VARCHAR(30),
Gender VARCHAR(15),
PRIMARY KEY (DID)
);
CREATE TABLE Clinic
(CID INT NOT NULL AUTO_INCREMENT,
Name VARCHAR(25),
Location VARCHAR(30),

PRIMARY KEY (CID)
);
CREATE TABLE Blood
(BID INT NOT NULL AUTO_INCREMENT,
Type VARCHAR(25),
DID INT NOT NULL,
CID INT NOT NULL,
PRIMARY KEY (BID),
FOREIGN KEY (DID)
REFERENCES Donor(DID),
FOREIGN KEY (CID)
REFERENCES Clinic(CID)
);

SCREENSHOTS

QUESTION TWO
INSERT DATA
INSERT INTO Donor (Name, Email, Gender) VALUES ('Ronna', 'Ronna@gmail.com',
'Female');
INSERT INTO Donor (Name, Email, Gender) VALUES ('Ben', 'Ben@gmail.com', 'Male');
INSERT INTO Donor (Name, Email, Gender) VALUES ('Brenda', 'brenda@gmail.com',
'Female');
INSERT INTO Donor (Name, Email, Gender) VALUES ('Ron', 'Ron@gmail.com', 'Male');
INSERT INTO Donor (Name, Email, Gender) VALUES ('Austin', 'Austin@gmail.com', 'Male');
INSERT INTO Clinic (Name, Location) VALUES ('Maternity', 'New York');
INSERT INTO Clinic (Name, Location) VALUES ('Dental', 'New Jersey');
INSERT INTO Clinic (Name, Location) VALUES ('Ear and Throat', 'Los Angeles');
INSERT INTO Clinic (Name, Location) VALUES ('Eye', 'Washington DC');
INSERT INTO Clinic (Name, Location) VALUES ('Gynaecology', 'Chicago');
INSERT INTO Blood (Type, DID, CID) VALUES ('AB', 1,1);
INSERT INTO Blood (Type, DID, CID) VALUES ('A', 2,2);
INSERT INTO Blood (Type, DID, CID) VALUES ('B', 3,3);
INSERT INTO Blood (Type, DID, CID) VALUES ('O+', 4,4);

INSERT INTO Blood (Type, DID, CID) VALUES ('O-', 5,5);
SCREENSHOTS
SELECT * FROM Donor;

SELECT * FROM Clinic;

SELECT * FROM Blood;

SELECT d.name, b.type, c.name FROM Donor d INNER JOIN Blood b ON d.DID=b.DID
INNER JOIN Clinic c ON c.CID=b.CID;

QUESTION THREE
Correct code:



PHP Exercise





.error{
font-weight: bold;
color: #C00;
}


Assignment 1
Enter your first and last name






The first error identified is the first input type name which should be "name" and not
"Firstname".

The Font-wieght =22; is erroneous in the html and causes the lack of retrieval of name from
query string and storing to a local variable. It leads to the execution of the else statement that
returns $name to NULL.
The next error thrown is a call to an undefined function called method() that should be removed
to prevent the throwing of the exception.
QUESTION FOUR
The PHP code to connect the database is:

The php code in operation:




PHP Exercise








.error{
font-weight: bold;
color: #C00;
}





Donor Name
Blood Type
Clinic Name
















Result


College of Computing and Informatics

E-Portals Development
IT-405
...


Anonymous
I use Studypool every time I need help studying, and it never disappoints.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags