SlideShare a Scribd company logo
1 of 6
Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning
ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020
ICT713 Advanced Database Design and Development
Tutorial 6
Topic: Database performance tuning, query optimization and Advanced SQL
Objective: Students learn about the Database performance tuning and write some
more SQL
Submission: Five minutes before the end of the tutorial word file containing student’s
answers need to be uploaded on Moodle
Part A: Answer the following questions:
1.
a. What is Referential Integrity?
It the concept relatedto database in which all foreignkeysshould
check with the primary keywhich shouldbe indicatedto foreignkey.
b. What isData independence?
Data independence isaterm that is relatedto data
transparency that is linkedto centralizedDBMS and givesto immunity to the user
to make changes in the data.
2. How can a table be deletedfromthe database?Provideanexample.
 Use the DELETE statementwithoutspecifyingaWHERE clause.Withsegmentedtable
spaces,deletingall rowsof a table isveryfast....
 Use the TRUNCATE statement.The TRUNCATEstatementcanprovide the following
advantagesovera DELETE statement:...
 Use the DROP TABLE statement.
DELETE FROMCustomersWHERE CustomerName='AlfredsFutterkiste';
Part B:
Considerthe followingrelational schema:Questions 1-8 are basedonreferential integrity.
Table Name Attributes
Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning
ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020
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)
);
1. 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
2. Define the DeptrelationinSQLsothat everydepartmentisguaranteedtohave amanager.
CREATE TABLE Dept ( did INTEGER,
budget REAL,
managerid INTEGER NOT NULL ,
PRIMARY KEY (did),
FOREIGN KEY (managerid) REFERENCES Emp)
3. Enter followinginformationintoDepttable.
did dname budget managerid
3 Finance 2000.50 6
4 Administration 5000.70 7
INSERT
INTO Dept(did,dname,budget,managerid)
VALUES (3, ‘finance’,2000.50, 6)
Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning
ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020
VALUES (4, ‘administration’,5000.70, 7)
4. Write SQL statementstocreate Emp relation.
a. Addthe FOREIGN KEY that will relate the DEPTtable tothe EMP table.
CREATE TABLE Emp(
Eid INTEGER NOT NULL,
Did INTEGER NOT NULL,
pcttime INTEGER,
PRIMARY KEY (eid, did),
UNIQUE(eid),
FOREIGNKEY (did) ReferencesDept)
Create TABLE Emp
On DELETE
{cascade, set default,setnull,no action}
b. Include appropriate versionsof all primaryandforeignkeyintegrityconstraints.
CREATE TABLE Emp(
Eid INTEGER,
Ename CHAR(10),
Age INTEGER,
Salary REAL,
PRIMARY KEY (eid))
CREATE TABLE WORKs(
Eid INTEGER,
Did INTEGER,
Pcttime INTEGER,
PRIMARY KEY (eid,did),
FOREIGNKEY(did) REFERENCES Dept,
FOREIGNKEY (eid) REFERENCES EMP,
On DELETE CASCADE)
5. Enter followinginformationintoEMP table
Eid Ename 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
INTO Emp (eid,ename,age, salary, did)
Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning
ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020
VALUES (1006, ‘petermiller’,40, 4000.90, 3)
VALUES (1007, ‘david john’,30, 5000.80, 3)
VALUES (1008, ‘kevinstudd’, 29, 6000.70, 4)
6. Can you insert following record into EMP table?
Eid Ename Age Salary did
1008 Cathy Simon 35 5000.80 5
NO, we cannot insert record into EMP table.
7. If you cannot insert, give an explanation why you couldn’t.
We cannot because EID is already taken by other person.
8. Delete department 3 from the DEPT table using the following command
a. DELETE FROMDept WHERE did=3;
DELETE
FROM dept
WHERE did=’3’
b. Explain what happens to EMP table when this statement is executed.
The UPDATE statement changes the values of specified columns in one or more rows in a table or
view.For a full descriptionof the UPDATE statement,see Oracle Database SQL Reference.Another
(usually short) name for the referenced table or view, typically used in the WHERE clause.
Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning
ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020
9. Create formsto enterdata foreach of the tables.
Forms in Accessare like display cases instores that make it easierto viewor get the itemsthat
you want. Since forms are objectsthrough which you or other users can add, edit,or displaythe
data storedin your Access desktopdatabase, the designof your form is an important aspect. If
your Access desktopdatabase is going to be usedby multiple users,well-designedformsis
essential forefficiencyanddata entry accuracy.
There are several ways of creating a form in an Access desktopdatabase and thisarticle points you
to some of the common ways.
10. Create any twosample reportsbasedonthe database.
As always, we’ll have to take a look at the data model we’re using. Ifyou’re a data analyst, some
of the expectedtasksyou can expectare – grab the data from the database, create a report, draw
conclusionsfrom the report data. Therefore,you can expectthat you’ll have a data model at your
disposal.
SQL queries- the data model we'll use in the article
In such a data model,you should identifythe tablesthat contain data neededinthe report. Also,
you’ll needto be sure how these tables are related.You shouldask yourselfquestionslike:
 Whichtablesare dictionariesand whichones are beingpopulatedwith data (eitherby
users/customers,eithersome automated process)? -> You’re interestedinanalyzing data
from tablesbeingpopulatedwith the data while dictionariesare here to displayinfoon
the screen(whenthe data is beinginserted+ used a category in reports)
 Does table X always have a relatedrecord in table Y? -> Maybe there always is a record in
the relatedtable,but that doesn’tneedto be the case always. This will be important when
you decide to use INNER JOIN (ifyou always have a relatedrecord) or LEFT JOIN (ifyou
don’t always have a relatedrecord) whenjoiningthese two tables
Part C:
WeeklylogforDatabase projectassessment:
Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning
ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020
No. Criteria Activity
1 Attendance at
weekly meeting
Convey information through telephone and social media, for
example, WhatsApp group used to exchange notes from
tutorials, other documents, and pictures for the assigned tasks
and Zoom meetings for discussions.
2 Weekly activity log After creating the ERD model, the next step was to design the
EERD for the enterprise.
3 Time management It took me 30 minutes to design the EERD for the enterprise.
4 Tasks Designed an Enhanced Entity Relationship Diagram which
represents the database entities and their attributes.
5 Actual contribution
to group project
 Creation of EERD model which
includes subclasses and superclasses,
Specialization & Generalization,
Attribute & Relationship Inheritance.
 Creation of EERD models through MS
Access.

More Related Content

What's hot

Elimination of data redundancy before persisting into dbms using svm classifi...
Elimination of data redundancy before persisting into dbms using svm classifi...Elimination of data redundancy before persisting into dbms using svm classifi...
Elimination of data redundancy before persisting into dbms using svm classifi...
nalini manogaran
 

What's hot (17)

Week 2 Characteristics & Benefits of a Database & Types of Data Models
Week 2 Characteristics & Benefits of a Database & Types of Data ModelsWeek 2 Characteristics & Benefits of a Database & Types of Data Models
Week 2 Characteristics & Benefits of a Database & Types of Data Models
 
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
 
A Review on Classification of Data Imbalance using BigData
A Review on Classification of Data Imbalance using BigDataA Review on Classification of Data Imbalance using BigData
A Review on Classification of Data Imbalance using BigData
 
Diedrich Free Research Systems
Diedrich Free Research SystemsDiedrich Free Research Systems
Diedrich Free Research Systems
 
Enhance The Technique For Searching Dimension Incomplete Databases
Enhance The Technique For Searching Dimension Incomplete DatabasesEnhance The Technique For Searching Dimension Incomplete Databases
Enhance The Technique For Searching Dimension Incomplete Databases
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#
 
data modeling and models
data modeling and modelsdata modeling and models
data modeling and models
 
Devry cis 321 week 4 milestone 4 part 1
Devry cis 321 week 4 milestone 4 part 1Devry cis 321 week 4 milestone 4 part 1
Devry cis 321 week 4 milestone 4 part 1
 
An overview of fragmentation
An overview of fragmentationAn overview of fragmentation
An overview of fragmentation
 
T2
T2T2
T2
 
Data resource management
Data resource managementData resource management
Data resource management
 
Informatica Data Modelling : Importance of Conceptual Models
Informatica Data Modelling : Importance of  Conceptual ModelsInformatica Data Modelling : Importance of  Conceptual Models
Informatica Data Modelling : Importance of Conceptual Models
 
OODM-object oriented data model
OODM-object oriented data modelOODM-object oriented data model
OODM-object oriented data model
 
Sq lite module1
Sq lite module1Sq lite module1
Sq lite module1
 
Elimination of data redundancy before persisting into dbms using svm classifi...
Elimination of data redundancy before persisting into dbms using svm classifi...Elimination of data redundancy before persisting into dbms using svm classifi...
Elimination of data redundancy before persisting into dbms using svm classifi...
 
Data Modeling PPT
Data Modeling PPTData Modeling PPT
Data Modeling PPT
 
Assign 1
Assign 1Assign 1
Assign 1
 

Similar to Ict713 t220-t6-dl-6 nov2020

Advanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docxAdvanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docx
nettletondevon
 
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docx
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docxCharles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docx
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docx
christinemaritza
 
Database DESIGN CONCEPTSDr. Dexter Francis2Data Design
Database DESIGN CONCEPTSDr. Dexter Francis2Data DesignDatabase DESIGN CONCEPTSDr. Dexter Francis2Data Design
Database DESIGN CONCEPTSDr. Dexter Francis2Data Design
OllieShoresna
 

Similar to Ict713 t220-t6-dl-6 nov2020 (20)

Chapter Five Physical Database Design.pptx
Chapter Five Physical Database Design.pptxChapter Five Physical Database Design.pptx
Chapter Five Physical Database Design.pptx
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
2nd chapter dbms.pptx
2nd chapter dbms.pptx2nd chapter dbms.pptx
2nd chapter dbms.pptx
 
Advanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docxAdvanced Database Systems CS352Unit 4 Individual Project.docx
Advanced Database Systems CS352Unit 4 Individual Project.docx
 
S2 DATA PROCESSING FIRST TERM C.A 2
S2 DATA PROCESSING FIRST TERM C.A 2S2 DATA PROCESSING FIRST TERM C.A 2
S2 DATA PROCESSING FIRST TERM C.A 2
 
7. SQL.pptx
7. SQL.pptx7. SQL.pptx
7. SQL.pptx
 
MIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresMIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome Measures
 
Data models
Data modelsData models
Data models
 
Introduction to database with ms access(DBMS)
Introduction to database with ms access(DBMS)Introduction to database with ms access(DBMS)
Introduction to database with ms access(DBMS)
 
Introduction to database with ms access.hetvii
Introduction to database with ms access.hetviiIntroduction to database with ms access.hetvii
Introduction to database with ms access.hetvii
 
Database aggregation using metadata
Database aggregation using metadataDatabase aggregation using metadata
Database aggregation using metadata
 
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docx
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docxCharles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docx
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docx
 
Database fundamentals
Database fundamentalsDatabase fundamentals
Database fundamentals
 
Databricks Data Analyst Associate Exam Dumps 2024.pdf
Databricks Data Analyst Associate Exam Dumps 2024.pdfDatabricks Data Analyst Associate Exam Dumps 2024.pdf
Databricks Data Analyst Associate Exam Dumps 2024.pdf
 
Microsoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdf
Microsoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdfMicrosoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdf
Microsoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdf
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Introduction to the Structured Query Language SQL
Introduction to the Structured Query Language SQLIntroduction to the Structured Query Language SQL
Introduction to the Structured Query Language SQL
 
Ssis sql ssrs_sp_ssas_mdx_hb_li
Ssis sql ssrs_sp_ssas_mdx_hb_liSsis sql ssrs_sp_ssas_mdx_hb_li
Ssis sql ssrs_sp_ssas_mdx_hb_li
 
Advanced database
Advanced databaseAdvanced database
Advanced database
 
Database DESIGN CONCEPTSDr. Dexter Francis2Data Design
Database DESIGN CONCEPTSDr. Dexter Francis2Data DesignDatabase DESIGN CONCEPTSDr. Dexter Francis2Data Design
Database DESIGN CONCEPTSDr. Dexter Francis2Data Design
 

More from NidhiGupta8431 (8)

T6
T6T6
T6
 
T9
T9T9
T9
 
T4
T4T4
T4
 
T7
T7T7
T7
 
T10
T10T10
T10
 
T1
T1T1
T1
 
Individual log file_3_shayan_.docx
Individual log file_3_shayan_.docxIndividual log file_3_shayan_.docx
Individual log file_3_shayan_.docx
 
Ict713 t320-t10-dl-08 dec2020
Ict713 t320-t10-dl-08 dec2020Ict713 t320-t10-dl-08 dec2020
Ict713 t320-t10-dl-08 dec2020
 

Recently uploaded

如何办理(UW毕业证书)滑铁卢大学毕业证成绩单原件一模一样
如何办理(UW毕业证书)滑铁卢大学毕业证成绩单原件一模一样如何办理(UW毕业证书)滑铁卢大学毕业证成绩单原件一模一样
如何办理(UW毕业证书)滑铁卢大学毕业证成绩单原件一模一样
qyguxu
 
Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
MasterG
 
如何办理(UoA毕业证书)奥克兰大学毕业证成绩单原件一模一样
如何办理(UoA毕业证书)奥克兰大学毕业证成绩单原件一模一样如何办理(UoA毕业证书)奥克兰大学毕业证成绩单原件一模一样
如何办理(UoA毕业证书)奥克兰大学毕业证成绩单原件一模一样
qyguxu
 
如何办理(PITT毕业证书)匹兹堡大学毕业证成绩单原件一模一样
如何办理(PITT毕业证书)匹兹堡大学毕业证成绩单原件一模一样如何办理(PITT毕业证书)匹兹堡大学毕业证成绩单原件一模一样
如何办理(PITT毕业证书)匹兹堡大学毕业证成绩单原件一模一样
qyguxu
 
如何办理(EUR毕业证书)鹿特丹伊拉斯姆斯大学毕业证成绩单原件一模一样
如何办理(EUR毕业证书)鹿特丹伊拉斯姆斯大学毕业证成绩单原件一模一样如何办理(EUR毕业证书)鹿特丹伊拉斯姆斯大学毕业证成绩单原件一模一样
如何办理(EUR毕业证书)鹿特丹伊拉斯姆斯大学毕业证成绩单原件一模一样
qyguxu
 
如何办理(KCL毕业证书)伦敦国王学院毕业证成绩单原件一模一样
如何办理(KCL毕业证书)伦敦国王学院毕业证成绩单原件一模一样如何办理(KCL毕业证书)伦敦国王学院毕业证成绩单原件一模一样
如何办理(KCL毕业证书)伦敦国王学院毕业证成绩单原件一模一样
qyguxu
 
如何办理(USYD毕业证书)悉尼大学毕业证成绩单原件一模一样
如何办理(USYD毕业证书)悉尼大学毕业证成绩单原件一模一样如何办理(USYD毕业证书)悉尼大学毕业证成绩单原件一模一样
如何办理(USYD毕业证书)悉尼大学毕业证成绩单原件一模一样
qyguxu
 
如何办理(Galway毕业证书)爱尔兰高威大学毕业证成绩单原件一模一样
如何办理(Galway毕业证书)爱尔兰高威大学毕业证成绩单原件一模一样如何办理(Galway毕业证书)爱尔兰高威大学毕业证成绩单原件一模一样
如何办理(Galway毕业证书)爱尔兰高威大学毕业证成绩单原件一模一样
qyguxu
 
如何办理(CBU毕业证书)浸会大学毕业证成绩单原件一模一样
如何办理(CBU毕业证书)浸会大学毕业证成绩单原件一模一样如何办理(CBU毕业证书)浸会大学毕业证成绩单原件一模一样
如何办理(CBU毕业证书)浸会大学毕业证成绩单原件一模一样
qyguxu
 
unit-5-final-cn-unit-5-notes-important-questions.pdf
unit-5-final-cn-unit-5-notes-important-questions.pdfunit-5-final-cn-unit-5-notes-important-questions.pdf
unit-5-final-cn-unit-5-notes-important-questions.pdf
radheeshyam1176
 
如何办理(Wintec毕业证书)怀卡托理工学院毕业证成绩单原件一模一样
如何办理(Wintec毕业证书)怀卡托理工学院毕业证成绩单原件一模一样如何办理(Wintec毕业证书)怀卡托理工学院毕业证成绩单原件一模一样
如何办理(Wintec毕业证书)怀卡托理工学院毕业证成绩单原件一模一样
qyguxu
 
toefl ibt practice test module download_1
toefl ibt practice test module download_1toefl ibt practice test module download_1
toefl ibt practice test module download_1
Aswar Amiruddin
 
