Dbms Record1
Dbms Record1
Aim
Algorithm
STEP 1: Start
STEP 2: Open Oracle 11 g and create a database name.
STEP 3: Crete a Table for the application such that Registration, Requirements, Registered ID
and Message
Syntax: create table table_name
(
Column_name1 data_type,
Column_name2 data_type
);
STEP 4: And set the Constraints on the columns value.
STEP 5: Insert the data in the table using the following syntax
Syntax: insert into table_name
(Column_name1, Column_name2 , ... ) values ( value1 , Value2 , ... ) ;
STEP 6: Retrieve the data using the following syntax, Select * from Table_name ; ( or ) Select
Column_name from Table_name ;
STEP 7: End.
Program
A)Registration Table
Table created.
QUALIFICATION VARCHAR(20)
DOB DATE
SALARY NUMBER(10)
MOBILE NUMBER(10)
AGE NUMBER(3)
PASSWORD VARCHAR2(30)
1 row created.
1 row created
III)Retrieving Records from Table
RID First Last Gender Qualific DOB Salar Address Mobi Age Passw
-ation y le ord
Name Name
Table created.
USERID NUMBER(10)
PASSWORD VARCHAR2(20)
1 row created.
1 row created.
III)Retrieving Records from Table
User ID Password
2001 Ram07
4824 Razid18
Table created.
AGE NUMBER(3)
SALARY NUMBER(10)
QUALIFICATION VARCHAR(20)
1 row created.
1 row created.
III)Retrieving Records from Table
MID NUMBER(10)
TO NAME VARCHAR(20)
MESSAGE VARCHAR(255)
PHONE NO NUMBER(10)
1 row created.
1 row created.
III)Retrieving Records from Table
Aim
To Convert the Normalization Form of the Matrimonial Application.
Algorithm
STEP 1: Start
STEP 3: And convert the table in First Normal Form using following rules,
4. Unique Table_name.
STEP 4: Then Convert the table in Second Normal Form using following rules,
1. Table should be in 1NF
STEP 5: Then convert the table Third Normal Form using following rules,
2. No Transitive Dependencies.
STEP 7: End.
Exp.No: Cursor Page No :
Date:
Aim
To im
Algorithm
Step 1: Start
Step 2: Create a Customer table with the following fields such as ID, Name, Age, Cost ,
Address. By using the following Syntax
Step 3: Insert some values into the above Customer table using the following Syntax.
Step 7: Stop
Program Coding
Creating Table
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
declare
n number(10);
ino pass.id%type;
pname pass.name%type;
page pass.age%type;
pcost pass.cost%type;
addr pass.address%type;
begin
dbms_output.put_line(' ------------------------------------------');
ino:=&ino;
if pcost<300 then
dbms_output.put_line(ino||'cost is incremented');
else
end if;
EXCEPTION
end;
SQL> @"E:\Razid\cursor.sql"
23 /
------------------------------------------
1cost is incremented
SQL> @"E:\Razid\cursor.sql"
23 /
------------------------------------------
3cost is incremented
Algorithm
Step 1: Start
Step 2: Create a Customer table with the following fields such as ID, Name, Pread, Cread, Unit,
Price By using the following Syntax
Step 3: Insert some values into the above Customer table using the following Syntax.
Step 7: Stop
SQL> create table eb(ebno number(5)primary key,cname varchar(15),pread number(5),cread number(5),unit
number(5),price number(10));
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
SQL> @"E:\Razid\ebill.sql";
14 /
Procedure created.
Bill.sql
SET SERVEROUTPUT ON
declare
CURSOR cu is SELECT * FROM eb where cread>pread;
e eb%rowtype;
u eb.unit%type;
a eb.price%type;
begin
open cu;
dbms_output.put_line('--------------------------------------------------------------');
dbms_output.put_line('ENO NAME PREAD CREAD UNIT AMOUNT ');
dbms_output.put_line('--------------------------------------------------------------');
loop
fetch cu into e;
exit when cu%notfound;
ebill(e.ebno,e.cname,e.pread,e.cread,u,a);
update eb set unit=u,price=a where ebno=e.ebno;
select * into e from eb where ebno=e.ebno;
dbms_output.put_line(e.ebno||' '||e.cname||' '||e.pread||' '||e.cread||' '||u||' '||a);
end loop;
close cu;
end;
SQL> @"E:\Razid\bill.sql";
21 /