0% found this document useful (0 votes)
764 views

Database Management System Practical

The document describes several SQL queries run against database tables containing customer, trade, security, and price data. The queries display customer information, trade details including IDs, symbols, customer IDs and quantities, company names and symbols, and unique trade ticker symbols. The size of the price field is also altered in the trade table.

Uploaded by

Kartik Mistry
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
764 views

Database Management System Practical

The document describes several SQL queries run against database tables containing customer, trade, security, and price data. The queries display customer information, trade details including IDs, symbols, customer IDs and quantities, company names and symbols, and unique trade ticker symbols. The size of the price field is also altered in the trade table.

Uploaded by

Kartik Mistry
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

PRACTICAL : 03

1.Display all Customer information.


SQL> select * from customer ;
CUSID
---------10111
10112
10113
10114
10115
10116
10117
10118

CUSTOMER_NAME
S
-----------------------------charles_schwab
datek
dlj direct
e_trade
fidelity.com
JB_oxford&company
merrill_lynch_direct
wingspan_bank

P
R
R
P
R
R
P
R

2. Display Trades id, name, Customer id and


quantity information
SQL> select trade_id, ticker_symbol, cuid, quantity from trade;
TRADE_ID
-------------13
12
11
10
9
8
7
6
5
4
3
2
1

TICKE
---------aol
msft
orcl
f
ba
sne
sne
orcl
msft
aol
orcl
f
aol

CUID
QUANTITY
----------------------10111
9000
10112
2000
10115
500
10115
6000
10111
10000
10112
7000
10115
30
10115
1100
10113
7600
10117
1400
10111
8000
10112
3000
10117
12000

3. Display Company name and ticker symbol


from security table.
SQL> select company_name, ticker_symbol from security;
COMPANY_NAME
-------------------------america_online
micro_corpo
compaq
apple_compu
oracle_corpo
ford_motor
wal_mart
boeing_co
sony_cp
abc_corpo

TICKER_SYMBOL
------------------------aol
msft
cpq
aapl
orcl
f
wmt
ba
sne
abc

4. Change size of price field 8,2 in trade


relation.
SQL> alter table trade modify (price number (8, 2));
SQL> select * from trade;
TRADE_ID TICKE
CUID POS QUANTITY PRICE_SHARE B
--------------- --------- ------- ------ ---------------------------13
aol
10111 p01
9000
17.45
157050
12
msft
10112 p01
2000
60.11
120220
11
orcl
10115 p99
500
7.77
3885
10
f
10115 p12
6000
23.22
139320
9
ba
10111 p44
10000
42.53
425300

PRICE
--B
B
S
B
S

sne

10112 p01

7000

51.23

sne

10115 p76

30

52.17

orcl

10115 p56

1100

8.5

msft

10113 p18

7600

55.25

aol

10117 p67

1400

16.01

358610
1565.1
9350
419900
22414
3

orcl

10111 p12

8000

8.57

10112 p01

3000

15.89

aol

10117 p01

12000

15.85

68560
47670
190200

5. Display unique ticker symbol from Trade


relation.
SQL> select distinct ticker_symbol from trade;
TICKER_SYMBOL
--------aol
ba
f
msft
orcl
sne

You might also like