ASSIGNMENT : ACCESS
QUESTIONS
1) How to create a Table.Create New Table in Microsoft Access.
Click on Create Tab. Click on Table Design Button.
You will see the table designation windows appear. Enter fields
name and its data type as below:
Set field stdid to Primary Key (Now allow duplicate data for
stdid) by Right Click on that field and choose Primary Key.
Click to Save the Table.
2) How to create a Query.
1) Create tab in the toolbar at the top of the screen. 2) Then
click on the Query Design button under the Other group.
3) Next, highlight the tables that you wish to use in the query.
In this example, we've selected the Employees table and clicked on
the Add button. 4) When you are done selecting the tables, click on
the Close button.
5) Add the fields to the query. You can do this by
double-clicking on the field name. In this example, we've added the
LastName, FirstName, and Address fields.6) Then click on the Save
button at the top left of the window (this is the button with the
picture of the disk).
7) The Save As window should appear. Enter the name that you'd
like to assign to the query and click on the OK button. In this
example, we've saved the query as Query1.
3) How to create a FormTo create a form :
1) Open the Navigation pane.2) Click the table or query on which
you want to base your form.3) Activate the create tab.4) Click Form
in the Forms group. Access create a form.
You can use the Navigation bars to move through the records on a
form.
1 Go to First Record2 Go to Previous Record3 The Current Record4
Go to Next Record5 Go to Last Record6 Create a New (Blank)
Record
To save a form:1. Click the Save button on the Quick Access
toolbar. Access saves the form unless you are saving for the first
time. If you are saving for the first time, the Save As dialog box
appears.2. Type the name you want to give the form.3. Click OK.
Access saves the form. You can now access the form by using the
Navigation pane.You can also save by right-clicking a forms tab and
then selecting Save from the menu that appears. Access saves the
form unless you are saving for the first time. If you are saving
for the first time, the Save As dialog box appears. Type the name
you want to give the form and then click OK. Access saves the form.
You can now access the form by using the Navigation pane.
4) How to create a Reports.To create a report:Reports give you
the ability to present components of your database in an
easy-to-read, printable format. Access lets you create reports from
both tables and queries.1. Open the table or query you would like
to use in your report. We want to print a list of cookies we've
sold, so we'll open the Cookies Sold query.
2. Select the Create tab on the Ribbon. Locate the Reports
group, then click the Report command.
3. Access will create a new report based on your object.4. It's
likely that some of your data will be located on the other side of
the page break. To fix this, resize your fields. Simply select a
field, then click and drag its edge until the field is the desired
size. Repeat with additional fields until all of your fields
fit.
5. To save your report, click the Save command on the Quick
Access toolbar. When prompted, type a name for your report, then
click OK.
Just like tables and queries, reports can be sorted and
filtered. Simply right-click the field you wish to sort or filter,
then select the desired option from the menu.
5) How to create a Relationships.
Step 1 How to create a relationship To create a relationship in
Access, start by clicking on the database tools tab and then click
on the relationship button. In this example we will create
relationship between all our tables and also set the referential
integrity between them.
Step 2 Adding tables
Click on the show tables button; select each table and add it.
Show tables button shows all the available tables created by the
user in the database. From the list, you can choose the tables
amongst which you want to create a relationship.
Step 3 Creating the first relationship
Now drag the worker id field from the sales people table and
drop it onto the sales field in the customers table. An edit
relationship window will appear showing you the source field and
destination field. Check the enforce referential integrity check
box and then check the other two boxes as well.
Step 4 Selecting the join type
Click on the join type button and select the second option.
Click on create button and you will see that a relationship has
been established between the sales people table and the customers
table. We select the second join type because we want to see
reports on sales employees even if they didnt have any assigned
customer. Once you click ok, you will notice that a one-to-many
relationship will be established. This means that one employee can
have several customers.
Step 5 Avoiding cascade delete option
Now for the last relationship, drag the SKU field from the
product table and drop it onto the product field in the order
table. In the edit relationship window, checkmark the first two
boxes and then click on the create button. Once a relationship in
Access is established, you will see a black line running from the
source table to the destination table. You will notice a 1 and an
infinity sign telling you the type of relationship. In the last
relationship, we selected only the cascade update related fields
option because we dont want the SKU to be deleted even if the
products are deleted from the product line.