1
CREATE TABLE Blood_Donations(
id INT,
date text,
DonorID INT PRIMARY KEY,
name VARCHAR(50),
age INT CHECK(age>0),
bloodtype VARCHAR(3),
branch CHAR(6),
amount_donated INT,
number_of_donations INT
);
INSERT INTO Blood_Donations VALUES
(1, '02 December 2020', 0028, 'Calvin Perks', 36, 'A-', 'Harare', 362, 4),
(2, '02 December 2020', 0145, 'Lisa Dorothy', 28, 'B+', 'Harare', 367, 5),
(3, '02 December 2020', 0063, 'Brian Denver', 24, 'AB-', 'Harare', 364, 9),
(4, '02 December 2020', 0097, 'Stella Leftner', 31, 'A-', 'Harare', 377, 6),
(5, '02 December 2020', 0134, 'Brilliant Lenovo', 44, 'O+', 'Harare', 406, 14),
(6, '03 December 2020', 0004, 'Sandra Sibina', 32, 'O+', 'Harare', 356, 7),
(7, '03 December 2020', 0086, 'Obriel Montez', 26, 'B-', 'Harare', 422, 3),
(8, '03 December 2020', 0045, 'Natasha Forbs', 38, 'O-', 'Harare', 384, 6),
(9, '04 December 2020', 0208, 'Marie Antebellum', 22, 'A+', 'Harare', 431, 1),
(10, '04 December 2020', 0041, 'Stanley Madagascar', 24, 'AB+', 'Harare', 412, 11);
SELECT SUM(amount_donated) FROM Blood_Donations WHERE date = '02 December 2020';
SELECT id, date, DonorID, name, age, bloodtype, branch, amount_donated, number_of_donations FROM Blood_Donations ORDER BY date Desc;
SELECT * FROM Blood_Donations WHERE name like 'B%';
SELECT * FROM Blood_Donations WHERE name like '%b%'
|
run
| edit
| history
| help
|
0
|
|
|