Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

DBMS Practical Programs

Rating
-
Sold
-
Pages
33
Grade
A+
Uploaded on
11-10-2024
Written in
2024/2025

This document containing practical programs for DBMS (Database Management System) typically includes hands-on exercises and coding tasks aimed at reinforcing key database concepts. These programs cover topics like SQL queries, data manipulation, schema design, normalization, and transaction management. The document helps students understand how to create, manage, and query databases using various commands such as SELECT, INSERT, UPDATE, and DELETE. It serves as a practical guide to applying theoretical knowledge in real-world database applications.

Show more Read less
Institution
Course

Content preview

PRACTICAL NO: 1 IMPLEMENTATION OF REFERENTIAL INTEGRITY

Aim:
To Implement the Referential Integrity.

Procedure:


Creating a Master table (course)

SQL> create table course

2 (cno number(5) primary key,

3 cname varchar2(20));

Table created.



SQL> desc course;

Name Null? Type
----------------------------------------- -------- ----------------------------
CNO NOT NULL NUMBER(5)
CNAME VARCHAR2(20)


SQL> insert into course values(&cno,'&cname');

Enter value for cno: 1001

Enter value for cname: BSC

old 1: insert into course values(&cno,'&cname')

new 1: insert into course values(1001,'BSC')

1 row created.
1

,SQL> /

Enter value for cno: 1002

Enter value for cname: BCOM

old 1: insert into course values(&cno,'&cname')

new 1: insert into course values(1002,'BCOM')

1 row created.



SQL> /

Enter value for cno: 1003

Enter value for cname: BCA

old 1: insert into course values(&cno,'&cname')

new 1: insert into course values(1003,'BCA')

1 row created.



SQL> /

Enter value for cno: 1004

Enter value for cname: BA

old 1: insert into course values(&cno,'&cname')

new 1: insert into course values(1004,'BA')

1 row created.

SQL> commit;

Commit complete.

2

,SQL> select * from course;



CNO CNAME

---------- --------------------

1001 BSC

1002 BCOM

1003 BCA

1004 BA



Creating a Child table (student)



SQL> create table student

2 (sno number(5) primary key,

3 sname varchar2(30),

4 dob date,

5 cno number(5) references course(cno));

Table created.



SQL> desc student;

Name Null? Type

----------------------------------------- -------- ----------------------------

SNO NOT NULL NUMBER(5)

3

, SNAME VARCHAR2(30)

DOB DATE

CNO NUMBER(5)



SQL> insert into student values(&sno,'&sname','&dob',&cno);

Enter value for sno: 1

Enter value for sname: Bhanu

Enter value for dob: 10-jan-1995

Enter value for cno: 1001

old 1: insert into student values(&sno,'&sname','&dob',&cno)

new 1: insert into student values(1,'Bhanu','10-jan-1995',1001)

1 row created.



SQL> /

Enter value for sno: 2

Enter value for sname: Swathi

Enter value for dob: 26-Aug-1998

Enter value for cno: 1002

old 1: insert into student values(&sno,'&sname','&dob',&cno)

new 1: insert into student values(2,'Swathi','26-Aug-1998',1002)

1 row created.



4

Written for

Institution
Course

Document information

Uploaded on
October 11, 2024
Number of pages
33
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
naveenbamaprofessional

Get to know the seller

Seller avatar
naveenbamaprofessional Self
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
9
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions