Database Material
Database Material
Database Material
Microsoft Access offers the functionality of a database and the programming capabilities to
create easy to navigate screens (forms). It helps you analyse large amounts of information,
and manage data efficiently.
ENTITY OR TABLES
Information in a database is stored in tables. A table has fields, which are similar to column
headings. Tables is often called Entity, the columns in the table caries the characteristics of
the table which is known as Attributes. Based on the library information Management system
the following tables was created.
1. Student
➢ Stud_id
➢ Stud_name
➢ Stud_gender
➢ Stud_course
➢ Stud_regno
➢ Stud_class
➢ Stud_email
➢ Stud_phone
➢ Stud_dob
2. Teacher
➢ Teac_id
➢ Teac_name
➢ Teac_gender
➢ Teac_phone
➢ Teac_email
➢ Teac_dob
➢ Teac_department
3. Staff member
➢ SM_id
➢ SM_name
➢ SM_email
➢ SM_phone
➢ SM_gender
➢ SM_dob
4. Book
➢ B_id
➢ B_title
➢ B_author
➢ B_edition
➢ B_volume
➢ B_publisher
➢ B_location
➢ B_Tcopies
5. Issue
➢ Date_return
➢ Date_issue
• Click File > New, and then select Blank desktop database.
• In the File Name box, type a file name for the new database.
• To browse to a different location and save the database, click the folder icon.
• Click Create.
Creating tables/Entities
• Now we start creating our tables required for our library information management
system as mentioned above and renaming them by saving the tables.
• We save the tables by right click on the table and click save and it will give out
renaming option as shown below.
The rows, instead, are called tuples, and represent data sets applied to a single entity to
uniquely identify each item. Attributes are, therefore, the characteristics of every individual
tuple that help describe its unique properties.
Data type
Data types are the building blocks of databases. A field’s data type not only influences
other important characteristics of that field, such as field size, but also how the field is
used throughout the database, such as in objects, calculations, expressions, and so forth.
Using the right data type is a key to success.
Primary key
A primary key is a column or a set of columns in a table whose values uniquely identify a
row in the table. A relational database is designed to enforce the uniqueness of primary
keys by allowing only one row with a given primary key value in a table.
Select primary key in the table.
• In the Navigation Pane, right click a table, and select Design View.
• Select the field or fields you want to use as the primary key.
• Select Design > Primary Key.
For our tables the primary key are Student(Stud_id), Teacher(Teac_id), Book(B_id),
Issue(Date_issue), Staff Member(SM_id). Samples as shown below.
Relationship
Database relationships are associations between tables that are created using join statements
to retrieve data. ... Both tables can have only one record on each side of the relationship. Each
primary key value relates to none or only one record in the related table.
types of relationship
i. One-to-One Relationship
Such a relationship exists when each record of one table is related to only one record of the
other table.
Creating relationship
• On the Design tab, in the Relationships group, click Add Tables (or Show Table in
Access 2013).
• Select one or more tables or queries and then click Add. After you have finished
adding tables and queries to the Relationships document tab, click Close.
• Drag a field (typically the primary key) from one table to the common field (the
foreign key) in the other table. To drag multiple fields, press the CTRL key, click
each field, and then drag them.
• Verify that the field names shown are the common fields for the relationship. If a field
name is incorrect, click on the field name and select the appropriate field from the list.
To enforce referential integrity for this relationship, select the Enforce Referential
Integrity check box. For more information about referential integrity, see the
section Enforce Referential Integrity.
• Click Create.
Access draws a relationship line between the two tables. If you selected the Enforce
Referential Integrity check box, the line appears thicker at each end. In addition, again
only if you selected the Enforce Referential Integrity check box, the number 1 appears
over the thick portion on one side of the relationship line, and the infinity symbol (∞)
appears over the thick portion on the on the other side of the line, as shown in the
following figure.
Database form
In a database context, a form is a window or screen that contains numerous fields, or spaces
to enter data. Each field holds a field label so that any user who views the form gets an idea
of its contents. A form is more user friendly than generating queries to create tables and
insert data into fields.
A good database form creator will give you the following capabilities:
• To add a field to the form, double-click it or drag it onto the form. To add several
fields at once, hold down CTRL and click several fields, and then drag them onto the
form at the same time.
• Use the tools in the Controls group on the Form Layout Tools tab to add a logo, title,
page numbers, or the date and time to the form.
• If you want to add a wider variety of controls to the form, click Design and use the
tools in the Controls group.
Query
A database query is a request to access data from a database to manipulate it or retrieve it.
This allows us to perform logic with the information we get in response to the query.
Creating query
• Choose whether you want to open the query in Datasheet view or modify the query in
Design view, and then select Finish.
Report
Creating report
• Select a table or query, double-click each field in Available Fields you want to add it
to the report, and select Next.
• Double-click the field you want to group by, and select Next.
• Complete the rest of the wizard screens, and select Finish.
Conclusion
After we have completed the project we are sure the problems in the existing system would
overcome. The “LIBRARY MANAGEMENT SYSTEM” process made computerized to
reduce human errors and to increase the efficiency. The main focus of this project is to lessen
human efforts. The maintenance of the records is made efficient, as all the records are stored
in the ACCESS database, through which data can be retrieved easily. The navigation control
is provided in all the forms to navigate through the large amount of records. If the numbers of
records are very large then user has to just type in the search string and user gets the results
immediately. The editing is also made simpler. The user has to just type in the required field
and press the update button to update the desired field.
Reference