0% found this document useful (0 votes)
7 views3 pages

Assignment 2(DBT)

The document outlines the creation of several database tables including NEWDEPOSIT, NEWACCOUNT, NEWBRANCH, and NEWCUSTOMER, along with their structures and sample data. It also includes a series of SQL queries for modifying the NEWACCOUNT table, removing customers from Yangon, altering the NEWCUSTOMER table, renaming the NEWBRANCH table, and deleting and recovering the NEWDEPOSIT table. The document serves as a guide for database management and manipulation tasks.

Uploaded by

Noko Hana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Assignment 2(DBT)

The document outlines the creation of several database tables including NEWDEPOSIT, NEWACCOUNT, NEWBRANCH, and NEWCUSTOMER, along with their structures and sample data. It also includes a series of SQL queries for modifying the NEWACCOUNT table, removing customers from Yangon, altering the NEWCUSTOMER table, renaming the NEWBRANCH table, and deleting and recovering the NEWDEPOSIT table. The document serves as a guide for database management and manipulation tasks.

Uploaded by

Noko Hana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment 2

1.Create the following tables with the given structures and insert sample data as specified: -

NEWDEPOSIT

dno varchar2(5)

acno varchar2(5)

amount number(8,2)

ddate date

NEWACCOUNT

acno varchar2(5)

cno varchar2(5)

bno varchar(5)

opdate date

balance number(10,2)

NEWBRANCH

bno varchar(5)

bname varchar2 (20)

location varchar2(20)

NEWCUSTOMER

cno varchar2(5)

cname varchar2(20)

city varchar2(20)

NEWDEPOSIT
DNO ACNO AMOUNT DDATE
1001 2001 100000 29-NOV-15
1002 2005 150000 30-NOV-15
1003 2002 130000 30-NOV-15
1004 2007 30000 01-DEC-15
1005 2003 50000 03-DEC-15
1006 2006 60000 09-DEC-15
1007 2004 70000 10-DEC-15

NEWACCOUNT
ACNO CNO BNO OPDATE
2001 4002 3011 23-NOV-13
2002 4003 3031 08-AUG-13
2003 4006 3033 30-NOV-14
2004 4005 3032 01-DEC-14
2005 4001 3021 14-AUG-15
2006 4004 3034 19-AUG-15
2007 4007 3012 10-DEC-15

NEWBRANCH
BNO BNAME LOCATION
3011 Yadanarpone Mandalay
3012 Kyaukse Mandalay
3021 Maymyo PyinooLwin
3031 Hlaingtharyar Yangon
3032 Thanlwin Yangon
3033 Sourth Dagon Yangon
3034 Yankin Yangon

NEWCUSTOMER
CNO CNAME CITY
4001 Thiha Yangon
4002 Ye Aung Mandalay
4003 Shwe Sin Pyinoolwin
4004 Cho Zin Yangon
4005 May Zaw Pyinoolwin
4006 Zarchi Yangon
4007 Naytoe Mandalay

(2)Write the following queries that are used by above tables.

1. Modify newaccount table by adding the values specified as follows to named “Balance” with
related ACNO.

ACNO BALANCE
2001 300000
2002 400000
2003 250000
2004 100000
2005 150000
2006 210000
2007 70000

2. Remove the newcustomer who lives in Yangon.

3. Modify the cname column from newcustomer table which can accept up to 30 total characters.

4. Add dob (date type) column to newcustomers table. Then insert appropriate date of birth for
all customers.

5. Rename table newbranch to branh_info.

6. Delete newdeposit table . And then recover it again.

You might also like