List4
1. Create Persons table with the following fields (declare
FirstName as DEFAULT 'Ola') and describe the table
Pid FirstName LastName Address City
1 Ola Hansen Timoteivn 10 Sandnes
2 Tove Svendson Borgvn 23 Sandnes
3 Kari Pettersen Storgt 20 Stavanger
2. Specify UNIQUE constraint on field LastName in the
Persons table
3. Specify PRIMARY KEY constraint on field Pid in the
Persons table
4. Create Orders table with the following fields (declare Oid as
Primary Key and Pid as Foreign Key) and describe the table
Oid OrderNo Pid
1 77895 3
2 44678 3
3 22456 2
4 24562 1
5. Insert the Persons records in to the Persons table
6. Insert the Orders records in to the Orders table
7. Insert (4,'Andy','Hansen','Storgt 20','Stavanger') record in to
the Persons table and observe the result
8. Insert (3,'Andy','Tahsen','Storgt 20','Stavanger') record in to
the Persons table and observe the result
9. Insert (5,51212,4) record in to the Orders table and observe
the result
10. Delete record from the Persons table whose Pid is 3 and
observe the result
11. Give example which includes all Arithmetic functions
12. Give example which includes all String functions
13. Give example which includes all Date and Time functions
14. Retrieve tuples from the reserves table (display ‘day’ as
dd-mon-yyyy)
15. Retrieve tuples from the boats table, in which trim ‘In’
from left side on ‘bname’
16. Retrieve tuples from the sailors table, in which trim ‘io’
from right side on ‘sname’
17. Convert ‘2010 10 feb’ in to date
18. Give example which includes all General functions