Beruflich Dokumente
Kultur Dokumente
ingrName
ingrUnit
---------- ---------- ---------1
Tomato
whole
3
Olive oil millilitre
4
Mozzarella grams
7
Oregano
tablespoon
8
Basil
tablespoon
9
Rocket
tablespoon
11
Chorizo
grams
sqlite> SELECT * FROM Ingredient WHERE UPPER(ingrName) LIKE '%O%' UNION SELECT *
FROM Ingredient WHERE LOWER(ingrUnit) = 'tables
poons';
ingrNo
ingrName
ingrUnit
---------- ---------- ---------1
Tomato
whole
3
Olive oil millilitre
4
Mozzarella grams
7
Oregano
tablespoon
8
Basil
tablespoon
9
Rocket
tablespoon
11
Chorizo
grams
sqlite> SELECT * FROM Ingredient WHERE UPPER(ingrName) LIKE '%O%' UNION ALL SELE
CT * FROM Ingredient WHERE LOWER(ingrUnit) = 'ta
blespoons';
ingrNo
ingrName
ingrUnit
---------- ---------- ---------1
Tomato
whole
3
Olive oil millilitre
4
Mozzarella grams
7
Oregano
tablespoon
9
Rocket
tablespoon
11
Chorizo
grams
7
Oregano
tablespoon
8
Basil
tablespoon
9
Rocket
tablespoon
sqlite> SELECT * FROM Ingredient WHERE UPPER(ingrName) LIKE '%O%' INTERSECT SELE
CT * FROM Ingredient WHERE LOWER(ingrUnit) = 'ta
blespoons';
ingrNo
ingrName
ingrUnit
---------- ---------- ----------7
Oregano
tablespoons
9
Rocket
tablespoons
sqlite> SELECT * FROM Ingredient WHERE
FROM Ingredient WHERE LOWER(ingrUnit)
poons';
ingrNo
ingrName
ingrUnit
---------- ---------- ---------1
Tomato
whole
11
Chorizo
grams
sqlite> SELECT * FROM Ingredient WHERE
FROM Ingredient WHERE LOWER(ingrUnit)
poons';
ingrNo
ingrName
ingrUnit
---------- ---------- ---------1
Tomato
whole
7
Oregano
tablespoon
11
Chorizo
grams
sqlite> SELECT * FROM Ingredient WHERE
FROM Ingredient WHERE LOWER(ingrUnit)
poons';
ingrNo
ingrName
ingrUnit
---------- ---------- ---------1
Tomato
whole
11
Chorizo
grams
sqlite> CREATE VIEW EmployeeList AS SELECT empID, empFirstName
Name empName, roleName FROM Employee e, Role r W
HERE e.roleID = r.roleID;
sqlite> DROP VIEW EmployeeList;
sqlite> CREATE VIEW EmployeeList AS SELECT empID, empFirstName
Name empName, roleName FROM Employee e, Role r W
HERE e.roleID = r.roleID;
sqlite> VIEW EmployeeList;
Error: near "VIEW": syntax error
sqlite> .table
Address
Customer
Ingredient
Product
AddressType
Employee
OrderProduct
ProductSpecial
CustOrder
EmployeeList
OrderStatus
Recipe
sqlite> SELECT * FROM EmployeeList
...> ;
empID
empName
roleName
---------- --------------- ---------1
Classie Filkins Manager
2
Miesha Rozek
Chef
3
Amanda Corry
Cashier
4
Owen Willcutt
Cashier
5
Gary Zeledon
Delivery
Review
ReviewType
Role
sqlite> SJELECT empName, roleName FROM EmployeeList WHERE empName LIKE 'c%';
Error: near "SJELECT": syntax error
sqlite> SELECT empName, roleName FROM EmployeeList WHERE empName LIKE 'c%';
empName
roleName
--------------- ---------Classie Filkins Manager
sqlite> CREATE INDEX ind_empLastName ON Employee(empLastName);
sqlite> SELECT empLastName FROM Employee;
empLastName
----------Corry
Filkins
Rozek
Willcutt
Zeledon
sqlite> SELECT empLastName FROM Employee WHERE empLastName = 'Filkins';
empLastName
----------Filkins
sqlite> CREATE TABLE LOG(x);
sqlite>
sqlite> CREATE TRIGGER Product_insert_log AFTER INSERT ON Product
...> BEGIN
...> INSERT INTO LOG VALUES('insert product: new name= ' || new.prodName || '
on ' || DATETIME('now', 'localtime'));
...> END;
sqlite>
sqlite> DROP TRIGGER Product_insert_log;
sqlite>
sqlite> SELECT * FROM LOG;