SlideShare a Scribd company logo
DATABASE DEVELOPMENT (IT203P)
WESTLAKE DATABASE
(2015)
Juanita M. McConnell
Computer Network Systems
ITT Technical Institute
Philadelphia PA 19106
Contact:
JMcConnell152@email.itt-tech.edu
WESTLAKE DATABASE PROJECT OBJECTIVES
1. Creating a table with a primary key
2. Defining a Primary Key
3. Types of Primary Keys
4. Creating a stored procedure to guard against
SQL injection attacks.
5. Executing queries to meet requirements.
CREATING A TABLE WITH A PRIMARY KEY
You can create a table using the CREATE TABLE command or by right-clicking the
Tables folder and running New Table. You can assign primary key functions to attributes
by selecting the golden key icon in column adjacent to Column Name.
PRIMARY KEYS
A primary key is an attribute that uniquely identifies an entity.
It should have a unique value, very uneasy to guess, not ever
change, and be previously non-existent or non-established.
TYPES OF PRIMARY KEYS
Five Types of Primary Keys
Composite Primary Key – a primary key that is made up of more than one attribute.
Surrogate Primary Key – a primary key that is computer generated and usually numeric.
Natural Key – a real world identifier such as an email address.
Candidate Key- a primary key with the capabilities to be a primary key.
Foreign Key – a primary key assigned to a second table as a secondary key formatting a
connection between the tables.
CREATING A STORED PROCEDURE TO
GUARD AGAINST SQL INJECTION ATTACKS
A SQL injection attack is the addition of malicious code to a
SQL statement with the intention to corrupt the database.
• To combat intrusions, data analysts can use stored procedures
to guard against SQL injection attacks.
• Stored procedures help protect against SQL injection because
queries will only accept values of the data type specified in the
parameter and multiple statements will not be executed as a
batch.
CREATING A STORED PROCEDURE TO
GUARD AGAINST SQL INJECTION ATTACKS
This a query statement designed to guard against a DELETE statement that
would execute all data from the Patients table, if the DELETE permission had
been compromised.
CREATING A STORED PROCEDURE TO
GUARD AGAINST SQL INJECTION ATTACKS
This a query statement designed to copy records from
RecordPatientSymptoms and insert them into the PatientVisitSymptoms table.
EXECUTING QUERIES TO MEET
REQUIREMENTS I
You can use a SELECT statement to retrieve data.
It supports the following clauses:
 FROM—identify the table
 ORDER BY—sort the data
 WHERE – filter the data
 LIKE—retrieve data that matches a pattern =, <, >—retrieve
data that meets a condition BETWEEN—retrieve data in a
range
 JOIN—join two tables together
 GROUP BY—group aggregated data
EXECUTING QUERIES TO MEET
REQUIREMENTS I
This is a query statement designed to retrieve the visit date and patient key for all patients that
reported a depression level over 5.
EXECUTING QUERIES TO MEET
REQUIREMENTS II
This is a query statement designed to retrieve the visit date and patient name, and depression
levels for all patients that reported a depression level over 5.
EXECUTING QUERIES TO MEET
REQUIREMENTS III
This is a query statement designed to retrieve the number of patient visits that occurred in which
the patient had a pulse over 45.
EXECUTING QUERIES TO MEET
REQUIREMENTS IV
This is a query statement designed to lists the visit date and patient name for each patient visit,
sorted by depression level from lowest to highest.
EXECUTING QUERIES TO MEET
REQUIREMENTS V
This is a query designed to display the patient’s last name, average pulse and average depression
level for each patient.
DATABASE DEVELOPMENT (IT203P)
WESTLAKE DATABASE
(2015)
Author Note
Juanita M. McConnell, Computer Network Systems, ITT Technical Institute.
Juanita McConnell is a student at ITT Technical Institute studying Computer
Networking, Computer Infrastructure and Computer Programming.
Correspondence concerning this PowerPoint should be addressed to
Juanita McConnell ,
Computer Network Systems,
ITT Technical Institute, 105 South 7th St., Suite 100 Philadelphia, PA 19106
Contact: JMcConnell152@email.itt-tech.edu

More Related Content

What's hot

Database design
Database designDatabase design
Database design
Safwan Hashmi
 
Resume
ResumeResume
Resume
kwilke859
 
Heart disease prediction using bio inspired algorithms
Heart disease prediction using bio inspired algorithmsHeart disease prediction using bio inspired algorithms
Heart disease prediction using bio inspired algorithms
Venkat Projects
 
