Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Consider the following command:
UPDATE order_details SET quantity = quantity --10
What happens if we run this command in MySQL?
-
a.)
An error is thrown due to the --.
-
b.)
The quantity in the order_details table for all records is decremented by 10.
-
c.)The order_details table has all of the quantity set to the same value as it previously had.
-
d.)
The quantity in the order_details table for all records is incremented by 10.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Task 2: StayWell is an active business and already has some data collected over e-mails and phone conversations. You need to insert the following data to the OWNER and PROPERTY tables: Add the provided information to the OWNER table. Add the provided information to the PROPERTY table.arrow_forwardPrint a single record using PL/SQL (show spool output please)( LEDGER_VIEW is shown in pic) SPOOL your output to c:\Folder\project3spool.txt Set SERVEROUTPUT ON to use the DBMS_OUTPUT package Set up variables in the DECLARE section using %TYPEfor REGID, REGDATE, FIRSTNAME, LASTNAME, ROOMNUM, and ROOMRATE SELECT the fields INTO the associated variables from LEDGER_VIEWwhere REGID is 8 Use DBMS__OUTPUT.OUTPUT_LINE to print the values for each field. Compile and run the procedure Close spoolarrow_forwardI need help with a delete statement that will remove all records in a products table that's has the vendor is FNG01.arrow_forward
- The Finance team wants to calculate a VAT (8%) on the amount of the stay reservations in the database. However, the team wants to calculate the VAT after the discounts are applied on the prices. In addition, it is important to remember if there is no discount/offers, then the value is NULL in the TRAVELS table. Create a procedure called VATCalculator to calculate the VAT amount and return with the corresponding travel ID. In addition, execute the procedure to account for NULL values and send the respective result to the team. The VAT value should be rounded to 2 decimals.arrow_forwardI would like to create a function to sum up total order amount within the date range, but i don't know how to write the right query. The query below is for counting the total orders, but I want to change to sum up total order amount. The Database table is attached. Please assist. ************************************** USE SQLBook; DROP FUNCTION IF EXISTS GetDateRangewithordersAmountGO CREATE FUNCTION GetDateRangewithordersAmount( @startDate DateTime, @endDate DateTime)RETURNS TABLE ASRETURN ( select [State], count (*) as [TotalOrderAmount] FROM [SQLBook].[dbo].[Orders] WHERE [OrderDate] between @startDate AND @endDate group by [State])GO SELECT * FROM GetDateRangewithordersAmount('2015-09-01','2015-10-31');GOarrow_forward!I am doing all this from cengage! Task 10: List all the tables contained within the system catalog, but only display the first 10 records with a TABLE_TYPE of SYSTEM VIEW. I did with: SELECT * FROM (SELECT * from KimTay) WHERE ROWNUM <= 11; and with: SELECT * FROM (SELECT TABLE_NAME FROM ALL_TABLES ORDER BY TABLE_NAME ) WHERE ROWNUM <= 10; and with: SELECT * FROM SYSTABLES but nothing worked and some of them gave me an error as (ERROR 1248 (42000) at line 1: Every derived table must have its own alias) and I need answers for these too: Task 11: List all the columns contained within the system catalog, but only display the first 11 records that are in the KimTay TABLE_SCHEMA. Task 12: List all the views contained within the system catalog, but only display the first 12 records. Task 13: Write the command to display only tables within the system catalog that have the KimTay TABLE_SCHEMA and are of the type BASE TABLE. Display only the following columns:…arrow_forward
- a. Write the SQL commands to create each table after normalization.b. Write insert command to add 5 rows in each of the table.c. Write a delete command to delete row from each table.d. Write the commands to query following values.1. Show Product id and finish date for all Products2. Show Product id and finish for all Products, sort by Product_Line_ID byascending order3. Show Product id and finish for all Products, sort by Product_Line_ID bydescending order4. Show each Product_Line_ID and the total number of Products for theProduct_Line_IDarrow_forwardFirst, create (Clone) another version of DEPARTMENTS table with Create table as select command .something like this below. CREATE TABLE new_departments AS SELECT * FROM hr_DEPARTMENTS WHERE 1=2; This unmatcheched WHERE condition will be able to create same table as DEPARTMENT but no data in it. Empty version. Create a PL/SQL block that selects the record which belongs to maximum department ID in the hr_departments table and stores entire record info to composite variable as RECORD. (Lets say cv_dept) Create this composite variable same ROWTYPE of DEPARTMENT table. Declare a variable, v_max_deptno , of type NUMBER in the declarative section. Start the executable section with the BEGIN keyword and include a SELECT statement to retrevive the maximum department_id from the departments table. By using this v_max_deptno use this number in WHERE condition of SELECT statement and make sure you only bring one row from DEPARTMENTS table to composite variable. You will now INSERT this max…arrow_forwardInsert the following records into their corresponding tables, using the MySQL CLI. Take a screenshot of a Select * command being successfully executed on each table (6 total). Subject subjectNumber Name gradeLevel 62 Algebra 9 33 Biology 10 83 Legal Studies 11 35 Entomology 9 70 Norse Mythology 10 23 Geography 10 67 Literature 12 78 World History 11 13 US History 12 9 Astronomy 9 53 Self Defense 12 85 Introduction to Computer Science 11 43 Algebra II 10arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education