SlideShare une entreprise Scribd logo
1  sur  8
LAB – 4
create table item(itemcode number, itemname varchar(20), price number(10,2), primary
key(itemcode));

Table created.

SQL> desc item;

Name                                Null?            Type

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

ITEMCODE                               NOT           NULL NUMBER

ITEMNAME                                             VARCHAR2(20)

PRICE                                                NUMBER(10,2)



create table purchase(itemcode number, qty number, foreign key(itemcode) references
item(itemcode));

Table created.

SQL> desc purchase;

Name                                Null?            Type

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

ITEMCODE                                             NUMBER

QTY                                                  NUMBER



SQL> insert into item values('&itemcode','&itemname','&price');

Enter value for itemcode: 001

Enter value for itemname: tea_powder

Enter value for price: 25

old 1: insert into item values('&itemcode','&itemname','&price')
new 1: insert into item values('001','tea_powder','25')



1 row created.



SQL> /

Enter value for itemcode: 002

Enter value for itemname: coffee_powder

Enter value for price: 40

old 1: insert into item values('&itemcode','&itemname','&price')

new 1: insert into item values('002','coffee_powder','40')



1 row created.



SQL> /

Enter value for itemcode: 003

Enter value for itemname: dove_soap

Enter value for price: 49

old 1: insert into item values('&itemcode','&itemname','&price')

new 1: insert into item values('003','dove_soap','49')



1 row created.



SQL> /

Enter value for itemcode: 004

Enter value for itemname: clinicplus
Enter value for price: 10

old 1: insert into item values('&itemcode','&itemname','&price')

new 1: insert into item values('004','clinicplus','10')



1 row created.



SQL> /

Enter value for itemcode: 005

Enter value for itemname: chilly_powder

Enter value for price: 15

old 1: insert into item values('&itemcode','&itemname','&price')

new 1: insert into item values('005','chilly_powder','15')



1 row created.



SQL> /

Enter value for itemcode: 006

Enter value for itemname: fair&lovely

Enter value for price: 40

old 1: insert into item values('&itemcode','&itemname','&price')

new 1: insert into item values('006','fair&lovely','40')



1 row created.



SQL> /
Enter value for itemcode: 007

Enter value for itemname: rice

Enter value for price: 30

old 1: insert into item values('&itemcode','&itemname','&price')

new 1: insert into item values('007','rice','30')



1 row created.



SQL> select * from item;



 ITEMCODE            ITEMNAME                PRICE

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

      1              tea_powder                25

      2              coffee_powder             40

      3              dove_soap                 49

      4              clinicplus                10

      5              chilly_powder             15

      6              fair&lovely               40

      7              rice                      30



7 rows selected.



SQL> insert into purchase values('&itemcode','&qty');

Enter value for itemcode: 001

Enter value for qty: 0
old 1: insert into purchase values('&itemcode','&qty')

new 1: insert into purchase values('001','0')



1 row created.



SQL> /

Enter value for itemcode: 002

Enter value for qty: 2

old 1: insert into purchase values('&itemcode','&qty')

new 1: insert into purchase values('002','2')



1 row created.



SQL> /

Enter value for itemcode: 003

Enter value for qty: 1

old 1: insert into purchase values('&itemcode','&qty')

new 1: insert into purchase values('003','1')



1 row created.



SQL> /

Enter value for itemcode: 004

Enter value for qty: 5

old 1: insert into purchase values('&itemcode','&qty')
new 1: insert into purchase values('004','5')



1 row created.



SQL> /

Enter value for itemcode: 005

Enter value for qty: 0

old 1: insert into purchase values('&itemcode','&qty')

new 1: insert into purchase values('005','0')



1 row created.



SQL> /

Enter value for itemcode: 007

Enter value for qty: 1

old 1: insert into purchase values('&itemcode','&qty')

new 1: insert into purchase values('007','1')



1 row created.



SQL> /

Enter value for itemcode: 006

Enter value for qty: 2

old 1: insert into purchase values('&itemcode','&qty')

new 1: insert into purchase values('006','2')
1 row created.



SQL> select * from purchase;



 ITEMCODE               QTY

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

      1                 0

      2                 2

      3                 1

      4                 5

      5                 0

      7                 1

      6                 2



7 rows selected.

SQL> select itemcode,itemname from item where itemcode in(select itemcode from purchase where
qty!=0);

ITEMCODE                ITEMNAME

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

      2                 coffee_powder

      3                 dove_soap

      4                 clinicplus

      6                 fair&lovely

      7                 rice
SQL> select itemcode,itemname from item where itemcode in(select itemcode from purchase where
qty=0);

ITEMCODE             ITEMNAME

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

     1                    Tea_powder
     2                    Chilly_powder



SQL>select i.tem_code,p.item_name,p.qty from item I,purchase p where i.item_code=p.item_code;

Select sum(item_code)total_items_purchased from purchase;

SQL>Commit;

Commit complete.

Contenu connexe

Tendances

Dealing with Legacy PHP Applications
Dealing with Legacy PHP ApplicationsDealing with Legacy PHP Applications
Dealing with Legacy PHP ApplicationsClinton Dreisbach
 
CocoaHeads Moscow. Азиз Латыпов, VIPole. «Запросы в CoreData с агрегатными фу...
CocoaHeads Moscow. Азиз Латыпов, VIPole. «Запросы в CoreData с агрегатными фу...CocoaHeads Moscow. Азиз Латыпов, VIPole. «Запросы в CoreData с агрегатными фу...
CocoaHeads Moscow. Азиз Латыпов, VIPole. «Запросы в CoreData с агрегатными фу...Mail.ru Group
 
Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片cfc
 
Typed? Dynamic? Both! Cross-platform DSLs in C#
Typed? Dynamic? Both! Cross-platform DSLs in C#Typed? Dynamic? Both! Cross-platform DSLs in C#
Typed? Dynamic? Both! Cross-platform DSLs in C#Vagif Abilov
 
The Ring programming language version 1.9 book - Part 95 of 210
The Ring programming language version 1.9 book - Part 95 of 210The Ring programming language version 1.9 book - Part 95 of 210
The Ring programming language version 1.9 book - Part 95 of 210Mahmoud Samir Fayed
 
The secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you aboutThe secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you aboutDror Helper
 
code for quiz in my sql
code for quiz  in my sql code for quiz  in my sql
code for quiz in my sql JOYITAKUNDU1
 
Asynchronous JS in Odoo
Asynchronous JS in OdooAsynchronous JS in Odoo
Asynchronous JS in OdooOdoo
 
Everything you always wanted to know about forms* *but were afraid to ask
Everything you always wanted to know about forms* *but were afraid to askEverything you always wanted to know about forms* *but were afraid to ask
Everything you always wanted to know about forms* *but were afraid to askAndrea Giuliano
 
PHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsPHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsMichelangelo van Dam
 
PHPunit and you
PHPunit and youPHPunit and you
PHPunit and youmarkstory
 
Postgres rules
Postgres rulesPostgres rules
Postgres rulesgisborne
 
Mastering Oracle ADF Bindings
Mastering Oracle ADF BindingsMastering Oracle ADF Bindings
Mastering Oracle ADF BindingsEuegene Fedorenko
 
How to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureHow to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureOdoo
 

Tendances (20)

Dealing with Legacy PHP Applications
Dealing with Legacy PHP ApplicationsDealing with Legacy PHP Applications
Dealing with Legacy PHP Applications
 
Specs2
Specs2Specs2
Specs2
 
CocoaHeads Moscow. Азиз Латыпов, VIPole. «Запросы в CoreData с агрегатными фу...
CocoaHeads Moscow. Азиз Латыпов, VIPole. «Запросы в CoreData с агрегатными фу...CocoaHeads Moscow. Азиз Латыпов, VIPole. «Запросы в CoreData с агрегатными фу...
CocoaHeads Moscow. Азиз Латыпов, VIPole. «Запросы в CoreData с агрегатными фу...
 
Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片Contagion的Ruby/Rails投影片
Contagion的Ruby/Rails投影片
 
Typed? Dynamic? Both! Cross-platform DSLs in C#
Typed? Dynamic? Both! Cross-platform DSLs in C#Typed? Dynamic? Both! Cross-platform DSLs in C#
Typed? Dynamic? Both! Cross-platform DSLs in C#
 
The Ring programming language version 1.9 book - Part 95 of 210
The Ring programming language version 1.9 book - Part 95 of 210The Ring programming language version 1.9 book - Part 95 of 210
The Ring programming language version 1.9 book - Part 95 of 210
 
Automated Refactoring With IntelliJ IDEA
Automated Refactoring With IntelliJ IDEAAutomated Refactoring With IntelliJ IDEA
Automated Refactoring With IntelliJ IDEA
 
The secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you aboutThe secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you about
 
Bd venta.sql
Bd venta.sqlBd venta.sql
Bd venta.sql
 
code for quiz in my sql
code for quiz  in my sql code for quiz  in my sql
code for quiz in my sql
 
Hidden rocks in Oracle ADF
Hidden rocks in Oracle ADFHidden rocks in Oracle ADF
Hidden rocks in Oracle ADF
 
