SlideShare a Scribd company logo
Assignment No. 2
Department: University Institute of Computing
Subject: Advanced Database Management
Systems
Subject Code: CAT-762
Session: Jan – April
Semester 4th
Submitting By: Submitted to
Kuldeep Kumar
UID: - 19MCA8202
Er. Sandeep Kaur
Group: - 6
1. Write the features of object identity. What is the role of OID, Value,
and type constructors?
Features Of Object Identity:
• An object retains its identity even if some or all of the values of variables or
definitions of methods change over time.
• This concept of object identity is necessary in applications but doe not apply to
tuples of a relational database.
• Object identity is a stronger notion of identity than typically found in
programming languages or in data models not based on object orientation.
• Several forms of identity: value: A data value is used for identity (e.g., the
primary key of a tuple in a relational database).name: A user-supplied name is
used for identity (e.g., file name in a file system).built-in: A notion of identity
is built-into the data model or programming languages, and no user-supplied
identifier is required (e.g., in OO systems).
• Object identity is typically implemented via a unique, system-generated OID.
The value of the OID is not visible to the external user, but is used internally by
the system to identify each object uniquely and to create and manage inter-
object references.
Role Of OID, Value, and type constructors:
An object identifier is an extensively used identification mechanism jointly developed
by ITU-T and ISO/IEC for naming any type of object, concept or "thing" with a globally
unambiguous name which requires a persistent name. It is not intended to be used for
transient naming. OIDs, once allocated, should not be re-used for a different
object/thing. It is based on a hierarchical name structure based on the "OID tree". This
naming structure uses a sequence of names, of which the first name identifies a top-
level "node" in the OID tree, and the next provides further identification of arcs leading
to sub-nodes beneath the top-level, and so on to any depth. A critical feature of this
identification mechanism is that it makes OIDs available to a great many organizations
and specifications for their own use.
Default Constructor is also called as Empty Constructor which has no arguments and
It is Automatically called when we create the object of class but Remember name of
Constructor is same as name of class and Constructor never declared with the help of
Return Type. Means we can’t Declare a Constructor with the help of void Return Type.
if we never Pass or Declare any Arguments then this called as the Copy Constructors.
Parameterized Constructor is Another type Constructor which has some Arguments and
same name as class name but it uses some Arguments So For this, we have to create
object of Class by passing some Arguments at the time of creating object with the name
of class.
Copy Constructor is also Another type of Constructor. In this Constructor we pass the
object of class into the Another Object of Same Class. As name Suggests you Copy,
means Copy the values of one Object into another Object of Class.
Destructor As we know that Constructor is that which is used for Assigning Some
Values to data Members and For Assigning Some Values This May also used Some
Memory.
2. A table consists of the following fields: -
Invoice Number Varchar2 4
Invoice Date Date
Customer Code Number 1
Product Code Number 1
Quantity Sold Number 3
There are ten customers with codes 0 to 9 and five products with codes 0 to 4. The
rates of products are Rs. 15, 35, 42, 51 and 60 respectively. Write a program to
find the total purchase in Rs. of each customer and total sale of each product using
this table and insert these values in two other tables.
Create table corder(“Invoice Number” varchar2(4),”Invoice Date” Date, “Customer
code” Number(1), “Product Code” Number(1), “Quantity Sold” Number(3));
insert into corder1 values('rj24','31-mar-12',2,0,3);
insert into corder1 values('rj24','31-mar-12',2,2,3);
insert into corder1 values('rj24','31-mar-12',2,3,3);
insert into corder1 values('rj24','31-mar-12',2,4,3);
insert into corder1 values('rj24','31-mar-12',2,5,3);
Create table totalpurchase(“Customer Code” Number(1), “Total Purchase” Number);
Create table totalsale(“Product Code” Number(1), “Total Sale” Number);
Create or replace procedure fint_sale_purchase as
Cursor c1 is
Select distinct (“Customer Code “)
From corder1;
Cursor c2(v_ccode number) is
Select*
From corder1
Where “Customer Code”=v_ccode;
Cursor c3 is
Select distinct(“product code”)
From corder1;
Cursor c4(v_pcode number)is
Select*
From corder1
Where “Product Code ”=v_pcode;
Rs number;
Total_purchase number:=0;
Total_sale number:=0;
Begin
Delete
From totalpurchase;
Delete
From totalsale
For i in c1 loop
For j in c2(i. “customer code”) loop
Select decode (j. “product code”,0,15,1,35,2,42,3,51,4,60,0) into rs from dual;
Rs: =rs*j. “quantity sold”;
Total_purchase: =total_purchase+rs;
End loop;
Insert into totalpurchase values (i. “customer code” ,total_purchase);
End loop;
Rs:=0;
For I in c3 loop
For j in c4(i. “product code”) loop
Select decode(j. “product code”, 0,15,1,35,2,42,3,51,4,60,0) into rs from dual;
Rs:=rs*j. “quantity sold”;
Total_sale:= total_sale+rs;
End loop;
Insert into totalsale values(i. “product code”, total_sale);
End loop;
End;
/
Output: -
exec find_sale_purchase;
select * from totalsale;
Product Code Total Sale
1 105
2 231
0 276
select * from totalpurchase;
Customer Code Total Purchase
2 276
3. Discuss the following with suitable examples: -
a) Valid time table
b) Transaction time table
c) Bitemporal table
Valid time table: There are several ways to create a valid-time table:
Create a new table as a valid-time table
Add a valid-time column to a nontemporal or transaction-time table
Create a valid-time table from a copy of a nontemporal table
Example: To create a valid-time table, use a normal CREATE TABLE statement, and
define one column as a valid-time column. The valid-time column can either be derived
from two date, timestamp or timestamp with time zone columns, or can be a single
period data type column: PERIOD(DATE), PERIOD(TIMESTAMP[(n)]), or
PERIOD(TIMESTAMP[(n)] WITH TIME ZONE). Use the VALIDTIME or AS
VALIDTIME column attribute to assign the column to be the valid-time column.
Transaction time table: A transaction is an activity performed by entities within the
system. These activities are captured to represent events like item purchase, ticket
booking. Understanding transactions will give you clearer distinction of master tables
from transaction tables.
Example: For example, to describe a class of students all the information needed will
be part of master tables like student info, class info, teacher info, subject info. But to
know what daily attendance of the students will be captured in the transaction table.
Bitemporal table: As seen above, the temporal table allows for periods of time to be
stored in a database. This is ideal for showing state changes of objects (valid times).
Bitemporal design expands on this to model not only valid time, but to additionally
model transaction time. Transaction time represents the physical time at which a
transaction happened within the database.
Example: a shipment arriving at a warehouse. This could happen on Wednesday
(which would be the valid time that the shipment was in the warehouse). An operator
might update the system on the Thursday to state when the shipment arrived. The
moment they add the record to the system would be the transaction time. What this
allows us to determine at a later date is when that shipment was believed to be in the
warehouse, and also when that shipment was known to be in the warehouse according
to the database.
4. Create a table EMPLOYEE with the following columns: -
Employee No. Varchar2 4
Employee Name Varchar2 30
Designation Varchar2 10
Category Character 1
Basic Salary Number 4
Category may be? J? ,?S?, or ?W? for Jr. officers, Sr. officers or Worker category.
Formulae: -
DA = 35% of Basic Salary correct up to paise.
HRA = 15% of Basic Salary subject to a maximum of Rs. 250/1000/30000 for
categories W/J/S
respectively.
Gross = Basic Salary +DA +HRA
Output the Employee Number and the Gross for each employee in a separate
table.
create table employee ("Employee No" Varchar2(4),"Employee Name" Varchar2(30),
Designation Varchar2(10), Category Character(1),"Basic Salary" Number(4));
Employee No Employee Name DESIGNATIO Category Basic Salary
1000 rakesh Sr.off j 3000
1001 kk Sr.off s 4000
1002 dk Jr.off w 5000
create table employee_gross;
create table gross("Employee No" Varchar2(4),"Gross Salary" Number(4));
create or replace procedure gross as
cursor c1 is
select * from employee;
emp_record employee%rowtype;
da number(20,2);
hra number(20,2);
gross number(20,2);
begin
delete
from employee_gross;
for emp_record in c1 loop
da:=emp_record."basic salary "*35/100;
hra: =emp_record."basic salary "*15/100;
if emp_record.category='j' and hra>250
then
hra: =250;
elsif emp_record.Category='s' and hra>1000
then
hra:=1000;
elsif emp_record.Category='w' and hra>30000
then
hra:=30000;
else
hra:=0;
end if;
gross:=emp_record."basic salary "+da+hra;
insert into employee_gross values(emp_record."Employee No ",gross);
end loop;
end;
/
5. Compare and contrast the advantages and disadvantages of intelligent
databases with temporal databases.
Intelligent Database:
An intelligent database is a full-text database that employs artificial intelligence (AI),
interacting with users to ensure that returned items (hits) contain the most relevant
information possible. This is in contrast to a traditional database, which is searchable
only by keywords and verbatim phrases connected by Boolean operations such as AND,
OR, and NOT. Intelligent database technology is in its infancy, and is evolving as AI
becomes more advanced.
Temporal Database:
A temporal database is generally understood as a database capable of supporting storage
and reasoning of time-based data. For example, medical applications may be able to
benefit from temporal database support” a record of a patient's medical history has little
value unless the test results, e.g. the temperatures, are associated to the times at which
they are valid, since we may wish to do reasoning about the periods in time in which
the patients temperature changed.
advantage and disadvantage of intelligent database or temporal database:
Many companies offer products whose prices vary over time. Daytime telephone calls,
for example, are usually more expensive than evening or weekend calls. Travel agents,
airlines or ferry companies distinguish between high and low seasons. Sports centres
offer squash or tennis courts at cheaper rate during the day. Hence, prices are time
dependent in these examples. They are typically summarised in tables with prices
associated with a time period. As well as the user of a database recording when certain
data values are valid, we may wish to store (for backup, or analysis reasons) historical
records of changes made to the database. So each time a change to a database is made
the system may automatically store a transaction timestamp.
When a search is conducted using a traditional full-text database, the mere presence of
keywords and phrases in a referenced file does not guarantee that the contents of that
file will be relevant in a given context. An intelligent database provides expanded and
more flexible options for conducting queries. For example, a user might type in a
question as a full sentence. The database then provides a list of hits arranged according
to the likelihood that the resulting data contains a useful answer to that question. The
AI may correct suspected errors input by the user. Some intelligent databases display
synonyms or antonyms for keywords and phrases.

