Monday, November 22, 2010

database:
tables
queries - asking questions, performing actions to your data
reports
forms

SQL - a language for queries

within access, there are three ways to design a query
1) Wizard
2) Design View for queries
3) SQL


within wizard, three things can choose
1) what table?
2) what fields?
3) what will we name this query?


SELECT LastName, SSN, Age
FROM Customer;



SELECT Customer.LastName, Customer.SSN, Customer.Age, Customer.FirstName
FROM Customer
WHERE Customer.FirstName="Joshua";

where clause

SELECT LastName, SSN, Age, FirstName
FROM Customer
WHERE Age>50 AND FirstName="Joshua"

SELECT Customer.LastName, Customer.SSN, Customer.Age, Customer.FirstName
FROM Customer
WHERE (((Customer.LastName)="Waxman")) OR (((Customer.Age)<25));


UPDATE Customer
SET FirstName="Josh"
WHERE FirstName="Joshua"

UPDATE Customer
SET FirstName="James"
WHERE FirstName="Josh" And LastName = "Waxman"

UPDATE Customer SET Customer.FirstName = "Jimmy"
WHERE (((Customer.LastName)="Waxman"));

DELETE *
From Customer
Where LastName = "Waxman"

INSERT into Customer
VALUES
("Joshua", "Waxman", "1234346", 54)

No comments:

Post a Comment