Design star schema for relatonal database
up vote
2
down vote
favorite
I'm a newbie to data warehousing and I've been reading articles and watching videos on the principles but I'm a bit confused as to how I would take the design below and convert it into a star schema.
in this example i assume that the fact table is (order-orderitem-book)
And the measures is (category-customer-time)
My question is about book author how can we put is as measure? Is it allowed to put many to many relationship in star schema ??
And if i am wrong how to draw star schema to this relatonal db?
data-warehouse star-schema
New contributor
add a comment |
up vote
2
down vote
favorite
I'm a newbie to data warehousing and I've been reading articles and watching videos on the principles but I'm a bit confused as to how I would take the design below and convert it into a star schema.
in this example i assume that the fact table is (order-orderitem-book)
And the measures is (category-customer-time)
My question is about book author how can we put is as measure? Is it allowed to put many to many relationship in star schema ??
And if i am wrong how to draw star schema to this relatonal db?
data-warehouse star-schema
New contributor
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm a newbie to data warehousing and I've been reading articles and watching videos on the principles but I'm a bit confused as to how I would take the design below and convert it into a star schema.
in this example i assume that the fact table is (order-orderitem-book)
And the measures is (category-customer-time)
My question is about book author how can we put is as measure? Is it allowed to put many to many relationship in star schema ??
And if i am wrong how to draw star schema to this relatonal db?
data-warehouse star-schema
New contributor
I'm a newbie to data warehousing and I've been reading articles and watching videos on the principles but I'm a bit confused as to how I would take the design below and convert it into a star schema.
in this example i assume that the fact table is (order-orderitem-book)
And the measures is (category-customer-time)
My question is about book author how can we put is as measure? Is it allowed to put many to many relationship in star schema ??
And if i am wrong how to draw star schema to this relatonal db?
data-warehouse star-schema
data-warehouse star-schema
New contributor
New contributor
edited 4 hours ago
New contributor
asked 5 hours ago
J. DOE
133
133
New contributor
New contributor
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
You could put a many-to-many relationship within a data warehouse, but many people consider it bad practice to do so - even so far as some data warehousing tools do not permit it to be created at all. Here is how I would create a star-schema from your design:
As your Author
table and Category
table only have one valuable attribute (the name) I would roll them into the Book
table which would then become your first dimension. The Customer
table can stay as-is and become a dimension as well. You would then roll the two Order
tables into one and create a Order
fact table which consists of OrderID
, Date
, BookID
, CustomerID
, Price
- like so:
CREATE TABLE DimBook
(
BookID INT NOT NULL PRIMARY KEY,
Author VARCHAR(50) NOT NULL,
Category VARCHAR(50) NOT NULL,
Title VARCHAR(50) NOT NULL,
ISBN VARCHAR(50) NOT NULL,
Year SMALLINT NOT NULL,
Price DECIMAL(9,2) NOT NULL,
NoPages SMALLINT NOT NULL,
Description VARCHAR(100) NOT NULL
);
CREATE TABLE DimCustomer
(
CustomerID INT NOT NULL PRIMARY KEY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) NOT NULL,
ZipCode VARCHAR(20) NOT NULL,
City VARCHAR(50) NOT NULL,
State VARCHAR(50) NOT NULL
);
CREATE TABLE FactOrders
(
OrderID INT NOT NULL,
"Date" DATETIME NOT NULL,
BookID INT NOT NULL REFERENCES DimBook(BookID),
CustomerID INT NOT NULL REFERENCES DimCustomer(CustomerID),
Price DECIMAL(9,2) NOT NULL
);
You may also want to consider a Date
dimension which is also commonly found in star-schemas and data warehouses to make searching by dates easier. A very basic implementation is below:
CREATE TABLE DimDate
(
"Date" DATETIME NOT NULL PRIMARY KEY,
"Year" SMALLINT NOT NULL,
"Month" TINYINT NOT NULL,
"Day" TINYINT NOT NULL
);
Then, just add a foreign key from your Date
attribute in the fact table to the Date
key in the DimDate
table. This would produce something like:
If you need to handle scenarios where a book can have many authors (which frequently happens), there are a couple of ways to do so.
The first, and my recommendation, is to have all of the authors within the Author
attribute. This would allow you to easily search for all books written by the same combination of authors.
The second approach denormalises the Author
attribute into its own dimension which is then referenced by the book dimension. This would create a snowflake schema (your question stated you wanted a star schema so I avoided this approach) and would also be slower when trying to search by multiple authors.
Ultimately, it depends on your exact needs and the requirements you are trying to meet. I would personally stick with having all authors in the same attribute as this is the easiest design and meets your star schema requirement.
1
What if the book has many authors? How can i roll them into book dimention?
– J. DOE
3 hours ago
I have updated my answer accordingly.
– Mr.Brownstone
3 hours ago
If i replace the category with publisher and inside it i put city country to make hierarchy on its location. Can i but the publisher on the book dimention in this case?
– J. DOE
2 hours ago
Yes, that would not be a problem.
– Mr.Brownstone
2 hours ago
add a comment |
up vote
1
down vote
So your question is a couple of different questions -
Author
should not be its own dimension, it will just be an attribute of theBook
dimension.Because a fact table's primary key is a composite key made up of a set of foreign keys, every table that has a many-to-many relationship has to be expressed as a fact table. You'll have to employ the use of bridge tables, but the best way to implement this depends on your needs.
I don't think you're wrong in your approach, but just to help you clarify what you're doing, you'll want
Order
as a fact table, andBook
(which I would moveAuthor
andCategory
into as attributes)DateTime
(orDate
andTime
separate from each other) andCustomer
as dimensions in your example. All your quantitative data (other thanDateTime
) should be going inOrder
and all your descriptive and qualitative data should be going in your surrounding dimensions.
New contributor
If i consider book as a dimention how can i put author in book dimention if the book has many authors?
– J. DOE
3 hours ago
There are a few ways you could do that. You could put all of the authors into theAuthor
attribute and separate them (i.e. Author:"John Smith, John Doe, Jane Citizen), or you could snowflake theBook
dimension so thatAuthor
becomes an outrigger (you can think of it as a subdimension). Although it isn't pretty, it's probably best to put all of the authors intoAuthor
and set it as a VARCHAR with a high character limit.
– Rhys
3 hours ago
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You could put a many-to-many relationship within a data warehouse, but many people consider it bad practice to do so - even so far as some data warehousing tools do not permit it to be created at all. Here is how I would create a star-schema from your design:
As your Author
table and Category
table only have one valuable attribute (the name) I would roll them into the Book
table which would then become your first dimension. The Customer
table can stay as-is and become a dimension as well. You would then roll the two Order
tables into one and create a Order
fact table which consists of OrderID
, Date
, BookID
, CustomerID
, Price
- like so:
CREATE TABLE DimBook
(
BookID INT NOT NULL PRIMARY KEY,
Author VARCHAR(50) NOT NULL,
Category VARCHAR(50) NOT NULL,
Title VARCHAR(50) NOT NULL,
ISBN VARCHAR(50) NOT NULL,
Year SMALLINT NOT NULL,
Price DECIMAL(9,2) NOT NULL,
NoPages SMALLINT NOT NULL,
Description VARCHAR(100) NOT NULL
);
CREATE TABLE DimCustomer
(
CustomerID INT NOT NULL PRIMARY KEY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) NOT NULL,
ZipCode VARCHAR(20) NOT NULL,
City VARCHAR(50) NOT NULL,
State VARCHAR(50) NOT NULL
);
CREATE TABLE FactOrders
(
OrderID INT NOT NULL,
"Date" DATETIME NOT NULL,
BookID INT NOT NULL REFERENCES DimBook(BookID),
CustomerID INT NOT NULL REFERENCES DimCustomer(CustomerID),
Price DECIMAL(9,2) NOT NULL
);
You may also want to consider a Date
dimension which is also commonly found in star-schemas and data warehouses to make searching by dates easier. A very basic implementation is below:
CREATE TABLE DimDate
(
"Date" DATETIME NOT NULL PRIMARY KEY,
"Year" SMALLINT NOT NULL,
"Month" TINYINT NOT NULL,
"Day" TINYINT NOT NULL
);
Then, just add a foreign key from your Date
attribute in the fact table to the Date
key in the DimDate
table. This would produce something like:
If you need to handle scenarios where a book can have many authors (which frequently happens), there are a couple of ways to do so.
The first, and my recommendation, is to have all of the authors within the Author
attribute. This would allow you to easily search for all books written by the same combination of authors.
The second approach denormalises the Author
attribute into its own dimension which is then referenced by the book dimension. This would create a snowflake schema (your question stated you wanted a star schema so I avoided this approach) and would also be slower when trying to search by multiple authors.
Ultimately, it depends on your exact needs and the requirements you are trying to meet. I would personally stick with having all authors in the same attribute as this is the easiest design and meets your star schema requirement.
1
What if the book has many authors? How can i roll them into book dimention?
– J. DOE
3 hours ago
I have updated my answer accordingly.
– Mr.Brownstone
3 hours ago
If i replace the category with publisher and inside it i put city country to make hierarchy on its location. Can i but the publisher on the book dimention in this case?
– J. DOE
2 hours ago
Yes, that would not be a problem.
– Mr.Brownstone
2 hours ago
add a comment |
up vote
1
down vote
accepted
You could put a many-to-many relationship within a data warehouse, but many people consider it bad practice to do so - even so far as some data warehousing tools do not permit it to be created at all. Here is how I would create a star-schema from your design:
As your Author
table and Category
table only have one valuable attribute (the name) I would roll them into the Book
table which would then become your first dimension. The Customer
table can stay as-is and become a dimension as well. You would then roll the two Order
tables into one and create a Order
fact table which consists of OrderID
, Date
, BookID
, CustomerID
, Price
- like so:
CREATE TABLE DimBook
(
BookID INT NOT NULL PRIMARY KEY,
Author VARCHAR(50) NOT NULL,
Category VARCHAR(50) NOT NULL,
Title VARCHAR(50) NOT NULL,
ISBN VARCHAR(50) NOT NULL,
Year SMALLINT NOT NULL,
Price DECIMAL(9,2) NOT NULL,
NoPages SMALLINT NOT NULL,
Description VARCHAR(100) NOT NULL
);
CREATE TABLE DimCustomer
(
CustomerID INT NOT NULL PRIMARY KEY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) NOT NULL,
ZipCode VARCHAR(20) NOT NULL,
City VARCHAR(50) NOT NULL,
State VARCHAR(50) NOT NULL
);
CREATE TABLE FactOrders
(
OrderID INT NOT NULL,
"Date" DATETIME NOT NULL,
BookID INT NOT NULL REFERENCES DimBook(BookID),
CustomerID INT NOT NULL REFERENCES DimCustomer(CustomerID),
Price DECIMAL(9,2) NOT NULL
);
You may also want to consider a Date
dimension which is also commonly found in star-schemas and data warehouses to make searching by dates easier. A very basic implementation is below:
CREATE TABLE DimDate
(
"Date" DATETIME NOT NULL PRIMARY KEY,
"Year" SMALLINT NOT NULL,
"Month" TINYINT NOT NULL,
"Day" TINYINT NOT NULL
);
Then, just add a foreign key from your Date
attribute in the fact table to the Date
key in the DimDate
table. This would produce something like:
If you need to handle scenarios where a book can have many authors (which frequently happens), there are a couple of ways to do so.
The first, and my recommendation, is to have all of the authors within the Author
attribute. This would allow you to easily search for all books written by the same combination of authors.
The second approach denormalises the Author
attribute into its own dimension which is then referenced by the book dimension. This would create a snowflake schema (your question stated you wanted a star schema so I avoided this approach) and would also be slower when trying to search by multiple authors.
Ultimately, it depends on your exact needs and the requirements you are trying to meet. I would personally stick with having all authors in the same attribute as this is the easiest design and meets your star schema requirement.
1
What if the book has many authors? How can i roll them into book dimention?
– J. DOE
3 hours ago
I have updated my answer accordingly.
– Mr.Brownstone
3 hours ago
If i replace the category with publisher and inside it i put city country to make hierarchy on its location. Can i but the publisher on the book dimention in this case?
– J. DOE
2 hours ago
Yes, that would not be a problem.
– Mr.Brownstone
2 hours ago
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You could put a many-to-many relationship within a data warehouse, but many people consider it bad practice to do so - even so far as some data warehousing tools do not permit it to be created at all. Here is how I would create a star-schema from your design:
As your Author
table and Category
table only have one valuable attribute (the name) I would roll them into the Book
table which would then become your first dimension. The Customer
table can stay as-is and become a dimension as well. You would then roll the two Order
tables into one and create a Order
fact table which consists of OrderID
, Date
, BookID
, CustomerID
, Price
- like so:
CREATE TABLE DimBook
(
BookID INT NOT NULL PRIMARY KEY,
Author VARCHAR(50) NOT NULL,
Category VARCHAR(50) NOT NULL,
Title VARCHAR(50) NOT NULL,
ISBN VARCHAR(50) NOT NULL,
Year SMALLINT NOT NULL,
Price DECIMAL(9,2) NOT NULL,
NoPages SMALLINT NOT NULL,
Description VARCHAR(100) NOT NULL
);
CREATE TABLE DimCustomer
(
CustomerID INT NOT NULL PRIMARY KEY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) NOT NULL,
ZipCode VARCHAR(20) NOT NULL,
City VARCHAR(50) NOT NULL,
State VARCHAR(50) NOT NULL
);
CREATE TABLE FactOrders
(
OrderID INT NOT NULL,
"Date" DATETIME NOT NULL,
BookID INT NOT NULL REFERENCES DimBook(BookID),
CustomerID INT NOT NULL REFERENCES DimCustomer(CustomerID),
Price DECIMAL(9,2) NOT NULL
);
You may also want to consider a Date
dimension which is also commonly found in star-schemas and data warehouses to make searching by dates easier. A very basic implementation is below:
CREATE TABLE DimDate
(
"Date" DATETIME NOT NULL PRIMARY KEY,
"Year" SMALLINT NOT NULL,
"Month" TINYINT NOT NULL,
"Day" TINYINT NOT NULL
);
Then, just add a foreign key from your Date
attribute in the fact table to the Date
key in the DimDate
table. This would produce something like:
If you need to handle scenarios where a book can have many authors (which frequently happens), there are a couple of ways to do so.
The first, and my recommendation, is to have all of the authors within the Author
attribute. This would allow you to easily search for all books written by the same combination of authors.
The second approach denormalises the Author
attribute into its own dimension which is then referenced by the book dimension. This would create a snowflake schema (your question stated you wanted a star schema so I avoided this approach) and would also be slower when trying to search by multiple authors.
Ultimately, it depends on your exact needs and the requirements you are trying to meet. I would personally stick with having all authors in the same attribute as this is the easiest design and meets your star schema requirement.
You could put a many-to-many relationship within a data warehouse, but many people consider it bad practice to do so - even so far as some data warehousing tools do not permit it to be created at all. Here is how I would create a star-schema from your design:
As your Author
table and Category
table only have one valuable attribute (the name) I would roll them into the Book
table which would then become your first dimension. The Customer
table can stay as-is and become a dimension as well. You would then roll the two Order
tables into one and create a Order
fact table which consists of OrderID
, Date
, BookID
, CustomerID
, Price
- like so:
CREATE TABLE DimBook
(
BookID INT NOT NULL PRIMARY KEY,
Author VARCHAR(50) NOT NULL,
Category VARCHAR(50) NOT NULL,
Title VARCHAR(50) NOT NULL,
ISBN VARCHAR(50) NOT NULL,
Year SMALLINT NOT NULL,
Price DECIMAL(9,2) NOT NULL,
NoPages SMALLINT NOT NULL,
Description VARCHAR(100) NOT NULL
);
CREATE TABLE DimCustomer
(
CustomerID INT NOT NULL PRIMARY KEY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) NOT NULL,
ZipCode VARCHAR(20) NOT NULL,
City VARCHAR(50) NOT NULL,
State VARCHAR(50) NOT NULL
);
CREATE TABLE FactOrders
(
OrderID INT NOT NULL,
"Date" DATETIME NOT NULL,
BookID INT NOT NULL REFERENCES DimBook(BookID),
CustomerID INT NOT NULL REFERENCES DimCustomer(CustomerID),
Price DECIMAL(9,2) NOT NULL
);
You may also want to consider a Date
dimension which is also commonly found in star-schemas and data warehouses to make searching by dates easier. A very basic implementation is below:
CREATE TABLE DimDate
(
"Date" DATETIME NOT NULL PRIMARY KEY,
"Year" SMALLINT NOT NULL,
"Month" TINYINT NOT NULL,
"Day" TINYINT NOT NULL
);
Then, just add a foreign key from your Date
attribute in the fact table to the Date
key in the DimDate
table. This would produce something like:
If you need to handle scenarios where a book can have many authors (which frequently happens), there are a couple of ways to do so.
The first, and my recommendation, is to have all of the authors within the Author
attribute. This would allow you to easily search for all books written by the same combination of authors.
The second approach denormalises the Author
attribute into its own dimension which is then referenced by the book dimension. This would create a snowflake schema (your question stated you wanted a star schema so I avoided this approach) and would also be slower when trying to search by multiple authors.
Ultimately, it depends on your exact needs and the requirements you are trying to meet. I would personally stick with having all authors in the same attribute as this is the easiest design and meets your star schema requirement.
edited 3 hours ago
answered 4 hours ago
Mr.Brownstone
8,66922041
8,66922041
1
What if the book has many authors? How can i roll them into book dimention?
– J. DOE
3 hours ago
I have updated my answer accordingly.
– Mr.Brownstone
3 hours ago
If i replace the category with publisher and inside it i put city country to make hierarchy on its location. Can i but the publisher on the book dimention in this case?
– J. DOE
2 hours ago
Yes, that would not be a problem.
– Mr.Brownstone
2 hours ago
add a comment |
1
What if the book has many authors? How can i roll them into book dimention?
– J. DOE
3 hours ago
I have updated my answer accordingly.
– Mr.Brownstone
3 hours ago
If i replace the category with publisher and inside it i put city country to make hierarchy on its location. Can i but the publisher on the book dimention in this case?
– J. DOE
2 hours ago
Yes, that would not be a problem.
– Mr.Brownstone
2 hours ago
1
1
What if the book has many authors? How can i roll them into book dimention?
– J. DOE
3 hours ago
What if the book has many authors? How can i roll them into book dimention?
– J. DOE
3 hours ago
I have updated my answer accordingly.
– Mr.Brownstone
3 hours ago
I have updated my answer accordingly.
– Mr.Brownstone
3 hours ago
If i replace the category with publisher and inside it i put city country to make hierarchy on its location. Can i but the publisher on the book dimention in this case?
– J. DOE
2 hours ago
If i replace the category with publisher and inside it i put city country to make hierarchy on its location. Can i but the publisher on the book dimention in this case?
– J. DOE
2 hours ago
Yes, that would not be a problem.
– Mr.Brownstone
2 hours ago
Yes, that would not be a problem.
– Mr.Brownstone
2 hours ago
add a comment |
up vote
1
down vote
So your question is a couple of different questions -
Author
should not be its own dimension, it will just be an attribute of theBook
dimension.Because a fact table's primary key is a composite key made up of a set of foreign keys, every table that has a many-to-many relationship has to be expressed as a fact table. You'll have to employ the use of bridge tables, but the best way to implement this depends on your needs.
I don't think you're wrong in your approach, but just to help you clarify what you're doing, you'll want
Order
as a fact table, andBook
(which I would moveAuthor
andCategory
into as attributes)DateTime
(orDate
andTime
separate from each other) andCustomer
as dimensions in your example. All your quantitative data (other thanDateTime
) should be going inOrder
and all your descriptive and qualitative data should be going in your surrounding dimensions.
New contributor
If i consider book as a dimention how can i put author in book dimention if the book has many authors?
– J. DOE
3 hours ago
There are a few ways you could do that. You could put all of the authors into theAuthor
attribute and separate them (i.e. Author:"John Smith, John Doe, Jane Citizen), or you could snowflake theBook
dimension so thatAuthor
becomes an outrigger (you can think of it as a subdimension). Although it isn't pretty, it's probably best to put all of the authors intoAuthor
and set it as a VARCHAR with a high character limit.
– Rhys
3 hours ago
add a comment |
up vote
1
down vote
So your question is a couple of different questions -
Author
should not be its own dimension, it will just be an attribute of theBook
dimension.Because a fact table's primary key is a composite key made up of a set of foreign keys, every table that has a many-to-many relationship has to be expressed as a fact table. You'll have to employ the use of bridge tables, but the best way to implement this depends on your needs.
I don't think you're wrong in your approach, but just to help you clarify what you're doing, you'll want
Order
as a fact table, andBook
(which I would moveAuthor
andCategory
into as attributes)DateTime
(orDate
andTime
separate from each other) andCustomer
as dimensions in your example. All your quantitative data (other thanDateTime
) should be going inOrder
and all your descriptive and qualitative data should be going in your surrounding dimensions.
New contributor
If i consider book as a dimention how can i put author in book dimention if the book has many authors?
– J. DOE
3 hours ago
There are a few ways you could do that. You could put all of the authors into theAuthor
attribute and separate them (i.e. Author:"John Smith, John Doe, Jane Citizen), or you could snowflake theBook
dimension so thatAuthor
becomes an outrigger (you can think of it as a subdimension). Although it isn't pretty, it's probably best to put all of the authors intoAuthor
and set it as a VARCHAR with a high character limit.
– Rhys
3 hours ago
add a comment |
up vote
1
down vote
up vote
1
down vote
So your question is a couple of different questions -
Author
should not be its own dimension, it will just be an attribute of theBook
dimension.Because a fact table's primary key is a composite key made up of a set of foreign keys, every table that has a many-to-many relationship has to be expressed as a fact table. You'll have to employ the use of bridge tables, but the best way to implement this depends on your needs.
I don't think you're wrong in your approach, but just to help you clarify what you're doing, you'll want
Order
as a fact table, andBook
(which I would moveAuthor
andCategory
into as attributes)DateTime
(orDate
andTime
separate from each other) andCustomer
as dimensions in your example. All your quantitative data (other thanDateTime
) should be going inOrder
and all your descriptive and qualitative data should be going in your surrounding dimensions.
New contributor
So your question is a couple of different questions -
Author
should not be its own dimension, it will just be an attribute of theBook
dimension.Because a fact table's primary key is a composite key made up of a set of foreign keys, every table that has a many-to-many relationship has to be expressed as a fact table. You'll have to employ the use of bridge tables, but the best way to implement this depends on your needs.
I don't think you're wrong in your approach, but just to help you clarify what you're doing, you'll want
Order
as a fact table, andBook
(which I would moveAuthor
andCategory
into as attributes)DateTime
(orDate
andTime
separate from each other) andCustomer
as dimensions in your example. All your quantitative data (other thanDateTime
) should be going inOrder
and all your descriptive and qualitative data should be going in your surrounding dimensions.
New contributor
New contributor
answered 3 hours ago
Rhys
113
113
New contributor
New contributor
If i consider book as a dimention how can i put author in book dimention if the book has many authors?
– J. DOE
3 hours ago
There are a few ways you could do that. You could put all of the authors into theAuthor
attribute and separate them (i.e. Author:"John Smith, John Doe, Jane Citizen), or you could snowflake theBook
dimension so thatAuthor
becomes an outrigger (you can think of it as a subdimension). Although it isn't pretty, it's probably best to put all of the authors intoAuthor
and set it as a VARCHAR with a high character limit.
– Rhys
3 hours ago
add a comment |
If i consider book as a dimention how can i put author in book dimention if the book has many authors?
– J. DOE
3 hours ago
There are a few ways you could do that. You could put all of the authors into theAuthor
attribute and separate them (i.e. Author:"John Smith, John Doe, Jane Citizen), or you could snowflake theBook
dimension so thatAuthor
becomes an outrigger (you can think of it as a subdimension). Although it isn't pretty, it's probably best to put all of the authors intoAuthor
and set it as a VARCHAR with a high character limit.
– Rhys
3 hours ago
If i consider book as a dimention how can i put author in book dimention if the book has many authors?
– J. DOE
3 hours ago
If i consider book as a dimention how can i put author in book dimention if the book has many authors?
– J. DOE
3 hours ago
There are a few ways you could do that. You could put all of the authors into the
Author
attribute and separate them (i.e. Author:"John Smith, John Doe, Jane Citizen), or you could snowflake the Book
dimension so that Author
becomes an outrigger (you can think of it as a subdimension). Although it isn't pretty, it's probably best to put all of the authors into Author
and set it as a VARCHAR with a high character limit.– Rhys
3 hours ago
There are a few ways you could do that. You could put all of the authors into the
Author
attribute and separate them (i.e. Author:"John Smith, John Doe, Jane Citizen), or you could snowflake the Book
dimension so that Author
becomes an outrigger (you can think of it as a subdimension). Although it isn't pretty, it's probably best to put all of the authors into Author
and set it as a VARCHAR with a high character limit.– Rhys
3 hours ago
add a comment |
J. DOE is a new contributor. Be nice, and check out our Code of Conduct.
J. DOE is a new contributor. Be nice, and check out our Code of Conduct.
J. DOE is a new contributor. Be nice, and check out our Code of Conduct.
J. DOE is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f224520%2fdesign-star-schema-for-relatonal-database%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown