Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need a fact _ table with columns of Store _ ID , Perscription ID , Brand _ ID and Quanity ordered. How do I
I need a fact
table with columns of Store
ID
Perscription ID
Brand
ID and Quanity ordered. How do I script that to create it and how do I script the data to insert How do I put it together I am lost. I have the data but I can't seem to figure out how to do it I have done this but I can't add it to a fact table. CREATE TABLE NFPATIENT
ID INT PRIMARY KEY,
NAME VARCHAR
ADDRESS VARCHAR
CITY VARCHAR
STATE CHAR;
INSERT INTO NFPATIENTID NAME, ADDRESS, CITY, STATE VALUES
'Matt Smith', Norht Hazel', 'Glenwood', IA
'John Blue', South', 'Omaha', NE
'Pete Jones', North Maple', 'Chicago', IL
'Bill Powers', Dodge', 'Chicago', IL
'Mark Bagg', Elm', 'Manhattan', KS
'Jim Dau', Oak Street', 'New York', NY
'Luke stier', Maple', 'Tabor', IA
'Emma Dier', Happs', 'Omaha', NE
'Colleen Riek', Sams', 'Carroll', I;
SELECT FROM NFPATIENT
CREATE TABLE NFDRUG
ID INT,
DRUGNAME VARCHAR
CODE VARCHAR
CODE VARCHAR
YEAR INT,
DEPARTMENT VARCHAR
CODE VARCHAR
CATEGORY VARCHAR
VALUE DECIMAL
VALUE INT,
VALUE DECIMAL
PRIMARY KEY ID CODE CODE YEAR
;
Insert data into the 'medications' table
INSERT INTO NFDRUGID DRUGNAME, CODE CODE YEAR, DEPARTMENT, CODE CATEGORY, VALUE VALUE VALUE VALUES
'Heart Clear', B 'Cardiology', F 'Whole Body',
'Heart Clear', B 'Cardiology', F 'Whole Body',
'Heart Clear', B 'Cardiology', F 'Whole Body',
'Lung Guard', B 'Pulmonary', B 'Lung Health',
'Lung Guard', B 'Pulmonary', B 'Lung Health',
'Lung Guard', B 'Pulmonary', B 'Lung Health',
'Lung Work', B 'Pulmonary', B 'Lung Health',
'Lung Work', B 'Pulmonary', B 'Lung Health',
'Lung Work', B 'Pulmonary', B 'Lung Health',
'Nervous Help', B 'Nervous', W 'Nervous Support',
'Nervous Help', B 'Nervous IIW 'Nervous Support', ;
SELECT FROM NFDRUG
Create a table called 'records'
CREATE TABLE NFPERSCRIPTIONS
CODE VARCHAR
DATE DATE,
ID INT,
VALUE INT,
VALUE INT
;
Insert data into the 'records' table
INSERT INTO NFPERSCRIPTIONSCODE DATE, ID VALUE VALUE VALUES
B
B
B
B
B
B
B
B
B
B
B;
SELECT FROM NFPERSCRIPTIONS
Create a table called 'stores'
CREATE TABLE NFSTORES
CODE INT,
STORENAME VARCHAR
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started