0% found this document useful (0 votes)
33 views2 pages

List4 Dbms Lab

The document outlines the creation and manipulation of two database tables: Persons and Orders, detailing the fields, constraints, and sample records. It includes instructions for inserting, deleting, and observing results of various records, as well as examples of arithmetic, string, date, and general functions. Additionally, it specifies retrieval operations for data formatting and trimming from existing tables.

Uploaded by

bijjahimanshu05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

List4 Dbms Lab

The document outlines the creation and manipulation of two database tables: Persons and Orders, detailing the fields, constraints, and sample records. It includes instructions for inserting, deleting, and observing results of various records, as well as examples of arithmetic, string, date, and general functions. Additionally, it specifies retrieval operations for data formatting and trimming from existing tables.

Uploaded by

bijjahimanshu05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

You might also like