SlideShare a Scribd company logo
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
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)
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.

More Related Content

DOCX
T 8-gurjinder
DOCX
Individual log file_3_shayan_.docx
DOCX
Assigment 2
PPT
Week 1 Before the Advent of Database Systems & Fundamental Concepts
PPTX
Week 1 Lab Directions
PDF
Data Mining And Data Warehousing Laboratory File Manual
PPTX
PDF
A statistical data fusion technique in virtual data integration environment
T 8-gurjinder
Individual log file_3_shayan_.docx
Assigment 2
Week 1 Before the Advent of Database Systems & Fundamental Concepts
Week 1 Lab Directions
Data Mining And Data Warehousing Laboratory File Manual
A statistical data fusion technique in virtual data integration environment

What's hot (15)

DOC
introduction of database in DBMS
PPTX
Chapter 7 relation database language
PDF
Informatica Data Modelling : Importance of Conceptual Models
PDF
Chapter 3 Entity Relationship Model
PDF
TWO PARTY HIERARICHAL CLUSTERING OVER HORIZONTALLY PARTITIONED DATA SET
PDF
A Detail Database Architecture
PDF
Database aggregation using metadata
PPT
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
PDF
Improved Slicing Algorithm For Greater Utility In Privacy Preserving Data Pub...
PPT
OODM-object oriented data model
PPT
Introduction to Data Abstraction
PPT
Week 4 The Relational Data Model & The Entity Relationship Data Model
ODP
introduction of database in DBMS
Chapter 7 relation database language
Informatica Data Modelling : Importance of Conceptual Models
Chapter 3 Entity Relationship Model
TWO PARTY HIERARICHAL CLUSTERING OVER HORIZONTALLY PARTITIONED DATA SET
A Detail Database Architecture
Database aggregation using metadata
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Improved Slicing Algorithm For Greater Utility In Privacy Preserving Data Pub...
OODM-object oriented data model
Introduction to Data Abstraction
Week 4 The Relational Data Model & The Entity Relationship Data Model
Ad

Similar to Week 9.docx (20)

PPT
DBMS unit 3.ppt semester 4 btech aktu 2024
PDF
PPTX
Relational Database Management System part II
PDF
Basics of DBMS - Traditional File System
PPT
Chapter2.ppt
PPT
Unit03 dbms
PPT
Unit03 dbms
DOCX
Mi0034 –database management systems
PPTX
Dbms & oracle
PDF
Sql interview questions and answers
PDF
Sql ch 9 - data integrity
PDF
011. RDBMS_SQL (1).pdfaaaaaaaaaaaaaaaaaaaaa
PPT
SQL commands in database management system
PPTX
Security and Integrity violations, Authorisation and views, Integrity Constant
PPTX
Integrity Constraints
PPT
Lec07-sql-ddldadadadajajdnajbdadwhyvydawvyduavd
PPT
Database Concepts 101
PPT
Eer >r.model
PPT
database management system presentation on integrity constraints
DBMS unit 3.ppt semester 4 btech aktu 2024
Relational Database Management System part II
Basics of DBMS - Traditional File System
Chapter2.ppt
Unit03 dbms
Unit03 dbms
Mi0034 –database management systems
Dbms & oracle
Sql interview questions and answers
Sql ch 9 - data integrity
011. RDBMS_SQL (1).pdfaaaaaaaaaaaaaaaaaaaaa
SQL commands in database management system
Security and Integrity violations, Authorisation and views, Integrity Constant
Integrity Constraints
Lec07-sql-ddldadadadajajdnajbdadwhyvydawvyduavd
Database Concepts 101
Eer >r.model
database management system presentation on integrity constraints
Ad

More from NidhiGupta8431 (9)

DOCX
Ict713 t320-t10-dl-08 dec2020
DOCX
Ict713 t320-t7-dl-20 oct2020
Ict713 t320-t10-dl-08 dec2020
Ict713 t320-t7-dl-20 oct2020

Recently uploaded (20)

PPTX
OnePlus 13R – ⚡ All-Rounder King Performance: Snapdragon 8 Gen 3 – same as iQ...
PPTX
ESD MODULE-5hdbdhbdbdbdbbdbdbbdndbdbdbdbbdbd
PDF
Sales and Distribution Managemnjnfijient.pdf
PPTX
_+✅+JANUARY+2025+MONTHLY+CA.pptx current affairs
PPTX
PMP (Project Management Professional) course prepares individuals
PDF
Prostaglandin E2.pdf orthoodontics op kharbanda
PPTX
internship presentation of bsnl in colllege
PDF
Daisia Frank: Strategy-Driven Real Estate with Heart.pdf
PDF
Manager Resume for R, CL & Applying Online.pdf
PPTX
Definition and Relation of Food Science( Lecture1).pptx
PPTX
Prokaryotes v Eukaryotes PowerPoint.pptx
PDF
L-0018048598visual cloud book for PCa-pdf.pdf
PDF
APNCET2025RESULT Result Result 2025 2025
PDF
Josh Gao Strength to Strength Book Summary
PDF
Blue-Modern-Elegant-Presentation (1).pdf
PPTX
Overview Planner of Soft Skills in a single ppt
PDF
Entrepreneurship PowerPoint for students
PDF
Biography of Mohammad Anamul Haque Nayan
PDF
Why Today’s Brands Need ORM & SEO Specialists More Than Ever.pdf
PPTX
The Stock at arrangement the stock and product.pptx
OnePlus 13R – ⚡ All-Rounder King Performance: Snapdragon 8 Gen 3 – same as iQ...
ESD MODULE-5hdbdhbdbdbdbbdbdbbdndbdbdbdbbdbd
Sales and Distribution Managemnjnfijient.pdf
_+✅+JANUARY+2025+MONTHLY+CA.pptx current affairs
PMP (Project Management Professional) course prepares individuals
Prostaglandin E2.pdf orthoodontics op kharbanda
internship presentation of bsnl in colllege
Daisia Frank: Strategy-Driven Real Estate with Heart.pdf
Manager Resume for R, CL & Applying Online.pdf
Definition and Relation of Food Science( Lecture1).pptx
Prokaryotes v Eukaryotes PowerPoint.pptx
L-0018048598visual cloud book for PCa-pdf.pdf
APNCET2025RESULT Result Result 2025 2025
Josh Gao Strength to Strength Book Summary
Blue-Modern-Elegant-Presentation (1).pdf
Overview Planner of Soft Skills in a single ppt
Entrepreneurship PowerPoint for students
Biography of Mohammad Anamul Haque Nayan
Why Today’s Brands Need ORM & SEO Specialists More Than Ever.pdf
The Stock at arrangement the stock and product.pptx

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.