Presentation is loading. Please wait.

Presentation is loading. Please wait.

DAY 7: ACCESS Rahul Kavi March 29, 2016 1.

Similar presentations


Presentation on theme: "DAY 7: ACCESS Rahul Kavi March 29, 2016 1."— Presentation transcript:

1 DAY 7: ACCESS Rahul Kavi Rahul.Kavi@mail.wvu.edu March 29, 2016 1

2 DEADLINES Homework 4 Posted. Homework 4 April 1 st. Homework 5 due April 8 th. MyITLab lesson C due April 15 th. 2

3 DEADLINES MyITLab lesson D due April 22 nd. Homework 6 due April 29 th. MyITLab lesson E due April 29 th. MyITLab late submission deadlines 29 th April. MyITLab bonus dead line April 25th 3

4 LAST CLASS Forms. In-class project. –Create Lookup fields with tables. –Create Forms and Sub Forms to enter data inside the tables. –Group by/Totals with queries. 4

5 TODAY Inner/Outer joins. SQL queries. Reports. 5

6 INNER JOINS (While writing queries) Inner joins in a relationship combines data from both tables where you have matching fields. This is the default relationship/join while building queries. 6

7 OUTER JOINS Sometimes you need all fields from left/right table and common fields in another table. You can get this using outer joins –left outer join –right outer join 7

8 SQL QUERIES SQL queries are descriptive/programmatic way of writing a query(without using query design). Every query you write may represented as a SQL Query (internally by Access). Copy-Paste SQL queries. 8

9 REPORTS Reports present a compact and clean view of the results from a query or a table. You can create reports using the report wizard in the “Create” tab. –Add the fields from queries or tables to the selected fields section. –Select how you want to view your data. –Select the sort order and grouping. –Select the layouts –Select name of the report and click finish –Adjust width in layout view of the report. 9

10 EXAMPLE Download classwork for today. Open the database file. 10

11 EXAMPLE 11 Regions Countries (top 5) Revenue (per country in 2008, 2010, 2012)

12 QUERIES Write a query to “Query6A” to display region name and total number of countries in that region. Your answer should contain 3 records and 2 fields. 12

13 QUERIES Write a query to “Query6B” to display region name and number of regions in that country. Display all region names even if they are not listed in the countries table. Your answer should contain 6 records and 2 fields. (use outer joins). 13

14 SQL QUERY EXAMPLE You copy paste SQL query in “SQL view” of a query. Copy paste the following SQL query to get calculate average foreign and domestic tourism income. Save it as Query 6C. SELECT Countries.CountryName, Revenue.DataYear, ([ForeignTouristRevenue]+[DomesticTouristRevenue])*1000000000 AS TotalRevenue, [ForeignTouristRevenue]/[DomesticTouristRevenue] AS ForeignDomesticRatio FROM Countries INNER JOIN Revenue ON Countries.CountryAbbrv = Revenue.Country ORDER BY Countries.CountryName, Revenue.DataYear; 14

15 REPORTS Using the Report Wizard, create a report to show the results of Query6C. Display all fields from the query. View by country name and sort by year in ascending order. Use a stepped layout and landscape page orientation. Name the report RevenueSummary. Ensure the full widths of all columns are visible on the report. 15

16


Download ppt "DAY 7: ACCESS Rahul Kavi March 29, 2016 1."

Similar presentations


Ads by Google