Saturday 10 June 2017

DBMS Tutorial-1

  1. CREATE TABLE DEPOSIT (ACTNO VARCHAR2(5),CNAME VARCHAR2(18),BNAME VARCHAR2(18),AMOUNT NUMBER(8,2),ADATE DATE);

    • INSERT INTO DEPOSIT VALUES('&ACTNO','&CNAME','&BNAME','&AMOUNT','&ADATE');
  2. CREATE TABLE BRANCH(BNAME VARCHAR2(18),CITY VARCHAR2(18));

    • INSERT INTO BRANCH VALUES('&BNAME','&CITY');
  3. CREATE TABLE CUSTOMERS(CNAME VARCHAR2(19) ,CITY VARCHAR2(18));

    • INSERT INTO CUSTOMERS VALUES('&CNAME','&CITY');
  4. CREATE TABLE BORROW(LOANNO VARCHAR2(5), CNAME VARCHAR2(18), BNAME VARCHAR2(18), AMOUNT NUMBER (8,2));

    • INSERT INTO BORROW VALUES('&LOANNO','&CNAME','&BNAME','&AMOUNT');

Queries

  1. Describe deposit, branch.

    • desc deposit;
    • desc branch;
  2. Describe borrow, customers.

    • desc borrow;
    • desc customers;
  3. List all data from table DEPOSIT.

    • select * from deposit;
  4. List all data from table BORROW.

    • select * from borrow;
  5. List all data from table CUSTOMERS.

    • select * from customers;
  6. List all data from table BRANCH.

    • select * from branch;
  7. Give account no and amount of depositors.

    • select accno,amount from deposit;
  8. Give name of depositors having amount greater than 4000.

    • select cname from deposit where amount>4000;
  9. Give name of customers who opened account after date '1-12-96'

    • select cname from deposit where adate>'1-12-96';
Share:

0 comments:

Post a Comment