Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Week 9.docx
1. Prepared by: Dr. Deepani Guruge Moderated By: A/Prof. Savitri Bevinakoppa Nov, 2016
MN405 Data and Information Management
Laboratory 9 : Database Design
Submission Due: End of laboratory class, submit the file on Moodle at least 10 minutes before
the end of laboratory class.
Total Marks = 5 marks for 10 weeks
Marks will be given only to students who attend and participate during 2 hours laboratory class.
Submission on Moodle is mandatory as an evidence of participation.
Description of the laboratory exercise:
The purpose of this assignment is to understand some database functions related to data integrity,
Primary keys, foreign keys, referential integrity, structured query language (SQL) and issues related
to data integrity and security.
This laboratory exercise has 2 parts, Part A and Part B.
Part A
Complete the Practice quiz 5 quiz and paste the result here. Try to obtain 85%+ on the quiz.
Part B
1.
a. What is Referential Integrity?
It the concept related to database in which all foreign keys should check with the
primary key which should be indicated to foreign key.
b. What is Data independence?
Data independence is a term that is related to data transparency that is linked to
centralized DBMS and gives to immunity to the user to make changes in the data.
c. List 3 DBMS’s security features.
1.) Access control
2.) Auditing
3.) Authentication
2. Search on-line and list types of threat that could affect a database system.
Different kind of threats that could affect a database system
1.) Execessive privilege
2. MN405 Data and Information Management Page 2 of2
Prepared by: Dr. Deepani Guruge Moderated By: A/Prof. Savitri Bevinakoppa Nov, 2016
2.) Legitimate privilege abuse
3.) Database injection attacks
4.) Maleware
5.) Storage media exposure
6.) Exploitation of vulnerable database
7.) Unmanaged sensitive data
8.) The human factor
3. Consider the following relational schema: Questions 3 -11 are based on referential
integrity.
Table Name Attributes
Emp (eid: integer, ename: string, age: integer, salary: real,did: integer)
Works (eid: integer, did: integer, ptime: integer)
Dept (did: integer, dname: string, budget: real, managerid: integer
Example : to CREATE TABLE Command with constraints
CREATE TABLE Emp(
eid int NOT NULL PRIMARY KEY,
age int NOT NULL,
……………………………..
did int FOREIGN KEY REFERENCES Dept(did)
);
4. Write SQL statements to create Dept relation. Note: did is the primary key (not null).
Hint: use CREATE TABLE Command with constraints
CREATE TABLE Dept
did INTEGER,
dhame STRING,
budget REAL,
managerid INTEGER,
PRIMARY KEY (did) ON DELETE SET NULL
5. Define the DeptrelationinSQLsothat everydepartmentisguaranteedtohave amanager.
CREATE TABLE Dept(
didINTEGER,
budgetSTRING,
manageridINTEGER,
PRIMARY KEY (did)
FOREIGN KEY (managerid) REFERENCES(Emp)
3. MN405 Data and Information Management Page 3 of3
Prepared by: Dr. Deepani Guruge Moderated By: A/Prof. Savitri Bevinakoppa Nov, 2016
6. Enter followinginformationintoDepttable.
did dname budget managerid
3 Finance 2000.50 6
4 Administration 5000.70 7
INSERT
INTODept(did,dname,budget,managerid)
VALUES (3,‘finance’,2000.50, 6)
VALUES (4,‘administration’,5000.70, 7)
7. Write SQL statementstocreate Emp relation.
a. Addthe FOREIGN KEY that will relate the DEPTtable tothe EMP table.
b. Include appropriate versionsof all primaryandforeignkeyintegrityconstraints.
8. Enter followinginformationintoEMP table
Eid Eame Age Salary did
1006 Peter Miller 40 4000.90 3
1007 David John 30 5000.80 3
1008 Kevin Studd 29 6000.70 4
INSERT
INTOEmp (eid,ename,age,salary,did)
VALUES (1006, ‘petermiller’,40,4000.90, 3)
VALUES (1007, ‘davidjohn’,30,5000.80, 3)
VALUES (1008, ‘kevinstudd’,29,6000.70, 4)
9. Can you insert following record into EMP table?
Eid Eame Age Salary did
1008 Cathy Simon 35 5000.80 5
NO, we cannot insert record into EMP table.
10. If you cannot insert, give an explanation why you couldn’t.
We cannot because EID is already taken by other person.
11. Delete department 3 from the DEPT table using the following command
a. DELETE FROMDept WHERE did=3;
DELETE
FROMdept
WHERE did=’3’
b. Explain what happens to EMP table when this statement is executed.
It will not execute.