LAB Experiment-2
LAB Experiment-2
1. NOT NULL: Ensures that a column cannot have a NULL value. This constraint ensures that a
field always contains a valid, non-missing value.
Example:
2. LOWER(string)
•Description: Converts all letters in the string to lowercase. Non-letter characters remain unaffected.
•Syntax: LOWER(string)
•Example:
4. UPPER(string)
•Description: Converts all letters in the string to uppercase. Non-letter characters are unaffected.
•Syntax: UPPER(string)
•Example
6. ROUND(value, precision)
•Description: Rounds a number to a specified number of decimal places.
•Syntax: ROUND(number, decimal_places)
•Example
8. LAST_DAY(date)
•Description: Returns the last day of the month for the given date.
•Syntax: LAST_DAY(date)
•Example
Add date of birth column (DOB) to Employee Table. Insert appropriate DOB values for different
employees and try the exercise problems given below:
24. Display the birth date of all the employees in the following format:
‘DD-MON-YYYY’
‘DD-MON-YY’
‘DD-MM-YY’
25. List the employee names and the year (fully spelled out) in which they are born
‘YEAR’
‘Year’
‘year’
1. Modify the employee table to check the salary of every employee to be greater than 5000.
2. Find the quarter of year from the given date.
3. Convert seconds to hours, minutes and seconds format.
4. Find the week of the year from the given date.
5. Find the names of all departments with instructor, and remove duplicates.
6. For all instructors who have taught some course, find their names and the course ID of the courses they
taught.
7. Find all the instructors with the courses they taught.
8. List all the students with student name, department name, advisor name and the number of courses
registered.