Part 24 mv status
Part 24 mv statusPart 24 mv status
Part 24 mv status
Girija Muscut
 
BI-Validator Usecase - Stress Test Plan
BI-Validator Usecase - Stress Test PlanBI-Validator Usecase - Stress Test Plan
BI-Validator Usecase - Stress Test Plan
Datagaps Inc
 
Hospital Management system Database design
Hospital Management system Database designHospital Management system Database design
Hospital Management system Database designElias Dinsa
 
Bi report testing Ver. 01
Bi report testing Ver.  01Bi report testing Ver.  01
Bi report testing Ver. 01
Rakesh Hansalia
 
Query types db connector
Query types db connectorQuery types db connector
Query types db connector
Thang Loi
 
Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18
Engr Imran Ashraf
 
Advanced excel topics
Advanced excel topicsAdvanced excel topics
Advanced excel topics
bindur87
 
ETL Validator Usecase - Validating Measures, Counts with Variance
ETL Validator Usecase - Validating Measures, Counts with VarianceETL Validator Usecase - Validating Measures, Counts with Variance
ETL Validator Usecase - Validating Measures, Counts with Variance
Datagaps Inc
 
Spreadsheet Errors Nm
Spreadsheet Errors NmSpreadsheet Errors Nm
Spreadsheet Errors NmNipun
 
Sql server ___________ (advance sql)
Sql server  ___________  (advance sql)Sql server  ___________  (advance sql)
Sql server ___________ (advance sql)
Ehtisham Ali
 
Object Oriented Programming - 4. Control Structure
Object Oriented Programming - 4. Control StructureObject Oriented Programming - 4. Control Structure
Object Oriented Programming - 4. Control Structure
AndiNurkholis1
 
Oracle SQL Part 2
Oracle SQL Part 2Oracle SQL Part 2
Oracle SQL Part 2
Gurpreet singh
 

What's hot (15)

Database design
Database designDatabase design
Database design
 
Resume
ResumeResume
Resume
 
Heart disease prediction using bio inspired algorithms
Heart disease prediction using bio inspired algorithmsHeart disease prediction using bio inspired algorithms
Heart disease prediction using bio inspired algorithms
 
Part 24 mv status
Part 24 mv statusPart 24 mv status
Part 24 mv status
 
BI-Validator Usecase - Stress Test Plan
BI-Validator Usecase - Stress Test PlanBI-Validator Usecase - Stress Test Plan
BI-Validator Usecase - Stress Test Plan
 
Hospital Management system Database design
Hospital Management system Database designHospital Management system Database design
Hospital Management system Database design
 
Bi report testing Ver. 01
Bi report testing Ver.  01Bi report testing Ver.  01
Bi report testing Ver. 01
 
Query types db connector
Query types db connectorQuery types db connector
Query types db connector
 
Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18
 
Advanced excel topics
Advanced excel topicsAdvanced excel topics
Advanced excel topics
 
ETL Validator Usecase - Validating Measures, Counts with Variance
ETL Validator Usecase - Validating Measures, Counts with VarianceETL Validator Usecase - Validating Measures, Counts with Variance
ETL Validator Usecase - Validating Measures, Counts with Variance
 
Spreadsheet Errors Nm
Spreadsheet Errors NmSpreadsheet Errors Nm
Spreadsheet Errors Nm
 
Sql server ___________ (advance sql)
Sql server  ___________  (advance sql)Sql server  ___________  (advance sql)
Sql server ___________ (advance sql)
 
Object Oriented Programming - 4. Control Structure
Object Oriented Programming - 4. Control StructureObject Oriented Programming - 4. Control Structure
Object Oriented Programming - 4. Control Structure
 
Oracle SQL Part 2
Oracle SQL Part 2Oracle SQL Part 2
Oracle SQL Part 2
 

Similar to J_McConnell_Westlake Database

Ijcet 06 10_005
Ijcet 06 10_005Ijcet 06 10_005
Ijcet 06 10_005
IAEME Publication
 
The Role of Audit Analysis in CyberSecurity
The Role of Audit Analysis in CyberSecurityThe Role of Audit Analysis in CyberSecurity
The Role of Audit Analysis in CyberSecurity
Tyrone Grandison
 
SQL Injection - Newsletter
SQL Injection - NewsletterSQL Injection - Newsletter
SQL Injection - Newsletter
Smitha Padmanabhan
 