如何办理(UNTEC毕业证书)新西兰联合理工学院毕业证成绩单原件一模一样
如何办理(UNTEC毕业证书)新西兰联合理工学院毕业证成绩单原件一模一样如何办理(UNTEC毕业证书)新西兰联合理工学院毕业证成绩单原件一模一样
如何办理(UNTEC毕业证书)新西兰联合理工学院毕业证成绩单原件一模一样
qyguxu
 

Recently uploaded (20)

如何办理(UW毕业证书)滑铁卢大学毕业证成绩单原件一模一样
如何办理(UW毕业证书)滑铁卢大学毕业证成绩单原件一模一样如何办理(UW毕业证书)滑铁卢大学毕业证成绩单原件一模一样
如何办理(UW毕业证书)滑铁卢大学毕业证成绩单原件一模一样
 
Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
 
HCE 5400 Practice Test: Key Concepts and Sample Questions
HCE 5400 Practice Test: Key Concepts and Sample QuestionsHCE 5400 Practice Test: Key Concepts and Sample Questions
HCE 5400 Practice Test: Key Concepts and Sample Questions
 
如何办理(UoA毕业证书)奥克兰大学毕业证成绩单原件一模一样
如何办理(UoA毕业证书)奥克兰大学毕业证成绩单原件一模一样如何办理(UoA毕业证书)奥克兰大学毕业证成绩单原件一模一样
如何办理(UoA毕业证书)奥克兰大学毕业证成绩单原件一模一样
 
如何办理(PITT毕业证书)匹兹堡大学毕业证成绩单原件一模一样
如何办理(PITT毕业证书)匹兹堡大学毕业证成绩单原件一模一样如何办理(PITT毕业证书)匹兹堡大学毕业证成绩单原件一模一样
如何办理(PITT毕业证书)匹兹堡大学毕业证成绩单原件一模一样
 
5CL-ADBA,5cladba, the best supplier in China
5CL-ADBA,5cladba, the best supplier in China5CL-ADBA,5cladba, the best supplier in China
5CL-ADBA,5cladba, the best supplier in China
 
DOH 5S ENHANCED DENGUE PROTOCOL (1).pptx
DOH 5S ENHANCED DENGUE PROTOCOL (1).pptxDOH 5S ENHANCED DENGUE PROTOCOL (1).pptx
DOH 5S ENHANCED DENGUE PROTOCOL (1).pptx
 
如何办理(EUR毕业证书)鹿特丹伊拉斯姆斯大学毕业证成绩单原件一模一样
如何办理(EUR毕业证书)鹿特丹伊拉斯姆斯大学毕业证成绩单原件一模一样如何办理(EUR毕业证书)鹿特丹伊拉斯姆斯大学毕业证成绩单原件一模一样
如何办理(EUR毕业证书)鹿特丹伊拉斯姆斯大学毕业证成绩单原件一模一样
 
如何办理(KCL毕业证书)伦敦国王学院毕业证成绩单原件一模一样
如何办理(KCL毕业证书)伦敦国王学院毕业证成绩单原件一模一样如何办理(KCL毕业证书)伦敦国王学院毕业证成绩单原件一模一样
如何办理(KCL毕业证书)伦敦国王学院毕业证成绩单原件一模一样
 
如何办理(USYD毕业证书)悉尼大学毕业证成绩单原件一模一样
如何办理(USYD毕业证书)悉尼大学毕业证成绩单原件一模一样如何办理(USYD毕业证书)悉尼大学毕业证成绩单原件一模一样
如何办理(USYD毕业证书)悉尼大学毕业证成绩单原件一模一样
 
如何办理(Galway毕业证书)爱尔兰高威大学毕业证成绩单原件一模一样
如何办理(Galway毕业证书)爱尔兰高威大学毕业证成绩单原件一模一样如何办理(Galway毕业证书)爱尔兰高威大学毕业证成绩单原件一模一样
如何办理(Galway毕业证书)爱尔兰高威大学毕业证成绩单原件一模一样
 
Kathleen McBride Costume Design Resume.pdf
Kathleen McBride Costume Design Resume.pdfKathleen McBride Costume Design Resume.pdf
Kathleen McBride Costume Design Resume.pdf
 
Job Hunting - pick over this fishbone for telephone interviews!.pptx
Job Hunting - pick over this fishbone for telephone interviews!.pptxJob Hunting - pick over this fishbone for telephone interviews!.pptx
Job Hunting - pick over this fishbone for telephone interviews!.pptx
 
如何办理(CBU毕业证书)浸会大学毕业证成绩单原件一模一样
如何办理(CBU毕业证书)浸会大学毕业证成绩单原件一模一样如何办理(CBU毕业证书)浸会大学毕业证成绩单原件一模一样
如何办理(CBU毕业证书)浸会大学毕业证成绩单原件一模一样
 
Final Syllabus Edited.pdf and the same to you and
Final Syllabus Edited.pdf and the same to you andFinal Syllabus Edited.pdf and the same to you and
Final Syllabus Edited.pdf and the same to you and
 
unit-5-final-cn-unit-5-notes-important-questions.pdf
unit-5-final-cn-unit-5-notes-important-questions.pdfunit-5-final-cn-unit-5-notes-important-questions.pdf
unit-5-final-cn-unit-5-notes-important-questions.pdf
 
Your 7-Step Job Application Checklist: Ace Your Next Career Move
Your 7-Step Job Application Checklist: Ace Your Next Career MoveYour 7-Step Job Application Checklist: Ace Your Next Career Move
Your 7-Step Job Application Checklist: Ace Your Next Career Move
 
如何办理(Wintec毕业证书)怀卡托理工学院毕业证成绩单原件一模一样
如何办理(Wintec毕业证书)怀卡托理工学院毕业证成绩单原件一模一样如何办理(Wintec毕业证书)怀卡托理工学院毕业证成绩单原件一模一样
如何办理(Wintec毕业证书)怀卡托理工学院毕业证成绩单原件一模一样
 
toefl ibt practice test module download_1
toefl ibt practice test module download_1toefl ibt practice test module download_1
toefl ibt practice test module download_1
 
如何办理(UNTEC毕业证书)新西兰联合理工学院毕业证成绩单原件一模一样
如何办理(UNTEC毕业证书)新西兰联合理工学院毕业证成绩单原件一模一样如何办理(UNTEC毕业证书)新西兰联合理工学院毕业证成绩单原件一模一样
如何办理(UNTEC毕业证书)新西兰联合理工学院毕业证成绩单原件一模一样
 

