|
toseef_asim
Starting Member
Pakistan
1 Posts |
Posted - 06/05/2012 : 04:00:32
|
Write SQL statements to construct the "Star Schema" given. Guide lines: Use appropriate data types for the table attributes. Show the Primary/Foreign key constraints. Please Check the code written is correct or not.
Create table Account_holder ( Account_holder_id int primary key, Name varchar(100), NIC_no int, Address varchar(300), Phone_no int, Email varchar(100) )
Create table account ( Account_ID int PRIMARY KEY, Account_name varchar(100), Account_type varchar(50), Account_no int, Profit_rate int )
create table savings ( Account_holder_ID FOREIGN KEY REFERENCES Account_holder(Account_holder_id), Account_ID int FOREIGN KEY REFERENCES Account (Account_ID), Time_ID int FOREIGN KEY REFERENCES Time (Time_ID), Bank_ID int FOREIGN KEY REFERENCES Bank (Bank_ID), Saving int PRIMARY KEY )
create table time ( Time_ID int PRIMARY KEY, Date datetime, Week int, Month varchar(100), Quarter int, Year varchar(100) )
create table Bank ( Bank_ID int PRIMARY KEY, Bank_name varchar(250), Branch_name varchar(250), Town varchar(50), City varchar(50), Zone varchar(50), Province varchar(50) )
Please Check the code and identify errors. regards Toseef asim toseef_asim@yahoo.com |
Edited by - toseef_asim on 06/05/2012 04:22:36
|
|