Chapter 5 ADVANCED DATA RETRIEVAL AND MODIFICATION 253
Chapter 5 ADVANCED DATA RETRIEVAL AND MODIFICATION 253 addition, there is also a one-to-many relationship between Person and Sales, which means one person may have made several purchases, which are recorded in the Sales table. You may want to go ahead and build this structure in its own database on the server on which you re doing the examples. Now insert some data into the sample schema and try it again. Some SELECT COUNT statements are at the bottom of the script to help you make sure you ve got the correct number of rows in each table. INSERT INTO Person VALUES ( Danny , Jones ) INSERT INTO Person VALUES ( Melissa , Jones ) INSERT INTO Person VALUES ( Scott , Smith ) INSERT INTO Person VALUES ( Alex , Riley ) INSERT INTO Person VALUES ( Chris , Avery ) INSERT INTO Person VALUES ( Jennifer , Avery ) INSERT INTO Person VALUES ( Bryan , Decker ) INSERT INTO Person VALUES ( Robin , Decker ) INSERT INTO Person VALUES ( Shelly , Alexander ) INSERT INTO Address VALUES ( 1213 NW 97th Ct , SQL Town , . MO , 64131 ) INSERT INTO Address VALUES ( 2721 SW 42nd Terr , Server .City , KS , 66212 ) INSERT INTO Address VALUES ( 1939 Overland St , Dell .Village , KS , 66213 ) INSERT INTO Address VALUES ( 9391 Nall Ave , Parrot .Township , MO , 64331 ) INSERT INTO Address VALUES ( 7737 Miner Dr , SQL Town , . MO , 64132 ) INSERT INTO Address VALUES ( 5334 Shamrock Ln , Orange , . KS , 66441 ) INSERT INTO PersonAddress VALUES (1, 1) INSERT INTO PersonAddress VALUES (2, 1) INSERT INTO PersonAddress VALUES (3, 2) INSERT INTO PersonAddress VALUES (4, 3) INSERT INTO PersonAddress VALUES (5, 4) INSERT INTO PersonAddress VALUES (6, 4) INSERT INTO PersonAddress VALUES (7, 5) INSERT INTO PersonAddress VALUES (8, 5) INSERT INTO PersonAddress VALUES (9, 6) INSERT INTO Sales VALUES (1, 37, 4, getdate()) INSERT INTO Sales VALUES (1, 38, 3, getdate()) INSERT INTO Sales VALUES (3, 39, 1, getdate()) INSERT INTO Sales VALUES (4, 51, 1, getdate()) INSERT INTO Sales VALUES (4, 47, 1, getdate()) INSERT INTO Sales VALUES (9, 37, 10, getdate()) INSERT INTO Sales VALUES (9, 38, 5, getdate()) INSERT INTO Sales VALUES (10, 41, 6, getdate()) INSERT INTO Product VALUES (37, Widget )
If you looking for unlimited one inclusive web hosting plan please check web hosting plan website.