Ict713 t220-t6-dl-6 nov2020

  • 1. Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020 ICT713 Advanced Database Design and Development Tutorial 6 Topic: Database performance tuning, query optimization and Advanced SQL Objective: Students learn about the Database performance tuning and write some more SQL Submission: Five minutes before the end of the tutorial word file containing student’s answers need to be uploaded on Moodle Part A: Answer the following questions: 1. a. What is Referential Integrity? It the concept relatedto database in which all foreignkeysshould check with the primary keywhich shouldbe indicatedto foreignkey. b. What isData independence? Data independence isaterm that is relatedto data transparency that is linkedto centralizedDBMS and givesto immunity to the user to make changes in the data. 2. How can a table be deletedfromthe database?Provideanexample.  Use the DELETE statementwithoutspecifyingaWHERE clause.Withsegmentedtable spaces,deletingall rowsof a table isveryfast....  Use the TRUNCATE statement.The TRUNCATEstatementcanprovide the following advantagesovera DELETE statement:...  Use the DROP TABLE statement. DELETE FROMCustomersWHERE CustomerName='AlfredsFutterkiste'; Part B: Considerthe followingrelational schema:Questions 1-8 are basedonreferential integrity. Table Name Attributes
  • 2. Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020 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) ); 1. 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 2. Define the DeptrelationinSQLsothat everydepartmentisguaranteedtohave amanager. CREATE TABLE Dept ( did INTEGER, budget REAL, managerid INTEGER NOT NULL , PRIMARY KEY (did), FOREIGN KEY (managerid) REFERENCES Emp) 3. Enter followinginformationintoDepttable. did dname budget managerid 3 Finance 2000.50 6 4 Administration 5000.70 7 INSERT INTO Dept(did,dname,budget,managerid) VALUES (3, ‘finance’,2000.50, 6)
  • 3. Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020 VALUES (4, ‘administration’,5000.70, 7) 4. Write SQL statementstocreate Emp relation. a. Addthe FOREIGN KEY that will relate the DEPTtable tothe EMP table. CREATE TABLE Emp( Eid INTEGER NOT NULL, Did INTEGER NOT NULL, pcttime INTEGER, PRIMARY KEY (eid, did), UNIQUE(eid), FOREIGNKEY (did) ReferencesDept) Create TABLE Emp On DELETE {cascade, set default,setnull,no action} b. Include appropriate versionsof all primaryandforeignkeyintegrityconstraints. CREATE TABLE Emp( Eid INTEGER, Ename CHAR(10), Age INTEGER, Salary REAL, PRIMARY KEY (eid)) CREATE TABLE WORKs( Eid INTEGER, Did INTEGER, Pcttime INTEGER, PRIMARY KEY (eid,did), FOREIGNKEY(did) REFERENCES Dept, FOREIGNKEY (eid) REFERENCES EMP, On DELETE CASCADE) 5. Enter followinginformationintoEMP table Eid Ename 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 INTO Emp (eid,ename,age, salary, did)
  • 4. Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020 VALUES (1006, ‘petermiller’,40, 4000.90, 3) VALUES (1007, ‘david john’,30, 5000.80, 3) VALUES (1008, ‘kevinstudd’, 29, 6000.70, 4) 6. Can you insert following record into EMP table? Eid Ename Age Salary did 1008 Cathy Simon 35 5000.80 5 NO, we cannot insert record into EMP table. 7. If you cannot insert, give an explanation why you couldn’t. We cannot because EID is already taken by other person. 8. Delete department 3 from the DEPT table using the following command a. DELETE FROMDept WHERE did=3; DELETE FROM dept WHERE did=’3’ b. Explain what happens to EMP table when this statement is executed. The UPDATE statement changes the values of specified columns in one or more rows in a table or view.For a full descriptionof the UPDATE statement,see Oracle Database SQL Reference.Another (usually short) name for the referenced table or view, typically used in the WHERE clause.
  • 5. Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020 9. Create formsto enterdata foreach of the tables. Forms in Accessare like display cases instores that make it easierto viewor get the itemsthat you want. Since forms are objectsthrough which you or other users can add, edit,or displaythe data storedin your Access desktopdatabase, the designof your form is an important aspect. If your Access desktopdatabase is going to be usedby multiple users,well-designedformsis essential forefficiencyanddata entry accuracy. There are several ways of creating a form in an Access desktopdatabase and thisarticle points you to some of the common ways. 10. Create any twosample reportsbasedonthe database. As always, we’ll have to take a look at the data model we’re using. Ifyou’re a data analyst, some of the expectedtasksyou can expectare – grab the data from the database, create a report, draw conclusionsfrom the report data. Therefore,you can expectthat you’ll have a data model at your disposal. SQL queries- the data model we'll use in the article In such a data model,you should identifythe tablesthat contain data neededinthe report. Also, you’ll needto be sure how these tables are related.You shouldask yourselfquestionslike:  Whichtablesare dictionariesand whichones are beingpopulatedwith data (eitherby users/customers,eithersome automated process)? -> You’re interestedinanalyzing data from tablesbeingpopulatedwith the data while dictionariesare here to displayinfoon the screen(whenthe data is beinginserted+ used a category in reports)  Does table X always have a relatedrecord in table Y? -> Maybe there always is a record in the relatedtable,but that doesn’tneedto be the case always. This will be important when you decide to use INNER JOIN (ifyou always have a relatedrecord) or LEFT JOIN (ifyou don’t always have a relatedrecord) whenjoiningthese two tables Part C: WeeklylogforDatabase projectassessment:
  • 6. Questions extracted from: Coronel, C. and Morris, S. (2018). Database Systems: Design, Implementation, & Management, 13 th Edition., Cengage Learning ICT713: Tutorial 6 CompiledBy:DivyaLeekha 06NOV2020 No. Criteria Activity 1 Attendance at weekly meeting Convey information through telephone and social media, for example, WhatsApp group used to exchange notes from tutorials, other documents, and pictures for the assigned tasks and Zoom meetings for discussions. 2 Weekly activity log After creating the ERD model, the next step was to design the EERD for the enterprise. 3 Time management It took me 30 minutes to design the EERD for the enterprise. 4 Tasks Designed an Enhanced Entity Relationship Diagram which represents the database entities and their attributes. 5 Actual contribution to group project  Creation of EERD model which includes subclasses and superclasses, Specialization & Generalization, Attribute & Relationship Inheritance.  Creation of EERD models through MS Access.