Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions