SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Using the class example database (SQLFUN), create the required SQL statements to produce the
following results: add a new food to the L_foods table from a new supplier, add Fresh Salmon as
menu-item 11, The supplier_id is CFF, The product_code is SA, the price is $8.25, there is no
price_increase value. Step 1: Add CFF to the L_supplier table(the name of this supplier is
Cathy's Fresh Fish). Step 2: In oracle or mySQL, make these two inserts in a single transaction.
Solution
Using transaction, we can make two insert statements into single transaction.
START TRANSACTION;
INSERT INTO L_Supplier (supplier_id, name) VALUES ('CFF', 'Cathy's Fesh Fish');
INSERT INTO L_foods (id, supplier_id, menu_item, product_code, price) VALUES (1, 'CFF',
11, 'SA', 8.25);
COMMIT;

Weitere ähnliche Inhalte

Mehr von rtodd575

Mehr von rtodd575 (6)

Using Java- Evaluate the expression- Be sure to list a value of approp.docx
Using Java- Evaluate the expression- Be sure to list a value of approp.docxUsing Java- Evaluate the expression- Be sure to list a value of approp.docx
Using Java- Evaluate the expression- Be sure to list a value of approp.docx
 
Use your favorite search engine to find the IRSSolutionS corporations.docx
Use your favorite search engine to find the IRSSolutionS corporations.docxUse your favorite search engine to find the IRSSolutionS corporations.docx
Use your favorite search engine to find the IRSSolutionS corporations.docx
 
Wade draws a correlation between _____________________ and the onset o.docx
Wade draws a correlation between _____________________ and the onset o.docxWade draws a correlation between _____________________ and the onset o.docx
Wade draws a correlation between _____________________ and the onset o.docx
 
Virtualization and the cloud Explain the differences between virtualiz.docx
Virtualization and the cloud Explain the differences between virtualiz.docxVirtualization and the cloud Explain the differences between virtualiz.docx
Virtualization and the cloud Explain the differences between virtualiz.docx
 
Use the following terms to answer the question(s) below- A- This react.docx
Use the following terms to answer the question(s) below- A- This react.docxUse the following terms to answer the question(s) below- A- This react.docx
Use the following terms to answer the question(s) below- A- This react.docx
 
Use the method of substitution to find the stationary values of Z- i-e.docx
Use the method of substitution to find the stationary values of Z- i-e.docxUse the method of substitution to find the stationary values of Z- i-e.docx
Use the method of substitution to find the stationary values of Z- i-e.docx
 

Kürzlich hochgeladen

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
heathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
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
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

Using the class example database (SQLFUN)- create the required SQL sta.docx

  • 1. Using the class example database (SQLFUN), create the required SQL statements to produce the following results: add a new food to the L_foods table from a new supplier, add Fresh Salmon as menu-item 11, The supplier_id is CFF, The product_code is SA, the price is $8.25, there is no price_increase value. Step 1: Add CFF to the L_supplier table(the name of this supplier is Cathy's Fresh Fish). Step 2: In oracle or mySQL, make these two inserts in a single transaction. Solution Using transaction, we can make two insert statements into single transaction. START TRANSACTION; INSERT INTO L_Supplier (supplier_id, name) VALUES ('CFF', 'Cathy's Fesh Fish'); INSERT INTO L_foods (id, supplier_id, menu_item, product_code, price) VALUES (1, 'CFF', 11, 'SA', 8.25); COMMIT;