Dbms Program 11 Mdu
Dbms Program 11 Mdu
PROGRAM NO. 11
Objective: - . For the data base stock exchange create a new table name share having following fields 1. Customer name of character type 2. Address of varchar type (primary key) 3. Amount deposit of integer type 4. Shares of character type 5. sale _ up of float type 6. sale_down of float type and use the following Arithmetic operations As: 1. Abs operation. 2. Ceil function. 3. Floor function. 4. Mod function 5. Power function. 6. Sqrt function. SQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 5 15:21:32 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options SQL> select * from share_cse10409;
CUSTOMER_N ---------Atul anuj yash dheeraj mayank ADDRESS AMOUNT_DEP SHARE SALE_UP SALE_DOWN -------- ---------- ----- ---------- ---------abcd454 600 maruti 1.6 3.5 23hsad 36000 tata 1.3 2.1 adsa12 30000 re l i ance 2.1 2.3 h435 45000 ndpl - 1.1 2.4 r35 4500 t i kona - 3.2 4.1
1. Abs operation SQL> select abs(sale_up) from share_cse10409; ABS(SALE_UP) -----------1.6 1.3 2.1 1.1 3.2
SBIT/CSE/IV/DBMS/CSE-212-F CSE/10/409
2. Ceil function. SQL> select ceil(sale_up) from share_cse10409; CEIL(SALE_UP) ------------2 2 3 -1 -3 3.Floor function. SQL> select floor(sale_down) from share_cse10409; FLOOR(SALE_DOWN) ---------------3 2 2 2 4 4. Mod function SQL> select mod(sale_up,sale_down) from share_cse10409; MOD(SALE_UP,SALE_DOWN) ---------------------1.6 1.3 2.1 -1.1 -3.2 5. Power function. SQL> select power(sale_up,2) from share_cse10409; POWER(SALE_UP,2) ---------------2.56 1.69 4.41 1.21 10.24
SBIT/CSE/IV/DBMS/CSE-212-F
CSE/10/409
6. Sqrt function. SQL> select sqrt(sale_down) from share_cse10409; SQRT(SALE_DOWN) --------------1.87082869 1.44913767 1.51657509 1.54919334 2.02484567 SQL>
SBIT/CSE/IV/DBMS/CSE-212-F
CSE/10/409