More Related Content

Similar to ADBMS ASSIGNMENT

SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdfSummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
ARORACOCKERY2111
 
Kernel Adiutor
Kernel AdiutorKernel Adiutor
Kernel Adiutor
willi ye
 
Classes1
Classes1Classes1
Classes1
phanleson
 
C programming session 09
C programming session 09C programming session 09
C programming session 09
Dushmanta Nath
 
C++ tutorials
C++ tutorialsC++ tutorials
C++ tutorials
Divyanshu Dubey
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01
Zafor Iqbal
 
Flavours - Classic/Technical BDD
Flavours - Classic/Technical BDDFlavours - Classic/Technical BDD
Flavours - Classic/Technical BDD
David Harrison
 
]project-open[ Data-Model “Categories”
]project-open[ Data-Model “Categories”]project-open[ Data-Model “Categories”
]project-open[ Data-Model “Categories”
Klaus Hofeditz
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture
topu93
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
topu93
 
PL/SQL New and Advanced Features for Extreme Performance
PL/SQL New and Advanced Features for Extreme PerformancePL/SQL New and Advanced Features for Extreme Performance
PL/SQL New and Advanced Features for Extreme Performance
Zohar Elkayam
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
ANURAG SINGH
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4
dplunkett
 
data structure and c programing concepts
data structure and c programing conceptsdata structure and c programing concepts
data structure and c programing concepts
kavitham66441
 
OOC MODULE1.pptx
OOC MODULE1.pptxOOC MODULE1.pptx
OOC MODULE1.pptx
1HK19CS090MOHAMMEDSA
 
c#.pptx
c#.pptxc#.pptx
LEARN C#
LEARN C#LEARN C#
LEARN C#
adroitinfogen
 
Bt0065
Bt0065Bt0065
Bt0065
Simpaly Jha
 
B T0065
B T0065B T0065
B T0065
Simpaly Jha
 
E learning excel vba programming lesson 3
E learning excel vba programming  lesson 3E learning excel vba programming  lesson 3
E learning excel vba programming lesson 3
Vijay Perepa
 

Similar to ADBMS ASSIGNMENT (20)

SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdfSummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
 
Kernel Adiutor
Kernel AdiutorKernel Adiutor
Kernel Adiutor
 
Classes1
Classes1Classes1
Classes1
 
C programming session 09
C programming session 09C programming session 09
C programming session 09
 
C++ tutorials
C++ tutorialsC++ tutorials
C++ tutorials
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01
 
Flavours - Classic/Technical BDD
Flavours - Classic/Technical BDDFlavours - Classic/Technical BDD
Flavours - Classic/Technical BDD
 
]project-open[ Data-Model “Categories”
]project-open[ Data-Model “Categories”]project-open[ Data-Model “Categories”
]project-open[ Data-Model “Categories”
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
 
PL/SQL New and Advanced Features for Extreme Performance
PL/SQL New and Advanced Features for Extreme PerformancePL/SQL New and Advanced Features for Extreme Performance
PL/SQL New and Advanced Features for Extreme Performance
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4
 
data structure and c programing concepts
data structure and c programing conceptsdata structure and c programing concepts
data structure and c programing concepts
 
OOC MODULE1.pptx
OOC MODULE1.pptxOOC MODULE1.pptx
OOC MODULE1.pptx
 
c#.pptx
c#.pptxc#.pptx
c#.pptx
 
LEARN C#
LEARN C#LEARN C#
LEARN C#
 
Bt0065
Bt0065Bt0065
Bt0065
 
B T0065
B T0065B T0065
B T0065
 
E learning excel vba programming lesson 3
E learning excel vba programming  lesson 3E learning excel vba programming  lesson 3
E learning excel vba programming lesson 3
 

More from Lori Moore

How To Research For A Research Paper. Write A Re
How To Research For A Research Paper. Write A ReHow To Research For A Research Paper. Write A Re
How To Research For A Research Paper. Write A Re
Lori Moore
 
Best Custom Research Writing Service Paper W
Best Custom Research Writing Service Paper WBest Custom Research Writing Service Paper W
Best Custom Research Writing Service Paper W
Lori Moore
 
Free Printable Number Worksheets - Printable Wo
Free Printable Number Worksheets - Printable WoFree Printable Number Worksheets - Printable Wo
Free Printable Number Worksheets - Printable Wo
Lori Moore
 
Author Research Paper. How To Co. 2019-02-04
Author Research Paper. How To Co. 2019-02-04Author Research Paper. How To Co. 2019-02-04
Author Research Paper. How To Co. 2019-02-04
Lori Moore
 
Free Rainbow Stationery And Writing Paper Writing Pap
Free Rainbow Stationery And Writing Paper Writing PapFree Rainbow Stationery And Writing Paper Writing Pap
Free Rainbow Stationery And Writing Paper Writing Pap
Lori Moore
 
Terrorism Threat To World Peace. Online assignment writing service.
Terrorism Threat To World Peace. Online assignment writing service.Terrorism Threat To World Peace. Online assignment writing service.
Terrorism Threat To World Peace. Online assignment writing service.
Lori Moore
 
Lined Paper For First Graders. Online assignment writing service.
Lined Paper For First Graders. Online assignment writing service.Lined Paper For First Graders. Online assignment writing service.
Lined Paper For First Graders. Online assignment writing service.
Lori Moore
 
FREE Printable Always Do Your Be. Online assignment writing service.
FREE Printable Always Do Your Be. Online assignment writing service.FREE Printable Always Do Your Be. Online assignment writing service.
FREE Printable Always Do Your Be. Online assignment writing service.
Lori Moore
 
Scholarship Essay Essay Writers Service. Online assignment writing service.
Scholarship Essay Essay Writers Service. Online assignment writing service.Scholarship Essay Essay Writers Service. Online assignment writing service.
Scholarship Essay Essay Writers Service. Online assignment writing service.
Lori Moore
 
Essay Written In Third Person - College Life
Essay Written In Third Person - College LifeEssay Written In Third Person - College Life
Essay Written In Third Person - College Life
Lori Moore
 
Professional Essay Writers At Our Service Papers-Land.Com Essay
Professional Essay Writers At Our Service Papers-Land.Com EssayProfessional Essay Writers At Our Service Papers-Land.Com Essay
Professional Essay Writers At Our Service Papers-Land.Com Essay
Lori Moore
 
Buy College Admission Essay Buy College Admissi
Buy College Admission Essay Buy College AdmissiBuy College Admission Essay Buy College Admissi
Buy College Admission Essay Buy College Admissi
Lori Moore
 
PPT - Attitudes Towards Religious Plurality Exclusi
PPT - Attitudes Towards Religious Plurality ExclusiPPT - Attitudes Towards Religious Plurality Exclusi
PPT - Attitudes Towards Religious Plurality Exclusi
Lori Moore
 
Critique Format Example. How To Write Critique With
Critique Format Example. How To Write Critique WithCritique Format Example. How To Write Critique With
Critique Format Example. How To Write Critique With
Lori Moore
 
Printable Alphabet Worksheets For Preschool
Printable Alphabet Worksheets For PreschoolPrintable Alphabet Worksheets For Preschool
Printable Alphabet Worksheets For Preschool
Lori Moore
 
Analysis Essay Thesis Example. Analytical Thesis Statement Exam
Analysis Essay Thesis Example. Analytical Thesis Statement ExamAnalysis Essay Thesis Example. Analytical Thesis Statement Exam
Analysis Essay Thesis Example. Analytical Thesis Statement Exam
Lori Moore
 
How To Write College Admission Essay. How To
How To Write College Admission Essay. How ToHow To Write College Admission Essay. How To
How To Write College Admission Essay. How To
Lori Moore
 
Modes Of Writing Worksheet, Are Yo. Online assignment writing service.
Modes Of Writing Worksheet, Are Yo. Online assignment writing service.Modes Of Writing Worksheet, Are Yo. Online assignment writing service.
Modes Of Writing Worksheet, Are Yo. Online assignment writing service.
Lori Moore
 
A Critique Of Racial Attitudes And Opposition To Welfare
A Critique Of Racial Attitudes And Opposition To WelfareA Critique Of Racial Attitudes And Opposition To Welfare
A Critique Of Racial Attitudes And Opposition To Welfare
Lori Moore
 
Elegant Writing Stationery Papers, Printable Letter Wr
Elegant Writing Stationery Papers, Printable Letter WrElegant Writing Stationery Papers, Printable Letter Wr
Elegant Writing Stationery Papers, Printable Letter Wr
Lori Moore
 

More from Lori Moore (20)

How To Research For A Research Paper. Write A Re
How To Research For A Research Paper. Write A ReHow To Research For A Research Paper. Write A Re
How To Research For A Research Paper. Write A Re
 
Best Custom Research Writing Service Paper W
Best Custom Research Writing Service Paper WBest Custom Research Writing Service Paper W
Best Custom Research Writing Service Paper W
 
Free Printable Number Worksheets - Printable Wo
Free Printable Number Worksheets - Printable WoFree Printable Number Worksheets - Printable Wo
Free Printable Number Worksheets - Printable Wo
 
Author Research Paper. How To Co. 2019-02-04
Author Research Paper. How To Co. 2019-02-04Author Research Paper. How To Co. 2019-02-04
Author Research Paper. How To Co. 2019-02-04
 
Free Rainbow Stationery And Writing Paper Writing Pap
Free Rainbow Stationery And Writing Paper Writing PapFree Rainbow Stationery And Writing Paper Writing Pap
Free Rainbow Stationery And Writing Paper Writing Pap
 
Terrorism Threat To World Peace. Online assignment writing service.
Terrorism Threat To World Peace. Online assignment writing service.Terrorism Threat To World Peace. Online assignment writing service.
Terrorism Threat To World Peace. Online assignment writing service.
 
Lined Paper For First Graders. Online assignment writing service.
Lined Paper For First Graders. Online assignment writing service.Lined Paper For First Graders. Online assignment writing service.
Lined Paper For First Graders. Online assignment writing service.
 
FREE Printable Always Do Your Be. Online assignment writing service.
FREE Printable Always Do Your Be. Online assignment writing service.FREE Printable Always Do Your Be. Online assignment writing service.
FREE Printable Always Do Your Be. Online assignment writing service.
 
Scholarship Essay Essay Writers Service. Online assignment writing service.
Scholarship Essay Essay Writers Service. Online assignment writing service.Scholarship Essay Essay Writers Service. Online assignment writing service.
Scholarship Essay Essay Writers Service. Online assignment writing service.
 
Essay Written In Third Person - College Life
Essay Written In Third Person - College LifeEssay Written In Third Person - College Life
Essay Written In Third Person - College Life
 
Professional Essay Writers At Our Service Papers-Land.Com Essay
Professional Essay Writers At Our Service Papers-Land.Com EssayProfessional Essay Writers At Our Service Papers-Land.Com Essay
Professional Essay Writers At Our Service Papers-Land.Com Essay
 
Buy College Admission Essay Buy College Admissi
Buy College Admission Essay Buy College AdmissiBuy College Admission Essay Buy College Admissi
Buy College Admission Essay Buy College Admissi
 
PPT - Attitudes Towards Religious Plurality Exclusi
PPT - Attitudes Towards Religious Plurality ExclusiPPT - Attitudes Towards Religious Plurality Exclusi
PPT - Attitudes Towards Religious Plurality Exclusi
 
Critique Format Example. How To Write Critique With
Critique Format Example. How To Write Critique WithCritique Format Example. How To Write Critique With
Critique Format Example. How To Write Critique With
 
Printable Alphabet Worksheets For Preschool
Printable Alphabet Worksheets For PreschoolPrintable Alphabet Worksheets For Preschool
Printable Alphabet Worksheets For Preschool
 
Analysis Essay Thesis Example. Analytical Thesis Statement Exam
Analysis Essay Thesis Example. Analytical Thesis Statement ExamAnalysis Essay Thesis Example. Analytical Thesis Statement Exam
Analysis Essay Thesis Example. Analytical Thesis Statement Exam
 
How To Write College Admission Essay. How To
How To Write College Admission Essay. How ToHow To Write College Admission Essay. How To
How To Write College Admission Essay. How To
 
Modes Of Writing Worksheet, Are Yo. Online assignment writing service.
Modes Of Writing Worksheet, Are Yo. Online assignment writing service.Modes Of Writing Worksheet, Are Yo. Online assignment writing service.
Modes Of Writing Worksheet, Are Yo. Online assignment writing service.
 
A Critique Of Racial Attitudes And Opposition To Welfare
A Critique Of Racial Attitudes And Opposition To WelfareA Critique Of Racial Attitudes And Opposition To Welfare
A Critique Of Racial Attitudes And Opposition To Welfare
 
Elegant Writing Stationery Papers, Printable Letter Wr
Elegant Writing Stationery Papers, Printable Letter WrElegant Writing Stationery Papers, Printable Letter Wr
Elegant Writing Stationery Papers, Printable Letter Wr
 

Recently uploaded

ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 

Recently uploaded (20)

ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 

ADBMS ASSIGNMENT

  • 1. Assignment No. 2 Department: University Institute of Computing Subject: Advanced Database Management Systems Subject Code: CAT-762 Session: Jan – April Semester 4th Submitting By: Submitted to Kuldeep Kumar UID: - 19MCA8202 Er. Sandeep Kaur Group: - 6
  • 2. 1. Write the features of object identity. What is the role of OID, Value, and type constructors? Features Of Object Identity: • An object retains its identity even if some or all of the values of variables or definitions of methods change over time. • This concept of object identity is necessary in applications but doe not apply to tuples of a relational database. • Object identity is a stronger notion of identity than typically found in programming languages or in data models not based on object orientation. • Several forms of identity: value: A data value is used for identity (e.g., the primary key of a tuple in a relational database).name: A user-supplied name is used for identity (e.g., file name in a file system).built-in: A notion of identity is built-into the data model or programming languages, and no user-supplied identifier is required (e.g., in OO systems). • Object identity is typically implemented via a unique, system-generated OID. The value of the OID is not visible to the external user, but is used internally by the system to identify each object uniquely and to create and manage inter- object references. Role Of OID, Value, and type constructors: An object identifier is an extensively used identification mechanism jointly developed by ITU-T and ISO/IEC for naming any type of object, concept or "thing" with a globally unambiguous name which requires a persistent name. It is not intended to be used for transient naming. OIDs, once allocated, should not be re-used for a different object/thing. It is based on a hierarchical name structure based on the "OID tree". This naming structure uses a sequence of names, of which the first name identifies a top- level "node" in the OID tree, and the next provides further identification of arcs leading to sub-nodes beneath the top-level, and so on to any depth. A critical feature of this identification mechanism is that it makes OIDs available to a great many organizations and specifications for their own use. Default Constructor is also called as Empty Constructor which has no arguments and It is Automatically called when we create the object of class but Remember name of Constructor is same as name of class and Constructor never declared with the help of Return Type. Means we can’t Declare a Constructor with the help of void Return Type. if we never Pass or Declare any Arguments then this called as the Copy Constructors. Parameterized Constructor is Another type Constructor which has some Arguments and same name as class name but it uses some Arguments So For this, we have to create object of Class by passing some Arguments at the time of creating object with the name of class. Copy Constructor is also Another type of Constructor. In this Constructor we pass the object of class into the Another Object of Same Class. As name Suggests you Copy, means Copy the values of one Object into another Object of Class. Destructor As we know that Constructor is that which is used for Assigning Some Values to data Members and For Assigning Some Values This May also used Some Memory.
  • 3. 2. A table consists of the following fields: - Invoice Number Varchar2 4 Invoice Date Date Customer Code Number 1 Product Code Number 1 Quantity Sold Number 3 There are ten customers with codes 0 to 9 and five products with codes 0 to 4. The rates of products are Rs. 15, 35, 42, 51 and 60 respectively. Write a program to find the total purchase in Rs. of each customer and total sale of each product using this table and insert these values in two other tables. Create table corder(“Invoice Number” varchar2(4),”Invoice Date” Date, “Customer code” Number(1), “Product Code” Number(1), “Quantity Sold” Number(3)); insert into corder1 values('rj24','31-mar-12',2,0,3); insert into corder1 values('rj24','31-mar-12',2,2,3); insert into corder1 values('rj24','31-mar-12',2,3,3); insert into corder1 values('rj24','31-mar-12',2,4,3); insert into corder1 values('rj24','31-mar-12',2,5,3); Create table totalpurchase(“Customer Code” Number(1), “Total Purchase” Number); Create table totalsale(“Product Code” Number(1), “Total Sale” Number); Create or replace procedure fint_sale_purchase as Cursor c1 is Select distinct (“Customer Code “) From corder1; Cursor c2(v_ccode number) is Select* From corder1 Where “Customer Code”=v_ccode; Cursor c3 is Select distinct(“product code”) From corder1; Cursor c4(v_pcode number)is Select* From corder1 Where “Product Code ”=v_pcode; Rs number;
  • 4. Total_purchase number:=0; Total_sale number:=0; Begin Delete From totalpurchase; Delete From totalsale For i in c1 loop For j in c2(i. “customer code”) loop Select decode (j. “product code”,0,15,1,35,2,42,3,51,4,60,0) into rs from dual; Rs: =rs*j. “quantity sold”; Total_purchase: =total_purchase+rs; End loop; Insert into totalpurchase values (i. “customer code” ,total_purchase); End loop; Rs:=0; For I in c3 loop For j in c4(i. “product code”) loop Select decode(j. “product code”, 0,15,1,35,2,42,3,51,4,60,0) into rs from dual; Rs:=rs*j. “quantity sold”; Total_sale:= total_sale+rs; End loop; Insert into totalsale values(i. “product code”, total_sale); End loop; End; / Output: - exec find_sale_purchase; select * from totalsale; Product Code Total Sale 1 105 2 231 0 276 select * from totalpurchase; Customer Code Total Purchase 2 276
  • 5. 3. Discuss the following with suitable examples: - a) Valid time table b) Transaction time table c) Bitemporal table Valid time table: There are several ways to create a valid-time table: Create a new table as a valid-time table Add a valid-time column to a nontemporal or transaction-time table Create a valid-time table from a copy of a nontemporal table Example: To create a valid-time table, use a normal CREATE TABLE statement, and define one column as a valid-time column. The valid-time column can either be derived from two date, timestamp or timestamp with time zone columns, or can be a single period data type column: PERIOD(DATE), PERIOD(TIMESTAMP[(n)]), or PERIOD(TIMESTAMP[(n)] WITH TIME ZONE). Use the VALIDTIME or AS VALIDTIME column attribute to assign the column to be the valid-time column. Transaction time table: A transaction is an activity performed by entities within the system. These activities are captured to represent events like item purchase, ticket booking. Understanding transactions will give you clearer distinction of master tables from transaction tables. Example: For example, to describe a class of students all the information needed will be part of master tables like student info, class info, teacher info, subject info. But to know what daily attendance of the students will be captured in the transaction table. Bitemporal table: As seen above, the temporal table allows for periods of time to be stored in a database. This is ideal for showing state changes of objects (valid times). Bitemporal design expands on this to model not only valid time, but to additionally model transaction time. Transaction time represents the physical time at which a transaction happened within the database. Example: a shipment arriving at a warehouse. This could happen on Wednesday (which would be the valid time that the shipment was in the warehouse). An operator might update the system on the Thursday to state when the shipment arrived. The moment they add the record to the system would be the transaction time. What this allows us to determine at a later date is when that shipment was believed to be in the warehouse, and also when that shipment was known to be in the warehouse according to the database.
  • 6. 4. Create a table EMPLOYEE with the following columns: - Employee No. Varchar2 4 Employee Name Varchar2 30 Designation Varchar2 10 Category Character 1 Basic Salary Number 4 Category may be? J? ,?S?, or ?W? for Jr. officers, Sr. officers or Worker category. Formulae: - DA = 35% of Basic Salary correct up to paise. HRA = 15% of Basic Salary subject to a maximum of Rs. 250/1000/30000 for categories W/J/S respectively. Gross = Basic Salary +DA +HRA Output the Employee Number and the Gross for each employee in a separate table. create table employee ("Employee No" Varchar2(4),"Employee Name" Varchar2(30), Designation Varchar2(10), Category Character(1),"Basic Salary" Number(4)); Employee No Employee Name DESIGNATIO Category Basic Salary 1000 rakesh Sr.off j 3000 1001 kk Sr.off s 4000 1002 dk Jr.off w 5000 create table employee_gross; create table gross("Employee No" Varchar2(4),"Gross Salary" Number(4)); create or replace procedure gross as cursor c1 is select * from employee; emp_record employee%rowtype; da number(20,2); hra number(20,2); gross number(20,2); begin delete from employee_gross; for emp_record in c1 loop da:=emp_record."basic salary "*35/100; hra: =emp_record."basic salary "*15/100; if emp_record.category='j' and hra>250 then hra: =250; elsif emp_record.Category='s' and hra>1000 then hra:=1000; elsif emp_record.Category='w' and hra>30000 then hra:=30000; else hra:=0; end if; gross:=emp_record."basic salary "+da+hra; insert into employee_gross values(emp_record."Employee No ",gross); end loop; end; /
  • 7. 5. Compare and contrast the advantages and disadvantages of intelligent databases with temporal databases. Intelligent Database: An intelligent database is a full-text database that employs artificial intelligence (AI), interacting with users to ensure that returned items (hits) contain the most relevant information possible. This is in contrast to a traditional database, which is searchable only by keywords and verbatim phrases connected by Boolean operations such as AND, OR, and NOT. Intelligent database technology is in its infancy, and is evolving as AI becomes more advanced. Temporal Database: A temporal database is generally understood as a database capable of supporting storage and reasoning of time-based data. For example, medical applications may be able to benefit from temporal database support” a record of a patient's medical history has little value unless the test results, e.g. the temperatures, are associated to the times at which they are valid, since we may wish to do reasoning about the periods in time in which the patients temperature changed. advantage and disadvantage of intelligent database or temporal database: Many companies offer products whose prices vary over time. Daytime telephone calls, for example, are usually more expensive than evening or weekend calls. Travel agents, airlines or ferry companies distinguish between high and low seasons. Sports centres offer squash or tennis courts at cheaper rate during the day. Hence, prices are time dependent in these examples. They are typically summarised in tables with prices associated with a time period. As well as the user of a database recording when certain data values are valid, we may wish to store (for backup, or analysis reasons) historical records of changes made to the database. So each time a change to a database is made the system may automatically store a transaction timestamp. When a search is conducted using a traditional full-text database, the mere presence of keywords and phrases in a referenced file does not guarantee that the contents of that file will be relevant in a given context. An intelligent database provides expanded and more flexible options for conducting queries. For example, a user might type in a question as a full sentence. The database then provides a list of hits arranged according to the likelihood that the resulting data contains a useful answer to that question. The AI may correct suspected errors input by the user. Some intelligent databases display synonyms or antonyms for keywords and phrases.