You are on page 1of 2

EXERCISE 4: SQL built in functions

Faculty Name: Dr. Abishi Chowdhury

Lab Slot: L15+L16

Class Number: CH2022235002536


Subject: Database System Lab (BCSE302P)

Date: 01/02/2023
Due Date for Submission: 01/02/2023

1. Create the following relations:


Student (sID: int, sName: varchar2(10), CGPA: int, city: varchar2(15),
phone_number: int)

2. sID must be unique and not null.


3. sName cannot take null values.
4. phone_number must be unique.
5. CGPA cannot be more than 10.
6. Insert 10 rows in Student.
7. Create a new column DoB in Student table. (Datatype will be date).
8. DoB for each Student in corresponding table.
9. Find average of CGPA round off to 2 decimal places.
10.Display name of all Students in uppercase and lowercase.
11. Find fourth alphabet of each student.
12. Find sID and sName of student whose sName has string length greater
than 3.
13. Find floor, ceiling and truncate (to one decimal place) value of average
CGPA.
14. Display details of all students whose sID is even.
15. Consider String ‘Database Systems’ replace this using the key (Hint: use
translate)
a b D e m S s t y
1 2 3 4 5 6 7 8 9

16. Compute on which date is next Saturday and last day of this month?
17.Compute Square Root of 900 and 247.

NOTE: While creating any new table suffix your first name
along with last two digits of your registration number.
Eg: STUDENT_Abishi94

You might also like