IT For Managers
IT For Managers
IT For Managers
IT FOR MANAGERS
Data Models and SQL
- Rakshanda Bhardwaj
Database Models
SELECT *
FROM Customer
Result:
SELECT FirstName, LastName, City
FROM Customer
Result:
SELECT Id, FirstName, LastName, City, Country, Phone
FROM Customer
WHERE Country = 'Sweden
Result:
INSERT INTO table-name (column-names)
VALUES (values)
Example:
INSERT INTO Customer (FirstName, LastName, City,
Country, Phone)
VALUES ('Craig', 'Smith', 'New York', 'USA', 1-01-993
2800)
Result:
UPDATE table-name
SET column-name = value, column-name = value, ...
WHERE condition
UPDATE Product
SET IsDiscontinued = 1
WHERE UnitPrice > 50
DELETE Product
WHERE UnitPrice > 50
Results:
7 records deleted.
SELECT DISTINCT column-name
FROM table-name
Can be used with COUNT and other aggregates:
Count
16
AGGREGATE FUNCTIONS : LOGICAL OPERATORS :