Question
Please write in python -- Grading: 1 point for design document, 1 point for coding style, and 3 points for three aggregate queries (i.e., COUNT,
Please write in python
-- Grading: 1 point for design document, 1 point for coding style, and 3 points for three aggregate queries (i.e., COUNT, AVG, and MAX). CREATE DATABASE db_tpch; USE db_tpch; CREATE TABLE Part (Partkey int, Size int); INSERT INTO Part VALUES (1, 7); INSERT INTO Part VALUES (2, 1); INSERT INTO Part VALUES (3, 21); INSERT INTO Part VALUES (4, 14); INSERT INTO Part VALUES (5, 15); INSERT INTO Part VALUES (6, 4); INSERT INTO Part VALUES (7, 45); INSERT INTO Part VALUES (8, 41); INSERT INTO Part VALUES (9, 12); INSERT INTO Part VALUES (10, 44); SELECT COUNT(*) FROM Part; SELECT AVG(Size) FROM Part; SELECT MAX(Size) FROM Part; .EXIT -- Expected output -- -- Database db_tpch created. -- Using database db_tpch. -- -- Table Part created. -- -- 1 new record inserted. -- 1 new record inserted. -- 1 new record inserted. -- 1 new record inserted. -- 1 new record inserted. -- 1 new record inserted. -- 1 new record inserted. -- 1 new record inserted. -- 1 new record inserted. -- 1 new record inserted. -- -- COUNT(*) -- 10 -- -- AVG(Size) -- 20.4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started