Create a table 'exam' in the database 'marks' and perform the following operations.
MarksID, English, Nepali, Maths, Science
a) Create a query to display Marks ID, Total, and Percentage.
Solution:-
To create a database 'marks' and make a 'exam' table.
Step 1:- Start Ms Access app.
Step 2:- Rename the database as 'marks'. 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 Marks ID, English, Nepali, Maths, Science, Total and Percentage to the table.
Step 5:- Next, select Save table from the menu. The Save As dialog box will appear to let you save the table name 'exam'.
Step 6:- Insert suitable 5 records in the exam table and save table.
a) 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 exam 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 Marks ID and Add two column field Total and Percentage and put the formula for that fileds.
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 'Accountsalary' and click on the OK button.
Step 6:- In the Total Column Field, type
Total: [English]+[Nepali]+[Maths]+[Science]
and in the Percentage Column Field type
Percentage: [Total]/400*100
Step 7:- Click Run under Results Group of Design Tab. Result on query displays followings.
Step 8:- That's all the steps for displaying query according to conditions in which we calculate total and percentage.
No comments:
Post a Comment