Permalink
Browse files

Added DDL scripts to create the minimum objects for using the SSBM wi…

…th MySQL. Note, these currently do not contain any constraints, indexes, etc...!
  • Loading branch information...
1 parent b2cd5cc commit 95e42f798aeb6dda930182fc4087752db6dd7e98 @NeilRobbins committed Mar 11, 2012
@@ -0,0 +1,16 @@
+-- =======================================================
+-- Create Dimension Table Star_Schema_Benchmark.Customer
+-- =======================================================
+USE Star_Schema_Benchmark;
+
+CREATE TABLE IF NOT EXISTS Customer
+(
+ C_CustomerKey bigint,
+ C_Name varchar(25),
+ C_Address varchar(25),
+ C_City char(10),
+ C_Nation char(15),
+ C_Region char(12),
+ C_Phone char(15),
+ C_MktSegment char(10)
+);
@@ -0,0 +1,4 @@
+-- =============================================
+-- Create database Star_Schema_Benchmark
+-- =============================================
+CREATE DATABASE IF NOT EXISTS Star_Schema_Benchmark;
@@ -0,0 +1,25 @@
+-- =======================================================
+-- Create Dimension Table Star_Schema_Benchmark.Date
+-- =======================================================
+USE Star_Schema_Benchmark
+
+CREATE TABLE IF NOT EXISTS `Date`
+(
+ D_DateKey bigint,
+ D_Date char(18),
+ D_DayOfWeek char(9),
+ D_Month char(9),
+ D_Year smallint,
+ D_YearMonthNum int,
+ D_YearMonth char(7),
+ D_DayNumInWeek tinyint,
+ D_DayNumInMonth tinyint,
+ D_DayNumInYear smallint,
+ D_MonthNumInYear tinyint,
+ D_WeekNumInYear tinyint,
+ D_SellingSeason char(12),
+ D_LastDayInWeekFl bit,
+ D_LastDayInMonthFl bit,
+ D_HolidayFl bit,
+ D_WeekDayFl bit
+);
@@ -0,0 +1,25 @@
+-- ==================================================
+-- Create Fact Table Star_Schema_Benchmark.LineOrder
+-- ==================================================
+USE Star_Schema_Benchmark;
+
+CREATE TABLE IF NOT EXISTS LineOrder
+(
+ LO_OrderKey bigint not null,
+ LO_LineNumber tinyint not null,
+ LO_CustKey bigint not null,
+ LO_PartKey bigint not null,
+ LO_SuppKey int not null,
+ LO_OrderDateKey bigint not null,
+ LO_OrderPriority char(15),
+ LO_ShipPriority char(1),
+ LO_Quantity tinyint,
+ LO_ExtendedPrice decimal,
+ LO_OrdTotalPrice decimal,
+ LO_Discount decimal,
+ LO_Revenue decimal,
+ LO_SupplyCost decimal,
+ LO_Tax tinyint,
+ LO_CommitDateKey bigint not null,
+ LO_ShipMode char(10)
+);
@@ -0,0 +1,18 @@
+-- =======================================================
+-- Create Dimension Table Star_Schema_Benchmark.Part
+-- =======================================================
+USE Star_Schema_Benchmark;
+
+CREATE TABLE IF NOT EXISTS Part
+(
+ P_PartKey bigint,
+ P_Name varchar(22),
+ P_MFGR char(6),
+ P_Category char(7),
+ P_Brand char(9),
+ P_Colour varchar(11),
+ P_Type varchar(25),
+ P_Size tinyint,
+ P_Container char(10)
+);
+
@@ -0,0 +1,16 @@
+-- =======================================================
+-- Create Dimension Table Star_Schema_Benchmark.Supplier
+-- =======================================================
+USE Star_Schema_Benchmark;
+
+CREATE TABLE Supplier
+(
+ S_SuppKey int,
+ S_Name char(25),
+ S_Address varchar(25),
+ S_City char(10),
+ S_Nation char(15),
+ S_Region char(12),
+ S_Phone char(15)
+);
+

0 comments on commit 95e42f7

Please sign in to comment.