Example 1: INSERT INTO PhoneNumbers (name, number) VALUES(‘john’, 2034329343);
Given tables as follows: Company (companyName, id); EmployeesHired(id, numHired, fiscalQuarter)
Example 2: SELECT companyName FROM Company, EmployeesHired WHERE Company.id = EmployeesHired.id AND fiscalQuarter = 4;
Example 3: SELECT companyName FROM Company WHERE id NOT IN (SELECT id from EmployeesHired WHERE numHired > 0);
Example 4: SELECT companyName, SUM(numHired) FROM Company, EmployeesHired WHERE Company.id = EmployeesHired.id GROUP BY companyName;
Friday, May 28, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment