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
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....
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...
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...
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:...
If you want to add the current date to the column of "Date" in Table1, which...
If you want to add the current date to the column of "Date" in Table1, which of the following code is correct: A. Dim dr As New Row = Table1.NewRow dr("Date") = Nowadys.ToShortDateString B. Dim dr As DataRow = Table1.NewRow dr("Date") = Now.ToLongDateString C. Dim dr As DataRow = Table1.NewRow dr("Date") = Current.ToShortDateString D. Dim dr As DataRow = Table1.Row dr("Date") = Present.ToLongDateString What's the meaning of "1" in the following line of code: .Item("AvgBooks") = FormatNumber(.Item("Books") / .Item("Number"), 1)...
in his New York Times column of May 27, 2005, economist Paul Krugman stated: “After all,...
in his New York Times column of May 27, 2005, economist Paul Krugman stated: “After all, the Fed’s ability to manage the economy mainly comes from the ability to create booms and busts in the housing market.” What do you think he means by that statement? Is it an accurate characterization of the Federal Reserve’s influence over the real economy?
In his New York Times column of May 27, 2005, economist Paul Krugman stated: “After all,...
In his New York Times column of May 27, 2005, economist Paul Krugman stated: “After all, the Fed’s ability to manage the economy mainly comes from the ability to create booms and busts in the housing market.” What do you think he means by that statement? Is it an accurate characterization of the Federal Reserve’s influence over the real economy?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT