Week 3 Lab1 Review on Database Dina A. Said

Slides:



Advertisements
Similar presentations
Customizing Reports. Custom Reports A report is a formatted hardcopy of the contents of one or more tables from a database. Although you can format and.
Advertisements

Concepts of Database Management Seventh Edition
Access Lesson 2 Creating a Database
Pivot Tables Need HW and exam. Why? A pivot table gives you a way to group, summarize and compare data in a spreadsheet. You can do the same tasks with.
Excel: Pivot Tables Computer Information Technology Section 6-18.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational Databases.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Chapter 1 Databases and Database Objects: An Introduction
Access Tutorial 1 Creating a Database
COMPREHENSIVE Access Tutorial 2 Building a Database and Defining Table Relationships.
Overview Importing text files Creating Forms Creating Reports.
FIRST COURSE Access Tutorial 2 Building a Database and Defining Table Relationships.
Chapter 2 Querying a Database
Mary K. Olson PS Reporting Instance – Query Tool 101.
Build a database IV: Create queries for a new Access database Overview: Ask your data — create queries It’s time to create queries, one of the most powerful.
Tutorial 1 Creating a Database. Objectives Learn basic database concepts and terms Learn basic database concepts and terms Explore the Microsoft Access.
Chapter 2 Querying a Database
Advanced Tables Lesson 9. Objectives Creating a Custom Table When a table template doesn’t suit your needs, you can create a custom table in Design view.
® Microsoft Access 2010 Tutorial 6 Using Form Tools and Creating Custom Forms.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
CS&E 1111 AcQueries Querying in Access Sorting data Aggregating Data Performing Calculations Objectives: Learn how to use the Access Query Design Tool.
Access Tutorial 2 Building a Database and Defining Table Relationships
Chapter 1 Databases and Database Objects: An Introduction
Microsoft Access Get a green book. Page AC 2 Define Access Define database.
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 4 BACKNEXTEND 4-1 LINKS TO OBJECTIVES Query Design Query Criteria Modify a Query Using OR.
Microsoft ® Access ® 2010 Training Create Queries for a New Database If a yellow security bar appears at the top of the screen in PowerPoint, click Enable.
Access 2013 Microsoft Access 2013 is a database application that is ideal for gathering and understanding data that’s been collected on just about anything.
ISM 4212 Lab Creating DB Tables 02 copyright Lars Paul Linden 2007.
Database Systems Microsoft Access Practical #1 Creating Tables Nos 215.
COMPREHENSIVE Access Tutorial 6 Using Form Tools and Creating Custom Forms.
Access Manual 2 By Dhawala Kovuri Elham S.Khorasani Ismail Guneydas.
Analyzing Data Using Access. Creating a new database To create a new database 1.Start Access. In the Task Pane, click Blank Database. 2.The File New Database.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
Database Systems Microsoft Access Practical #3 Queries Nos 215.
Office Management Tools II Ms Saima Gul. Office Management Tools II Ms Saima Gul.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T7 PROBLEM SOLVING USING ACCESS.
® Microsoft Office 2013 Access Creating a Database.
A Skills Approach Access 2010 Working with Tables © 2012 The McGraw-Hill Companies, Inc. All rights reserved Chapter 2.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
Week 3 Lab1 Review on Database Dina A. Said
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T7: Problem Solving Using Access 2007 Business Driven Technology.
What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of.
T7-1 LEARNING OUTCOMES – ACCESS PROBLEM SOLVING 1.Describe the process of using the Simple Query Wizard using Access 2.Describe the process of using the.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
Classwork: Common Errors Primary keys: don’t forget them! Primary keys: choose the best one! – “Name” and “birthday” are not the best choices. – “Phone.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
Lesson 4: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Set query.
Build a database II: Create tables for a new Access database Create your tables In a relational database, tables store your data. Your data doesn’t “live”
COMPREHENSIVE Access Tutorial 1 Creating a Database.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T7: Problem Solving Using Access 2007 Business Driven Technology.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Access Tutorial 2 Building a Database and Defining Table Relationships
Tutorial 1 Creating a Database
Querying in Access Objectives: Learn how to use the Access Query Design Tool manipulate data in Access: Sorting data Aggregating Data Performing Calculations.
Access Tutorial 1 Creating a Database
Plug-In T7: Problem Solving Using Access 2007
Access Creating a Database
Access Creating a Database
Access Tutorial 1 Creating a Database
Access Quiz.
Microsoft Official Academic Course, Access 2016
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Chapter 1 Databases and Database Objects: An Introduction
Access Tutorial 2 Building a Database and Defining Table Relationships
Access Tutorial 2 Building a Database and Defining Table Relationships
Access Tutorial 1 Creating a Database
Access Tutorial 1 Creating a Database
Presentation transcript:

Week 3 Lab1 Review on Database Dina A. Said

Next Week (T1 & T2 only)  Next Monday  Lab Quiz #2 on Databases  Current Wednesday  “Week 1 Lab 2” of Problem Solving  Thanks for TA Paul for Today slides

Uploading Data from Excel  Got to the "External Data" tab and then select from the Import section Excel. 1/21/2009CPSC203- Week2- Lab13

1/21/2009CPSC203- Week2- Lab14

Review for Lab Quiz #2  Create a new database named Stuff.

Review for Lab Quiz #2  Create a table called Orders with the fields: OrderID, ProductID, SalespersonName, SalesDate, Quantity and SellingPricePerPiece.  What is the primary key?  Data type for ProductID?  Data type for SalespersonName?  Data type for SalesDate?

To Create a new Table 1. Choose Tab Create  Table 2. Write click on the table name to choose the design view 3. Start writing variables Names and types  Notes:  Choose the unique variable to be primary key  To make a variable primary key: choose the variable, right click  primary key  Primary key variable is the one with yellow key to its left  If you are required to enter values for ID, make its type number instead of autonumber 1/21/2009CPSC203- Week2- Lab17

Review for Lab Quiz #2  Create a table called Products with the fields ProductID, PName, PurchaseDate, Supplier and PurchasePricePerPiece.  What relationships might be required?

To create a relationship 1. Choose tab Database Tools 2. Choose relationships 3. Choose both tables 4. To make a relationship between variable A and variable B I. Drag variable A from the first table to variable B in the second table II. A box will appear to you with the relationship variables III. Make sure that variables names are correct and then press ok 1/21/2009CPSC203- Week2- Lab19

Review for Lab Quiz #2  Set the default quantity in the Orders table to 0.  How? 1. Open the Design view of the required table 2. Choose the variable that you want to set its default value 3. Set default value in the bottom box

Review for Lab Quiz #2  Add the following records to the products table:  ProductID: 10089, PName: Bath Salts, PurchaseDate: 10/20/2008, Supplier: Bath and Beyond, PurchasePricePerPiece: $2  ProductID: 10768, PName: Shower Gel, PurchaseDate: 10/1/2008, Supplier: Lush, PurchasePricePerPiece: $4.50  ProductID: 10769, PName: Shampoo, PurchaseDate: 10/1/2007, Supplier: Lush, PurchasePricePerPiece: $8

Review for Lab Quiz #2  Add the following data to the orders table: 1/21/2009CPSC203- Week2- Lab112 orders orderIDproductID salesManNa me quantityorderDate sellingPriceP erPiece John Smith211/1/ Lora Bill112/1/ Sandra smith105/1/ John Smith52/1/20095

Review for Lab Quiz #2  Create a query named query_1 that displays all the information from both tables.  How? 1. Choose create tab  Query Wizard 2. Choose simple Query wizard 3. Choose both tables 4. Choose which fields you want to be displayed using > 5. If you want to not show a certain field after choosing it, use < 6. Rename the query as required

Review for Lab Quiz #2  Create a query named query_2, using query_1, that displays all fields in both tables, but limit the query to the Supplier "Lush".  How? 1. Creating the query using simple query wizard to select all fields from query-1 2. Open the query in the design view 3. In the suppler field, set the criteria to “Lush” 4. You can check SQL by right-click and choose Show SQL

Review for Lab Quiz #2  Create an aggregate query named query_3. Group the query using SalesPersonName and calculate the Average quantity he/she sells

How to create Aggregate query? 1. Create the query using simple query wizard and choose only salesPersonName and quantity 2. Open the query in the design view 3. Choose Totals 4. You will find a new row added named total and the word GroupBy is written for both fields 5. For Quantity, change the word GroupBy to be Sum so that the sum of Quantity is displayed 6. Don’t forget to check SQL 1/21/2009CPSC203- Week2- Lab116

Review for Lab Quiz #2  Create a new query query_4, that displays all information in table products. Then, create a new field called RevenueAmount. This should be calculated by Quantity*SellingPricePerPiece.  How?  Create the Query using the simple query wizard  Display SQL of query_4  Add to the select statement the following: Select …., Quantity*SellingPricePerPiece as RevenueAmount

Review for Lab Quiz #2  In query_4, create a new field called Status. This should display "Profit" if SellingPricePerPiece>PurchasePricePerPiece, "Breakeven" if they were equal and "Loss" otherwise.  First, write the expression in English statements  if SellingPricePerPiece>PurchasePricePerPiece Status=profit  Else if SellingPricePerPiece=PurchasePricePerPiece Status=equal  Else Status=loss

How to make If statement?  Go to the design view of the query  Add anthoer field as:  Status:IIF(SellingPricePerPiece>PurchasePricePerPiece, ”Profit”, IIF(if SellingPricePerPiece=PurchasePricePerPiece, “Equal”,”Loss)) 1/21/2009CPSC203- Week2- Lab119

Review for Lab Quiz #2  Create a crosstab query from query_1. Let the rows show the SalesPersonName, the columns show the product name, and calculate the sum of Quantity.  How?  Choose Create  Query Wizard  Crosstab query  Choose query  query1  Select SalesPersonName in rows  Select ProductName in column  Select quantity as data and sum as function (on the right)

 Notes  Take care which fields are required to be rows and which fields are required to be columns  Take care which function is required to be calculated; avg, sum, max, etc… 1/21/2009CPSC203- Week2- Lab121