Question
This is an SQL question and involve writing SELECT and DML statements involving a single table. The SQL should be written using the standard coding
This is an SQL question and involve writing SELECT and DML statements involving a single table.
The SQL should be written using the standard coding style:
all keywords are to be in upper case
all user-defined names are to be in lower case (example: table and field names)
there should be a carriage return before each major part of the SQL statement (i.e. before SELECT, FROM, WHERE and ORDER BY)
Example:
SELECT columns
FROM tables
WHERE conditions
ORDER BY column1, column2;
__________________________________________________________________
Display customer number for customers who have payments. Do not included any repeated values. Sort the result based on the customer number. (Hints: How do you know a customer has made a payment? You will need to access only one table for this query) The first 10 rows of the output result. The query returns 98 rows.
__________________________________________________________________
List customer numbers, check number, and amount for customers whose payment amount is not in the range of $1,500 to $120,000. Sort the output by top payments amount first.
_________________________________________________________________
The company needs to know the percentage markup for each product sold. Produce a query that outputs the ProductCode, ProductName, BuyPrice, MSRP in addition to - The difference between MSRP and BuyPrice (i.e. MSRP-BuyPrice) called markup - The percentage markup (100 * (markup / BuyPrice)) called percmarkup rounded to 1 decimal place. - Sort the result according to percmarkup. - Show products with percmarkup greater than 140.
__________________________________________________________________
Display product code, product name, and quantity in stock the information of all products with the string co in their product name. (c and o can be lower or upper case). Sort the result according to quantity in stock.
_____________________________________________________________________
Display customer number, contact first name, contact last name for all customers whose contact first name starts with letter s (both lowercase and uppercase) and includes letter e (both lowercase and uppercase). Sort the result according to customer number.
1 2 3 5 6 7 CUSTOMERNUMBER 103 112 114 119 121 124 128 129 131 141 9 10 1 2 3 CUSTOMERNUMBER CHECKNUMBER AMOUNT 141 JE 105477 120166.58 121 FD317790 1491.38 381 MS154481 1128.2 398 JPMR 4544 615.45 MARKUP PRODUCTCODE PRODUCTNAME BUYPRICE MSRP 1 S18 2432 1926 Ford Fire Engine 24.92 60.77 35.85 2 S12 3990 1970 Plymouth Hemi Cuda 31.92 79.8 47.88 3 324 3420 1937 Horch 930V Limousine 26.3 65.75 39.45 + S18 2625 1936 Harley Davidson El Knucklehead 24.23 60.57 36.34 5 S24 4620 1961 Chevrolet Impala 32.33 80.84 48.51 PERCMARKUP 143.9 150 150 150 150 PRODUCTCODE PRODUCTNAME IS12 3891 1969 Ford Falcon 2 518 4721 1957 Corvette Convertible 3 524 2840 1958 Chevy Corvette Limited Edition 4 524 1444 1970 Dodge Coronet SS18 1662 1980s Black Hawk Helicopter 6 818 2957 1934 Ford V Coupe 7 318 3259 Collectable Wooden Train 8 524 3856 1956 Porsche 356A Coupe 924 3949 Corsair F4U ( Bird Cage) 10 312 3148 1969 Corvair Monza 11 S700 2610 The USS Constitution Ship 12 524 1937 1939 Chevrolet Deluxe Coupe 13 824 1628 1966 Shelby Cobra 427 S/C 14 S18 1342 1937 Lincoln Berline 15 518 2325 1932 Model A Ford J-Coupe 16 324 3432 2002 Chevy Corvette QUANTITYINSTOCK 1049 1249 2542 4074 5330 5649 6450 6600 6812 6906 7083 7332 8197 8693 9354 9446 1 2 3 CUSTOMERNUMBER CONTACTFIRSTNAME CONTACTLASTNAME 319 Steve Frick 450 Sue Frick 459 Sven Ottlieb 471 Sean clenahan 475 Steve Thompson 487 Sue Taylor 5 6 1 2 3 5 6 7 CUSTOMERNUMBER 103 112 114 119 121 124 128 129 131 141 9 10 1 2 3 CUSTOMERNUMBER CHECKNUMBER AMOUNT 141 JE 105477 120166.58 121 FD317790 1491.38 381 MS154481 1128.2 398 JPMR 4544 615.45 MARKUP PRODUCTCODE PRODUCTNAME BUYPRICE MSRP 1 S18 2432 1926 Ford Fire Engine 24.92 60.77 35.85 2 S12 3990 1970 Plymouth Hemi Cuda 31.92 79.8 47.88 3 324 3420 1937 Horch 930V Limousine 26.3 65.75 39.45 + S18 2625 1936 Harley Davidson El Knucklehead 24.23 60.57 36.34 5 S24 4620 1961 Chevrolet Impala 32.33 80.84 48.51 PERCMARKUP 143.9 150 150 150 150 PRODUCTCODE PRODUCTNAME IS12 3891 1969 Ford Falcon 2 518 4721 1957 Corvette Convertible 3 524 2840 1958 Chevy Corvette Limited Edition 4 524 1444 1970 Dodge Coronet SS18 1662 1980s Black Hawk Helicopter 6 818 2957 1934 Ford V Coupe 7 318 3259 Collectable Wooden Train 8 524 3856 1956 Porsche 356A Coupe 924 3949 Corsair F4U ( Bird Cage) 10 312 3148 1969 Corvair Monza 11 S700 2610 The USS Constitution Ship 12 524 1937 1939 Chevrolet Deluxe Coupe 13 824 1628 1966 Shelby Cobra 427 S/C 14 S18 1342 1937 Lincoln Berline 15 518 2325 1932 Model A Ford J-Coupe 16 324 3432 2002 Chevy Corvette QUANTITYINSTOCK 1049 1249 2542 4074 5330 5649 6450 6600 6812 6906 7083 7332 8197 8693 9354 9446 1 2 3 CUSTOMERNUMBER CONTACTFIRSTNAME CONTACTLASTNAME 319 Steve Frick 450 Sue Frick 459 Sven Ottlieb 471 Sean clenahan 475 Steve Thompson 487 Sue Taylor 5 6Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started