Question

In: Computer Science

Enter the following record into the Inventory table using data listed below: Make Model Yr Description...

  1. Enter the following record into the Inventory table using data listed below:

Make

Model

Yr

Description

CarCondition

Cost

Selling Price

Date Arrived

Date Sold

RepNumber

Pontiac

Grand Am

2005

4-Door, Red

Excellent

$8,000

$9,990

5/5/08

6/1/08

1

Lincoln

Town Car

2001

2-Door, White

Good

$5,500

$5,995

4/15/08

4/20/08

3

Chevrolet

Cavalier

2005

4-Door, Blue

Excellent

$7,000

5/15/08

Toyota

Corolla

2001

4-Door, Black

Fair

$4,000

$4,500

5/1/08

Ford

Tempo

2002

2-Door, Red

Poor

$2,000

$2,300

5/5/08

Chevrolet

Lumina

2005

2-Door, White

Excellent

$8,500

5/12/08

Ford

Focus

2003

5 Speed, Black

Good

$6,500

$7,000

4/20/08

4/30/08

1

Ford

Escort

2000

2-Door, White

Excellent

$5,500

5/3/08

Plymouth

Neon

2001

4-Door, Blue

Good

$6,500

5/1/08

Ford

Taurus LX

2003

Wagon, Gray

Excellent

$8,200

5/20/07

  1. The Chevrolet Lumina was sold on 5/20/08 by Bauer for $9,300. Update the INVENTORY table and modify date sold, selling price, and repnumber.
  2. Write SQL statements to query the following information
    1. All vehicles available for sale with a selling price less than $6,000, sorted by cost in descending order.
    2. All vehicles sold, grouped by Sales Rep.
    3. All vehicles made by Ford and Toyota.

Solutions

Expert Solution

HERE In the Inventory table I used the column name as [Date Arrived] because in the column name we cannot use the space directly. So in the bracket we write like that or just DateArrived. LIkewise I named the column

I used Microsoft Sql SErver and this query language is not case sensitive. So capital or small letter name will be same. Also dollar symbol or the comma used to seperate the cost is removed because its not needed As a float I m inserting.


--TABLE CREATION QUERY 
Create table Inventory(Make VARCHAR(20),Model VARCHAR(20),Yr INT,Description VARCHAR(20),CarCondition VARCHAR(20),Cost FLOAT,
[Selling Price] FLOAT,[Date Arrived] DATETIME,[Date Sold] DATETIME,RepNumber INT )


--INSERTING INTO THE INVENTORY TABLE QUERY
INSERT INTO INVENTORY VALUES('Pontiac','Grand Am',2005,'4-Door, Red','Excellent',8000,9990,'5/5/2008','6/1/2008',1)
INSERT INTO INVENTORY VALUES('Lincoln','Town Car',2001,'2-Door, White','Good',5500,5995,'4/15/08','4/20/08',3)
INSERT INTO INVENTORY VALUES('Chevrolet','Cavalier',2005,'4-Door, Blue','Excellent',7000,'','5/15/08','','')
INSERT INTO INVENTORY VALUES('Toyota','Corolla',2001,'4-Door, Black','Fair',4000,4500,'5/1/08','','')
INSERT INTO INVENTORY VALUES('Ford','Tempo',2002,'2-Door, Red','Poor',2000,2300,'5/5/08','','')
INSERT INTO INVENTORY VALUES('Chevrolet','Lumina',2005,'2-Door, White','Excellent',8500,'','5/12/08','','')
INSERT INTO INVENTORY VALUES('Ford','Focus',2003,'5 Speed, Black','Good',6500,7000,'4/20/08','4/30/08',1)
INSERT INTO INVENTORY VALUES('Ford','Escort',2000,'2-Door, White','Excellent',5500,'','5/3/08','','')
INSERT INTO INVENTORY VALUES('Plymouth','Neon',2001,'4-Door, Blue','Good',6500,'','5/1/08','','')
INSERT INTO INVENTORY VALUES('Ford','Taurus LX',2003,'Wagon, Gray','Excellent',8200,'','5/20/07','','')


--SELECT * FROM INVENTORY


--  FOR UPDATING THE CHEVROLET LUMINA
UPDATE Inventory SET [Date Sold]='5/20/08',[Selling Price]=9300 WHERE MAKE='Chevrolet' AND MODEL='Lumina'

--Q(1) All vehicles available for sale with a selling price less than $6,000, sorted by cost in descending order.

SELECT * FROM Inventory  WHERE [SELLING PRICE]<6000 ORDER BY COST DESC



--Q(2) All vehicles sold, grouped by Sales Rep.

SELECT REPNUMBER,COUNT(REPNUMBER)[COUNT] FROM INVENTORY WHERE [Date Sold]!='' GROUP BY RepNumber


--Q(3) All vehicles made by Ford and Toyota

SELECT * FROM Inventory WHERE MAKE IN ('Ford','Toyota')

Related Solutions