Asynchronous JS in Odoo
Asynchronous JS in OdooAsynchronous JS in Odoo
Asynchronous JS in Odoo
 
Leveraging Symfony2 Forms
Leveraging Symfony2 FormsLeveraging Symfony2 Forms
Leveraging Symfony2 Forms
 
Everything you always wanted to know about forms* *but were afraid to ask
Everything you always wanted to know about forms* *but were afraid to askEverything you always wanted to know about forms* *but were afraid to ask
Everything you always wanted to know about forms* *but were afraid to ask
 
PHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsPHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the tests
 
PHPunit and you
PHPunit and youPHPunit and you
PHPunit and you
 
Mpg Dec07 Gian Lorenzetto
Mpg Dec07 Gian Lorenzetto Mpg Dec07 Gian Lorenzetto
Mpg Dec07 Gian Lorenzetto
 
Postgres rules
Postgres rulesPostgres rules
Postgres rules
 
Mastering Oracle ADF Bindings
Mastering Oracle ADF BindingsMastering Oracle ADF Bindings
Mastering Oracle ADF Bindings
 
How to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureHow to Create a l10n Payroll Structure
How to Create a l10n Payroll Structure
 

En vedette

Марина Цветаева
Марина ЦветаеваМарина Цветаева
Марина Цветаеваhotcam20
 
досвід роботи
досвід роботи досвід роботи
досвід роботи nataljalistopad
 
Восточные лакомства
Восточные лакомстваВосточные лакомства
Восточные лакомстваhotcam20
 
The 6 biggest mistakes of golf instructors
The 6 biggest mistakes of golf instructorsThe 6 biggest mistakes of golf instructors
The 6 biggest mistakes of golf instructorsCharlie King
 
Up Close with Mayor Dave Bing
Up Close with Mayor Dave BingUp Close with Mayor Dave Bing
Up Close with Mayor Dave BingSkylineClub
 
Biologia odola
Biologia odolaBiologia odola
Biologia odolabioneskak
 
досвід роботи н. с.
досвід роботи н. с.досвід роботи н. с.
досвід роботи н. с.nataljalistopad
 
Guru panas baran (teori realiti)
Guru panas baran (teori realiti)Guru panas baran (teori realiti)
Guru panas baran (teori realiti)Merah Jambu
 
10 Steps to Product Market Fit - Japanese Translation
10 Steps to Product Market Fit - Japanese Translation10 Steps to Product Market Fit - Japanese Translation
10 Steps to Product Market Fit - Japanese TranslationMomoko Nagaoka
 

En vedette (11)

Марина Цветаева
Марина ЦветаеваМарина Цветаева
Марина Цветаева
 
досвід роботи
досвід роботи досвід роботи
досвід роботи
 
Восточные лакомства
Восточные лакомстваВосточные лакомства
Восточные лакомства
 
The 6 biggest mistakes of golf instructors
The 6 biggest mistakes of golf instructorsThe 6 biggest mistakes of golf instructors
The 6 biggest mistakes of golf instructors
 
Up Close with Mayor Dave Bing
Up Close with Mayor Dave BingUp Close with Mayor Dave Bing
Up Close with Mayor Dave Bing
 
Biologia odola
Biologia odolaBiologia odola
Biologia odola
 
Cost element categories
Cost element categoriesCost element categories
Cost element categories
 
досвід роботи н. с.
досвід роботи н. с.досвід роботи н. с.
досвід роботи н. с.
 
Guru panas baran (teori realiti)
Guru panas baran (teori realiti)Guru panas baran (teori realiti)
Guru panas baran (teori realiti)
 
10 Steps to Product Market Fit - Japanese Translation
10 Steps to Product Market Fit - Japanese Translation10 Steps to Product Market Fit - Japanese Translation
10 Steps to Product Market Fit - Japanese Translation
 
Opportunity analysis (2)
Opportunity analysis (2)Opportunity analysis (2)
Opportunity analysis (2)
 

Similaire à DBMS LAB

Organic Gardens SQL Database Schema By Christopher Kaczor
Organic Gardens SQL Database Schema By Christopher KaczorOrganic Gardens SQL Database Schema By Christopher Kaczor
Organic Gardens SQL Database Schema By Christopher KaczorChristopher Kaczor
 
Beyond SQL - Comparing SQL to TypeQL
Beyond SQL - Comparing SQL to TypeQLBeyond SQL - Comparing SQL to TypeQL
Beyond SQL - Comparing SQL to TypeQLVaticle
 
Optimizer in oracle 11g by wwf from ebay COC
Optimizer in oracle 11g by wwf from ebay COCOptimizer in oracle 11g by wwf from ebay COC
Optimizer in oracle 11g by wwf from ebay COCLouis liu
 
Sql seuence and sub queries
Sql seuence and sub queriesSql seuence and sub queries
Sql seuence and sub queriespooja kumari
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersConnor McDonald
 
Oracle Web Adi For upload item master
Oracle Web Adi For upload item masterOracle Web Adi For upload item master
Oracle Web Adi For upload item masterAhmed Elshayeb
 
Neo4j Makes Graphs Easy: Nicole White
Neo4j Makes Graphs Easy: Nicole WhiteNeo4j Makes Graphs Easy: Nicole White
Neo4j Makes Graphs Easy: Nicole WhiteNeo4j
 
SQL WORKSHOP::Lecture 7
SQL WORKSHOP::Lecture 7SQL WORKSHOP::Lecture 7
SQL WORKSHOP::Lecture 7Umair Amjad
 
Sql 99 and_some_techniques
Sql 99 and_some_techniquesSql 99 and_some_techniques
Sql 99 and_some_techniquesAlexey Kiselyov
 
Les07[1]Multiple-Column Subqueries
Les07[1]Multiple-Column SubqueriesLes07[1]Multiple-Column Subqueries
Les07[1]Multiple-Column Subqueriessiavosh kaviani
 
SQL Server 2008 Portfolio
SQL Server 2008 PortfolioSQL Server 2008 Portfolio
SQL Server 2008 Portfoliolilredlokita
 
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and OptimizationPgDay.Seoul
 
How Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills setsHow Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills setsChad Petrovay
 

Similaire à DBMS LAB (20)

Organic Gardens SQL Database Schema By Christopher Kaczor
Organic Gardens SQL Database Schema By Christopher KaczorOrganic Gardens SQL Database Schema By Christopher Kaczor
Organic Gardens SQL Database Schema By Christopher Kaczor
 
SQL QUERY PRACTICE
SQL QUERY PRACTICE SQL QUERY PRACTICE
SQL QUERY PRACTICE
 
4sem dbms(1)
4sem dbms(1)4sem dbms(1)
4sem dbms(1)
 
Sql-Injection
Sql-InjectionSql-Injection
Sql-Injection
 
Beyond SQL - Comparing SQL to TypeQL
Beyond SQL - Comparing SQL to TypeQLBeyond SQL - Comparing SQL to TypeQL
Beyond SQL - Comparing SQL to TypeQL
 
Optimizer in oracle 11g by wwf from ebay COC
Optimizer in oracle 11g by wwf from ebay COCOptimizer in oracle 11g by wwf from ebay COC
Optimizer in oracle 11g by wwf from ebay COC
 
Sql seuence and sub queries
Sql seuence and sub queriesSql seuence and sub queries
Sql seuence and sub queries
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer Disasters
 
Oracle Web Adi For upload item master
Oracle Web Adi For upload item masterOracle Web Adi For upload item master
Oracle Web Adi For upload item master
 
Sql ejercicio 1
Sql ejercicio 1Sql ejercicio 1
Sql ejercicio 1
 
Neo4j Makes Graphs Easy: Nicole White
Neo4j Makes Graphs Easy: Nicole WhiteNeo4j Makes Graphs Easy: Nicole White
Neo4j Makes Graphs Easy: Nicole White
 
SQL WORKSHOP::Lecture 7
SQL WORKSHOP::Lecture 7SQL WORKSHOP::Lecture 7
SQL WORKSHOP::Lecture 7
 
Sql 99 and_some_techniques
Sql 99 and_some_techniquesSql 99 and_some_techniques
Sql 99 and_some_techniques
 
Les07[1]Multiple-Column Subqueries
Les07[1]Multiple-Column SubqueriesLes07[1]Multiple-Column Subqueries
Les07[1]Multiple-Column Subqueries
 
Plsql lab mannual
Plsql lab mannualPlsql lab mannual
Plsql lab mannual
 
Cassandra 2.2 & 3.0
Cassandra 2.2 & 3.0Cassandra 2.2 & 3.0
Cassandra 2.2 & 3.0
 
SQL Server 2008 Portfolio
SQL Server 2008 PortfolioSQL Server 2008 Portfolio
SQL Server 2008 Portfolio
 
DOODB_LAB.pptx
DOODB_LAB.pptxDOODB_LAB.pptx
DOODB_LAB.pptx
 
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
 
How Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills setsHow Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills sets
 

