Vous êtes sur la page 1sur 7

MS ACCESS JOIN QUERIES

AND phpMyAdmin MySQL


ASSIGNMENT – WEEK 04
• Part 1: Consider these two tables. Show their join table by
customer ID.

orders
order_no purch_amt ord_date customer_id
70001 150.5 2012-10-05 3005
70009 270.65 2012-09-10 3001
70002 65.26 2012-10-05 3002
70007 948.5 2012-09-10 3005

customer
customer_id cust_name city salesman_id
3002 Nick New York 5001
3005 Graham California 5002
3008 Julian London 5002

9 October 2018
2
ASSIGNMENT – WEEK 04
• Part 2: How many records are there in the results of the
following queries? Give and explain your answers without
running the queries.
• 1.1. SELECT *

FROM orders, customer

• 1.2. SELECT *
FROM orders, customer
WHERE orders.customer_id = customer.customer_id

9 October 2018
3
ASSIGNMENT – WEEK 04
• Part 3: create the following tables in MS Access.
companies

products

9 October 2018
4
ASSIGNMENT – WEEK 04
• Using MS Access Design View to pose and execute the
following queries:
• Q1: Show the information of all products together with the names of their
producing companies.
• Q2: Show the information of the products produced by Frontech.
• Q3: Show the names of the companies producing “drive” products and the
number of “drive” products by each of those companies.

9 October 2018
5
ASSIGNMENT – WEEK 04
• Part 4: Use phpMyAdmin to pose and execute the following
queries:
• Q4: Display the IDs and names of the “board” products whose prices are below
1000.
• Q5: Display the company ID, and the min and max prices of the products
produced by each company.
• Q6: Display the information of all products together with the information of their
producing companies.

• Q7: Display the information of the products whose prices are above 500
produced by iBall.
• Q8: Display the company name, and the number and average price of the
products produced by each company that produces more than one product.

9 October 2018
6
ASSIGMENT – WEEK 04
• Notes:
• Your created data tables must have exactly the same table names, field names,
field order, and data as in given printed one.

• For each query, the order of displayed columns must be the same as given in
the query. If all information is required, the order must be the same as in the
given data table.

• Since this is a computer-based assignment, you will get “full or none” grade for
each query based on your shown result when running the query.
• Your database file must contain the required tables and queries. Name your
queries as “Q1”, “Q2”, …, respectively.
• Submit Part 1, Part 2, and Part 4 of your work in one PDF file; Part 4 includes the
screenshot showing each query and its result; Part 3 in one MS Access
database file (*.accdb). Put your name in front of the file names.

9 October 2018
7

Vous aimerez peut-être aussi