Sie sind auf Seite 1von 4

Create the following customer table using data_constraints

COLUMN NAME DATA TYPE SIZE CONSTRAINTS


cust_name Varchar2 10 Primary key
cust_street Varchar2 10 Not null
cust_city Varchar2 10 Not null

Queory:
Create table customer (cust_name varchar2(10) constraint customer_custname primary
key,custstreet varchar2(10) constraint customer_custstreet not null,custcity varchar2(10)
constraint customer custcity not null);

Create the following branch table using data_constraints

COLUMN NAME DATA TYPE SIZE CONSTRAINTS


Branch_name Varchar2 10 Primary key
branch_city Varchar2 10 Not null
assets Number 10 Assets value > 100000

QUEORY:
Create table branch (branchname varchar2(10) constraint branch _branchname primary
key ,assets number(10) constraint branch_assets assetsvalue>100000);

Create the following account table using data_constraints

COLUMN NAME DATA TYPE SIZE CONSTRAINTS


acc_no Varchar2 10 Primary key / First letter
must start with ‘A’
branch_name Varchar2 10 Foreign key references
branch table
balance Number 10 Not null

QUEORY:
Create table acounts (acc_no varchar2(10) constraint

Create the following loan table using data_constraints

COLUMN NAME DATA TYPE SIZE CONSTRAINTS


loan_no Varchar2 10 Primary key / first letter
must start with ‘L’
branch_name Varchar2 10 Foreign key references
branch table
amount Number 10 Not null

Create the following depositor table using data_constraints

COLUMN NAME DATA TYPE SIZE CONSTRAINTS


cust_name Varchar2 10 Foreign key references
customer table
acc_no Varchar2 10 Foreign key references
account table

Create the following borrower table using data_constraints

COLUMN NAME DATA TYPE SIZE CONSTRAINTS


cust_name Varchar2 10 Foreign key references
customer table
loan_no Varchar2 10 Foreign key references
loan table

1. Customer Table

Cust_name Cust_street Cust_city


Jones Main Harrison
Smith North Rye
Hays Main Harrison
Curry North Rye
Lindsay Park Pittsfield
Turner Putnam Stamford
Williams Nassau Princeton
Adams Spring Pittsfield
Johnson Alma Palo Alto
Glenn Sand Hill Woodside
Brooks Senator Brooklyn
Green Walnut Stamford

2.Branch Table

Branch_name Branch_city Assets


Down town Brooklyn 9000000
Redwood Palo Alto 2100000
Perryridge Horseneck 1700000
Mianus Horseneck 400000
Round Hill Horseneck 8000000
Pownal Bennington 300000
North town Rye 3700000
Brighton Brooklyn 7100000

3.Account Table

Acc_no Branch_name Balance


A-101 Down town 500
A-215 Mianus 700
A-102 Perryridge 400
A-305 Round Hill 350
A-201 Brighton 900
A-222 Redwood 700
A-217 Brighton 750

4.Loan Table

Loan_no Branch_name Amount


L-17 Down town 1000
L-23 Redwood 2000
L-15 Perryridge 1500
L-14 Down town 1500
L-93 Mianus 500
L-11 Round Hill 900
L-16 Perryridge 1300

5.Depositor table

Cust_name Acc_no
Johnson A-101
Smith A-215
Hayes A-102 6.Borrower table
Turner A-305
Johnson A-201 Cust_name Loan_no
Jones A-217 Jones L-17
Lindsay A-222 Smith L-23
Hayes L-15
Jackson L-14
Curry L-93
Smith L-11
Williams L-17
Adams L-16

Das könnte Ihnen auch gefallen