The custom order database that we created in the last session included a customer table. We then asked you to create an order table based on some sample data we provided. Hopefully you completed the sexercise since we will be using it in this section. If you didn't have time, I would recommend that you attempt it before continuing. We can join the two tables relationally using the primary key customer ID from the parent table to the foreign key customer ID in the order child table. Let's do it now in Microsoft Access Oh that we use the design view to create the two tables, corresponding fields and data types.
In doing so we use Microsoft Access GUI. Alternately, we could have done this in SQL using a DDL data Definition Language. To give you a taste of this, here's an example. We create the table customer with the fields, data types, and some nomenclature, not no identity. And we add constraint identifying the primary key for the table customer for the table order. Likewise, we've identified the fields specified I empty as integers not know, in order to specify that we must have a field into some values and the identity aspect starting at one and incrementing at one with constraints for the order ID as a PA, and a constraint customer ID as the fk.
Further we call to insert values into the tables in access, we use the datasheet view. How could we do this in native SQL? well with the insert into declaration by adding the values for the customer, one, Tracy Beckham, seven, East worker, Toronto, Ontario, etc. Note that the SQL approach is quite demanding. added to the fact that any mistake like missing a comma or a quote symbol will cause a compilation Never much easier for a beginner to use a GUI that comes with Microsoft Access. So why would you use a native SQL DDL and DML statements?
Far more possibilities and flexibility for programmers