Q&A

Q1:How will I know what tables, columns, and properties to have for my database?
A1: Draw a picture of your database to help you see the relationships in the data. Know as much as you can about what you need to accomplish with the database before you even start adding the database and tables. Sample data can often give you ideas about the tables you will need and the constraints on the columns, but in the real world, these aren't set in stone. That's when the ALTER DATABASE and ALTER TABLE commands come in handy.
Q2:What's the difference between a primary key and a foreign key?
A2: The primary key is referenced by a foreign key. The primary key can not be a NULL value. A foreign key can be NULL or it can be linked to the primary key. A table can have multiple foreign keys but only one primary key. By itself, the primary key can maintain data integrity within a table. A foreign key can be linked to a primary key to provide data integrity between tables.
Q3:What is a unique constraint?
A3: The unique constraint is exactly like the primary key with a couple of differences. First, you can have multiple unique columns per table. Second, unique columns will allow a NULL value in one row per unique column.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset