A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 6, Problem 4SCG
Program Plan Intro
UPDATE command:
- The “UPDATE” command is employed to update information present in a table.
- It is always used with SET keyword either in bulk or individually.
Syntax for update the value in the table is given as follows:
The Syntax for update the value in the table is given below:
UPDATE table_name
SET column1 = data1, column2 = data2, ...
WHERE condition;
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
StayWell has increased the monthly rent of each large property by $150. Update the monthly rents in the LARGE_PROPERTY table accordingly.
Some rows of the table STUDENT are shown below:
CODE
NAME
DEPARTMENT
GPA
YEAR
291
ALEX
PSI
3.1
1992
938
MICHELE
PHY
2.3
1992
931
JHON
MD
3.3
2001
182
JOE
MD
3.4
2002
190
REY
PHY
2.0
2001
330
RON
PSI
3.9
2001
You want the name all departments that have a department GPA average of 2004 greater than the global GPA average. Which query gives you the desired result?
a.
SELECT DEPARTMENT
FROM STUDENT
WHERE YEAR = 2004
GROUP BY DEPARTMENT
HAVING AVG(GPA) > (SELECT AVG(GPA) FROM STUDENT);
b.
SELECT DEPARTMENT
FROM STUDENT
WHERE YEAR = 2004 AND AVG(GPA) > (SELECT AVG(GPA) FROM STUDENT)
GROUP BY DEPARTMENT;
c.
SELECT DEPARTMENT
FROM STUDENT
WHERE YEAR = 2004
GROUP BY DEPARTMENT
HAVING AVG(GPA) > (SELECT GPA FROM STUDENT GROUP BY DEPARTMENT);
d.
SELECT *
FROM STUDENT
WHERE YEAR = 2004
GROUP BY DEPARTMENT
HAVING AVG(GPA) > (SELECT AVG(GPA) FROM STUDENT);
Three columns and 20 rows make up 'game1' and 15 rows make up 'game2' in this example. Both tables have five rows in common. What is the table's degree and cardinality if we take union?
Chapter 6 Solutions
A Guide to SQL
Ch. 6 - Prob. 1RQCh. 6 - Which command and clause adds an individual row to...Ch. 6 - How do you add data from an existing table to...Ch. 6 - Prob. 4RQCh. 6 - Which command removes rows from a table?Ch. 6 - Which command makes updates permanent?Ch. 6 - Which command reverses updates? Which updates are...Ch. 6 - Prob. 8RQCh. 6 - What is the format of the SET clause that changes...Ch. 6 - Which command and clause adds a column to an...
Ch. 6 - Prob. 11RQCh. 6 - Which command deletes a table and all its data?Ch. 6 - Prob. 13RQCh. 6 - Prob. 1TDCh. 6 - Prob. 2TDCh. 6 - Prob. 3TDCh. 6 - Prob. 4TDCh. 6 - Prob. 5TDCh. 6 - Prob. 6TDCh. 6 - In the NONGAME table, change the category for item...Ch. 6 - Prob. 8TDCh. 6 - Prob. 9TDCh. 6 - Prob. 10TDCh. 6 - Prob. 11TDCh. 6 - Use SQL to make the following changes to the...Ch. 6 - Prob. 2CATCh. 6 - Prob. 3CATCh. 6 - Prob. 4CATCh. 6 - Prob. 5CATCh. 6 - Prob. 6CATCh. 6 - Add to the PADDLING table a new character column...Ch. 6 - Prob. 8CATCh. 6 - Prob. 9CATCh. 6 - Prob. 10CATCh. 6 - Prob. 11CATCh. 6 - Prob. 12CATCh. 6 - Use SQL to make the following changes to the...Ch. 6 - Prob. 2SCGCh. 6 - Prob. 3SCGCh. 6 - Prob. 4SCGCh. 6 - Prob. 5SCGCh. 6 - Prob. 6SCGCh. 6 - Prob. 7SCGCh. 6 - Prob. 8SCGCh. 6 - Prob. 9SCGCh. 6 - Prob. 10SCGCh. 6 - Prob. 11SCGCh. 6 - Prob. 12SCG
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
- Ensure that the only legal values for the BDRMS column in the CONDO_UNIT table are 1, 2, or 3.arrow_forwardHow can you verify the constraints that exist for a table?arrow_forwardGiven the employee information in Question 11, list the query output for the EXCEPT (MINUS) query of EMPLOYEE to EMPLOYEE_1.arrow_forward
- Problem 22 Insert the following customer into the CUST_MYSQL table, allowing the AUTO_INCREMENT attribute set up in Problem 20.a and Problem 20.b to generate the customer number automatically: CUST_LNAME CUST_FNAME CUST_BALANCE Powers Ruth 500arrow_forwardColonial Adventure Tours is considering changing the way it handles reservations. Instead of storing the number of persons associated with one reservation, the company would like to store the name and address of each person associated with each reservation. If Colonial Adventure Tours decides to implement this change, the tripprice and other fee amounts for each trip would be dependent on only the trip ID. Determine the multivalued dependencies in the following table, and then convert this table to an equivalent collection of tables that are infourth normal form: Reservation (ReservationID, TripID, TripDate, TripPrice, OtherFees,(ClientNum, ClientLastName, ClientFirstName, Address, City, State,ZipCode, Phone))arrow_forwardUsing apply, make a table that's a copy of raw_compensation with one additional column called Total Pay ($). That column should contain the result of applying convert_pay_string_to_number to the Total Pay column (as we did above). Call the new table compensation. compensation = raw_compensation.with_column( "Total Pay ($)", ... )compensationarrow_forward
- A table called "game1" contains three columns and twenty rows, but "game2" has the same column as game1 (ie 3) and fifteen rows. Both tables have 5 rows in common. What is the degree and cardinality of the resulting table if we take union?arrow_forwardConvert the following table to an equivalent collection of tables that are in third normal form. This table contains information about patients of a dentist. Each patient belongs to a household. Patient (HouseholdNum, HouseholdName, Street, City, State, PostalCode, Balance, PatientNum, PatientName, (ServiceCode, Description, Fee, Date)) The following dependencies exist in the Patient table: PatientNum → HouseholdNum, HouseholdName, Street, City, State, PostalCode, Balance, PatientName HouseholdNum → HouseholdName, Street, City, State, PostalCode, Balance ServiceCode → Description, Fee PatientNum, ServiceCode → Datearrow_forward4.1 Your company wants to categorize employee salaries to determine who is eligible for a payraise based on their current salary. Below are the conditions.• Less than 10,000 is classify as a low wage.• Between 10,000 and 20,000, is classify as a medium wage, and• Above 20,000, is classify as a high wage.Write an SQL query to implement this using the stafflist tablearrow_forward
- Some rows of the STUDENT table are shown below: CODE NAME GPA YEAR 291 ALEX 3.1 2 938 MICHELE 2.3 1 931 JHON 3.3 1 182 JOE 3.4 2 190 REY 2.0 2 330 RON 3.9 3 Which best describes the result of the query below? SELECT YEAR, AVG(GPA) FROM STUDENT WHERE GPA > 2.0 GROUP BY YEAR a. The average maximum GPA of all the students in each year. b. The year of the student with the maximum GPA. c. The average GPA of students with a GPA higher than 2.0 each year. d. The average GPA of the students with a GPA higher than 2.0.arrow_forwardQ51: Which of the following tables will be the better candidate for Incremental Backup? • Customers • Products • Sales • Employees Q52: When normalizing tables and we say that attribute a determines attribute b we mean that : • When we type in a value for a, we can get multiple values for b • When we type in a value for a, we do not get any values for b • When we type in a value for a, we get one and only one value for b • Attribute a is the parent attribute and attribute b is the child attributearrow_forwardProblem 22 Insert the following customer into the CUST_MYSQL table, allowing the AUTO_INCREMENT attribute set up in Problem 20.a and Problem 20.b to generate the customer number automatically: CUST_LNAME CUST_FNAME CUST_BALANCE Powers Ruth 500 This is what problem 20.a said, and got right: Using MySQL, create a table named CUST_MYSQL with the same fields as in Problem 16, except, use the AUTO_INCREMENT feature for the CUST_NUM field. This is what problem 20.b said, and got right: Using MySQL, alter the table to populate the CUST_NUM field, beginning the increment with 2000.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage Learning
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning