Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You were hired to do some data analysis for a local zoo. Below is the data table

ID: 3818236 • Letter: Y

Question

You were hired to do some data analysis for a local zoo. Below is the data table, including the necessary constraints and all the insert statements to populate the database.

-- Drop all the tables to clean up

DROP TABLE Animal;

-- ACategory: Animal category 'common', 'rare', 'exotic'. May be NULL

-- TimeToFeed: Time it takes to feed the animal (hours)

CREATE TABLE Animal

(

AID NUMBER(3, 0),

AName VARCHAR2(30) NOT NULL,

ACategory VARCHAR2(18),

TimeToFeed NUMBER(4,2),

CONSTRAINT Animal_PK PRIMARY KEY(AID)

);

INSERT INTO Animal VALUES(1, 'Galapagos Penguin', 'exotic', 0.5);

INSERT INTO Animal VALUES(2, 'Emperor Penguin', 'rare', 0.75);

INSERT INTO Animal VALUES(3, 'Sri Lankan sloth bear', 'exotic', 2.5);

INSERT INTO Animal VALUES(4, 'Grizzly bear', 'common', 3.0);

INSERT INTO Animal VALUES(5, 'Giant Panda bear', 'exotic', 1.5);

INSERT INTO Animal VALUES(6, 'Florida black bear', 'rare', 1.75);

INSERT INTO Animal VALUES(7, 'Siberian tiger', 'rare', 3.5);

INSERT INTO Animal VALUES(8, 'Bengal tiger', 'common', 2.75);

INSERT INTO Animal VALUES(9, 'South China tiger', 'exotic', 2.25);

INSERT INTO Animal VALUES(10, 'Alpaca', 'common', 0.25);

INSERT INTO Animal VALUES(11, 'Llama', NULL, 3.5);

Explanation / Answer

select AName from Animal where TimeToFeed < 1.5; select AName, TimeToFeed from Animal where ACategory = 'rare' order by TimeToFeed; select AName, ACategory from Animal where AName like '%bear'; select AName from Animal where ACATEGORY is null; SELECT AName from ANIMAL where ACategory = 'rare' and TIMETOFEED BETWEEN 1 and 2.5; select AName from Animal where ACATEGORY != 'common' and AName like '%tiger'; select min(TimeToFeed),max(TimeToFeed) from Animal; select avg(TimeToFeed) from ANIMAL where ACATEGORY = 'rare';
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote