-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitData.sql
More file actions
118 lines (94 loc) · 4.13 KB
/
Copy pathinitData.sql
File metadata and controls
118 lines (94 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
drop table account;
drop table borrower;
drop table branch;
drop table customer;
drop table depositor;
drop table employee;
drop table loan;
create table if not exists account
(account_number char(5) not null primary key, branch_name varchar(10),
balance double
);
create table if not exists branch
(
branch_name varchar(10) not null primary key, branch_city varchar(10),
assets double
);
create table if not exists customer
(
customer_name varchar(20) not null primary key, customer_street varchar(20),
customer_city varchar(10) );
create table if not exists loan
(
loan_number varchar(5) not null primary key, branch_name varchar(10),
amount double
);
create table if not exists borrower
(
customer_name varchar(20) not null, loan_number varchar(5) not null,
primary key(customer_name, loan_number) );
create table if not exists depositor
(
customer_name varchar(20) not null, account_number char(5) not null,
primary key(customer_name, account_number) );
create table if not exists employee
(employee_name varchar(20) not null, branch_name varchar(10) not null,
salary double,
primary key(employee_name,branch_name) );
insert into account values('A-101', 'Downtown', 500);
insert into account values('A-102', 'Perryridge', 400);
insert into account values('A-201', 'Brighton', 900);
insert into account values('A-215', 'Mianus',700);
insert into account values('A-217', 'Brighton', 750);
insert into account values('A-222', 'Redwood', 700);
insert into account values('A-305', 'Round Hill', 350);
insert into branch values('Brighton', 'Brooklyn',7100000);
insert into branch values('Downtown','Brooklyn', 9000000);
insert into branch values('Mianus','Horseneck',400000);
insert into branch values('North Town', 'Rye', 3700000);
insert into branch values('Perryridge', 'Horseneck', 1700000);
insert into branch values('Pownal', 'Bennington', 300000);
insert into branch values('Redwood', 'Palo Alto', 2100000);
insert into branch values('Round Hill', 'Horseneck',8000000);
insert into customer values('Adams','Spring','Pittsfield');
insert into customer values('Brooks','Senator','Brooklyn');
insert into customer values('Curry','North', 'Rye');
insert into customer values('Glenn','Sand Hill', 'Woodside');
insert into customer values('Green','Walnut','Stamford');
insert into customer values('Hayes', 'Main', 'Harrison');
insert into customer values('Johnson','Alma','Palo Alto');
insert into customer values('Jones','Main','Harrison');
insert into customer values('Lindsay', 'Park', 'Pittsfield');
insert into customer values('Smith', 'North', 'Rye');
insert into customer values('Turner', 'Putnam', 'Stamford');
insert into customer values('Williams', 'Nassau', 'Princeton');
insert into depositor values('Hayes', 'A-102');
insert into depositor values('Johnson', 'A-102');
insert into depositor values('Johnson', 'A-201');
insert into depositor values('Jones', 'A-217');
insert into depositor values('Lindsay', 'A-222');
insert into depositor values('Smith', 'A-215');
insert into depositor values('Turner', 'A-305');
insert into loan values('L-11', 'Round Hill', 900);
insert into loan values('L-14', 'Downtown', 1500);
insert into loan values('L-15', 'Perryridge', 1500 );
insert into loan values('L-16', 'Perryridge', 1300 );
insert into loan values('L-17', 'Downtown', 1000);
insert into loan values('L-23', 'Redwood', 2000);
insert into loan values('l-93', 'Mianus',500);
insert into borrower values('Adams', 'L-16');
insert into borrower values('Curry', 'L-93');
insert into borrower values('Hayes', 'L-15');
insert into borrower values('Jackson','L-14');
insert into borrower values('Jones','L-17');
insert into borrower values('Smith','L-11');
insert into borrower values('Smith','L-23');
insert into borrower values('Williams', 'L-17');
insert into employee values('Adams','Perryridge', 1500);
insert into employee values('Brown','Perryridge', 1300);
insert into employee values('Gopal','Perryridge', 5300);
insert into employee values('Johnson','Downtown', 1500);
insert into employee values('Loreena','Downtown', 1300);
insert into employee values('Peterson', 'Downtown', 2500);
insert into employee values('Rao', 'Austin', 1500);
insert into employee values('Sato', 'Austin', 1600);