Question: Create given tables with ID as suffix (for example, I would create REP table as REP_0111111, where 0111111 is my college ID) with provided column
- Create given tables with ID as suffix (for example, I would create REP table as REP_0111111, where 0111111 is my college ID) with provided column names. Fail to do so will result in 0 points for the assignment. Use most appropriate data types for each column based on data in it. Use DEFAULT value 0 for Balance column in CUSTOMER table. Identify PRIMARY KEY for each table, name and define it at the time of table creation. Copy your CREATE statements in a file as you will submit them.
- Add a new table: CATEGORY (CatId, CatDesc) with CatId with same data type as Category field in the ITEM table.
- Add a PaymentStatus column to ORDER table to store ‘P’ or ‘U’ (paid or unpaid) data in the future.
- Use created tables to add FOREIGN KEY, NOT NULL, UNIQUE and CHECK constraints with the ALTER statement, as appropriate.
- INSERT given records in to the tables. For CATEGORY table, use CatID from ITEM table’s Category column and use appropriate CatDesc.
- Add a record for yourself in the CUSTOMER table and create appropriate record in ORDERS and ORDERLINE table.
Upload the following to Blackboard drop-box in single MS-Word file.
- all CREATE/ALTER statements used to accomplish the tasks
- structures (DESCRIBE), data records (SELECT *) and constraint information by each table in form of screenshots.
Rep RepNum LastName FirstName Street Campos Gradey Tian Sefton 15 30 45 60 Customer CustomerNum 126 260 334 386 440 502 586 665 713 796 824 893 51608 51610 51613 51614 51617 51619 51623 51625 Rafael Megan Hui Janet CustomerName Toys Galore Brookings Direct The Everything Shop KL78 MT03 NL89 TR40 TW35 Johnson's Department Store Grove Historical Museum Store Cards and More Orders OrderNum OrderDate Almondton General Store Cricket Gift Shop Cress Store Unique Gifts Kline's All Season Gifts 10/12/2015 126 10/12/2015 334 10/13/2015 386 10/13/2015 260 10/15/2015 586 10/15/2015 126 10/15/2015 586 10/16/2015. 796 724 Vinca Dr. 632 Liatris St. Mancala Rocking Horse Puzzle Gift Set Cribbage Set 1785 Tyler Ave. 267 Oakley St. Street City 28 Laketon St. Fullton 452 Columbus Dr. Grove 342 Magee St. 124 Main St. 167 Hale St. 3345 Devon Ave. 372 Oxford St. 12 Rising Sun Ave. 786 Passmore St. CustomerNum Item ItemNum Description AH74 Patience BR23 Skittles CD33 Wood Block Set (48 piece) DL51 Classic Railway Set DR67 Giant Star Brain Teaser DW23 FD11 FH24 KA12 KD34 3456 Central Ave. Fullton Pentominoes Brain Teaser Pick Up Sticks Zauberkasten Brain Teaser Wood Block Set (62 piece) Tic Tac Toe Fire Engine City Grove CA 90092 Fullton CA 90085 Northfield CA 90098 Congaree CA 90097 Congaree 51608 51610 51610 51613 51614 51617 51617 CA 90104 Almondton CA 90125 Grove CA 90092 Congaree CA 90097 Northfield CA 90098 Mesa CA 90104 382 Wildwood Ave. Fullton CA 90085 945 Gilham St. 51619 51623 51623 51623 51625 OrderLine OrderNum Northfield CA 90098 Mesa OnHand Category 9 GME 21 GME 36 TOY 12 TOY 24 PZL 40 GME 8 TOY 65 PZL 56 GME 60 PZL 110 GME 45 PZL 32 75 GME 30 TOY State PostalCode Commission Rate $23,457.50 0.06 $41,317.00 0.08 $27,789.25 0.06 $0.00 0.06 TW35 FD11 DR67 FH24 KD34 MT03 State PostalCode CA CA CA Item Num CD33 KL78 TR40 DL51 FD11 NL89 3 2 1 3 2 3 90085 90092 90097 3 1 3 2 1 1 3 2 2 CA 90085 Storehouse Price $22.99 $29.99 $89.49 $107.95 $31.95 $50.00 $124.95 $38.95 $75.00 $14.95 $10.95 $45.79 $119.75 $13.99 $118.95 5 25 10 5 1 4 3 2 5 12 10 Balance CreditLimit RepNum $1,210.25 $7,500.00 15 $575.00 $10,000.00 30 $2,345.75 $7,500.00 45 8 $879.25 NumOrdered QuotedPrice $86.99 $10.95 $13.99 $104.95 $124.95 $115.99 $116.95 $121.95 $29.95 $36.95 $13.10 $45.79 TAMOITAIRE $345.00 $7,500.00 30 $5,000.00 45 $5,000.00 15 $5,025.75 $3,456.75 $15,000.00 45 $678.90 $7,500.00 30 $4,234.60 $10,000.00 15 $124.75 $7,500.00 45 $2,475.99 $15,000.00 30 $935.75 $7,500.00 15
Step by Step Solution
There are 3 Steps involved in it
135 DECLARE addedValue int 136 EXEC addedValue vcAddUser Logi... View full answer
Get step-by-step solutions from verified subject matter experts
