SQL1
SQL1
• Create Database,
• Create Table,
• Alter Table,
• Create Table with constraint
• Primary key
• Foreign key
• Date time
• Time stamp
• Insert records
Select Statement
condition.
Select Query – WHERE clause
For integer values…
SELECT * FROM Customer
SELECT * FROM Customer
WHERE custcontry = ‘usa';
WHERE column_name = …. ;
Select Query – WHERE
The SQL AND, OR and NOT Operators
The WHERE clause can be combined with
AND, OR, and NOT operators.
SELECT * FROM Customer
WHERE custcontry = 'Germany' AND custcity =
'Berlin';
Select Query – WHERE
The SQL OR Operator
WHERE Custcountry LIKE '_r%' Finds any values that have "r" in the second position
WHERE Custcountry LIKE ‘u_%' Finds any values that start with "a" and are at least 2 characters in length
WHERE Custcountry LIKE ‘u__%' Finds any values that start with "a" and are at least 3 characters in length
WHERE Custname LIKE 'a%o' Finds any values that start with "a" and ends with "o"
Select Query – ORDERBY