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.
Ad

More Related Content

Similar to ADBMS ASSIGNMENT (20)

Programming Building Blocks for Admins
Programming Building Blocks for Admins Programming Building Blocks for Admins
Programming Building Blocks for Admins
Salesforce Admins
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
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
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Introduction to C Programming -Lecture 4
Introduction to C Programming -Lecture 4Introduction to C Programming -Lecture 4
Introduction to C Programming -Lecture 4
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
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
 
Object Oriented Programming (OOP) using C++ - Lecture 1
Object Oriented Programming (OOP) using C++ - Lecture 1Object Oriented Programming (OOP) using C++ - Lecture 1
Object Oriented Programming (OOP) using C++ - Lecture 1
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
topu93
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture
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
 
Programming Building Blocks for Admins
Programming Building Blocks for Admins Programming Building Blocks for Admins
Programming Building Blocks for Admins
Salesforce Admins
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
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
 
C programming session 09
C programming session 09C programming session 09
C programming session 09
Dushmanta Nath
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
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 structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
topu93
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture
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
 

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
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
 
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
 
Ad

Recently uploaded (20)

Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Ad

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.