Data Warehousing in Pharma: How to Find Bad Data while Meeting Regulatory Req...
Data Warehousing in Pharma: How to Find Bad Data while Meeting Regulatory Req...Data Warehousing in Pharma: How to Find Bad Data while Meeting Regulatory Req...
Data Warehousing in Pharma: How to Find Bad Data while Meeting Regulatory Req...
RTTS
 
Owasp Top 10
Owasp Top 10Owasp Top 10
Owasp Top 10
Gaurav Narwani
 
Detection of Structured Query Language Injection Attacks Using Machine Learni...
Detection of Structured Query Language Injection Attacks Using Machine Learni...Detection of Structured Query Language Injection Attacks Using Machine Learni...
Detection of Structured Query Language Injection Attacks Using Machine Learni...
AIRCC Publishing Corporation
 
Ijcatr04041018
Ijcatr04041018Ijcatr04041018
Ijcatr04041018
Editor IJCATR
 
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
Rana sing
 
Final review ppt
Final review pptFinal review ppt
Final review ppt
Rana sing
 
E017131924
E017131924E017131924
E017131924
IOSR Journals
 
SQL Injection Prevention by Adaptive Algorithm
SQL Injection Prevention by Adaptive AlgorithmSQL Injection Prevention by Adaptive Algorithm
SQL Injection Prevention by Adaptive Algorithm
IOSR Journals
 
Sql Injection
Sql InjectionSql Injection
Sql Injection
Lakshika Rasanjali
 
Chapter 14 sql injection
Chapter 14 sql injectionChapter 14 sql injection
Chapter 14 sql injection
newbie2019
 
SQL Injection: Unraveling the Threats
SQL Injection: Unraveling the ThreatsSQL Injection: Unraveling the Threats
SQL Injection: Unraveling the Threats
InsecureLab
 
SQL Injection Attack Detection and Prevention Techniques to Secure Web-Site
SQL Injection Attack Detection and Prevention Techniques to Secure Web-SiteSQL Injection Attack Detection and Prevention Techniques to Secure Web-Site
SQL Injection Attack Detection and Prevention Techniques to Secure Web-Site
ijtsrd
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4
kaashiv1
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4kaashiv1
 
Overview on SQL Injection Attacks
Overview on SQL Injection AttacksOverview on SQL Injection Attacks
Overview on SQL Injection Attacks
ijsrd.com
 

Similar to J_McConnell_Westlake Database (20)

Sql xp 05
Sql xp 05Sql xp 05
Sql xp 05
 
Ijcet 06 10_005
Ijcet 06 10_005Ijcet 06 10_005
Ijcet 06 10_005
 
The Role of Audit Analysis in CyberSecurity
The Role of Audit Analysis in CyberSecurityThe Role of Audit Analysis in CyberSecurity
The Role of Audit Analysis in CyberSecurity
 
SQL Injection - Newsletter
SQL Injection - NewsletterSQL Injection - Newsletter
SQL Injection - Newsletter
 
Data Warehousing in Pharma: How to Find Bad Data while Meeting Regulatory Req...
Data Warehousing in Pharma: How to Find Bad Data while Meeting Regulatory Req...Data Warehousing in Pharma: How to Find Bad Data while Meeting Regulatory Req...
Data Warehousing in Pharma: How to Find Bad Data while Meeting Regulatory Req...
 
Owasp Top 10
Owasp Top 10Owasp Top 10
Owasp Top 10
 
Detection of Structured Query Language Injection Attacks Using Machine Learni...
Detection of Structured Query Language Injection Attacks Using Machine Learni...Detection of Structured Query Language Injection Attacks Using Machine Learni...
Detection of Structured Query Language Injection Attacks Using Machine Learni...
 
Ijcatr04041018
Ijcatr04041018Ijcatr04041018
Ijcatr04041018
 
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
 
Final review ppt
Final review pptFinal review ppt
Final review ppt
 
E017131924
E017131924E017131924
E017131924
 
SQL Injection Prevention by Adaptive Algorithm
SQL Injection Prevention by Adaptive AlgorithmSQL Injection Prevention by Adaptive Algorithm
SQL Injection Prevention by Adaptive Algorithm
 
Sql Injection
Sql InjectionSql Injection
Sql Injection
 
Chapter 14 sql injection
Chapter 14 sql injectionChapter 14 sql injection
Chapter 14 sql injection
 
SQL Injection: Unraveling the Threats
SQL Injection: Unraveling the ThreatsSQL Injection: Unraveling the Threats
SQL Injection: Unraveling the Threats
 
SQL Injection Attack Detection and Prevention Techniques to Secure Web-Site
SQL Injection Attack Detection and Prevention Techniques to Secure Web-SiteSQL Injection Attack Detection and Prevention Techniques to Secure Web-Site
SQL Injection Attack Detection and Prevention Techniques to Secure Web-Site
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4
 
Ebook4
Ebook4Ebook4
Ebook4
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4
 
Overview on SQL Injection Attacks
Overview on SQL Injection AttacksOverview on SQL Injection Attacks
Overview on SQL Injection Attacks
 

J_McConnell_Westlake Database

  • 1. DATABASE DEVELOPMENT (IT203P) WESTLAKE DATABASE (2015) Juanita M. McConnell Computer Network Systems ITT Technical Institute Philadelphia PA 19106 Contact: JMcConnell152@email.itt-tech.edu
  • 2. WESTLAKE DATABASE PROJECT OBJECTIVES 1. Creating a table with a primary key 2. Defining a Primary Key 3. Types of Primary Keys 4. Creating a stored procedure to guard against SQL injection attacks. 5. Executing queries to meet requirements.
  • 3. CREATING A TABLE WITH A PRIMARY KEY You can create a table using the CREATE TABLE command or by right-clicking the Tables folder and running New Table. You can assign primary key functions to attributes by selecting the golden key icon in column adjacent to Column Name.
  • 4. PRIMARY KEYS A primary key is an attribute that uniquely identifies an entity. It should have a unique value, very uneasy to guess, not ever change, and be previously non-existent or non-established.
  • 5. TYPES OF PRIMARY KEYS Five Types of Primary Keys Composite Primary Key – a primary key that is made up of more than one attribute. Surrogate Primary Key – a primary key that is computer generated and usually numeric. Natural Key – a real world identifier such as an email address. Candidate Key- a primary key with the capabilities to be a primary key. Foreign Key – a primary key assigned to a second table as a secondary key formatting a connection between the tables.
  • 6. CREATING A STORED PROCEDURE TO GUARD AGAINST SQL INJECTION ATTACKS A SQL injection attack is the addition of malicious code to a SQL statement with the intention to corrupt the database. • To combat intrusions, data analysts can use stored procedures to guard against SQL injection attacks. • Stored procedures help protect against SQL injection because queries will only accept values of the data type specified in the parameter and multiple statements will not be executed as a batch.
  • 7. CREATING A STORED PROCEDURE TO GUARD AGAINST SQL INJECTION ATTACKS This a query statement designed to guard against a DELETE statement that would execute all data from the Patients table, if the DELETE permission had been compromised.
  • 8. CREATING A STORED PROCEDURE TO GUARD AGAINST SQL INJECTION ATTACKS This a query statement designed to copy records from RecordPatientSymptoms and insert them into the PatientVisitSymptoms table.
  • 9. EXECUTING QUERIES TO MEET REQUIREMENTS I You can use a SELECT statement to retrieve data. It supports the following clauses:  FROM—identify the table  ORDER BY—sort the data  WHERE – filter the data  LIKE—retrieve data that matches a pattern =, <, >—retrieve data that meets a condition BETWEEN—retrieve data in a range  JOIN—join two tables together  GROUP BY—group aggregated data
  • 10. EXECUTING QUERIES TO MEET REQUIREMENTS I This is a query statement designed to retrieve the visit date and patient key for all patients that reported a depression level over 5.
  • 11. EXECUTING QUERIES TO MEET REQUIREMENTS II This is a query statement designed to retrieve the visit date and patient name, and depression levels for all patients that reported a depression level over 5.
  • 12. EXECUTING QUERIES TO MEET REQUIREMENTS III This is a query statement designed to retrieve the number of patient visits that occurred in which the patient had a pulse over 45.
  • 13. EXECUTING QUERIES TO MEET REQUIREMENTS IV This is a query statement designed to lists the visit date and patient name for each patient visit, sorted by depression level from lowest to highest.
  • 14. EXECUTING QUERIES TO MEET REQUIREMENTS V This is a query designed to display the patient’s last name, average pulse and average depression level for each patient.
  • 15.
  • 16. DATABASE DEVELOPMENT (IT203P) WESTLAKE DATABASE (2015) Author Note Juanita M. McConnell, Computer Network Systems, ITT Technical Institute. Juanita McConnell is a student at ITT Technical Institute studying Computer Networking, Computer Infrastructure and Computer Programming. Correspondence concerning this PowerPoint should be addressed to Juanita McConnell , Computer Network Systems, ITT Technical Institute, 105 South 7th St., Suite 100 Philadelphia, PA 19106 Contact: JMcConnell152@email.itt-tech.edu