2. Perform the calculations and record the following data in the table below. What is the...
2. Perform the calculations and record the following data in the table below. What is the empirical formula of the copper sulfate hydrate? The molar mass of water is 18.015 g/mol and the molar mass of anhydrous copper sulfate is 159.609 g/mol. Show your calculations. mass of water in the hydrate sample (g)= number of moles of water= mass of anhydrous salt (g) = number of moles of anhydrous salt= molar ratio of anhydrous salt to water= empirical formula of...
This question is about the Balance of Payments Accounts. Record each transaction listed below. Make sure...
This question is about the Balance of Payments Accounts. Record each transaction listed below. Make sure to separate the current and the financial accounts. a. The export of wine from California to France for $100 paid for with US dollars that the French importer holds at home in a box. b. The import of a BWM for $200 (it’s used) from Germany paid for with euros that the American importer held in bank account in Frankfurt. c. What is the...
The partially completed inventory record for the driveshaft subassembly in the table below shows gross? requirements,...
The partially completed inventory record for the driveshaft subassembly in the table below shows gross? requirements, scheduled? receipts, lead? time, and current? on-hand inventory. a. Complete the last three rows of the record for an FOQ of 50 units. ?(Enter your responses as integers. A response of? "0" is equivalent to being not? applicable.) ?Item: Driveshaft subassembly Lot? Size: FOQequals=50 units Lead? Time: 3 weeks Week 1 2 3 4 5 6 7 8 Gross requirements 30 25 20 15...
4. Use the following table to calculate the amounts listed below: Hellitech Corporation – Selected Data...
4. Use the following table to calculate the amounts listed below: Hellitech Corporation – Selected Data Credit Sales $127,382 Cost of Goods Sold $76,157 Beginning Inventory $10,583 ENDING INVENTORY $13,685 Accounts Receivable BEGINING $5,130 ENDING $5,690. Accounts Payable BEGINING $7,205, ENDING $8,105. What is the: ? Inventory Period ? Accounts Receivable Period ? Accounts Payable Period ? Operating Cycle ? Cash Cycle
Using the table below, describe the types of budgets. In your description, include: • The objective...
Using the table below, describe the types of budgets. In your description, include: • The objective of the budget • How the budget assists an organization in managing its financial activities • What types of data need to be included in that specific budget. Types of Budget Description Cash Flow Operating Sales Static Financial
Description of Variables/Data Dictionary: The following table is a data dictionary that describes the variables and...
Description of Variables/Data Dictionary: The following table is a data dictionary that describes the variables and their locations in this dataset (Note: Dataset is on second page of this document): Variable Name Location in Dataset Variable Description Coding UniqueID# First Column Unique number used to identify each survey responder Each responder has a unique number from 1-30 SE-MaritalStatus Second Column Marital Status of Head of Household Not Married/Married SE-Income Third Column Total Annual Household Income Amount in US Dollars SE-AgeHeadHousehold...
Enter the data from the table below into Microsoft Excel and determine the linear correlation coefficient,...
Enter the data from the table below into Microsoft Excel and determine the linear correlation coefficient, R2 for time versus position. Then, calculate y/t and determine the linear correlation coefficient, R2 for time versus y/t. Write in the calculated values in the table below (use two decimal places). Time, t (s) Position, y (cm) Velocity, y/t (cm/s) 0/60 0.00 1/60 2.41 2/60 5.09 3/60 8.08 4/60 11.30 5/60 14.79 6/60 18.56 7/60 22.52 8/60 26.96 9/60 31.56 Determine the linear...
Match the letter description listed below with the correct information characteristic listed numbers below. 1. Access...
Match the letter description listed below with the correct information characteristic listed numbers below. 1. Access restricted ___2. Accurate ___3. Available ___4. Reputable ___5. Complete ___6. Concise ___7. Consistent ___8. Current ___9. Objective ___ 10. Relevant ___ 11. Timely ___ 12. Useable ___ 13. Understandable ___ 14. Verifiable ____ a. A report was carefully designed so that its data was easily comprehended by the reader. b. A manager working on the weekend needed information about a customer’s production requests and...
Initial rate data at 25o C are listed in the table below for the reaction: 2NO(g)...
Initial rate data at 25o C are listed in the table below for the reaction: 2NO(g) + Cl2(g) → 2NOCl(g) [NO]i (M) [Cl2]i(M) Initial rate (M/s) 0.13 0.20 1.0 x 10-2 0.26 0.20 4.0 x 10-2 0.13 0.10 5.0 x 10-3 First determine the experimental rate law and calculate the the value of the rate constant, k (no units). k = Tries 0/45 Then, calculate the initial rate of this reaction, when the initial concentration of NO is 0.78 M...
Calculate for Movit Manufacturing in Problem 1 the financial ratios listed in the table below. Using...
Calculate for Movit Manufacturing in Problem 1 the financial ratios listed in the table below. Using these ratios and those provided for 2014 and 2015, conduct a short analysis of Movit’s financial health. Movit's Financial Ratios 2015 2014 Current Ratio 1.90 1.60 Acid test 0.90 0.75 Equity Ratio 0.40 0.55 Inventory Turns 7.00 12.00 Return on Assets Ratio 8% 10% Return on Equity Ratio 20% 18%
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT