SlideShare a Scribd company logo
1 of 14
CIT 407
T-SQL Queries Design and Tuning
What is a database
• an organized collection of structured data
• stored electronically in a computer system
• controlled by a database management system (DBMS)
• data, the DBMS and applications are referred as a
database system
• data is typically modeled in rows and columns
• in a series of tables to make processing and data
querying efficient
• data can then be easily accessed, managed, modified,
updated, controlled, and organized
• Relational databases use structured query language
(SQL) for writing and querying data.
• SQL is a programming language used by nearly
all relational databases to query, manipulate, and define
data, and to provide access control.
• SQL was first developed at IBM in the 1970s which led to
implementation of the SQL ANSI standard
• SQL has spurred many extensions from companies such
as IBM, Oracle, Microsoft, MySQL
There are many different types of databases
• Relational databases
• Object-oriented databases
• Distributed databases
• Data warehouses
• NoSQL databases
• Graph databases
• OLTP databases
• Open source databases
• Cloud databases
• Multimodel database
• Document/JSON database
• Self-driving databases
Relational databases
• Items in a relational database are organized as a
set of tables with columns and rows
• Relational database technology provides the
most efficient and flexible way to access
structured information
What is data modelling
• is the process of creating a data model for the data to be stored
in a database
• Conceptual representation of Data objects, the associations
between different data objects and the rules
• Data modeling helps in the visual representation of data and
enforces business rules, regulatory compliances, and
government policies on the data
• Data Models ensure consistency in naming conventions, default
values, semantics, security while ensuring quality of the data
The two types of Data Models techniques are
1. Entity Relationship (E-R) Model
2. UML (Unified Modelling Language)
There are three types of data models:
1. Conceptual
2. Logical
3. Physical
The main aim of this model is to establish the entities, their
attributes, and their relationships.
In this data modeling level, there is hardly any detail
available of the actual database structure.
Conceptual Model
The 3 basic tenants of Data Model are
Entity: A real-world thing
Attribute: Characteristics or properties of an entity
Relationship: Dependency or association between two
entities
Conceptual Model
For example:
• customer and product are two entities
• customer number and name are attributes of the
customer entity
• product name and price are attributes of product entity
• sale is the relationship between the customer and
product
customer name
customer number
product name
product price
sale
Entity relationship diagram
Customer buys
product from
website
product
A sale is recorded
Item is shipped to customer
Inventory gets replenished
Item is purchased
from suppliers

More Related Content

What's hot

Mergenthaler mis405 1301 a-01 ph 1 ip
Mergenthaler mis405 1301 a-01 ph 1 ipMergenthaler mis405 1301 a-01 ph 1 ip
Mergenthaler mis405 1301 a-01 ph 1 ipSabrina Mergenthaler
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to DatabaseFARHAN615
 
Type of Database Management System
Type of Database Management SystemType of Database Management System
Type of Database Management SystemParam Radadiya
 
Artifacts, Data Dictionary, Data Modeling, Data Wrangling
Artifacts, Data Dictionary, Data Modeling, Data WranglingArtifacts, Data Dictionary, Data Modeling, Data Wrangling
Artifacts, Data Dictionary, Data Modeling, Data WranglingFaisal Akbar
 
Database management system
Database management systemDatabase management system
Database management systemrishi ram khanal
 
Application of Unified Modelling Language
Application of Unified Modelling LanguageApplication of Unified Modelling Language
Application of Unified Modelling LanguageRasan Samarasinghe
 
data and information
data and informationdata and information
data and informationuzmajamal
 
International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)MiajackB
 
Database Management Systems 1
Database Management Systems 1Database Management Systems 1
Database Management Systems 1Nickkisha Farrell
 
RDBMS Arch & Models
RDBMS Arch & ModelsRDBMS Arch & Models
RDBMS Arch & ModelsSarmad Ali
 
International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)ijfcst journal
 
International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)ijfcst journal
 
International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)ijfcst journal
 
International Journal of Database Management Systems (IJDMS)
International Journal of Database Management Systems (IJDMS)International Journal of Database Management Systems (IJDMS)
International Journal of Database Management Systems (IJDMS)ijdms
 

What's hot (20)

Mergenthaler mis405 1301 a-01 ph 1 ip
Mergenthaler mis405 1301 a-01 ph 1 ipMergenthaler mis405 1301 a-01 ph 1 ip
Mergenthaler mis405 1301 a-01 ph 1 ip
 
Database and types of databases
Database and types of databasesDatabase and types of databases
Database and types of databases
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
Type of Database Management System
Type of Database Management SystemType of Database Management System
Type of Database Management System
 
Artifacts, Data Dictionary, Data Modeling, Data Wrangling
Artifacts, Data Dictionary, Data Modeling, Data WranglingArtifacts, Data Dictionary, Data Modeling, Data Wrangling
Artifacts, Data Dictionary, Data Modeling, Data Wrangling
 
Database management system
Database management systemDatabase management system
Database management system
 
Data Modeling
Data ModelingData Modeling
Data Modeling
 
Application of Unified Modelling Language
Application of Unified Modelling LanguageApplication of Unified Modelling Language
Application of Unified Modelling Language
 
data and information
data and informationdata and information
data and information
 
DSA
DSADSA
DSA
 
Data model
Data modelData model
Data model
 
Databases and types of databases
Databases and types of databasesDatabases and types of databases
Databases and types of databases
 
International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)
 
Database Management Systems 1
Database Management Systems 1Database Management Systems 1
Database Management Systems 1
 
RDBMS Arch & Models
RDBMS Arch & ModelsRDBMS Arch & Models
RDBMS Arch & Models
 
Database and types of database
Database and types of databaseDatabase and types of database
Database and types of database
 
International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)
 
International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)
 
International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)International Journal of Database Management Systems (IJDBMS)
International Journal of Database Management Systems (IJDBMS)
 
International Journal of Database Management Systems (IJDMS)
International Journal of Database Management Systems (IJDMS)International Journal of Database Management Systems (IJDMS)
International Journal of Database Management Systems (IJDMS)
 

Similar to T-SQL

Similar to T-SQL (20)

(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)
 
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnetUtsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnet
 
Dbms
DbmsDbms
Dbms
 
dbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodungadbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodunga
 
lecture5 (1) (2).pptx
lecture5 (1) (2).pptxlecture5 (1) (2).pptx
lecture5 (1) (2).pptx
 
Dbms
DbmsDbms
Dbms
 
Dbms unit 1
Dbms unit 1Dbms unit 1
Dbms unit 1
 
DBMS data modeling.pptx
DBMS data modeling.pptxDBMS data modeling.pptx
DBMS data modeling.pptx
 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdf
 
Digital data
Digital dataDigital data
Digital data
 
Digital Types
Digital TypesDigital Types
Digital Types
 
Data modelling it's process and examples
Data modelling it's process and examplesData modelling it's process and examples
Data modelling it's process and examples
 
Sql server ___________session_1-intro
Sql server  ___________session_1-introSql server  ___________session_1-intro
Sql server ___________session_1-intro
 
Data Modeling Training.pptx
Data Modeling Training.pptxData Modeling Training.pptx
Data Modeling Training.pptx
 
DatabaseManagementSystem.pptx
DatabaseManagementSystem.pptxDatabaseManagementSystem.pptx
DatabaseManagementSystem.pptx
 
Access
AccessAccess
Access
 
Unit1 DBMS Introduction
Unit1 DBMS IntroductionUnit1 DBMS Introduction
Unit1 DBMS Introduction
 
BAB 7 Pangkalan data new
BAB 7   Pangkalan data newBAB 7   Pangkalan data new
BAB 7 Pangkalan data new
 
RowanDay4.pptx
RowanDay4.pptxRowanDay4.pptx
RowanDay4.pptx
 
DBMS
DBMS DBMS
DBMS
 

Recently uploaded

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

T-SQL

  • 1. CIT 407 T-SQL Queries Design and Tuning
  • 2. What is a database
  • 3. • an organized collection of structured data • stored electronically in a computer system • controlled by a database management system (DBMS) • data, the DBMS and applications are referred as a database system • data is typically modeled in rows and columns • in a series of tables to make processing and data querying efficient • data can then be easily accessed, managed, modified, updated, controlled, and organized
  • 4. • Relational databases use structured query language (SQL) for writing and querying data. • SQL is a programming language used by nearly all relational databases to query, manipulate, and define data, and to provide access control. • SQL was first developed at IBM in the 1970s which led to implementation of the SQL ANSI standard • SQL has spurred many extensions from companies such as IBM, Oracle, Microsoft, MySQL
  • 5. There are many different types of databases • Relational databases • Object-oriented databases • Distributed databases • Data warehouses • NoSQL databases • Graph databases • OLTP databases • Open source databases • Cloud databases • Multimodel database • Document/JSON database • Self-driving databases
  • 6. Relational databases • Items in a relational database are organized as a set of tables with columns and rows • Relational database technology provides the most efficient and flexible way to access structured information
  • 7. What is data modelling • is the process of creating a data model for the data to be stored in a database • Conceptual representation of Data objects, the associations between different data objects and the rules • Data modeling helps in the visual representation of data and enforces business rules, regulatory compliances, and government policies on the data • Data Models ensure consistency in naming conventions, default values, semantics, security while ensuring quality of the data
  • 8. The two types of Data Models techniques are 1. Entity Relationship (E-R) Model 2. UML (Unified Modelling Language)
  • 9. There are three types of data models: 1. Conceptual 2. Logical 3. Physical
  • 10. The main aim of this model is to establish the entities, their attributes, and their relationships. In this data modeling level, there is hardly any detail available of the actual database structure. Conceptual Model
  • 11. The 3 basic tenants of Data Model are Entity: A real-world thing Attribute: Characteristics or properties of an entity Relationship: Dependency or association between two entities Conceptual Model
  • 12. For example: • customer and product are two entities • customer number and name are attributes of the customer entity • product name and price are attributes of product entity • sale is the relationship between the customer and product
  • 13. customer name customer number product name product price sale Entity relationship diagram
  • 14. Customer buys product from website product A sale is recorded Item is shipped to customer Inventory gets replenished Item is purchased from suppliers