SlideShare une entreprise Scribd logo
1  sur  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.

Contenu connexe

Tendances

Bis245 week 5 i lab devry university er diagram and er matrix
Bis245 week 5 i lab devry university   er diagram and er matrixBis245 week 5 i lab devry university   er diagram and er matrix
Bis245 week 5 i lab devry university er diagram and er matrix
litmanen232
 

Tendances (18)

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]
 
Database Systems
Database SystemsDatabase Systems
Database Systems
 
Test Strategy Utilising Mc Useful Tools
Test Strategy Utilising Mc Useful ToolsTest Strategy Utilising Mc Useful Tools
Test Strategy Utilising Mc Useful Tools
 
Database management system
Database management systemDatabase management system
Database management system
 
Phd coursestatalez2datamanagement
Phd coursestatalez2datamanagementPhd coursestatalez2datamanagement
Phd coursestatalez2datamanagement
 
Database fundamentals
Database fundamentalsDatabase fundamentals
Database fundamentals
 
Sq lite module1
Sq lite module1Sq lite module1
Sq lite module1
 
Data models
Data modelsData models
Data models
 
Diedrich Free Research Systems
Diedrich Free Research SystemsDiedrich Free Research Systems
Diedrich Free Research Systems
 
SWL 8
SWL 8SWL 8
SWL 8
 
Bc0058 data warehousing
Bc0058   data warehousingBc0058   data warehousing
Bc0058 data warehousing
 
Lecture1 data structure(introduction)
Lecture1 data structure(introduction)Lecture1 data structure(introduction)
Lecture1 data structure(introduction)
 
Assign 1
Assign 1Assign 1
Assign 1
 
Improved Slicing Algorithm For Greater Utility In Privacy Preserving Data Pub...
Improved Slicing Algorithm For Greater Utility In Privacy Preserving Data Pub...Improved Slicing Algorithm For Greater Utility In Privacy Preserving Data Pub...
Improved Slicing Algorithm For Greater Utility In Privacy Preserving Data Pub...
 
Active database system
Active database systemActive database system
Active database system
 
Technical Note on DBMS
Technical Note on DBMSTechnical Note on DBMS
Technical Note on DBMS
 
NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I
 
Bis245 week 5 i lab devry university er diagram and er matrix
Bis245 week 5 i lab devry university   er diagram and er matrixBis245 week 5 i lab devry university   er diagram and er matrix
Bis245 week 5 i lab devry university er diagram and er matrix
 

Similaire à T6

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
 

Similaire à T6 (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
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#
 
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
 
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
 

Plus de NidhiGupta8431 (8)

T9
T9T9
T9
 
T4
T4T4
T4
 
T7
T7T7
T7
 
T 8-gurjinder
T 8-gurjinderT 8-gurjinder
T 8-gurjinder
 
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
 

Dernier

Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
amitlee9823
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
amitlee9823
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 

T6

  • 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.