SQL – Microsoft Access
------------------------------------------------------------------------------
display all the fields mentioned; but do NOT display those not mentioned
create ONE QUERY (not five queries) to practice (1) GROUP BY, (2) expressions (calculations), (3) alias, (4) JOIN:
Join the tables Franchisees and Restaurants, (the following points are for you to check and make sure your SQL codes deliver the requirements):
1) find for each credit rating (of franchisees) and for each state (we have CA and FL in the data) (each group is of different rating-state)
2) the number of restaurants in each group – use proper column heading (alias),
3) the average annual sales in each group – use alias,
4) the maximum square footage of restaurant in each group – use alias,
5) and the average sales per square footage in each group (use “SalesPerFt” as column header),
6) for those restaurants whose SalesPerSqFt are $400 or higher.
------------------------------------------------------------------------------
If you have any doubts, please give me comment...
-- 1
SELECT CreditRating, HomeState
FROM Franchisees;
-- 2
SELECT FranchiseeID, COUNT(*) noOfRestaurents
FROM Franchisees
GROUP BY FranchiseeID;
-- 3
SELECT FranchiseeID, AVG(AnnualSales) avgSales
FROM Restaurants
GROUP BY FranchiseeID;
-- 4
SELECT FranchiseeID, MAX(SquareFootage) maximuSquareFootage
FROM Restaurants
GROUP BY FranchiseeID;
-- 5
SELECT FranchiseeID, AVG(SquareFootage) SalesPerFt
FROM Restaurants
GROUP BY FranchiseeID;
-- 6
SELECT FranchiseeID, AVG(SquareFootage) avgSquareFootage
FROM Restaurants
GROUP BY FranchiseeID
HAVING AVG(SquareFootage)>=400;
SQL – Microsoft Access -------------------------------------------------------------------------...
The Language Is SQL The language is SQL 13- List full details of agents with first names having exactly three or four letters sorted by the state attribute. 14- List the first name, the last name, the address, the city, the state, the branch number, and the email of agents working in the branch 8005 and having email addresses from yahoo.com. 15-List the first name, the last name, the address, the city, the state, the branch number, and the email...