0% found this document useful (0 votes)
46 views10 pages

CB 8 4

Class 8 _ Cbse CS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
46 views10 pages

CB 8 4

Class 8 _ Cbse CS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 10
ACCESS: QUERIES, FORMS AND REPORTS @ Define queries eee eee @ Learn to create and use queries {7 the previous chapter, you kave learnt almost all the |@ Define query window O operations which ae performed on tables in Access such | Define and ereate forms 5 as creating tables using diferent table views, applying $ |@ Define and ereste reports 5 data types and key constraints, and many more. Let us | move forward to learn the use of other objects such as {_Queris,Foms and Reports Queries As you know that database contains a huge amount of data. When the data increases in the tables, it becomes a tough task to extract desired data records from the table, Therefore, Microsoft Access provides a solution in the form of Queries. ‘A Query is a database object which is used to extract data 6, from one or more tables depending upon the given criteria. Quiz me Data retrieved using a Query stores ina separate table known | What ig the meaning of ® as Query Table, the word query? Find out Creating a Query : and form two sentences using the word. : ‘The steps to create a Query in Design View are as follows: 99/ 1. Click on the Create tab. Select the Query Design option from the Queries group. ee ee query in Detign BEE ae ‘BOs oe ‘Application Teble Table SharePoint Query \Gheny | Youcenthen wethe Show Table” Report Report Blank [) ce Parts > eign Uits- Wied Design seen * ¥ ‘Design Report = meee ti ieee nee 4A. selecting the Query Design option from the Queries group 2. Select the table(s) from the Show table dialog box on which you want to run the Query. Click on Add button and then Close button. 3. ‘The Query Design window appears. It is divided into two sections ~ Design Area and Design Grid. + Design Area (the top portion): It displays the fields, tables and queries that you may want to use in the query. + Design Grid (the lower portion): It contains columns where you can set up the fields. Reports Maret cose 4 | (a7) |. ‘The selected table will appear in the Object Relationship pane available in the Design Grid of the Query Design window as shown. ‘& Fig, 4.2 the Query Design window 5. Below the Design Area, you will notice the Design Grid. It contains the following elements: Field Itcontains the selected table’ fields. Table It displays name of the selected table. Contains checkboxes, it displays the data when the query is being run. To Show hide the field during query run, you can hide the field by deselecting the checkbox. Sort Used to sort the data in ascending or descending order. It is optional. Criteria Contains the criteria on which records are to be filtered in the query output: Or ‘Used to set multiple criteria in a query. 6. Select the desired table field from the Field drop-down list. Add other required fields and click on the Show checkboxes. [Fev Student. Info & Fig. 4.3 adding fields in Query Design window 7. Click on the Design tab and then the Run option to run the Query. Run ‘DUnion & Es Insert Rows, > S| Petormethe scone pecedins BPee-togh =! ox osteo ¥ Deete Columns 8 sa Sow eure ets i RutaDefntion Thoye NOuider Rete a> oer te cer Setup Srowitie & Fig. 4.4 Selecting Run option 8. Query data will appear in a query table as shown below. A Fig. 4.5 retrieved data using Query ® EI) Suppose you want to see the records of only those students whose marks in Science are equal to or greater than 70 (marks >= 70). In such a situation, you need to apply multiple criteria. Let us specify multiple criteria. Solution: To specify multiple criteria in a query, follow these steps: 1. Click on the Create tab. Select the Query Design option from the Queries group. 2. Select the table(s) from the Show table dialog box on which you want to run the Query. Click on Add button and then Close button. 3. The selected table will appear in the Object Relationship pane available in the Design Grid of the Query Design window as shown. 4, Select the desired table field from the Field drop-down list. Add other required fields and click on the Show checkboxes. 5. Inthe Criteria field, type in the condition “= 70”. Type the second condition in OR option, “> 70”. B awey : c x o_o | science z |student, marks | student Marts ean Conditions & Fig. 4.6 setting multiple criteria 6. Click on the Design tab and then the Run option to run the Query. Observe the output shown below. Oe (New) ° & Fig. 4.7 query output | To extract data from multiple tables using a query, you have to create a relationship amon, : tables first. Forms Form is a more user-friendly object of database. It appears in a rectangular window. It contains numerous fields, or spaces to enter data. Bach field holds a field label so that any user who views the form, gets the idea of its contents. In Access, a form is a database object which is used to create a user interface for a database application. Forms are of two types: + Bound: Itis directly connected to a data source such as a table or query, and can be used to enter, edit or display data from the data source. + Unbound: It is not linked directly to the data source, but contains command buttons, labels or other controls that you need to operate your application. Form allow users to perform data entry. Data can be inserted, updated, or deleted from a table using forms. Any changes made in forms reflect in the corresponding table. Access provides different form views, as mentioned below: + Form View: Used to enter, edit and view data, + Design View: Used to provide structure to the form, such as setting header, detail and footer section, etc. It helps you set and adjust your form design. + Layout View: Used to alter the appearance of your form like size of various controls on the form. Creating a Form To create a form, follow these steps: 1. Select a table or query from the Navigation Pane that you want to use as a data source. 2. Click on the Create tab. Select the Form option from the Forms group. * ae Form reste form that ete you enter ‘Appleton Table Tle SharePoint Query Query fort Report Blank 5] Macro james Oesgn “ate” Wand Deyo Lan ifomutoneronecorta Ee a Tempistes Tables ves Repos Macosacose 8 i em RS & Fig. 4.8 selecting the Form option 3. A New Form opens in the Layout View as shown, On creating a form, three new tabs appear on the ribbon — Design, Arrange and Format. You can change the appearance of the Form using options available under these tabs, a 51 [3 student_info 7 q Class va Navigation Pane freer wee] >| a : eee To ew onto OS BE & Fig. 4.9 a form in Layout View . To edit or enter data in the form, click on Home —» View —» Form View. ‘The form opens in Form View. Here, you can enter or update data as shown. EL x 7 Student_Iinfo ono Fig, 4.10 selecting Form View option ‘A Fig. 4.11 editing form data . Use the Record navigation bar to move through the records in the Form. After entering and updating records, save your work. ormatting a Form ou can change the appearance of a Form using various options given on the Design and Format tabs. + Using the Design tab: You can add logo and title to your form by using Logo and Title option available on the Header/Footer group. + Using the Format tab: You can set the font properties such as, size, color, alignment, etc., of the labels, can add/alter the background image, color etc., using various options available on the Format tab. Reports Reports offer a way to view, format and summarize the information in your database. Reports can be used to view or print data online. For example, you can create a simple report of phone numbers for all of your contacts, or a summary report on the total sales across different regions and time periods. Your report can be based on either a table or a query. ‘Access provides four report view: + Report View: Used to enter and edit data in the report. + Print Preview: Used to preview the report before printing. + Layout View: This is the default view of a report. It is used to change the appearance and style of the report. + Design View: Used to design the report. Creating a Report ‘To create a report, select a table or query from the Navigation Pane that you want to use for creating a report. Now follow the given steps: 1. Click on the Create tab. Select the Report option from the Reports group. a Tp A B = 1 RS &sesok* Crees bic repr etn epexion Tae “bie Spt Goo Gey Ferm Fem tink ENRen | theca uae och Paes eign tse Wear Desgn " paign Fom EB Mere Fema yovcansddteores ches Templates ‘Tables Queries Forms. at ase a 4 Fig, 4.12. selecting the Report option 2. A report opens in the Layout View, as shown. ‘& Fig. 4.13 a report in the Layout View 3. You can edit the data inthe report by switching it to Report View. Click on the Save button after applying changes. (53) 4 (Keywords ® ° Query: Database object used to retrieve data from one or multiple tables depending on a given condition(s). Form: Used to create a user interface for a database application. Report: Used to view and print data from the tables in an organized way. Memorise e e e A. Queries are used to retrieve data from the tables that meet certain criteria. Data retrieved using queries is stored in a query table, To retrieve data from multiple tables, you need to create relationship among tables first. Forms are used to enter data in tables. You can design and format a form. You can change the look and feel of a form as desired. Reports are used to view and print data. You can format your report. Tick (/) the correct option. Have you and your classmate ticked the same answers? @ Cross-check. 1. Query is used to a. Retrieve data (Jb Fiterdata = [7]. Arrange data O 2. The Form option is available under the a. Create tab (.} b. Design tab (J) & Home tab {J 3. The Run button resides on the Design tab (.) b. Home tab [) & Layouttab i 4. The Criteria option is used for applying a. Conditions () b. Settings [7] keys (i; 5. The Sort option is used to a. Data collection [] be Filter data () © Sortdata | Fill in the blanks. Compare your answers with your classmates’ answers. ® relationship bound record navigation pane print preview toolbar layout view _ | You can see the report before printing ir 2. is used to navigate through the table records. 3. forms are connected directly to the data source. 4, is the default view of a report. 5. To retrieve data from multiple tables, must be set among tables. . State ‘True’ or ‘False’, 1. Forms are the graphical representation of data 2. You can edit table data in reports. 3. Multiple queries can be created in one table. 4, Query window is divided into four parts. 5. Forms can be of two types. Match the following columns. Column A Column B 1. Field a. Selected table for creating a query 2. Show b. To add second condition for the query 3. Unbound form c. Table fields to be added in a query 4. Table d. Checkboxes in design grid 5. Or e. Not connected to the data source directly . Short answer questions. 1. Define Queries in Access. 2. What do you understand by Design Grid? 3. What are different types of Forms? 4, What are different Report views? 5. What is a Report? = Long answer questions. ® 1. Write the steps to create a Query. 2. Explain the difference between Reports and Forms. 3. Distinguish between Design Area and Design Grid of Query Design window. 4. Write down steps to create a form in Access. ireaser, A. Solve the crossword with the help of given clues. 'Q Clues: It stores Query or Query data: . Itis an option used to execute a Query. a a 3. Itis a view in which reports are edited. 4. . Itis a type of form, directly connected to the data source. “B D 5. It is used to design the report. *DLE Ww. a (55) B. Describe the followin, 1. Criteria field: 2. Report view: Lab Activity Bikes) ae) EA | Ba) i Work in pairs. Visit the lab and do the following tasks. i 1. a. Create table with the name ‘Students_Info’ with the following fields: i | Roll_No, Name, Address, Age, Class b. Create a query to extract the records where Age is >= 15.7 c. Create a form to represent the table data. ! d. Create a report for the above table. | 2, a. Open the 'indiaDetailsDB! database you had created in chapter 2. i b. Create a query to extract the records where the animal/bird is an endangered species. c, .Create a form and report for the table data. | Group Discussion Discuss Forms in Access and its types with your friends and classmates. Project Work | Create a chart representing Data Grid. Explain all the options available in it to create a Query in Access. Online Links ® www.tutorialspoint.com/ms_access/ms_access_query_data, htm. | © www.techopedia.com/definition/4661/form-databases © Discuss about Queries, Forms and Reports. © Demonstrate to the students the steps to create Queries, Forms and Reports.

You might also like