Page 67 - DCAP508_DATABASE_ADMINISTRATION
P. 67
Unit 5: SQL Server Databases
Self Assessment Notes
Fill in the blanks:
1. After you create a database, it is recommended that you create a ……………………. of the
master database.
2. It is recommended that you specify a ……………………. to which the file is permitted to
grow.
3. ……………………. columns provide a mechanism to identify each item stored in the table.
4. The user who creates the database becomes the ……………………. of the database.
5. ……………………. are files hold the log information used to recover the database. To
create a database using the Create Database Wizard, you have to use the Enterprise Manager
5.5 Tables
Tables are database objects that contain all the data in a database. A table definition is a collection
of columns. In tables, data is organized in a row-and-column format similar to a spreadsheet.
Each row represents a unique record, and each column represents a field within the record. For
example, a table containing employee data for a company can contain a row for each employee
and columns representing employee information such as employee number, name, address, job
title, and home phone number.
When you design a database, you decide what tables you need, what type of data goes in each
table, who can access each table, and so on. As you create and work with tables, you continue to
make more detailed decisions about them.
5.5.1 Designing Tables
The most efficient way to create a table is to define everything you need in the table at one time,
including its data restrictions and additional components. However, you can also create a basic
table, add some data to it, and then work with it for a while. This approach gives you a chance to
see what types of transactions are most common and what types of data are frequently entered
before you commit to a firm design by adding constraints, indexes, defaults, rules, and other
objects.
It is a good idea to outline your plans on paper before creating a table and its objects. Decisions
that must be made include:
Types of data the table will contain.
Columns in the table and the data type (and length, if required) for each column.
Which columns accept null values.
Whether and where to use constraints or defaults and rules.
Types of indexes needed, where required, and which columns are primary keys and which
are foreign keys.
5.5.2 Creating and Modifying a Table
After you have designed the database, the tables that will store the data in the database can be
created. The data is usually stored in permanent tables. Tables are stored in the database files
until they are deleted and are available to any user who has the appropriate permissions.
LOVELY PROFESSIONAL UNIVERSITY 61