USER MANUAL
Creating the Database Tables
When an address book, the obvious fields come to mind—name, glasses, customer name
number, email address,wastage report However, it look at own paper-based address book, may
note that have several entries for one person. Maybe that person has three telephone numbers, or
two email addresses, and so forth. In online address book, a set of related tables will help
alleviate the redundancy and repetition of information.
shows sample table and field names to use for online address book. In a minute, will
create the actual SQL statements, but first should look at this information and try to see the
relationships appear. The fields should be primary or unique keys.
As it can see in the following SQL statements, the master_name table has two
fields besides the ID and date-related fields: f_name and l_name, for first name and last name.
The id field is the primary key. No other keys need to be primary or unique, it is really want to
limit address book to one John Smith, one Mary Jones, and so forth.
The field lengths for the text fields in the following statements are arbitrary; it can make
as long or as short as want, within the allowable definition of the field type.
Learning Basic SQL Commands:
The OLAP Services feature available in SQL Server version 7.0 is now
called SQL Server 2000 Analysis Services. The term OLAP Services has been replaced with the
term Analysis Services. Analysis Services also includes a new data mining component. The
Repository component available in SQL Server version 7.0 is now called Microsoft SQL Server
2000 Meta Data Services. References to the component now use the term Meta Data Services.
The term repository is used only in reference to the repository engine within Meta Data Services
SQL-SERVER database consist of six type of objects,
They are,
1. TABLE
2. QUERY
3. FORM
4. REPORT
5. MACRO
TABLE:
A database is a collection of data about a specific topic.
VIEWS OF TABLE:
We can work with a table in two types,
1. Design View
2. Datasheet View
Design View
To build or modify the structure of a table we work in the table design
view. We can specify what kind of data will be hold.
Datasheet View
To add, edit or analyses the data itself we work in tables datasheet view
mode.
QUERY:
A query is a question that has to be asked the data. Access gathers data that answers the
question from one or more table. The data that make up the answer is either dynaset (if you edit
it) or a snapshot (it cannot be edited).Each time we run query, we get latest information in the
dynaset. Access either displays the dynaset or snapshot for us to view or perform an action on it,
such as deleting or updating.
Microsoft SQL Server
To launch Microsoft SQL Server, click Start -> Programs -> Microsoft SQL Server 2005 ->
SQL Server Management Studio.
When it starts, it would present a dialog box that expects you to log in.
Introduction to Code
Although you will perform many of your database operations visually, some other operations
will require that you write code. To assist with this, Microsoft SQL Server provides a code
editor and various code templates.
To open the editor:
On the main menu, you can click File -> New -> Query With Current Connection
On the Standard toolbar, click the New Query button
In the Object Explorer, right-click the name of the server and click New Query
This would create a new window and position it on the right side of the interface.
Executing a Statement
In the next sections and lessons, we will learn various techniques of creating SQL
statements with code. By default, when a new query window appears, it is made of a wide
white area where you write your statements:
After writing a statement, you can execute it, either to make it active or simply to test it. To
execute a statement:
You can press F5
On the main menu, you can click Query -> Execute
On the SQL Editor toolbar, you can click the Execute button
You can right-click somewhere in the code editor and click Execute
When you execute code, code editor becomes divided into two horizontal sections:
Whether you have already written code or not, you can save the document of the code
editor at any time. To save it:
You can press Ctrl + S
On the main menu, you can click File -> Save SQLQueryX.sql...
On the Standard toolbar, you can click the Save button
1. In the Object Explorer, right-click Databases and click New Database...
2. In the Name text box, type MotorVehicleAdministration
Creating a Table
1. In the Object Explorer, expand the BCR node (click its + button)
Under BCR, right-click Tables and click New Table...