SlideShare uma empresa Scribd logo
1 de 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.

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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.hetvii
Introduction to database with ms access.hetviiIntroduction to database with ms access.hetvii
Introduction to database with ms access.hetvii
 
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)
 
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
 
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
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Database concepts and Archeticture Ch2 with in class Activities
Database concepts and Archeticture Ch2 with in class ActivitiesDatabase concepts and Archeticture Ch2 with in class Activities
Database concepts and Archeticture Ch2 with in class Activities
 

Mais de 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
 

Último

Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night StandCall Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls In Chandapura ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Chandapura ☎ 7737669865 🥵 Book Your One night StandCall Girls In Chandapura ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Chandapura ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...
amitlee9823
 
Call Girls In Kr Puram ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kr Puram ☎ 7737669865 🥵 Book Your One night StandCall Girls In Kr Puram ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kr Puram ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
amitlee9823
 
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men 🔝Pallavaram🔝 E...
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men  🔝Pallavaram🔝   E...➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men  🔝Pallavaram🔝   E...
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men 🔝Pallavaram🔝 E...
amitlee9823
 
Just Call Vip call girls Jammu Escorts ☎️9352988975 Two shot with one girl (J...
Just Call Vip call girls Jammu Escorts ☎️9352988975 Two shot with one girl (J...Just Call Vip call girls Jammu Escorts ☎️9352988975 Two shot with one girl (J...
Just Call Vip call girls Jammu Escorts ☎️9352988975 Two shot with one girl (J...
gajnagarg
 
Call Girls Hoodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hoodi Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hoodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hoodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfreStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
Ken Fuller
 
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
ZurliaSoop
 
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 

Último (20)

Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...
 
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night StandCall Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Chandapura ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Chandapura ☎ 7737669865 🥵 Book Your One night StandCall Girls In Chandapura ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Chandapura ☎ 7737669865 🥵 Book Your One night Stand
 
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...
 
Joshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptxJoshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptx
 
Call Girls In Kr Puram ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kr Puram ☎ 7737669865 🥵 Book Your One night StandCall Girls In Kr Puram ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kr Puram ☎ 7737669865 🥵 Book Your One night Stand
 
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
Hyderabad 💫✅💃 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATIS...
 
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Jabalpur [ 7014168258 ] Call Me For Genuine Models ...
 
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
 
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men 🔝Pallavaram🔝 E...
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men  🔝Pallavaram🔝   E...➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men  🔝Pallavaram🔝   E...
➥🔝 7737669865 🔝▻ Pallavaram Call-girls in Women Seeking Men 🔝Pallavaram🔝 E...
 
Guide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNGuide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWN
 
Dubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai KokoDubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai Koko
 
Just Call Vip call girls Jammu Escorts ☎️9352988975 Two shot with one girl (J...
Just Call Vip call girls Jammu Escorts ☎️9352988975 Two shot with one girl (J...Just Call Vip call girls Jammu Escorts ☎️9352988975 Two shot with one girl (J...
Just Call Vip call girls Jammu Escorts ☎️9352988975 Two shot with one girl (J...
 
Call Girls Hoodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hoodi Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hoodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hoodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfreStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
 
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
 
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
 

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.