Q1. Write a SQL command for following: i) Student( roll_no,name, address, phone_number). a) Add primary key constraint on roll_no and unique constraint on phone number. b) Display the record of...


Q1. Write a SQL command for following:
i) Student( roll_no,name, address, phone_number).
a) Add primary key constraint on roll_no and unique constraint on phone number.
b) Display the record of student whose name contains ‘a’ character.
ii) create new user ‘user1’ and set password ‘user123’.
a) Assign select permission on student table which is created by user ‘system’ to ‘user1’
and ‘user1’ should be able to assign same permission to other users
b) Revoke all the permission of ‘user1’ and also revoke the permissions which are issued
by ‘user1’ to other users.
iii) Consider the following database:
Employee(emp_id,name,dept_id,job,email,mobile_number,join_date,salary,mgr_id)
Department(dept_id,dept_name,block_no);
a) Query to display each department name ,number of employees in the department and
the average salary for all the employees in that department.


Q1. Write a SQL command for following:<br>i) Student( roll_no,name, address, phone_number).<br>a) Add primary key constraint on roll_no and unique constraint on phone number.<br>b) Display the record of student whose name contains 'a' character.<br>ii) create new user 'user1' and set password 'user123’.<br>a) Assign select permission on student table which is created by user 'system' to 'userl'<br>and 'userl' should be able to assign same permission to other users<br>b) Revoke all the permission of 'userl’ and also revoke the permissions which are issued<br>by 'userl' to other users.<br>iii) Consider the following database:<br>Employee(emp_id,name,dept_id.job,email,mobile_number,join_date,salary,mgr_id)<br>Department(dept_id,dept_name,block_no);<br>a) Query to display each department name ,number of employees in the department and<br>the average salary for all the employees in that department.<br>

Extracted text: Q1. Write a SQL command for following: i) Student( roll_no,name, address, phone_number). a) Add primary key constraint on roll_no and unique constraint on phone number. b) Display the record of student whose name contains 'a' character. ii) create new user 'user1' and set password 'user123’. a) Assign select permission on student table which is created by user 'system' to 'userl' and 'userl' should be able to assign same permission to other users b) Revoke all the permission of 'userl’ and also revoke the permissions which are issued by 'userl' to other users. iii) Consider the following database: Employee(emp_id,name,dept_id.job,email,mobile_number,join_date,salary,mgr_id) Department(dept_id,dept_name,block_no); a) Query to display each department name ,number of employees in the department and the average salary for all the employees in that department.
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here