Pract. model

advertisement
Kingdom of Saudi Arabia
‫الـمـمـلكـة الـعـربـيـة الـسـعـوديـة‬
‫وزارة الـتـعـلـيـم الـعـالـي‬
‫جـامـعـة الـمـجـمـعـة‬
‫كلية العلوم بالزلفي‬
Ministry of Higher Education
Majmaah University
College Of Sciences in Alzulfi
CIS326 -:‫رقم ورمز المادة‬
Second exam
10/7/1436-:‫تاريخ اإلمتحان‬
2‫ – تجسير ش‬2 ‫قواعد البيانات‬
-:‫الرقم الجامعي‬
-:‫اسم الطالب‬
Question 1:
- Create the Employee and Dept tables based on the following charts:
Table name Employee:
Column Name
Key type
Null/unique
Check
FK Ref Table
FK Ref column
Data Type
Length
EmpNo
PK
NN,U
First_Name
Salary
NN
Number
3
Table name Dept:
Column Name
Key type
Null/unique
Data Type
Length
DeptNo
FK
NN
>1000
Number Varchar2
4
20
DeptNo Name
PK
NN, U
Number Varchar2
2
20
1
-:‫اسم المادة‬
Dept
DeptNo
Number
2
Kingdom of Saudi Arabia
‫الـمـمـلكـة الـعـربـيـة الـسـعـوديـة‬
‫وزارة الـتـعـلـيـم الـعـالـي‬
‫جـامـعـة الـمـجـمـعـة‬
‫كلية العلوم بالزلفي‬
Ministry of Higher Education
Majmaah University
College Of Sciences in Alzulfi
Second exam
CIS326 -:‫رقم ورمز المادة‬
10/7/1436-:‫تاريخ اإلمتحان‬
-
2‫ – تجسير ش‬2 ‫قواعد البيانات‬
-:‫الرقم الجامعي‬
-:‫اسم المادة‬
-:‫اسم الطالب‬
Rewrite following instructions after correcting the mistakes- if exist – according to constraints:
Note: instructions executed in this sequence:
a- Insert the row(1, comp) in the Dept table?
b- Insert the row(7,Farid,500,1)in the Employee table?
c- Change the department number of employee "Farid" in Employee
table to be 6.
d- Remove the row (7,Farid,500,1) from Employee table
2
Kingdom of Saudi Arabia
‫الـمـمـلكـة الـعـربـيـة الـسـعـوديـة‬
‫وزارة الـتـعـلـيـم الـعـالـي‬
‫جـامـعـة الـمـجـمـعـة‬
‫كلية العلوم بالزلفي‬
Ministry of Higher Education
Majmaah University
College Of Sciences in Alzulfi
Second exam
CIS326 -:‫رقم ورمز المادة‬
10/7/1436-:‫تاريخ اإلمتحان‬
2‫ – تجسير ش‬2 ‫قواعد البيانات‬
-:‫الرقم الجامعي‬
-:‫اسم المادة‬
-:‫اسم الطالب‬
Q2) Consider the two tables instructor and department:
Instructor
Department:
ID
Name
Dept_name Salary
Dept_name Building
Budget
Biology
1001 Ted
Watson
40000Finance
10000
Chemistry
1002 Bob
Painter
30000Music
20000
Music
1003 Ron
Taylor
50000Physics
50000
a) Create a view that displays the ID, name, Building from the two tables.
b) create sequence for the department table that starts by 100 and end by 1000 increment
by 5.
3
Kingdom of Saudi Arabia
‫الـمـمـلكـة الـعـربـيـة الـسـعـوديـة‬
‫وزارة الـتـعـلـيـم الـعـالـي‬
‫جـامـعـة الـمـجـمـعـة‬
‫كلية العلوم بالزلفي‬
Ministry of Higher Education
Majmaah University
College Of Sciences in Alzulfi
Second exam
CIS326 -:‫رقم ورمز المادة‬
10/7/1436-:‫تاريخ اإلمتحان‬
2‫ – تجسير ش‬2 ‫قواعد البيانات‬
-:‫الرقم الجامعي‬
-:‫اسم المادة‬
-:‫اسم الطالب‬
Q3) Select the best answer:
1. A _________ consists of a sequence of query and/or update statements.
a) Transaction
b) Commit
c) Rollback
d) Flashback
2. Which of the following makes the transaction permanent in the database ?
a) View
b) Commit
c) Rollback
d) sequence
3. In order to undo the work of transaction after last commit which one should be used ?
a) View
b) Commit
c) Rollback
d) Flashback
4. Consider the following action:
Transaction…..
Commit;
Rollback;
What does Rollback do?
a) Undoes the transactions before commit
b) Clears all transactions
c) Redoes the transactions before commit
d) No action
5. In case of any shut down during transaction before commit which of the following
statement is done automatically ?
a) View
b) Commit
c) Rollback
d) sequnce
4
Download