Question:- Create a database named “library” and do the following tasks.
-Create a table student with stdid, stdname, address, bookname, issuedate, returndate
-Insert any five records.
-Generate a query to view the records of students who has 7 days due for book return.
Solution:-
a) To create a library database and make a student table.
Step 1:- Start Ms Access app.
Step 2:- Rename the database as “library”. Click Create to finish naming the database.
Step 3:- To add more fields to a table in Datasheet view, double-click the Add New Field header.
Step 4:- Next, we've added the fields stdid, stdname, address, bookname, issuedate and returndate to the student table.
Step 5:- Next, Ctrl + S to save the table. The Save As dialog box will appear to let you save the table name “student”.
Step 6:- To change the field data type of issuedata and returndate, Select issuedate column field.
Step 7:- Select Date/Time datatype from Data Type & Formatting under Datasheet Tab.
Step 8:- Now for returndate column field to change data type text to Date/Time.
Step 9:- Select Date/Time datatype from Data Type & Formatting under Datasheet Tab.
Step 10:- Insert suitable 5 records in the table and save table.
b) To create a required query
Step 1:- Select the Create tab. Then click on the Query Design button under the Other group.
Step 2:- Next, highlight the student table and clicked on the Add button. When you are done selecting the tables, click on the Close button.
Step 3:- Add the fields to the query. You can do this by double-clicking on the field name. In this example, we've added the all fields of the student table.
Step 4:- Then click on the Save button at the top left of the window.
Step 5:- The Save As window should appear. Enter the name “duedate” and click on the OK button.
Step 6:- Click on Total button under Show/Hide Group in Design Tab.
Step 7:- In the field, next of returndate, type following formula to find out the due date.
Due Date: [returndate]-[issuedate]
Step 8:- In the Criteria of that field type >7 to find due date greater than 7 days.
Step 9:- Click Run under Results Group of Design Tab. Result on query displays followings.
Step 10:- That’s all the steps for displaying view the records of students who has 7 days due for book return.
No comments:
Post a Comment