Question: From the attached ER diagram, is the solution below. Kindly explain to me the meaning of this PART>>>>>> Value sfor SALE_ITEM Sale_Item(1,1); Sale_Item(2,3); Sale_Item(3,2); Sale_Item(4,5); Sale_Item(5,4); Sale_Item(6,5); CREATE TABLE SALE( SaleID INTEGER NOT NULL PRIMARY KEY, SaleDate DATE NOT NULL, Tax DECIMAL(4,2), Total DECIMAL(10,2) ); TABLE SALE Create table Sale ( SaleID INTEGER NOT NULL PRIMARY KEY, SaleDate DATE NOT NULL, Tax DECIMAL(4,2), Total DECIMAL(10,2) ); For Sale (1,'2001-04-04',121,1230); For Sale(2,'2002-04-04',122,1270); For Sale(3,'2003-04-04',123,1260); For Sale(4,'2004-04-04',124,1250); For Sale(5,'2005-04-04',125,1240); For Sale(6,'2006-04-04',126,1240); CREATE TABLE ITEM( ItemID INTEGER NOT NULL PRIMARY KEY, Name VARCHAR(30) NOT NULL Cost DECIMAAL(10,2) NOT NULL Price DECIMAL(10,2) NOT NULL ); Values of Items Item(1,'Item1',11,120); Item(2,'Item2',12,121); Item(3,'Item3',13,122); Item(4,'Item4',14,123); Item(5,'Item5',15,124); Item(6 'Item6',17,125); CREATE TABLE SALE_ITEM( SaleID INTEGER references SALE(ID), SaleItemID INTEGER references ITEM(ItemID) ); Value sfor SALE_ITEM Sale_Item(1,1); Sale_Item(2,3); Sale_Item(3,2); Sale_Item(4,5); Sale_Item(5,4); Sale_Item(6,5); Update for “Price” value: UPDATE Item SET Price='500' WHEN ItemID = 1;
Question: From the attached ER diagram, is the solution below. Kindly explain to me the meaning of this PART>>>>>>
Value sfor SALE_ITEM
Sale_Item(1,1);
Sale_Item(2,3);
Sale_Item(3,2);
Sale_Item(4,5);
Sale_Item(5,4);
Sale_Item(6,5);
CREATE TABLE SALE(
SaleID INTEGER NOT NULL PRIMARY KEY,
SaleDate DATE NOT NULL,
Tax DECIMAL(4,2),
Total DECIMAL(10,2)
);
TABLE SALE
Create table Sale (
SaleID INTEGER NOT NULL PRIMARY KEY,
SaleDate DATE NOT NULL,
Tax DECIMAL(4,2),
Total DECIMAL(10,2)
);
For Sale (1,'2001-04-04',121,1230);
For Sale(2,'2002-04-04',122,1270);
For Sale(3,'2003-04-04',123,1260);
For Sale(4,'2004-04-04',124,1250);
For Sale(5,'2005-04-04',125,1240);
For Sale(6,'2006-04-04',126,1240);
CREATE TABLE ITEM(
ItemID INTEGER NOT NULL PRIMARY KEY,
Name VARCHAR(30) NOT NULL
Cost DECIMAAL(10,2) NOT NULL
Price DECIMAL(10,2) NOT NULL
);
Values of Items
Item(1,'Item1',11,120);
Item(2,'Item2',12,121);
Item(3,'Item3',13,122);
Item(4,'Item4',14,123);
Item(5,'Item5',15,124);
Item(6 'Item6',17,125);
CREATE TABLE SALE_ITEM(
SaleID INTEGER references SALE(ID),
SaleItemID INTEGER references ITEM(ItemID)
);
Value sfor SALE_ITEM
Sale_Item(1,1);
Sale_Item(2,3);
Sale_Item(3,2);
Sale_Item(4,5);
Sale_Item(5,4);
Sale_Item(6,5);
Update for “Price” value:
UPDATE Item
SET Price='500'
WHEN ItemID = 1;
Trending now
This is a popular solution!
Step by step
Solved in 2 steps