Need help with sql code.
TAL Distributors Use the TAL Distributors database (see Figure 1-2 in Chapter 1) to complete the following exercises. If directed to do so by your instructor, use the information provided with the Chapter 3 Exercises to print your output or save it to a file.
REP REP_NUM LAST_NAME FIRST_NAME STREET CITY STATE POSTAL CODE COMMISSION RATE 15 Campos Rafael 724 Vinca Dr. Grove CA 90092 $23,457.50 0.06 30 Gradey Megan 6.32 Lintris St. Pullton CA 90085 $41,317.00 0.ON 45 Tian llui 1785 Tyler Ave. Northfield CA 9009 $27,789.25 Janet 267 Oakley Congaree CA $0.00 CUSTOMER CUSTOMER_NUM CUSTOMER_NAME STREET CITY STATE POSTAL_CODE BALANCE CREDIT_LIMIT REP_NUM 126 Toys Galore 28 Laketon Fullton CA 90095 $1.210.25 $7,500.00 15 260 Brookings Direct 452 Columbus Dr Grove CA 90092 $575.00 $10,000.00 30 334 The Everything 342 Magee St. Congaree CA 90097 $2,345.75 $7,500.00 45 Shop 386 Johnson's 124 Main St Northfield CA 0098 $879.25 $7,500.00 Department Store 410 Grove 3456 Central Ave. Fullton CA 90055 $345.00 $5,000.00 45 Historien Museum Store 502 Cards and More 167 llale su Mesa CA 90104 $5,025.75 $5,000,00 15 586 Alniondton 3.345 Devon Ave. Almondton CA 90125 $3,456.75 General Store $15,000.00 45 665 Cricket Gift Shop 372 Oxford St. Grove |СА 90092 $678.90 $7,500.00 30 713 Cress Store 12 Rising Sun Ave. Congreo CA 90097 $1,234.60 $10,000.00 15 796 Unique Gifts 786 Passmore St. Northfield CA 9000N $124.75 $7,500.00 45 824 Kline's 945 Gilham St. Mesa CA 9010 $2.475.99 $15,000.00 893 All Season Gifts 352 Wildwood Ave. Pullten CA 90095 $9.35.75 $7,500.00 15 FIGURE 1-2 Sample data for TAL Distributors
Introduction to TAL Distributors, Colonial Adventure Tours, and Solmaris Condominium Group 5 ORDERS ORDER_NUM 51608 51610 51613 51614 51617 51619 51623 51625 ORDER DATE CUSTOMER_NUM 10/12/2015 126 10/12/2015 334 10/13/2015 386 10/1.1/2015 260 10/15/2015 5N6 10/15/2015 126 10/15/2015 56 10/16/2013 796 ORDER_LINE ORDER_NUM ITEM_NUM 51608 CD33 51610 KL78 51610 TR40 51613 DL51 51614 FD11 51617 NL.NO 51617 TW35 51619 FD11 51623 DR67 51623 FH24 51623 KD14 51625 MTO NUM ORDERED QUOTED PRICE 5 $56.99 25 $10.95 10 $13.99 5 $104.95 1 $124.95 + $115.99 3 $116.95 2 $121.95 5 $29.95 12 $.36,95 10 $13.10 S $45.79 و نه ها ITEM ITEM_NUM DESCRIPTION All 74 Patience BR23 Skittles CD33 Wood Block Set (48 piece) DL51 Classic Railway Set DR67 Giant Star Brain Teaser DW23 Mancala FDI Rocking Horse FH24 Puzzle Gift Set KA12 Criblage Set KD34 Pentominoes Brain Teaser KL78 Pick Up Sticks MTO3 Zauberkasten Brain Teaser NLSO Wood Block Set (62 piece) TR40 Tic Tac Toe TW35 Fire Engine STOREHOUSE 3 2 1 3 2 3 3 ON HAND CATEGORY 4 | ME 21 | ME 36 TOY 12 TOY 24PZL 40 | GME STOY 65 PZL 50 | ME 60 PZL. 11 | ME 45 PZL 32 TOY 75 CME мо | Toy PRICE $22.99 $29.99 $89.49 $107.95 $31.95 $50,00 $124.95 S.38.95 $75.00 $14.95 $10.95 $45.79 $119.75 $13.99 $118.95 1 3 2 1 1 3 2 2 FIGURE 1-2 Sample data for TAL Distributors (continued)
5. Write PL/SQL or T-SQL procedures to accomplish the following tasks: a. Obtain the name and credit limit of the customer whose number currently is stored in _CUSTOMER_NUM. Place these values in the variables l_CUSTOMER_NAME and _CREDIT_LIMIT, respectively. Output the contents of I_CUSTOMER_NAME and |_CREDIT_LIMIT b. Obtain the order date, customer number, and name for the order whose number currently is stored in I_ORDER_NUM. Place these values in the variables _ORDER_DATE, I_CUSTOMER_NUM and I_CUSTOMER_NAME, respectively, Output the contents of L_ORDER_DATE, I_CUSTOMER_NUM, and _CUSTOMER_NAME. c. Add a row to the ORDERS table. d. Change the date of the order whose number is stored in L_ORDER_NUM to the date currently found in 1_ORDER_DATE. e. Delete the order whose number is stored in L_ORDER_NUM.
Need help with sql code.
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Need help with sql code.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!