-------------------------
-- Create Departmentsstable
-------------------------
CREATE TABLE Departmentss
(
dept_id smallint NOTNULL ,
dept_name varchar(20) NOT NULL
);
--------------------------
-- Create ProductType table
--------------------------
CREATE TABLE ProductType
(
product_type_id varchar(10) NOTNULL ,
product_type_name varchar(50) NOTNULL ,
);
----------------------
-- Create Product table
----------------------
CREATE TABLE Product
(
product_id varchar(10) NOT NULL ,
product_name varchar(50) NOT NULL ,
Product_type_id varchar(10) NOTNULL ,
date_offereddatetime NOTNULL,
date_retireddatetime NOTNULL,
);
------------------------
-- Create Account table
------------------------
CREATE TABLE Account
(
account_id Integer NOT NULL ,
product_id varchar(10) NOT NULL ,
custom_id integer NOT NULL ,
open_date date NOTNULL ,
close_date date NOTNULL ,
last_activity date NOTNULL ,
account_status varchar(10) NULL,
branch_id smallintNOTNULL,
emp_id smallintNOTNULL,
avail_balance float(10,2) NOTNULL,
pending_balance float(10,2) NOTNULL,
);
-----------------------
-- Create Customertable
-----------------------
CREATE TABLE Customer
(
custom_id integer NOTNULL ,
custom_type char(2) NOTNULL,
fed_id varchar(12) NOTNULL ,
custom_addressvarchar(30) NULL ,
custom_city varchar(20) NULL ,
custom_state varchar(20) NULL ,
custom_zip varchar(10) NULL ,
);
-----------------------
-- Create Businesstable
-----------------------
CREATE TABLE Business
(
busi_id char(10) NOTNULL ,
custom_id integer NOTNULL ,
busi_name varchar(40) NOT NULL ,
id_state char(5) NOT NULL ,
incorp_date date NOTNULL
);
-----------------------
-- Create Officertable
-----------------------
CREATE TABLE Officer
(
officer_idsmallintNOTNULL ,
custom_id integer NOT NULL ,
first_name varchar(30) NOTNULL ,
last_name varchar(30) NOT NULL ,
starts_date date NOT NULL ,
end_date date NOT NULL
);
-----------------------
-- Create Individual table
-----------------------
CREATE TABLE Individual
(
individual_id char(10) NOTNULL ,
custom_id integer NOT NULL ,
f_name varchar(30) NOT NULL ,
l_name varchar(30) NOT NULL ,
birth_date date NOT NULL
);
-----------------------
-- Create Transactions table
-----------------------
CREATE TABLE Transactions
(
txn_id integerNOTNULL ,
txn_date datetime NOTNULL ,
account_id integer NOTNULL ,
txn_type_od varchar(10) NOT NULL ,
amount double(10,2) NULL,
emp_id smallint NOTNULL ,
branch_id smallintNOTNULL ,
funds_avail date NOT NULL
);
-----------------------
-- Create Employee table
-----------------------
CREATE TABLE Employee
(
emp_id smallint NOTNULL ,
fname varchar(20) NOT NULL ,
lname varchar(20) NOT NULL ,
s_date date NOT NULL ,
e_date date NOT NULL ,
superior_emp_id smallint NOTNULL ,
dept_id smallint NOTNULL ,
tit varchar(20) NULL,
branch_idsmallintNOTNULL
);
-----------------------
-- Create Branch table
-----------------------
CREATE TABLE Branch
(
branch_id smallintNOTNULL,
branch_name varchar(20) NOT NULL ,
branch_addresschar(30) NULL ,
branch_city char(20) NULL ,
branch_state varchar(20) NULL ,
branch_zip char(12) NULL ,
);
----------------------
-- Define primary keys
----------------------
ALTER TABLE CustomerWITHNOCHECKADD CONSTRAINTPK_CustomerPRIMARYKEYCLUSTERED
(custom_id);
ALTER TABLE Branch WITH NOCHECKADD CONSTRAINTPK_BranchPRIMARYKEY CLUSTERED
(branch_id);
ALTER TABLE Product_type WITHNOCHECKADD CONSTRAINTPK_Product_type PRIMARYKEY
CLUSTERED (product_type_id);
ALTER TABLE ProductWITH NOCHECKADD CONSTRAINTPK_ProductPRIMARYKEY CLUSTERED
(product_id);
ALTER TABLE AccountWITH NOCHECKADD CONSTRAINTPK_AccountPRIMARYKEY CLUSTERED
(account_id);
ALTER TABLE OfficerWITHNOCHECKADD CONSTRAINTPK_OfficerPRIMARYKEYCLUSTERED
(officer_id);
ALTER TABLE BusinessWITHNOCHECKADDCONSTRAINTPK_BusinessPRIMARYKEYCLUSTERED
(busi_id);
ALTER TABLE Individual WITHNOCHECKADDCONSTRAINTPK_Individual PRIMARYKEYCLUSTERED
(individual_id);
ALTER TABLE Employee WITHNOCHECKADDCONSTRAINTPK_Employee PRIMARYKEYCLUSTERED
(emp_id);
ALTER TABLE TransactionsWITH NOCHECKADD CONSTRAINTPK_TransactionsPRIMARYKEY
CLUSTERED (txn_id);
ALTER TABLE DeparmentsWITHNOCHECKADD CONSTRAINTPK_DepartmentsPRIMARYKEY
CLUSTERED (dept_id);
----------------------
-- Define foreignkeys
----------------------
ALTER TABLE ProductADD
CONSTRAINTFK_Product_ProductType FOREIGN KEY(product_type_id) REFERENCESProductType
(product_type_id);
ALTER TABLE AccountADD
CONSTRAINTFK_Account_ProductFOREIGN KEY(product_id) REFERENCESProduct(product_id),
CONSTRAINTFK_Account_CustomerFOREIGN KEY(custom_id) REFERENCESCustomer
(custom_id),
CONSTRAINTFK_Account_Branch FOREIGN KEY (branch_id) REFERENCESBranch(branch_id),
CONSTRAINTFK_Account_EmployeeFOREIGN KEY(emp_id) REFERENCESEmployee (emp_id);
ALTER TABLE BusinessADD
CONSTRAINTFK_Business_CustomerFOREIGN KEY(custom_id) REFERENCESCustomer
(custom_id);
ALTER TABLE Individual ADD
CONSTRAINTFK_Individual_CustomerFOREIGN KEY(custom_id) REFERENCESCustomer
(custom_id);
ALTER TABLE OfficerADD
CONSTRAINTFK_Officer_CustomerFOREIGN KEY(custom_id) REFERENCESCustomer(custom_id);
ALTER TABLE TransactionsADD
CONSTRAINTFK_Transactions_AccountFOREIGN KEY(account_id) REFERENCESAccount
(account_id),
CONSTRAINTFK_Transactions_Employee FOREIGN KEY(emp_id) REFERENCESEmployee (emp_id),
CONSTRAINTFK_Transactions_BranchFOREIGN KEY(branch_id) REFERENCESBranch (branch_id);
ALTER TABLE Employee ADD
CONSTRAINTFK_Employee_DepartmentsFOREIGN KEY(dept_id) REFERENCESDeparments
(dept_id),
CONSTRAINTFK_Employee_EmployeeFOREIGN KEY(superior_emp_id) REFERENCESEmployee
(superior_emp_id),
CONSTRAINTFK_Employee_BranchFOREIGN KEY(branch_id) REFERENCESBranch(branch_id);
---TRANSACTIONS---
INSERT INTOTransactions
(txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail)
VALUES(00001,'2005-02-22',101,'CDT','1000.00',1,901,'2005-02-22')
INSERT INTO
Transactions(txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail)
VALUES(00002,'2005-02-23',102,'CDT','525.75',2,902,'2005-02-23')
INSERT INTOTransactions
(txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail)
VALUES(00003,'2005-02-24',103,'DBT','100.00',3,903,'2005-02-24')
INSERT INTOTransactions
(txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail)
VALUES(00004,'2005-02-24',104,'CDT','55',4,904,'2005-02-25')
INSERT INTOTransactions
(txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail)
VALUES(00005,'2005-02-25',105,'DBT','50',5,905,'2005-02-26')
INSERT INTOTransactions
(txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail)
VALUES(00007,'2005-02-25',107,'CDT','125.37',6,906,'2005-02-27')
INSERT INTOTransactions
(txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail)
VALUES(00008,'2005-02-26',108,'DBT','10',7,907,'2005-02-28')
INSERT INTOTransactions
(txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail)
VALUES(00009,'2005-02-27',109,'CDT','75',8,908,'2005-02-29')
----ACCOUNT-----
INSERT INTO
Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra
nch_id,emp_id,avail_balance,pending_balance)
VALUES(101,20001,0001,'2005-02-22','2005-03-02','2005-05-11','active',901,1,'1000.00','200')
INSERT INTO
Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra
nch_id,emp_id,avail_balance,pending_balance)
VALUES(102,20002,0002,'2005-02-23','2005-03-03','2005-05-12','active',902,2,'1000.00','200')
INSERT INTO
Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra
nch_id,emp_id,avail_balance,pending_balance)
VALUES(103,20003,0003,'2005-02-24','2005-03-04','2005-05-13','active',903,3,'1000.00','200')
INSERT INTO
Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra
nch_id,emp_id,avail_balance,pending_balance)
VALUES(104,20004,0004,'2005-02-25','2005-03-05','2005-05-14','active',904,4,'1000.00','200')
INSERT INTO
Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra
nch_id,emp_id,avail_balance,pending_balance)
VALUES(105,20005,0005,'2005-02-26','2005-03-06','2005-05-15','inactive',905,5,'1000.00','200')
INSERT INTO
Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra
nch_id,emp_id,avail_balance,pending_balance)
VALUES(107,20006,0006,'2005-02-27','2005-04-07','2005-05-15','inactive',906,6,'1000.00','200')
INSERT INTO
Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra
nch_id,emp_id,avail_balance,pending_balance)
VALUES(108,20007,0007,'2005-02-28','2005-04-08','2005-05-16','inactive',907,7,'1000.00','200')
INSERT INTO
Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra
nch_id,emp_id,avail_balance,pending_balance)
VALUES(109,20009,0008,'2005-02-29','2005-04-09','2005-05-17','inactive',908,8,'1000.00','200')
----EMPLOYEE-------
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(1,'Michael','Smith','2005-04-03','2008-04-03',801,501,'informatica',901)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(2, 'Susan','Barker','2005-04-03','2008-04-03',802,502,'gerente',902)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(3,'Robert','Tyler','2005-04-03','2008-04-03',803,503,'contador',903)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(4,'Susan','Hawthorne','2005-04-03','2008-04-03',805,504,'gerente',904)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(5,'John','Gooding','2005-04-03','2008-04-03',805,505,'acesor',905)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(6,'Helen','Fleming','2005-04-03','2008-04-03',806,506,'acesor de tramites',906)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(7,'Chris','Tucker','2005-04-03','2008-04-03',807,507,'operador',907)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(8,'Sarah','Parker','2005-04-03','2008-04-03',808,508,'cajero',908)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(9,'Jane','Grossman','2005-04-03','2008-04-03',809,509,'ejecutivo',909)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(10, 'Paula','Roberts','2005-04-03','2008-04-03',810,510,'abogado',910)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(11, 'Thomas','Ziegler','2005-04-03','2008-04-03',811,511,'policia',911)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(12, 'Samantha','Jameson','2005-04-03','2008-04-03',812,512,'intendente',913)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(13, 'John','Blake','2005-04-03','2008-04-03',813,513,'ejecutivo',914)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(14, 'Cindy','Mason','2005-04-03','2008-04-03',814,514,'diseñador',915)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(15, 'Frank','Portmant','2005-04-03','2008-04-03',815,515,'abogado',915)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(16, 'Theresa','Markham','2005-04-03','2008-04-03',816,516,'acesor',916)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(17, 'Beth','Fowler','2005-04-03','2008-04-03',817,517,'ejecutivo',917)
INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id,
dept_id,tit,branch_id)
VALUES(18, 'Rick','Tulman','2005-04-03','2008-04-03',818,518,'cobrador',918)
----PRODUCTYPE-------
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(601,'credito')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(602,'debito')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(603,'platino')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(604,'dorada')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(605,'empresarial')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(606,'preferente')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(607,'credito')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(608,'debito')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(609,'platino')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(610,'preferente')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(611,'empresarial')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(612,'dorada')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(613,'credito')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(614,'debito')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(615,'empresarial')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(616,'platino')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(617,'dorada')
INSERT INTOProductType( product_type_id,product_type_name)
VALUES(618,'credito')
------PRODUCT----------
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20001,'tarjeta',601,'2005-01-28','2006-01-05')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20002,'tarjeta',602,'2005-02-28','2006-02-06')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20003,'tarjeta',603,'2005-03-28','2006-03-07')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20004,'tarjeta',604,'2005-04-28','2006-04-11')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20005,'tarjeta',605,'2005-05-28','2006-05-30')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20006,'tarjeta',606,'2005-06-28','2006-06-24')
INSERT INTOProduct( product_id,product_name, product_type_id,date_offered,date_retired)
VALUES(20007,'tarjeta',607,'2005-07-28','2006-07-28')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20008,'tarjeta',608,'2005-08-28','2006-08-14')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20009,'tarjeta',609,'2005-09-28','2006-09-16')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20010,'tarjeta',610,'2005-10-28','2006-10-15')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20011,'tarjeta',611,'2005-11-28','2006-11-13')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20012,'tarjeta',612,'2005-12-28','2006-12-29')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20013,'tarjeta',613,'2005-01-28','2006-02-28')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20014,'tarjeta',614,'2005-02-28','2006-03-31')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20015,'tarjeta',615,'2005-03-28','2006-04-19')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20016,'tarjeta',616,'2005-04-28','2006-05-02')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20017,'tarjeta',617,'2005-05-28','2006-06-08')
INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
VALUES(20018,'tarjeta',618,'2005-06-28','2006-07-12')
--------BRANCH--------
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(901,'diazmiron','diazmiron#655','veracruz','veracruz','91700')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(902,'independencia','independencia #273','veracruz','veracruz','91710' )
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(903,'ruizcortinez','ruizcortinez#949','veracruz','veracruz','91720')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(904,'2 de abril','2 de abril #399','veracruz','veracruz','91730')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(905,'20 de noviembre','diazmiron#8838','veracruz','veracruz','91740')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(906,'bolivar','bolivar#427','veracruz','veracruz','91750')
INSERT INTOBranch( branch_id,branch_name, branch_address,
branch_city,branch_state,branch_zip)
VALUES(907,'reforma','reforma#345','veracruz','veracruz','91760')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(908,'juanpabloII','juanpablo II #8060','veracruz','veracruz','91770')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(909,'costa verde','costaverde #6780','veracruz','veracruz','91780')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(910,'costa de oro','costa de oro #523','veracruz','veracruz','91790')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(911,'cuauhtemoc','cuauhtemoc#499','veracruz','veracruz','91800')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(912,'miguel aleman','miguel aleman#324','veracruz','veracruz','91810')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(913,'circunvalacion','circunvalacion#7011','veracruz','veracruz','91820')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(914,'la fragua','lafragua#6030','veracruz','veracruz','91830')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(915,'marti','marti #7030','veracruz','veracruz','91840')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(916,'americas','americas#1110','veracruz','veracruz','91850')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(917,'5 de mayo','5 de mayo #220','veracruz','veracruz','91860')
INSERT INTOBranch( branch_id,branch_name,branch_address,
branch_city,branch_state,branch_zip)
VALUES(918,'hidalgo','hidalgo#330','veracruz','veracruz','91870')
----CUSTOMER-----
INSERT INTOCustomer(custom_id,
custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip)
VALUES('0001', 'ep','00012341', 'reforma#145', 'mexico','veracruz','95400');
INSERT INTOCustomer(custom_id,
custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip)
VALUES('0002', 'pl','00012342', 'carpio #43', 'mexico','guadalajara','94670');
INSERT INTOCustomer(custom_id,
custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip)
VALUES('0003','pr', '00012343', 'libertad#1136', 'mexico','xalapa', '45678');
INSERT INTOCustomer(custom_id,
custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip)
VALUES('0004', 'hm', '00012344', 'campo real #717', 'mexico','monterrey','45678');
INSERT INTOCustomer(custom_id,
custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip)
VALUES('0005', 'pl','00012345', 'ruiz cortinez#67', 'mexico','veracruz','95400');
INSERT INTOCustomer(custom_id,
custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip)
VALUES('0006', 'ep','00012346', 'diaz miron#654', 'mexico','veracruz','95400');
INSERT INTOCustomer(custom_id,
custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip)
VALUES('0007', 'hm', '00012347', '2 de abril #245', 'mexico','yucatan','45673');
INSERT INTOCustomer(custom_id,
custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip)
VALUES('0008', 'pr', '00012348', '20 de noviembre #1678', 'mexico','guanajuato','56433');
INSERT INTOCustomer(custom_id,
custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip)
VALUES('0009', 'pl','00012349', 'murillovidal #25', 'mexico','veracruz','95400');
INSERT INTOCustomer(custom_id,
custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip)
VALUES('0010', 'ep','00012351', 'arriola molina#456', 'mexico','xalapa','45678');
------OFFICER-------
INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date)
VALUES('1000', '0001', 'roberto','meguelle','2010/08/03', '2010/12/31');
INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date)
VALUES('2000', '0002', 'juan carlos','vidal','1990/10/23', '1995/05/29');
INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date)
VALUES('3000', '0003', 'fernando','guzman','2010/01/03', '2010/08/16');
INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date)
VALUES('4000', '0004', 'enrique','rodriguez','2010/05/07', '2010/07/12');
INSERT INTOOfficer(officer_id, custom_id,first_name,last_name,starts_date,end_date)
VALUES('5000', '0005', 'jose','mimendi','2010/02/14', '2010/03/19');
INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date)
VALUES('6000', '0006', 'ivan','nicanor', '2000/09/12', '2003/12/17');
INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date)
VALUES('7000', '0007', 'jonathan','nieto','2008/05/18', '2010/11/22');
INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date)
VALUES('8000', '0008', 'julian','hernandez','2003/10/16', '2005/09/11');
INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date)
VALUES('9000', '0009', 'arturo', 'lopez','2010/01/03', '2010/12/31');
INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date)
VALUES('1100', '0010', 'noe','avila','2007/07/25', '2010/11/20');
----------BUSINESS--------
INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date)
VALUES('123451', '0001', 'tramite tarjeta','ver','2010/09/10');
INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date)
VALUES('123452', '0002', 'asesoriabancaria','gdl', '2003/06/19');
INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date)
VALUES('123453', '0003', 'cuentacheques','xlp','2001/01/22');
INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date)
VALUES('123454', '0004', 'tramite tarjeta','mty', '2006/01/11');
INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date)
VALUES('123455', '0005', 'cancelacion','ver','2006/04/24');
INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date)
VALUES('123456', '0006', 'deposito','ver', '2010/06/15');
INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date)
VALUES('123457', '0007', 'retiroenefectivo','mex','2009/10/24');
INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date)
VALUES('123458', '0008', 'tramite de tarjeta','ver', '2008/07/09');
INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date)
VALUES('123459', '0009', 'deposito','gdl','2010/08/08');
INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date)
VALUES('123461', '0010', 'cuentacheques','mex','2000/09/10');
------------INDIVIDUAL-----------
INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date)
VALUES('10131', '0001', 'monica','lorenzo','1984/09/11');
INSERT INTOIndividual(individual_id,custom_id,f_name, l_name,birth_date)
VALUES('10132', '0002', 'mariana','camara', '1986/11/23');
INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date)
VALUES('10133', '0003', 'victor','vidal','1990/03/15');
INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date)
VALUES('10134', '0004', 'manuel','hernandez','1970/07/17');
INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date)
VALUES('10135', '0005', 'gonzalo','nicanor','1978/01/05');
INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date)
VALUES('10136', '0006', 'daniel','limon','1976/02/14');
INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date)
VALUES('10137', '0007', 'lorena','perez','1979/11/11');
INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date)
VALUES('10138', '0008', 'zamara', 'moreno','1984/03/22');
INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date)
VALUES('10139', '0009', 'saul','zamorano','1989/12/01');
INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date)
VALUES('10140', '0010', 'johnny','granda','1978/07/01');

Actividad 1 de unidad 4

  • 2.
    ------------------------- -- Create Departmentsstable ------------------------- CREATETABLE Departmentss ( dept_id smallint NOTNULL , dept_name varchar(20) NOT NULL ); -------------------------- -- Create ProductType table -------------------------- CREATE TABLE ProductType ( product_type_id varchar(10) NOTNULL , product_type_name varchar(50) NOTNULL , ); ---------------------- -- Create Product table ---------------------- CREATE TABLE Product ( product_id varchar(10) NOT NULL , product_name varchar(50) NOT NULL , Product_type_id varchar(10) NOTNULL , date_offereddatetime NOTNULL,
  • 3.
    date_retireddatetime NOTNULL, ); ------------------------ -- CreateAccount table ------------------------ CREATE TABLE Account ( account_id Integer NOT NULL , product_id varchar(10) NOT NULL , custom_id integer NOT NULL , open_date date NOTNULL , close_date date NOTNULL , last_activity date NOTNULL , account_status varchar(10) NULL, branch_id smallintNOTNULL, emp_id smallintNOTNULL, avail_balance float(10,2) NOTNULL, pending_balance float(10,2) NOTNULL, ); ----------------------- -- Create Customertable ----------------------- CREATE TABLE Customer
  • 4.
    ( custom_id integer NOTNULL, custom_type char(2) NOTNULL, fed_id varchar(12) NOTNULL , custom_addressvarchar(30) NULL , custom_city varchar(20) NULL , custom_state varchar(20) NULL , custom_zip varchar(10) NULL , ); ----------------------- -- Create Businesstable ----------------------- CREATE TABLE Business ( busi_id char(10) NOTNULL , custom_id integer NOTNULL , busi_name varchar(40) NOT NULL , id_state char(5) NOT NULL , incorp_date date NOTNULL ); ----------------------- -- Create Officertable -----------------------
  • 5.
    CREATE TABLE Officer ( officer_idsmallintNOTNULL, custom_id integer NOT NULL , first_name varchar(30) NOTNULL , last_name varchar(30) NOT NULL , starts_date date NOT NULL , end_date date NOT NULL ); ----------------------- -- Create Individual table ----------------------- CREATE TABLE Individual ( individual_id char(10) NOTNULL , custom_id integer NOT NULL , f_name varchar(30) NOT NULL , l_name varchar(30) NOT NULL , birth_date date NOT NULL ); ----------------------- -- Create Transactions table -----------------------
  • 6.
    CREATE TABLE Transactions ( txn_idintegerNOTNULL , txn_date datetime NOTNULL , account_id integer NOTNULL , txn_type_od varchar(10) NOT NULL , amount double(10,2) NULL, emp_id smallint NOTNULL , branch_id smallintNOTNULL , funds_avail date NOT NULL ); ----------------------- -- Create Employee table ----------------------- CREATE TABLE Employee ( emp_id smallint NOTNULL , fname varchar(20) NOT NULL , lname varchar(20) NOT NULL , s_date date NOT NULL , e_date date NOT NULL , superior_emp_id smallint NOTNULL , dept_id smallint NOTNULL , tit varchar(20) NULL, branch_idsmallintNOTNULL
  • 7.
    ); ----------------------- -- Create Branchtable ----------------------- CREATE TABLE Branch ( branch_id smallintNOTNULL, branch_name varchar(20) NOT NULL , branch_addresschar(30) NULL , branch_city char(20) NULL , branch_state varchar(20) NULL , branch_zip char(12) NULL , ); ---------------------- -- Define primary keys ---------------------- ALTER TABLE CustomerWITHNOCHECKADD CONSTRAINTPK_CustomerPRIMARYKEYCLUSTERED (custom_id); ALTER TABLE Branch WITH NOCHECKADD CONSTRAINTPK_BranchPRIMARYKEY CLUSTERED (branch_id); ALTER TABLE Product_type WITHNOCHECKADD CONSTRAINTPK_Product_type PRIMARYKEY CLUSTERED (product_type_id); ALTER TABLE ProductWITH NOCHECKADD CONSTRAINTPK_ProductPRIMARYKEY CLUSTERED (product_id); ALTER TABLE AccountWITH NOCHECKADD CONSTRAINTPK_AccountPRIMARYKEY CLUSTERED (account_id);
  • 8.
    ALTER TABLE OfficerWITHNOCHECKADDCONSTRAINTPK_OfficerPRIMARYKEYCLUSTERED (officer_id); ALTER TABLE BusinessWITHNOCHECKADDCONSTRAINTPK_BusinessPRIMARYKEYCLUSTERED (busi_id); ALTER TABLE Individual WITHNOCHECKADDCONSTRAINTPK_Individual PRIMARYKEYCLUSTERED (individual_id); ALTER TABLE Employee WITHNOCHECKADDCONSTRAINTPK_Employee PRIMARYKEYCLUSTERED (emp_id); ALTER TABLE TransactionsWITH NOCHECKADD CONSTRAINTPK_TransactionsPRIMARYKEY CLUSTERED (txn_id); ALTER TABLE DeparmentsWITHNOCHECKADD CONSTRAINTPK_DepartmentsPRIMARYKEY CLUSTERED (dept_id); ---------------------- -- Define foreignkeys ---------------------- ALTER TABLE ProductADD CONSTRAINTFK_Product_ProductType FOREIGN KEY(product_type_id) REFERENCESProductType (product_type_id); ALTER TABLE AccountADD CONSTRAINTFK_Account_ProductFOREIGN KEY(product_id) REFERENCESProduct(product_id), CONSTRAINTFK_Account_CustomerFOREIGN KEY(custom_id) REFERENCESCustomer (custom_id), CONSTRAINTFK_Account_Branch FOREIGN KEY (branch_id) REFERENCESBranch(branch_id), CONSTRAINTFK_Account_EmployeeFOREIGN KEY(emp_id) REFERENCESEmployee (emp_id); ALTER TABLE BusinessADD CONSTRAINTFK_Business_CustomerFOREIGN KEY(custom_id) REFERENCESCustomer (custom_id); ALTER TABLE Individual ADD
  • 9.
    CONSTRAINTFK_Individual_CustomerFOREIGN KEY(custom_id) REFERENCESCustomer (custom_id); ALTERTABLE OfficerADD CONSTRAINTFK_Officer_CustomerFOREIGN KEY(custom_id) REFERENCESCustomer(custom_id); ALTER TABLE TransactionsADD CONSTRAINTFK_Transactions_AccountFOREIGN KEY(account_id) REFERENCESAccount (account_id), CONSTRAINTFK_Transactions_Employee FOREIGN KEY(emp_id) REFERENCESEmployee (emp_id), CONSTRAINTFK_Transactions_BranchFOREIGN KEY(branch_id) REFERENCESBranch (branch_id); ALTER TABLE Employee ADD CONSTRAINTFK_Employee_DepartmentsFOREIGN KEY(dept_id) REFERENCESDeparments (dept_id), CONSTRAINTFK_Employee_EmployeeFOREIGN KEY(superior_emp_id) REFERENCESEmployee (superior_emp_id), CONSTRAINTFK_Employee_BranchFOREIGN KEY(branch_id) REFERENCESBranch(branch_id); ---TRANSACTIONS--- INSERT INTOTransactions (txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail) VALUES(00001,'2005-02-22',101,'CDT','1000.00',1,901,'2005-02-22') INSERT INTO Transactions(txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail) VALUES(00002,'2005-02-23',102,'CDT','525.75',2,902,'2005-02-23') INSERT INTOTransactions (txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail) VALUES(00003,'2005-02-24',103,'DBT','100.00',3,903,'2005-02-24') INSERT INTOTransactions (txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail) VALUES(00004,'2005-02-24',104,'CDT','55',4,904,'2005-02-25')
  • 10.
    INSERT INTOTransactions (txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail) VALUES(00005,'2005-02-25',105,'DBT','50',5,905,'2005-02-26') INSERT INTOTransactions (txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail) VALUES(00007,'2005-02-25',107,'CDT','125.37',6,906,'2005-02-27') INSERTINTOTransactions (txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail) VALUES(00008,'2005-02-26',108,'DBT','10',7,907,'2005-02-28') INSERT INTOTransactions (txn_id,txn_date,account_id,txn_type_od,amount,emp_id,branch_id,funds_avail) VALUES(00009,'2005-02-27',109,'CDT','75',8,908,'2005-02-29') ----ACCOUNT----- INSERT INTO Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra nch_id,emp_id,avail_balance,pending_balance) VALUES(101,20001,0001,'2005-02-22','2005-03-02','2005-05-11','active',901,1,'1000.00','200') INSERT INTO Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra nch_id,emp_id,avail_balance,pending_balance) VALUES(102,20002,0002,'2005-02-23','2005-03-03','2005-05-12','active',902,2,'1000.00','200') INSERT INTO Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra nch_id,emp_id,avail_balance,pending_balance) VALUES(103,20003,0003,'2005-02-24','2005-03-04','2005-05-13','active',903,3,'1000.00','200') INSERT INTO Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra nch_id,emp_id,avail_balance,pending_balance)
  • 11.
    VALUES(104,20004,0004,'2005-02-25','2005-03-05','2005-05-14','active',904,4,'1000.00','200') INSERT INTO Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra nch_id,emp_id,avail_balance,pending_balance) VALUES(105,20005,0005,'2005-02-26','2005-03-06','2005-05-15','inactive',905,5,'1000.00','200') INSERT INTO Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra nch_id,emp_id,avail_balance,pending_balance) VALUES(107,20006,0006,'2005-02-27','2005-04-07','2005-05-15','inactive',906,6,'1000.00','200') INSERTINTO Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra nch_id,emp_id,avail_balance,pending_balance) VALUES(108,20007,0007,'2005-02-28','2005-04-08','2005-05-16','inactive',907,7,'1000.00','200') INSERT INTO Account(account_id,product_id,custom_id,open_date,close_date,last_activity,account_status,bra nch_id,emp_id,avail_balance,pending_balance) VALUES(109,20009,0008,'2005-02-29','2005-04-09','2005-05-17','inactive',908,8,'1000.00','200') ----EMPLOYEE------- INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(1,'Michael','Smith','2005-04-03','2008-04-03',801,501,'informatica',901) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(2, 'Susan','Barker','2005-04-03','2008-04-03',802,502,'gerente',902) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(3,'Robert','Tyler','2005-04-03','2008-04-03',803,503,'contador',903) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id)
  • 12.
    VALUES(4,'Susan','Hawthorne','2005-04-03','2008-04-03',805,504,'gerente',904) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(5,'John','Gooding','2005-04-03','2008-04-03',805,505,'acesor',905) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(6,'Helen','Fleming','2005-04-03','2008-04-03',806,506,'acesorde tramites',906) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(7,'Chris','Tucker','2005-04-03','2008-04-03',807,507,'operador',907) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(8,'Sarah','Parker','2005-04-03','2008-04-03',808,508,'cajero',908) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(9,'Jane','Grossman','2005-04-03','2008-04-03',809,509,'ejecutivo',909) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(10, 'Paula','Roberts','2005-04-03','2008-04-03',810,510,'abogado',910) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(11, 'Thomas','Ziegler','2005-04-03','2008-04-03',811,511,'policia',911) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(12, 'Samantha','Jameson','2005-04-03','2008-04-03',812,512,'intendente',913) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(13, 'John','Blake','2005-04-03','2008-04-03',813,513,'ejecutivo',914)
  • 13.
    INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(14, 'Cindy','Mason','2005-04-03','2008-04-03',814,514,'diseñador',915) INSERTINTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(15, 'Frank','Portmant','2005-04-03','2008-04-03',815,515,'abogado',915) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(16, 'Theresa','Markham','2005-04-03','2008-04-03',816,516,'acesor',916) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(17, 'Beth','Fowler','2005-04-03','2008-04-03',817,517,'ejecutivo',917) INSERT INTOEmployee(emp_id,fname,lname,s_date,e_date,superior_emp_id, dept_id,tit,branch_id) VALUES(18, 'Rick','Tulman','2005-04-03','2008-04-03',818,518,'cobrador',918) ----PRODUCTYPE------- INSERT INTOProductType( product_type_id,product_type_name) VALUES(601,'credito') INSERT INTOProductType( product_type_id,product_type_name) VALUES(602,'debito') INSERT INTOProductType( product_type_id,product_type_name) VALUES(603,'platino') INSERT INTOProductType( product_type_id,product_type_name) VALUES(604,'dorada') INSERT INTOProductType( product_type_id,product_type_name) VALUES(605,'empresarial')
  • 14.
    INSERT INTOProductType( product_type_id,product_type_name) VALUES(606,'preferente') INSERTINTOProductType( product_type_id,product_type_name) VALUES(607,'credito') INSERT INTOProductType( product_type_id,product_type_name) VALUES(608,'debito') INSERT INTOProductType( product_type_id,product_type_name) VALUES(609,'platino') INSERT INTOProductType( product_type_id,product_type_name) VALUES(610,'preferente') INSERT INTOProductType( product_type_id,product_type_name) VALUES(611,'empresarial') INSERT INTOProductType( product_type_id,product_type_name) VALUES(612,'dorada') INSERT INTOProductType( product_type_id,product_type_name) VALUES(613,'credito') INSERT INTOProductType( product_type_id,product_type_name) VALUES(614,'debito') INSERT INTOProductType( product_type_id,product_type_name) VALUES(615,'empresarial') INSERT INTOProductType( product_type_id,product_type_name) VALUES(616,'platino') INSERT INTOProductType( product_type_id,product_type_name) VALUES(617,'dorada') INSERT INTOProductType( product_type_id,product_type_name) VALUES(618,'credito')
  • 15.
    ------PRODUCT---------- INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20001,'tarjeta',601,'2005-01-28','2006-01-05') INSERTINTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20002,'tarjeta',602,'2005-02-28','2006-02-06') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20003,'tarjeta',603,'2005-03-28','2006-03-07') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20004,'tarjeta',604,'2005-04-28','2006-04-11') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20005,'tarjeta',605,'2005-05-28','2006-05-30') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20006,'tarjeta',606,'2005-06-28','2006-06-24') INSERT INTOProduct( product_id,product_name, product_type_id,date_offered,date_retired) VALUES(20007,'tarjeta',607,'2005-07-28','2006-07-28') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20008,'tarjeta',608,'2005-08-28','2006-08-14') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20009,'tarjeta',609,'2005-09-28','2006-09-16') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20010,'tarjeta',610,'2005-10-28','2006-10-15') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20011,'tarjeta',611,'2005-11-28','2006-11-13') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired)
  • 16.
    VALUES(20012,'tarjeta',612,'2005-12-28','2006-12-29') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20013,'tarjeta',613,'2005-01-28','2006-02-28') INSERTINTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20014,'tarjeta',614,'2005-02-28','2006-03-31') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20015,'tarjeta',615,'2005-03-28','2006-04-19') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20016,'tarjeta',616,'2005-04-28','2006-05-02') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20017,'tarjeta',617,'2005-05-28','2006-06-08') INSERT INTOProduct( product_id,product_name,product_type_id,date_offered,date_retired) VALUES(20018,'tarjeta',618,'2005-06-28','2006-07-12') --------BRANCH-------- INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(901,'diazmiron','diazmiron#655','veracruz','veracruz','91700') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(902,'independencia','independencia #273','veracruz','veracruz','91710' ) INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(903,'ruizcortinez','ruizcortinez#949','veracruz','veracruz','91720') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip)
  • 17.
    VALUES(904,'2 de abril','2de abril #399','veracruz','veracruz','91730') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(905,'20 de noviembre','diazmiron#8838','veracruz','veracruz','91740') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(906,'bolivar','bolivar#427','veracruz','veracruz','91750') INSERT INTOBranch( branch_id,branch_name, branch_address, branch_city,branch_state,branch_zip) VALUES(907,'reforma','reforma#345','veracruz','veracruz','91760') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(908,'juanpabloII','juanpablo II #8060','veracruz','veracruz','91770') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(909,'costa verde','costaverde #6780','veracruz','veracruz','91780') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(910,'costa de oro','costa de oro #523','veracruz','veracruz','91790') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(911,'cuauhtemoc','cuauhtemoc#499','veracruz','veracruz','91800') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(912,'miguel aleman','miguel aleman#324','veracruz','veracruz','91810') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(913,'circunvalacion','circunvalacion#7011','veracruz','veracruz','91820')
  • 18.
    INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(914,'lafragua','lafragua#6030','veracruz','veracruz','91830') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(915,'marti','marti #7030','veracruz','veracruz','91840') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(916,'americas','americas#1110','veracruz','veracruz','91850') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(917,'5 de mayo','5 de mayo #220','veracruz','veracruz','91860') INSERT INTOBranch( branch_id,branch_name,branch_address, branch_city,branch_state,branch_zip) VALUES(918,'hidalgo','hidalgo#330','veracruz','veracruz','91870') ----CUSTOMER----- INSERT INTOCustomer(custom_id, custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip) VALUES('0001', 'ep','00012341', 'reforma#145', 'mexico','veracruz','95400'); INSERT INTOCustomer(custom_id, custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip) VALUES('0002', 'pl','00012342', 'carpio #43', 'mexico','guadalajara','94670'); INSERT INTOCustomer(custom_id, custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip) VALUES('0003','pr', '00012343', 'libertad#1136', 'mexico','xalapa', '45678'); INSERT INTOCustomer(custom_id, custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip)
  • 19.
    VALUES('0004', 'hm', '00012344','campo real #717', 'mexico','monterrey','45678'); INSERT INTOCustomer(custom_id, custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip) VALUES('0005', 'pl','00012345', 'ruiz cortinez#67', 'mexico','veracruz','95400'); INSERT INTOCustomer(custom_id, custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip) VALUES('0006', 'ep','00012346', 'diaz miron#654', 'mexico','veracruz','95400'); INSERT INTOCustomer(custom_id, custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip) VALUES('0007', 'hm', '00012347', '2 de abril #245', 'mexico','yucatan','45673'); INSERT INTOCustomer(custom_id, custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip) VALUES('0008', 'pr', '00012348', '20 de noviembre #1678', 'mexico','guanajuato','56433'); INSERT INTOCustomer(custom_id, custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip) VALUES('0009', 'pl','00012349', 'murillovidal #25', 'mexico','veracruz','95400'); INSERT INTOCustomer(custom_id, custom_type,fed_id,custom_address,custom_city,custom_state,custom_zip) VALUES('0010', 'ep','00012351', 'arriola molina#456', 'mexico','xalapa','45678'); ------OFFICER------- INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date) VALUES('1000', '0001', 'roberto','meguelle','2010/08/03', '2010/12/31'); INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date) VALUES('2000', '0002', 'juan carlos','vidal','1990/10/23', '1995/05/29'); INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date) VALUES('3000', '0003', 'fernando','guzman','2010/01/03', '2010/08/16'); INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date)
  • 20.
    VALUES('4000', '0004', 'enrique','rodriguez','2010/05/07','2010/07/12'); INSERT INTOOfficer(officer_id, custom_id,first_name,last_name,starts_date,end_date) VALUES('5000', '0005', 'jose','mimendi','2010/02/14', '2010/03/19'); INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date) VALUES('6000', '0006', 'ivan','nicanor', '2000/09/12', '2003/12/17'); INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date) VALUES('7000', '0007', 'jonathan','nieto','2008/05/18', '2010/11/22'); INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date) VALUES('8000', '0008', 'julian','hernandez','2003/10/16', '2005/09/11'); INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date) VALUES('9000', '0009', 'arturo', 'lopez','2010/01/03', '2010/12/31'); INSERT INTOOfficer(officer_id,custom_id,first_name,last_name,starts_date,end_date) VALUES('1100', '0010', 'noe','avila','2007/07/25', '2010/11/20'); ----------BUSINESS-------- INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date) VALUES('123451', '0001', 'tramite tarjeta','ver','2010/09/10'); INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date) VALUES('123452', '0002', 'asesoriabancaria','gdl', '2003/06/19'); INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date) VALUES('123453', '0003', 'cuentacheques','xlp','2001/01/22'); INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date) VALUES('123454', '0004', 'tramite tarjeta','mty', '2006/01/11'); INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date) VALUES('123455', '0005', 'cancelacion','ver','2006/04/24'); INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date)
  • 21.
    VALUES('123456', '0006', 'deposito','ver','2010/06/15'); INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date) VALUES('123457', '0007', 'retiroenefectivo','mex','2009/10/24'); INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date) VALUES('123458', '0008', 'tramite de tarjeta','ver', '2008/07/09'); INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date) VALUES('123459', '0009', 'deposito','gdl','2010/08/08'); INSERT INTOBusiness(busi_id,custom_id,busi_name,id_state,incorp_date) VALUES('123461', '0010', 'cuentacheques','mex','2000/09/10'); ------------INDIVIDUAL----------- INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date) VALUES('10131', '0001', 'monica','lorenzo','1984/09/11'); INSERT INTOIndividual(individual_id,custom_id,f_name, l_name,birth_date) VALUES('10132', '0002', 'mariana','camara', '1986/11/23'); INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date) VALUES('10133', '0003', 'victor','vidal','1990/03/15'); INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date) VALUES('10134', '0004', 'manuel','hernandez','1970/07/17'); INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date) VALUES('10135', '0005', 'gonzalo','nicanor','1978/01/05'); INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date) VALUES('10136', '0006', 'daniel','limon','1976/02/14'); INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date) VALUES('10137', '0007', 'lorena','perez','1979/11/11'); INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date)
  • 22.
    VALUES('10138', '0008', 'zamara','moreno','1984/03/22'); INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date) VALUES('10139', '0009', 'saul','zamorano','1989/12/01'); INSERT INTOIndividual(individual_id,custom_id,f_name,l_name,birth_date) VALUES('10140', '0010', 'johnny','granda','1978/07/01');