Create Alter Rename Drop
Create Alter Rename Drop
Create Alter Rename Drop
No : 1
Date :
Aim:
To implement and execute a query for defining data items in a Oracle
database using Structured Query Language commands.
DDL Commands:
Create
Alter
Rename
Drop
Syntax:
Create
Create table <tablename> (columnname1 datatype1, columnname2
datatype2,…, columnnameN datatypeN);
Alter
- Add
- Modify
- Drop
Alter table <tablename> add (columnname1 datatype1,..);
Alter table <tablename> modify (columnname1 datatype1,..);
Alter table <tablename> drop column (columnname);
Rename
Rename <tablename> to <newtablename>;
Drop
Drop table <tablename>;
CREATE AND DESCRIBE THE FOLLOWING TABLES:
A) NAME: branch
FIELDS DATATYPE
branch_name varchar2(30) primary key
branch_city varchar2(30)
assets number(8,2)
B) NAME: account
FIELDS DATATYPE
account_no varchar2(11) primary key
branch_name varchar2(30) references branch(branch_name)
balance number(8)
C) NAME: customer
FIELD DATATYPE
customer_id varchar2(11) primary key
customer_name varchar2(20)
customer_street varchar2(15)
customer_city varchar2(15)
D) NAME: depositor
FIELD DATATYPE
customer_id varchar2(11)references customer (customer_id)
account_no varchar2(11)references account (account_no)
E) NAME: loan
FIELDS DATATYPE
loan_no varchar2(4) primary key
branch_name varchar2(30) references branch(branch_name)
amount number(8,2)
F) NAME: borrower
FIELDS DATATYPE
customer_id varchar2(11) references customer(customer_id)
loan_no varcahr2(4) references loan(loan_no)
2) account :
3) loan :
CUSTOMER_ID ACCOUNT_NO
c_08 182_73_6091
c_03 192_83_7465
c_05 321_12_3123
c_07 336_66_9999
c_08 963_96_3963
c_02 376_66_9999
5) customer
6) borrower
CUSTOMER_ID LOAN_NO
c_01 1_11
c_01 1_23
c_03 1_93
c_05 1_17
c_03 1_16
c_05 1_14
CREATE THE FOLLOWING TABLES:
A)NAME: branch
FIELDS DATATYPE
branch_name varchar2(30) primary key
branch_city varchar2(30)
assets number(8,2)
B)NAME:account
FIELDS DATATYPE
account_no varchar2(11) primary key
branch_name varchar2(30) references branchz(branch_name)
balance number(8)
SQL> create table accountz(account_no varchar2(11)
primary key,branch_name varchar2(30) references
branchz(branch_name),balance number(8));
Table created.
8 rows selected.
___________________________________________________
C)NAME:customer
FIELD DATATYPE
customer_id varchar2(11)primary key
customer_name varchar2(20)
customer_street varchar2(15)
customer_city varchar2(15)
SQL> create table customer(customer_id varchar2(11)
primary key,customer_name varchar2(20),customer_street
varchar2(15),customer_city varchar2(15));
Table created.
_____________________________________________________________
D)NAME:depositor
FIELDS DATATYPE
loan_no varchar2(4)primary key
branch_name varchar2(30)references branchz(branch_name)
amount number(8,2)
SQL> create table loan(loan_no varchar2(4) primary key,
branch_name varchar2(30) references branchz(branch_name),
amount number(8,2));
Table created.
7 rows selected.
_____________________________________________________________
________
F)NAME:borrower
FIELDS DATATYPE
customer_id varchar2(11)references cusotmer(customer_id)
loan_no references loan(loan_no)
RESULT:
Thus the program to create and modify a table using data
defining language commands was executed successfully.
Expt. No : 2 `
Date :
Aim:
To implement and execute a query for manipulating & storing data
items in a Oracle database using Structured Query Language
commands.
DML Commands:
Insert
Select
Update
Delete
DCL Commands:
Commit
Rollback
Savepoint
Privilege
Syntax:
Insert
Single level insertion
Insert into <tablename> values (Columnname1,…);
Multilevel insertion
Insert into <tablename> values (&columnname1…);
Select
Single level selection
Select Columnname from <tablename>;
Multilevel selection
Select * from <tablename>;
Update
Update <tablename> set <columnname>=’valuetobegiven’ where
<condition>;
Delete
Single row deletion
Delete from <tablename> where <columnname>=’valuegiven’;
Multi row deletion
Delete from <tablename>;
Commit
Commit;
Rollback
Rollback <label>;
Savepoint
Savepoint <label>;
Privilege
Grant <privilege> on <tablename> to userN;
Exercises :
22.Find all loan no's that appear in the loan relations with null values
for amount.
23.Find all loan no's that appear in the loan relations with not null
values for amount.
24.Find all customers having both account and loan at the same
bank(subquery).
25.Find all customers who do have a loan at the bank, but who do
not have an account at the bank(subquery).
26.Find the custoemers whose names are neither smith nor Jones.
27.Find the names of all branches that have assets greater than those
at least one branch located in Harrison (sub query).
28.Find those branches for which the average balance is greater than
or equal to all average balances.
29.Find all customers who have both an account and a loan at the
bank (using exists)
30.Create a view called all customer consisting of branch names and
the name of customers who have either an account or a loan at
that branch.
31.From all customer view, find all customers of the perryridge
branch.
32.Delete all account tuples in the perryridge branch.
BRANCH_NAME
------------------------------
downtown
mianus
perryridge
redwood
roundhill
100*AMOUNT
----------
90000
150000
150000
130000
100000
200000
50000
7 rows selected.
4)Find all loan no's for loan's made at the perryridge branch
with loan amounts greater than 1200
SQL> select loan_no from loanz where branch_name='perryridge'
and amount>1200;
LOAN
----
1_15
1_16
5)Find all loan no's for loan's with loan amount between
900 and 1500.
SQL> select loan_no from loanz where amount>900 and amount<1500;
LOAN
----
1_16
1_17
6)For all customers who have a loan from the bank, find their ids,
loan numbers and loan amount.
SQL> select borrowerz.customer_id,loanz.loan_no,loanz.branch_name,
loanz.amount from loanz,borrowerz where
loanz.loan_no=borrowerz.loan_no;
CUSTOMER_ID LOAN BRANCH_NAME AMOUNT
----------- ---- ------------------------------ -------------------------------
c_01 1_11 roundhill 900
c_01 1_23 redwood 2000
c_03 1_93 mianus 500
c_05 1_17 downtown 1000
c_03 1_16 perryridge 1300
c_05 1_14 downtown 1500
6 rows selected.
7)For all custoemers who have a loan at perryridge branch, find their ids,
loan numbers and
loan numbers
SQL> select borrowerz.customer_id,loanz.loan_no,loanz.branch_name,
loanz.amount from loanz,borrowerz where(loanz.branch_name='perryridge'
and loanz.loan_no=borrowerz.loan_no);
CUSTOMER_ID LOAN BRANCH_NAME AMOUNT
----------- ---- ------------------------------ ----------------------------------------
c_03 1_16 perryridge 1300
8)SQL> select branch_name from branchz where assets>any
(select assets from branchz where branch_city='stamford');
BRANCH_NAME
------------------------------
redwood
mianus
roundhill
10)Find the names of customers whose street address starts with 'sp'.
SQL> select customer_name from customerz where customer_street like 'sp
%';
CUSTOMER_NAME
Adoms
11)Display all customer name in alphabetic order who have a
loan at perryridge branch.
SQL> select customer_name from customerz where
customerz.customer_id=any
(select borrowerz.customer_id from borrowerz where
borrowerz.loan_no=any
(select loan_no from loanz where loanz.branch_name='perryridge'))
order by customerz.customer_name asc;
CUSTOMER_NAME
13)Find all customers having a loan, or account or both at the same bank.
SQL> select distinct customer_id from borrowerz union select
customer_id from depositorz;
CUSTOMER_ID
-----------
c_01
c_02
c_03
c_05
c_07
c_08
6 rows selected.
14)In the above query include duplicates.
SQL> select customer_id from borrowerz union select customer_id
from depositorz;
CUSTOMER_ID
-----------
c_01
c_02
c_03
c_05
c_07
c_08
6 rows selected.
16)Find all customers having both account and loan at the same bank.
SQL> select customer_id from depositorz intersect select customer_id
from borrowerz;
CUSTOMER_ID
-----------
c_03
c_05
20)Find the branches where the average account balance greater than 1200.
SQL> select avg(balance) from accountz having avg(balance)>1200
group by branch_name;
AVG(BALANCE)
------------
1800
2300
1500
23)Find all loan no's that appear in the loan relations with null
values for amount.
SQL> select loan_no from loanz where amount is null;
no rows selected
24)Find all loan no's that appear in the loan relations with not
null values for amount.
SQL> select loan_no from loanz where amount is not null;
LOAN
----
1_11
1_14
1_15
1_16
1_17
1_23
1_93
7 rows selected.
27)Find the custoemers whose names are neither smith nor jones.
SQL> select customer_name from customerz where
not(customer_name='smith' or customer_name='jones');
CUSTOMER_NAME
--------------------
turner
johnson
curry
adoms
lindsay
hayes
williams
7 rows selected.
28)Find the names of all branches that have assets greater than
those atleast one branch located in harrison(subquery).
SQL> select branch_name from branchz where assets>any
(select assets from branchz where branch_city='harrison');
BRANCH_NAME
Mianus
29)Find those branches for which the average balance is greater
than or equal to all average balances.
SQL> select branch_name,avg(balance) from accountz group by
branch_name having avg(balance)>=all(select
avg(balance) from accountz group by branch_name);
BRANCH_NAME AVG(BALANCE)
------------------------------ ------------
downtown 2300
30)Find all customers who have both an account and a loan at the
bank (using exists)
SQL> select customer_id from borrowerz where
exists(select * from depositorz where
depositorz.customer_id=borrowerz.customer_id);
CUSTOMER_ID
-----------
c_03
c_05
c_03
c_05
RESULT:
Thus the program to perform manipulation on created table
using data manipulation language commands was executed successfully.
Expt. No : 3 `
Date :
AIM:
To perform the transaction control of database using data control
language commands.
LIST OF COMMANDS:
Commit
Roll back
Save point
COMMIT:
Commit ends the current transaction and makes
permanent changes made during the transaction.
SYNTAX:
SQL>COMMIT;
>ROLL BACK:
SYNTAX:
SQL>SAVE POINT<name>
SQL> commit;
Commit complete.
SQL> rollback;
Rollback complete.
1 rows deleted.
SQL> select * from bankz;
RESULT:
Thus the program to perform the transaction control of database
using data control language commands was executed successfully.
Expt. No : 4 `
Date :
BUILT IN FUNCTIONS
AIM:
LIST OF COMMANDS:
The list of built in functions in SQL are
>Numeric
>character
>Aggregate
>NUMERIC:
ABSOLUTE:
Used to find the absolute value of a given number.
SYNTAX:
SQL>Select abs(n) from dual;
POWER:
Used to find the power value of the given number.
Power(m,n)means m^n.
SYNTAX:
SQL>Select power(m,n) from dual;
SQRT:
It will give the square root of the given number
SYNTAX:
SQL>Select sqrt(n) from dual;
TRIGONOMETRIC VALUES:
To find trigonometric value of the given
given number.
SYNTAX:
SQL>Select sin (n) from dual;
SQL>Select cos (n) from dual;
SQL>Select tan (n) from dual;
CHARACTER VALUE:
It will give the corresponding ASCII values of a
given character.
SYNTAX:
SQL>Select char (n) from dual;
MODULUS VALUE:
It will give the modulus value of a given number(i.e)it
will give the remainder of a division(m%n).
SYNTAX:
SQL>Select mod(m,n) from dual;
ROUND VALUE:
It will give the round off value of a given number.
SYNTAX:
SQL>Select round(m,n) from dual;
TRUNCATE:
It will roud off the value and gives the value with one
decimal point.
SYNTAX:
SQL>Select trunk (m,n) from dual;
LOG:
It will give the logarithmic value of a given number log
m^n.
SYNTAX:
SQL>Select log (m,n) from dual;
NATURAL LOGARITHM:
It wil give the natural logarithm of a number
ln(n)
SYNTAX:
SQL>Select ln(n) from dual;
EXPONENT VALUE:
It will give the exponent value of a given number(i.e )
e^n.
SYNTAX:
SQL>Select exp(n) from dual;
CEIL:
It is also a type of round off value.
SYNTAX:
SQL>Select ceil(n) from dual;
FLOOR:
It will be give the integer value for the given number.
SYNTAX:
SQL>Select floor(n) from dual;
>CHARACTER FUNCTIONS:
UPPER:
To convert lower case into upper case character.
SYNTAX:
SQL>Select upper(‘CHAR’) from dual;
LOWER:
To convert upper case into lower case character.
SYNTAX:
SQL>Select lower(‘CHAR’)from dual;
INITCAP:
To convert the first character of the string into upper case
character.
SYNTAX:
SQL>Select initcap(‘STRING’)from dual;
CONCATINATION:
To join any two words where C1 and C2 are characters.
SYNTAX:
SQL>Select concat(‘C1’,’C2’)from dual;
REPLACE:
To replace a character in a string by another character.
SYNTAX:
SQL>Select replace(‘TEXT’,’C1’,’C2’)from dual;
SUBSTRING:
To remove a number of characters from a string
where n is the starting position and m is the total number of
characters fetched from that position.
SYNTAX:
SQL>Select substr(‘s’,n,m)from dual;
LENGTH:
To find the length of the given string.
SYNTAX:
SQL>Select length(‘STRING’);
LPAD:
To add symbols to left side of the string where n is the
number of characters and ‘char’ is the character that
should be added to left side.
SYNTAX:
SQL>Select lpad(‘string’,n,’CHA’)from dual;
RPAD:
To add symbols to right side of the string where n is the number
of characters and ‘char’ is the character that should be added to
right side.
SYNTAX:
SQL>Select rpad(‘STRING’,n,’CHAR’)from dual;
LTRIM:
Write string by neglecting the matching character from left
where ‘char’ is the character to be neglected from left side.
SYNTAX:
SQL>Select ltrim(‘STRING’,”CHAR’)from dual;
RTRIM:
Write string by neglecting the matching character from right
where ‘char’ is the character to be neglected from right side.
SYNTAX:
SQL>Select rtrim(‘STRING’,”CHAR’)from dual;
>AGGREGATE FUNCTIONS:
MINIMUM:
To find maximum value of the given field.
SYNTAX:
SQL>Select min (Cn) from <table name>;
MAXIMUM:
To find minimum value of the given field.
SYNTAX:
SQL>Select max (Cn) from <table name>;
AVERAGE:
To find the average value of a given field.
SYNTAX:
SQL>Select avg (Cn) from <table name>;
STANDARD DEVIATION:
To find the standard deviation of a given field.
SYNTAX:
SQL>Select stddev(Cn) from <table name>;
COUNT:
To give the number of elements in the given field.
SYNTAX:
SQL>Select count(Cn) from <table name>;
COUNT(*)
To give the maximum number of records in the given
table.
SYNTAX:
SQL>Select count(*) from <table name>;
>DATE FUNCTIONS:
SYSTEM TABLE:
This command displays the current date of the system.
SYNTAX:
SQL>Select sysdate from dual;
NEXT DAY:
To give the same day of the next week.
SYNTAX:
SQL>Select
next_day(‘DD_MM_YYYY’,’day’)from dual;
LAST DAY:
To give the previous day of the current day from
previous week.
SYNTAX:
SQL>Select last_day(‘DD_MM_YYYY’)from
dual;
ADD MONTHS:
This command adds the number of specified months to
the given month.
SYNTAX:
SQL>Select
add_months(‘DD_MM_YYYY’,n)from dual;
MONTHS BETWEEN:
It calculates and gives the number of months between to
the given dates.
SYNTAX:
SQL>Select
months_between(‘DD_MM_YYYY’,’DD_MM_YYYY’) from dual;
TO DATE:
This command is used to give the month in character
when it is given as numeric.
SYNTAX:
SQL>Select
to_date(‘DD_NO_YYYY’,’DD_MM_YYYY’)from
dual;
TO NUMBER:
It gives the number to the given character.
SYNTAX:
SQL>Select to_number(‘number’)from dual;
BUILT IN FUNCTIONS
SYSDATE
---------
09-SEP-09
LAST_DAY(
---------
31-AUG-09
RESULT:
Thus the program to execute the built in function
was executed successfully.
Expt. No : 5 `
Date :
Aim:
To implement and execute Cursor for storing data items in a same area
or disk in Oracle database using Procedural Language concepts.
Procedural Language
Declaration Section – It is a part in which all the PL / SQL
variable constants and expression are declared.
Execution Commands – PL / SQL program codes are placed in
this section.
Exception Handling – Errors are handled in the execution part.
This part is optional.
Syntax for Procedural Language:
Declare
Declaration 1;
.......
Declaration N;
Begin
Execution 1;
……
Execution N;
Exception
Exception handlers;
End;
Simple Loops
– Sequence of statement between the loop will be executed repeatedly
forever.
Syntax:
Loop
……
Exit when < Condition > Area > 100;
End Loop;
Cursor Control
Open – executes the query and identifies the active set & position
of the pointer before the first row.
Syntax:
Open <cursorname>;
Fetch
– Retrieves the current row and places the pointer to the next row.
– % rowtype – Provides a record type represents a row in a table.
Syntax:
Fetch <cursorname> into <columnname>;
Close – After processing the last row in the active set, the cursor is
closed using close command
Syntax:
Close <cursorname>;
Cursor attributes
% notfound
% found
% rowcount
% isopen
EXCEPTION HANDLING
- User defined exceptions should be declared in the declarative part
and raised explicit by a ‘raise’ statement
Syntax:
Exception_name exception;
Raise exception_name;
////////////////////////////////////////////////////ELECTRIC
BILL\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
DECLARE
CURSOR V1 IS SELECT * FROM AVIEBILL WHERE CNO=&CNO;
CCNO AVIEBILL.CNO%TYPE;
CCNAME AVIEBILL.CNAME%TYPE;
CUNITS AVIEBILL.UNIT%TYPE;
COST NUMBER(10);
BEGIN
OPEN V1;
IF(V1%ISOPEN) THEN
LOOP
FETCH V1 INTO CCNO,CCNAME,CUNITS;
EXIT WHEN(V1%NOTFOUND);
IF(CUNITS < 200)THEN
COST:=2*CUNITS;
ELSIF(CUNITS < 500 AND CUNITS > 200)THEN
COST:=(200*2)+((500-CUNITS)*4);
ELSIF(CUNITS > 500)THEN
COST:=1600+((CUNITS-500)*6);
END IF;
END LOOP;
DBMS_OUTPUT.PUT_LINE('THE BILL IS :'||COST);
END IF;
CLOSE V1;
END;
AVIEBILL TABLE
OUT PUT:
Aim:
To implement and execute trigger in Oracle database using Procedural
Language concepts
Triggers
- Trigger is a special type of procedure that the oracle executes
when an insert, modify or delete operation is performed against a
given table
- It is a stored sub program associated with a table
- It is used to keep an audit trial of a table, to prevent invalid
transaction, enforce complex security authorization, to generate
data automatically
Syntax:
Create or replace trigger <trigger_name>
{ before / after / instead of }
{ insert / update / delete [of column] }
on <tablename / viewname>
referencing { old as old / new as new }
[for each statement / for each row [ when <condition>]]
Declare
Variable declaration
Constant declaration
Begin
PL / SQL Sub program body
Exception
Exception PL / SQL Block (or) user defined exception
End
Problem specification :
Create a table ‘stud’ that consist of student’s roll no, name date
of birth. Also it should give the details about student’s marks and
individual grades in various subjects.
Commit;
Select * from product;
Select * from audit_product;
Update product set price =101 where product_code=’101’;
Select * from audit_product;
Rollback;
Select * from audit_product;
Delete product where product_code=’101’;
Select * from audit_product;
Commit;
Select * from product;
Select * from audit_product;
RESULT:
Thus the commands were wriiten and successfully executed using
PL/SQL.
Expt. No : 7 `
Date :
Aim:
To implement and execute procedures and functions in Oracle database
using Procedural Language concepts.
Procedure:
- Procedure is a sub program used to perform an action
- Replace – recreates the procedure if it already exists
3 Modes:
In – Means you must specify a value for the argument at the time execution
of the procedure
Out – Passes back a value to its calling program
In Out – When calling the procedure, you must specify the value and that
procedure passes the value back to the calling procedure
Procedure Syntax:
Create or replace procedure < procedure_name > (argument { in, out,
in out } data type) { is, as }
Variable declaration
Begin
PL / SQL Subprogram body
Exception
Exception PL / SQL Block
End;
FUNCTION:
- A function is a sub program that accepts argument and returns a
unique value to the caller.
-
Function Syntax:
Create or replace function <functionname> [(parameter[,parameter,…])] return
<datatype> is
Begin
Executable statement;
Exception
Exception handlers;
End [functionname];
Exercise :
1. Write the PLSQL program to add two numbers?
2. Write the PLSQL program to find the amount from loan
branch?
3. Write the PLSQL program to find the value of i&j?
4. Write the PLSQL program to find value of i in the loop?
1)Write the PLSQL program to add two numbers?
SQL> set serveroutput on
SQL>
1 declare
2 a integer;
3 b integer;
4 c integer;
5 begin
6 a:=10;
7 b:=12;
8 c:=a+b;
9 dbms_output.put_line('c is'||c);
10 end;
SQL> /
c is22
PL/SQL procedure successfully completed.
2)Write the PLSQL program to find the amount from loan branch?
SQL>declare
2 amt integer;
3 begin
4 select amount into amt from loanz where loan_no='&loan_number';
5 dbms_output.put_line('amount is'||amt);
6 end;
7 /
Enter value for loan_number: 1_11
old 4: select amount into amt from loanz where loan_no='&loan_number';
new 4: select amount into amt from loanz where loan_no='1_11';
amount is900
PL/SQL procedure successfully completed.
FUNCTIONS
Function created.
SET SERVEROUTPUT ON
DECLARE
NO NUMBER(6);
C CHAR(2);
AM NUMBER(10);
BB NUMBER(10);
BEGIN
NO:=&NO;
C:='&C';
AM:=&AMOUNT;
IF C='W' THEN
BB:=WITHDRAW(NO,AM);
UPDATE AVIBNK SET BAL_AMT=BB WHERE ACCNO=NO;
ELSIF C='D' THEN
BB:=DEPOSIT(NO,AM);
UPDATE AVIBNK SET BAL_AMT=BB WHERE ACCNO=NO;
ELSE
DBMS_OUTPUT.PUT_LINE('NO CAHR FOUND');
END IF;
END;
OUT PUT:
RESULT:
Thus the program for implementing procedures and functions in
oracle database using procedural langage concepts was executed
successfully.
Expt . No: 8
Date:
RAILWAY RESERVATION
AIM:
To write a PL/SQL to perform reservation in railway using
procedures.
ALGORITHM:
PL/SQL:
DECLARE
<declaration>;
BEGIN
<executable statement>;
EXCEPTION
<exception handling>;
END;
CREATE OR REPLACE
PROCEDURE{Schema}procedure name
(argument(IN,OUT,INOUT)datatypes…….)
{.S,AS}
Variable decleration;
Constant decleration;
BEGIN
PL/SQL subprogram body;
EXCEPTION
Exception PL/SQL block;
END;
1 row created.
1 row created.
1 row created.
1 row created.
declare
oo varchar2(10);
ddd varchar2(10);
pname varchar2(20);
dd date;
nn number(5);
trn number(5);
tna varchar2(10);
begin
oo:='&oo';
ddd:='&ddd';
dd:='&dd';
nn:='&nn';
select tno,tname into trn,tna from train1 where origin=oo;
rail(oo,ddd,dd,nn);
pname:='&pname';
insert into passeng values(pname,tna,trn,oo,ddd,dd,nn);
end;
/
OUTPUT:
RESULT:
Thus the program to perform railway reservation using procedure was
executed successfully.
Expt.No: 9
Date:
AIM:
To design and implement payroll processing system using visual basic
6.0 as front end and oracle 8.0 as back end.
FORM2:
NORMALISATION
AIM:
To create a database(table) and implement
the normalization concept to the SQL server
environment.
ALGORITHM:
CUSTNAME CUSTADDR
------------------------ ----------------------
Shobana Ambur
Abi Vellore
Karan Chennai
CUSTNAME CUSTADDR
------------------------ ----------------------
Shobana Ambur
Abi Vellore
Karan Chennai
CUSTNAME ORDNO
------------------------------ ----------
Shobana 5
Abi 15
Karan 70
SQL> create view cust_order as select ordno, prodno, proddesc, qty, dateord
from custord;
View created.
SQL> select * from cust_order;
CUSTNAME CUSTADDR
------------------------ ----------------------
Shobana Ambur
Abi Vellore
Karan Chennai
CUSTNAME ORDNO
------------------------------ ----------
Shobana 5
Abi 15
Karan 70
SQL> create view ord_only as select ordno, prodno, qty, dateord from
custord;
View created.
SQL> select * from ord_only;
PRODNO PRODDESC
---------------- ------------------
5 Chocolate
459 Shirts
256 Pen
SQL> Commit;
Commit complete.
RESULT:
Thus a database table was created and
the normalization concept to the database in
SQL server environment was implemented.