Hi I am working at constructing a Data Model from a textbook
Hi, I am working at constructing a Data Model from a textbook example. The Textbook is Modern Systems Analysis and Design 8th edition and I am referencing chapter 8 and the CQ. I have entities and attributes identified for this example, but I am confused on what type of attributes are which. Which entities are attributive or associative entities and how can I tell? Also please note that I also have an Employee and a Purchase entity as well that are not listed below. Thanks for your tips!
Entity
Attribute
Key?
Coupon
Coupon_ID
PK
Coupon_Amt
Coupon_Desc
Coupon_Expiration
Coupon_Customer
Coupon_Validity
Coupon_Status
Service
Service_ID
PK
Service_Name
Service_Cost
Service_Desc
Service_Type
Promotion
Promotion_ID
PK
Promotion_Value
Promotion_Desc
Promotion_Expiration
Promotion_Type
Promotion_Eligibility
Customer
Customer_ID
PK
Customer_Name
Customer_Phone
Customer_Address
Customer_Type
Customer_Value
Transaction
Transaction_ID
PK
Transaction_Item
Transaction_Time
Transaction_Customer
Transaction_Value
Transaction_Point
Product
Product_ID
PK
Product_Name
Product_Cost
Product_Desc
Product_Type
Statement
Statement_ID
PK
Statement_Customer
Statement_Account
| Entity | Attribute | Key? |
| Coupon | Coupon_ID | PK |
| Coupon_Amt | ||
| Coupon_Desc | ||
| Coupon_Expiration | ||
| Coupon_Customer | ||
| Coupon_Validity | ||
| Coupon_Status |
Solution
Answer:-
1) create table Coupon.
CREATE TABLE [dbo].[Coupon](
[Coupon_ID] [int] IDENTITY(1,1) NOT NULL,
[Coupon_Amt] [money] NULL,
[Coupon_Desc] [nvarchar](250) NULL,
[Coupon_Expiration] [datetime] NULL,
[Coupon_Customer] [nvarchar](250) NULL,
[Coupon_Validity] [int] NULL,
[Coupon_Status] [bit] NULL,
CONSTRAINT [PK_Coupon] PRIMARY KEY CLUSTERED
(
[Coupon_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
2) create table Service.
CREATE TABLE [dbo].[Service](
[Service_ID] [int] IDENTITY(1,1) NOT NULL,
[Service_Name] [nvarchar](250) NULL,
[Service_Cost] [money] NULL,
[Service_Desc] [nvarchar](250) NULL,
[Service_Type] [nvarchar](100) NULL,
CONSTRAINT [PK_Service] PRIMARY KEY CLUSTERED
(
[Service_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
3) create table Promation.
CREATE TABLE [dbo].[Promotion](
[Promotion_ID] [int] IDENTITY(1,1) NOT NULL,
[Promotion_Value] [nvarchar](100) NULL,
[Promotion_Desc] [nvarchar](250) NULL,
[Promotion_Expiration] [datetime] NULL,
[Promotion_Type] [nvarchar](100) NULL,
[Promotion_Eligibility] [nvarchar](50) NULL,
CONSTRAINT [PK_Promotion] PRIMARY KEY CLUSTERED
(
[Promotion_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
4) create table Customer.
CREATE TABLE [dbo].[Customer](
[Customer_ID] [int] IDENTITY(1,1) NOT NULL,
[Customer_Name] [nvarchar](50) NULL,
[Customer_Phone] [nvarchar](50) NULL,
[Customer_Address] [nvarchar](250) NULL,
[Customer_Type] [nvarchar](50) NULL,
[Customer_Value] [nvarchar](50) NULL,
CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED
(
[Customer_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
5) create table Transaction
CREATE TABLE [dbo].[Transaction](
[Transaction_ID] [int] IDENTITY(1,1) NOT NULL,
[Transaction_Item] [nvarchar](250) NULL,
[Transaction_Time] [nvarchar](50) NULL,
[Transaction_Customer] [nvarchar](50) NULL,
[Transaction_Value] [nvarchar](50) NULL,
[Transaction_Point] [nvarchar](50) NULL,
CONSTRAINT [PK_Transaction] PRIMARY KEY CLUSTERED
(
[Transaction_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
6) create table Product.
CREATE TABLE [dbo].[Product](
[Product_ID] [int] IDENTITY(1,1) NOT NULL,
[Product_Name] [nvarchar](250) NULL,
[Product_Cost] [nvarchar](50) NULL,
[Product_Desc] [nvarchar](250) NULL,
[Product_Type] [nvarchar](50) NULL,
CONSTRAINT [PK_Product] PRIMARY KEY CLUSTERED
(
[Product_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
7) create table Statement.
CREATE TABLE [dbo].[Statement](
[Statement_ID] [int] IDENTITY(1,1) NOT NULL,
[Statement_Customer] [nvarchar](250) NULL,
CONSTRAINT [PK_Statement] PRIMARY KEY CLUSTERED
(
[Statement_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]



