SQL Day3
SQL Day3
SQL Day3
SQL (Day3):
1 Insert one row in each of the following tables: students, courses and
students_courses.
Savepoint firsto
3 In the employees table increase the salary by 10% for employees whose salary
is below 3000.
update employees
set salary=salary*1.1
where salary < 3000 ;
delete students_courses;
5 Discard the most recent DELETE and UPDATE operation without discarding
the earlier INSERT operation.
commit
7 Add column 'Email' to table students and check that the email contains the @
sign.
9 Modify the registration date column to have the current date as a default value.
10 Populate the students table with suitable values from the employees table.
11 Remove the constraint created in 7. Add another one which will assure that the
email column has no duplicate values
14 Create a view called EMP_VU based on the employee number, employee name,
and department number from the EMP table. Change the heading for the
employee name to EMPLOYEE.
15 Select the view name and text from the appropriate data dictionary view.
Note: the view can't be used to manipulate the employees in departments other
than 20.
19 Insert one row in the courses table using the created sequence.
21 Create a nonunique index on the foreign key column (DEPT_ID) in the EMP.
22 Display the index name and uniqueness that exist in the data dictionary for the
EMP table.
23 Create a user with your name and give him the appropriate system privileges.
24 Create a role to include the appropriate object privileges the user needs to start
properly.
25 Give the user the ability to see the contents of the students table. Create a
synonym to facilitate the retrieval of the students table' contents.