Dernier

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Dernier (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 

DBMS LAB

  • 1. LAB – 4 create table item(itemcode number, itemname varchar(20), price number(10,2), primary key(itemcode)); Table created. SQL> desc item; Name Null? Type ----------------------------------------- -------- ---------------------------- ITEMCODE NOT NULL NUMBER ITEMNAME VARCHAR2(20) PRICE NUMBER(10,2) create table purchase(itemcode number, qty number, foreign key(itemcode) references item(itemcode)); Table created. SQL> desc purchase; Name Null? Type ----------------------------------------- -------- ---------------------------- ITEMCODE NUMBER QTY NUMBER SQL> insert into item values('&itemcode','&itemname','&price'); Enter value for itemcode: 001 Enter value for itemname: tea_powder Enter value for price: 25 old 1: insert into item values('&itemcode','&itemname','&price')
  • 2. new 1: insert into item values('001','tea_powder','25') 1 row created. SQL> / Enter value for itemcode: 002 Enter value for itemname: coffee_powder Enter value for price: 40 old 1: insert into item values('&itemcode','&itemname','&price') new 1: insert into item values('002','coffee_powder','40') 1 row created. SQL> / Enter value for itemcode: 003 Enter value for itemname: dove_soap Enter value for price: 49 old 1: insert into item values('&itemcode','&itemname','&price') new 1: insert into item values('003','dove_soap','49') 1 row created. SQL> / Enter value for itemcode: 004 Enter value for itemname: clinicplus
  • 3. Enter value for price: 10 old 1: insert into item values('&itemcode','&itemname','&price') new 1: insert into item values('004','clinicplus','10') 1 row created. SQL> / Enter value for itemcode: 005 Enter value for itemname: chilly_powder Enter value for price: 15 old 1: insert into item values('&itemcode','&itemname','&price') new 1: insert into item values('005','chilly_powder','15') 1 row created. SQL> / Enter value for itemcode: 006 Enter value for itemname: fair&lovely Enter value for price: 40 old 1: insert into item values('&itemcode','&itemname','&price') new 1: insert into item values('006','fair&lovely','40') 1 row created. SQL> /
  • 4. Enter value for itemcode: 007 Enter value for itemname: rice Enter value for price: 30 old 1: insert into item values('&itemcode','&itemname','&price') new 1: insert into item values('007','rice','30') 1 row created. SQL> select * from item; ITEMCODE ITEMNAME PRICE ---------- -------------------- ---------- 1 tea_powder 25 2 coffee_powder 40 3 dove_soap 49 4 clinicplus 10 5 chilly_powder 15 6 fair&lovely 40 7 rice 30 7 rows selected. SQL> insert into purchase values('&itemcode','&qty'); Enter value for itemcode: 001 Enter value for qty: 0
  • 5. old 1: insert into purchase values('&itemcode','&qty') new 1: insert into purchase values('001','0') 1 row created. SQL> / Enter value for itemcode: 002 Enter value for qty: 2 old 1: insert into purchase values('&itemcode','&qty') new 1: insert into purchase values('002','2') 1 row created. SQL> / Enter value for itemcode: 003 Enter value for qty: 1 old 1: insert into purchase values('&itemcode','&qty') new 1: insert into purchase values('003','1') 1 row created. SQL> / Enter value for itemcode: 004 Enter value for qty: 5 old 1: insert into purchase values('&itemcode','&qty')
  • 6. new 1: insert into purchase values('004','5') 1 row created. SQL> / Enter value for itemcode: 005 Enter value for qty: 0 old 1: insert into purchase values('&itemcode','&qty') new 1: insert into purchase values('005','0') 1 row created. SQL> / Enter value for itemcode: 007 Enter value for qty: 1 old 1: insert into purchase values('&itemcode','&qty') new 1: insert into purchase values('007','1') 1 row created. SQL> / Enter value for itemcode: 006 Enter value for qty: 2 old 1: insert into purchase values('&itemcode','&qty') new 1: insert into purchase values('006','2')
  • 7. 1 row created. SQL> select * from purchase; ITEMCODE QTY ---------- ---------- 1 0 2 2 3 1 4 5 5 0 7 1 6 2 7 rows selected. SQL> select itemcode,itemname from item where itemcode in(select itemcode from purchase where qty!=0); ITEMCODE ITEMNAME ---------- -------------------- 2 coffee_powder 3 dove_soap 4 clinicplus 6 fair&lovely 7 rice
  • 8. SQL> select itemcode,itemname from item where itemcode in(select itemcode from purchase where qty=0); ITEMCODE ITEMNAME ---------------------------------------- 1 Tea_powder 2 Chilly_powder SQL>select i.tem_code,p.item_name,p.qty from item I,purchase p where i.item_code=p.item_code; Select sum(item_code)total_items_purchased from purchase; SQL>Commit; Commit complete.