Question

assume that you have a new column called itempricetax after tax added to the item table...

assume that you have a new column called itempricetax after tax added to the item table this column will store the price of the item after tax. Write a sql statement to update all the values of this column. sales tax is 6.25%.

Homework Answers

Answer #1

We can use an alter statement to insert a new column to a existing table and then to update the values of that column update statement can be used. According to the question, itempricetax is a new column into existing table item . We can assume that there is a price column that contains price of respective item then we can use the update statement like

Update item set itempricetax = (0.0625*price)+ price ;

A where clause is often given in update statement if we want to change particular row but since in this case we want to update all rows so where clause is not used. The above statement will add sales tax of 6.25% to the price of the items.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write an update statement modifies the sales_total column of sales_totals table. Modify the sales_total as "2345.56"...
Write an update statement modifies the sales_total column of sales_totals table. Modify the sales_total as "2345.56" for the representative with id 4 for the year 2017 After execution of your query, data of sales_Totals table should look as shown below : rep_id sales_year sales_total 1 2016 1274856.38 1 2017 923746.85 1 2018 998337.46 2 2016 978465.99 2 2017 974853.81 2 2018 887695.75 3 2016 1032875.48 3 2017 1132744.56 4 2017 2345.56 4 2018 72443.37 5 2017 422847.86 5 2018 45182.44...
Assume the TRIP table contains a column named TotalPersons that represents the total number of persons...
Assume the TRIP table contains a column named TotalPersons that represents the total number of persons for that trip. Following the style shown in the class PowerPoint, write the T-SQL trigger code for the situations given below.  You will not be able to test these triggers without the TotalPersons column. When inserting a row in the RESERVATION table, add the NumPersons value to the TotalPersons value for the appropriate trip. When updating a row in the RESERVATION table, add the difference...
EMPLOYEE Field Name EMP_ID EMP_LNAME EMP_MI EMP_FNAME EMP_SEX EMP_AGE EMP_SALARY EMP_HIREDATE DEPT_CODE Table: DEPARTMENT DEPT_CODE BIOL...
EMPLOYEE Field Name EMP_ID EMP_LNAME EMP_MI EMP_FNAME EMP_SEX EMP_AGE EMP_SALARY EMP_HIREDATE DEPT_CODE Table: DEPARTMENT DEPT_CODE BIOL CPTR HIST MATH RELB Data Type Text Text Text Text Text Number Currency Date/Time Text DEPT_TITLE Biology Computer Science History Mathematics Religion    Field Name DEPT_CODE DEPT_TITLE Data Type Text Text INSTRUCTIONS Use SQL commands to create the tables and enter the data shown above using MS Access. Write the following SQL statement given below: 1. 2. 3. 4. 5. 6. 7. 8. 9....
A Guide to SQL Questions 1. How do you create a table using SQL? 2. How...
A Guide to SQL Questions 1. How do you create a table using SQL? 2. How do you delete a table using SQL? 3. What are the common data types used to define columns using SQL? 4. Identify the best data type to use to store the following data in Oracle, in SQL Server, and in Access:    a. The month, day, and year that an employee was hired    b. An employee’s Social Security number    c. The department...
Use the following tables to answer Q5 and Q6. Tourist (tno, Name, phone, age,loc) Vehicle (Vno,...
Use the following tables to answer Q5 and Q6. Tourist (tno, Name, phone, age,loc) Vehicle (Vno, model, mileage, owner_name, owner_ph)) Rented (tno, Vno) 5. (i)Write an SQL query, to create the table vehicle with following constraints: Vno should begin with second letter ‘v’; Models are one among Thar, X3. Mileage should be above 18 and below 25. No two records can have same phone (ii) Write an SQL query to retrieve the name of the owner who does owns X3...
Summary The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to projects....
Summary The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each employee works on each project. The structure and contents of the Ch08_ConstructCo database are shown in Figure P8.1. Use this database to answer the following problems. Database Schema The schema for the Ch08_ConstructCo database is shown below and should be used to answer the next several problems. Click this image to view it in its own...
If you had to create a new table in your database called EMPLOYEE and load data...
If you had to create a new table in your database called EMPLOYEE and load data into it using SQL commands below. CREATE TABLE EMPLOYEE (               EMP_ID INT PRIMARY KEY,               EMP_FNAME VARCHAR(200) NOT NULL,               EMP_LNAME VARCHAR(200) NOT NULL,               EMP_CITY VARCHAR(500) NULL ,               EMP_STATE VARCHAR(20) NULL ) INSERT INTO EMPLOYEE VALUE (1, ‘Kevin’, ‘Lailnay’, NULL, ‘PA’) INSERT INTO EMPLOYEE VALUE (2, ‘Sarita, ‘Kawn, ‘Princeton’,’NJ’) INSERT INTO EMPLOYEE VALUE (2, ‘Gloria, ‘Pitts, ‘Allentown, ‘PA’) INSERT INTO EMPLOYEE...
After-Tax Cash Flows Warren Company plans to open a new repair service center for one of...
After-Tax Cash Flows Warren Company plans to open a new repair service center for one of its electronic products. The center requires an investment in depreciable assets costing $420,000. The assets will be depreciated on a straight-line basis, over four years, and have no expected salvage value. The annual income statement for the center is given below. Revenues $410,000 Less: Cash operating expenses (164,000) Depreciation (105,000)   Income before income taxes $141,000 Less: Income taxes (@40%) 56,400   Net income $84,600 Required:...
After-Tax Cash Flows Warren Company plans to open a new repair service center for one of...
After-Tax Cash Flows Warren Company plans to open a new repair service center for one of its electronic products. The center requires an investment in depreciable assets costing $448,000. The assets will be depreciated on a straight-line basis, over four years, and have no expected salvage value. The annual income statement for the center is given below. Revenues $400,000 Less: Cash operating expenses (160,000) Depreciation (112,000)   Income before income taxes $128,000 Less: Income taxes (@40%) 51,200   Net income $76,800 Required:...
-- Drop the tables if they existDROP TABLE REP CASCADE CONSTRAINTS;DROP TABLE CUSTOMER CASCADE CONSTRAINTS;DROP TABLE...
-- Drop the tables if they existDROP TABLE REP CASCADE CONSTRAINTS;DROP TABLE CUSTOMER CASCADE CONSTRAINTS;DROP TABLE ORDERS CASCADE CONSTRAINTS;DROP TABLE ITEM CASCADE CONSTRAINTS;DROP TABLE ORDER_LINE CASCADE CONSTRAINTS;-- You are to change CUSTOMER to CUSTOMERS for the Colonial database to avoid conflict with the CUSTOMER table in Tal.-- Create the tablesCREATE TABLE REP(REP_NUM CHAR(2) PRIMARY KEY,LAST_NAME CHAR(15),FIRST_NAME CHAR(15),STREET CHAR(15),CITY CHAR(15),STATE CHAR(2),POSTAL_CODE CHAR(5),COMMISSION DECIMAL(7,2),RATE DECIMAL(3,2) );CREATE TABLE CUSTOMER(CUSTOMER_NUM CHAR(3) PRIMARY KEY,CUSTOMER_NAME CHAR(35) NOT NULL,STREET CHAR(20),CITY CHAR(15),STATE CHAR(2),POSTAL_CODE CHAR(5),BALANCE DECIMAL(8,2),CREDIT_LIMIT DECIMAL(8,2),REP_NUM CHAR(2) );CREATE...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT