Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
732 B
4
Indexable
Never
%sql
-- Create the database
CREATE DATABASE IF NOT EXISTS Day3a;

-- Use the database
USE Day3a;

-- Create the table
CREATE TABLE IF NOT EXISTS Team (
  First_Name STRING,
  Last_Name STRING,
  Age INT,
  Residential_Area STRING
);

-- Populate the table with data
INSERT INTO Team VALUES
  ('George', 'Mouxios', 27, '40 Ekklisies'),
  ('Konstantinos', 'Ntellas', 29, 'Toumpa'),
  ('Persa', 'Antoniou', 27, 'Euosmos'),
  ('Vasiliki', 'Tranterou', 25, 'Ano Poli'),
  ('Ilona', 'Baimpouridou', 28, 'Kalamaria');

-- Show the data in the table
SELECT * FROM Team;

-- Repartition the table by Age
ALTER TABLE Team REPARTITION (4, "Age");

-- Show the data in the repartitioned table
SELECT * FROM Team;