Professional Documents
Culture Documents
Mid - cmuis401sc - nguyễn Thị Mỹ Trinh
Mid - cmuis401sc - nguyễn Thị Mỹ Trinh
Duration: 90 minutes
1. Consider the following relational schema and briefly answer the questions that follow:
DEPARTMENT(ID_DEPT, NAME)
Write the function that calculates the total number of employees when entering the department code
value
Go
returns int
As
Begin
End
Go
print dbo.fSumnv('P02');
Write a transaction to aggregate amount for each customer (Have use Isolation level)
as
set transaction isolation level read uncommitted select TENKHACH, datediff( dd, NGAYDEN, NGAYDI ) * GIA *
SOPHONG
As
TOTAL of MONEY
and
and
commit transaction
end
3.1. Define a table constraint on Catalog that will ensure that all cost > = 0
cost real ,
3.2. Find the pids of parts supplied by at least two different suppliers.
AS
WHERE
GROUP BY
4. Database security
User Jane, who is the owner of the MovieSchema schema that contains tables
4.1. Grant the INSERT and SELECT privileges on table STUDIO and privileges
SELECT on MOVIE to users Mary and Kird. Moreover, she includes the grant
option with these privileges
->
GRANT INSERT,
GRANT
4.2. Kird grant to use Peter the same privileges, but without the grant option
->
GRANT INSERT,
No 2 Page 3
SELECT ON STUDIO
TO Peter;
GRANT
No 2 Page 4
No 2 Page 5