SlideShare a Scribd company logo
Database Management System
Beginner Training
Practices in 2017
Prepared by: Moutasm Tamimi
Using SQL language
Microsoft SQL Server Management Studio
Versions (2008-2010-2012-2014)
Speaker Information
 Moutasm tamimi
Independent consultant , IT Researcher , CEO at ITG7
Instructor of: Project Development.
DBMS.
.NET applications.
Digital marketing.
Email: tamimi@itg7.com
LinkedIn: click here.
Database Management System - SQL beginner Training
Introduction
Database: is an organized collection of data It is the collection
of schemas, tables, queries, reports, views, and other objects.
SQL: is a standard language for accessing and manipulating databases.
What is SQL?
•SQL stands for Structured Query Language
•SQL lets you access and manipulate databases
•SQL is an ANSI (American National Standards Institute)
standard
The four main categories of SQL statements
are as follows:
1. DDL (Data Definition Language)
2. DML (Data Manipulation Language)
3. DCL (Data Control Language)
4. TCL (Transaction Control Language)
Open Microsoft SQL Server
Server name
Input (.) dot as default
server login
Create database
Creating a database
 We need to use Master database for creating a database
 By default the size of a database is 1 MB
 A database consists of
Master Data File (.mdf)
Primary Log File (.ldf)
Data Types in SQL
 Data types in
Microsoft SQL server
2012
Create Tables in SQL
PName Price Category Manufacturer
Gizmo $19.99 Gadgets GizmoWorks
Powergizmo $29.99 Gadgets GizmoWorks
SingleTouch $149.99 Photography Canon
MultiTouch $203.99 Household Hitachi
Product
Attribute names
Table name
Tuples or rows
Column name
Create new table
Tables Explained
 The schema of a table is the table name and its
attributes:
Product(PName, Price, Category, Manfacturer)
 A key is an attribute whose values are unique;
we underline a key
Product(PName, Price, Category, Manfacturer)
Identity Property
 Identity has
A seed
An increment
 Seed is the initial value
 Increment is the value by which we need to skip to fetch the
nextvalue
 Identity(1,2) will generate sequence numbers 1,3,5,7…
Primary key constraints and Identity Property
Create a New Database Diagram
A database schema of a database system is its structure
described in a formal language supported by the database
management system (DBMS).
Create Database diagram
Blue box: primary key
Yellow box: foreign key
How To add records from the database on
a table
Stored procedures
 Stored procedures provide improved performance because
fewer calls need to be sent to the database.
 How to creare New Quey in Microsoft SQL server
Store the code of Stored Procedures:
Open the code of the Stored procedures
Insert statements
 Inserting data to all columns
 Insert into tablename(col1,col2) values(v1,v2)
 Insert into tablename values(v1,v2)
 Inserting data to selected columns
 Insert into tablename(col1) values (v1)
 Insert into tablename(col2) values (v2)
Insert statements in Microsoft SQL Server
Update statement
Update table tablename
Set colname=value
- This updates all rows with colname set to value
Update table tablename
Set colname=value
Where <<condition>>
- This updates selected rows with colname as value only if the row satisfies the
condition
Update statement statements in Microsoft
SQL Server
Delete statements
Delete from table1;
Deletes all rows in table1
Delete from table1 where <<condition>>
Deletes few rows from table1 if they satisfy the condition
Delete statement statements in Microsoft
SQL Server
SQL Select Query
Basic form:
SELECT <attributes>
FROM <one or more relations>
WHERE <conditions>
Simple SQL Query
PName Price Category Manufacturer
Gizmo $19.99 Gadgets GizmoWorks
Powergizmo $29.99 Gadgets GizmoWorks
SingleTouch $149.99 Photography Canon
MultiTouch $203.99 Household Hitachi
SELECT *
FROM Product
WHERE category=‘Gadgets’
Product
PName Price Category Manufacturer
Gizmo $19.99 Gadgets GizmoWorks
Powergizmo $29.99 Gadgets GizmoWorks“selection”
Simple SQL Query
PName Price Category Manufacturer
Gizmo $19.99 Gadgets GizmoWorks
Powergizmo $29.99 Gadgets GizmoWorks
SingleTouch $149.99 Photography Canon
MultiTouch $203.99 Household Hitachi
SELECT PName, Price, Manufacturer
FROM Product
WHERE Price > 100
Product
PName Price Manufacturer
SingleTouch $149.99 Canon
MultiTouch $203.99 Hitachi
“selection” and
“projection”
Notation
Product(PName, Price, Category, Manfacturer)
Answer(PName, Price, Manfacturer)
Input Schema
Output Schema
SELECT PName, Price, Manufacturer
FROM Product
WHERE Price > 100
Details
 Case insensitive:
 Same: SELECT Select select
 Same: Product product
 Different: ‘Seattle’ ‘seattle’
 Constants:
 ‘abc’ - yes
 “abc” - no
The LIKE operator
 s LIKE p: pattern matching on strings
 p may contain two special symbols:
 % = any sequence of characters
 _ = any single character
SELECT *
FROM Products
WHERE PName LIKE ‘%gizmo%’
Eliminating Duplicates
SELECT DISTINCT category
FROM Product
Compare to:
SELECT category
FROM Product
Category
Gadgets
Gadgets
Photography
Household
Category
Gadgets
Photography
Household
Ordering the Results
SELECT pname, price, manufacturer
FROM Product
WHERE category=‘gizmo’ AND price > 50
ORDER BY price, pname
Ties are broken by the second attribute on the ORDER BY list, etc.
Ordering is ascending, unless you specify the DESC keyword.
SELECT Category
FROM Product
ORDER BY PName
PName Price Category Manufacturer
Gizmo $19.99 Gadgets GizmoWorks
Powergizmo $29.99 Gadgets GizmoWorks
SingleTouch $149.99 Photography Canon
MultiTouch $203.99 Household Hitachi
?
SELECT DISTINCT category
FROM Product
ORDER BY category
SELECT DISTINCT category
FROM Product
ORDER BY PName
?
?
Keys and Foreign Keys
PName Price Category Manufacturer
Gizmo $19.99 Gadgets GizmoWorks
Powergizmo $29.99 Gadgets GizmoWorks
SingleTouch $149.99 Photography Canon
MultiTouch $203.99 Household Hitachi
Product
Company
CName StockPrice Country
GizmoWorks 25 USA
Canon 65 Japan
Hitachi 15 Japan
Key
Foreign
key
Joins
Product (pname, price, category, manufacturer)
Company (cname, stockPrice, country)
Find all products under $200 manufactured in Japan;
return their names and prices.
SELECT PName, Price
FROM Product, Company
WHERE Manufacturer=CName AND Country=‘Japan’
AND Price <= 200
Join
between Product
and Company
Joins
 Cross Join
 Cartesian product. Simply merges two tables.
 Inner Join
 Cross join with a condition. Used to find matching records in the two tables
 Outer Join
 Used to find un matched rows in the two tables
 Self Join
 Joining a table with itself
Database Management System - SQL beginner Training
Joins
PName Price Category Manufacturer
Gizmo $19.99 Gadgets GizmoWorks
Powergizmo $29.99 Gadgets GizmoWorks
SingleTouch $149.99 Photography Canon
MultiTouch $203.99 Household Hitachi
Product
Company
Cname StockPrice Country
GizmoWorks 25 USA
Canon 65 Japan
Hitachi 15 Japan
PName Price
SingleTouch $149.99
SELECT PName, Price
FROM Product, Company
WHERE Manufacturer=CName AND Country=‘Japan’
AND Price <= 200
Database Management System
Beginner Training
Practices in 2017
Prepared by: Moutasm Tamimi
Using SQL language
Microsoft SQL Server Management Studio
Versions (2008-2010-2012-2014)
Ad

More Related Content

What's hot (20)

Sql Basics And Advanced
Sql Basics And AdvancedSql Basics And Advanced
Sql Basics And Advanced
rainynovember12
 
Dbms lab Manual
Dbms lab ManualDbms lab Manual
Dbms lab Manual
Vivek Kumar Sinha
 
Internet Environment
Internet  EnvironmentInternet  Environment
Internet Environment
guest8fdbdd
 
Ch 9 S Q L
Ch 9  S Q LCh 9  S Q L
Ch 9 S Q L
guest8fdbdd
 
Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
BG Java EE Course
 
BIS05 Introduction to SQL
BIS05 Introduction to SQLBIS05 Introduction to SQL
BIS05 Introduction to SQL
Prithwis Mukerjee
 
SQL Server Learning Drive
SQL Server Learning Drive SQL Server Learning Drive
SQL Server Learning Drive
TechandMate
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
Sachidananda M H
 
Dbms practical list
Dbms practical listDbms practical list
Dbms practical list
RajSingh734307
 
Sql fundamentals
Sql fundamentalsSql fundamentals
Sql fundamentals
Ravinder Kamboj
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
Nilt1234
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
Pongsakorn U-chupala
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
Mahir Haque
 
12 SQL
12 SQL12 SQL
12 SQL
Praveen M Jigajinni
 
Intro to T-SQL - 1st session
Intro to T-SQL - 1st sessionIntro to T-SQL - 1st session
Intro to T-SQL - 1st session
Medhat Dawoud
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)
Nalina Kumari
 
DDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using OracleDDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using Oracle
Farhan Aslam
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
Rumman Ansari
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)
Sabana Maharjan
 
SQL : introduction
SQL : introductionSQL : introduction
SQL : introduction
Shakila Mahjabin
 

Viewers also liked (6)

Best Practices For Business Analyst - Part 3
Best Practices For Business Analyst - Part 3Best Practices For Business Analyst - Part 3
Best Practices For Business Analyst - Part 3
Moutasm Tamimi
 
An integrated security testing framework and tool
An integrated security testing framework  and toolAn integrated security testing framework  and tool
An integrated security testing framework and tool
Moutasm Tamimi
 
Software Quality Models: A Comparative Study paper
Software Quality Models: A Comparative Study  paperSoftware Quality Models: A Comparative Study  paper
Software Quality Models: A Comparative Study paper
Moutasm Tamimi
 
Critical Success Factors (CSFs) In International ERP Implementations with que...
Critical Success Factors (CSFs) In International ERP Implementations with que...Critical Success Factors (CSFs) In International ERP Implementations with que...
Critical Success Factors (CSFs) In International ERP Implementations with que...
Moutasm Tamimi
 
Critical Success Factors along ERP life-cycle in Small medium enterprises
Critical Success Factors along ERP life-cycle in Small medium enterprises Critical Success Factors along ERP life-cycle in Small medium enterprises
Critical Success Factors along ERP life-cycle in Small medium enterprises
Moutasm Tamimi
 
Concepts Of business analyst Practices - Part 1
Concepts Of business analyst Practices - Part 1Concepts Of business analyst Practices - Part 1
Concepts Of business analyst Practices - Part 1
Moutasm Tamimi
 
Best Practices For Business Analyst - Part 3
Best Practices For Business Analyst - Part 3Best Practices For Business Analyst - Part 3
Best Practices For Business Analyst - Part 3
Moutasm Tamimi
 
An integrated security testing framework and tool
An integrated security testing framework  and toolAn integrated security testing framework  and tool
An integrated security testing framework and tool
Moutasm Tamimi
 
Software Quality Models: A Comparative Study paper
Software Quality Models: A Comparative Study  paperSoftware Quality Models: A Comparative Study  paper
Software Quality Models: A Comparative Study paper
Moutasm Tamimi
 
Critical Success Factors (CSFs) In International ERP Implementations with que...
Critical Success Factors (CSFs) In International ERP Implementations with que...Critical Success Factors (CSFs) In International ERP Implementations with que...
Critical Success Factors (CSFs) In International ERP Implementations with que...
Moutasm Tamimi
 
Critical Success Factors along ERP life-cycle in Small medium enterprises
Critical Success Factors along ERP life-cycle in Small medium enterprises Critical Success Factors along ERP life-cycle in Small medium enterprises
Critical Success Factors along ERP life-cycle in Small medium enterprises
Moutasm Tamimi
 
Concepts Of business analyst Practices - Part 1
Concepts Of business analyst Practices - Part 1Concepts Of business analyst Practices - Part 1
Concepts Of business analyst Practices - Part 1
Moutasm Tamimi
 
Ad

Similar to Database Management System - SQL beginner Training (20)

Sql for biggner
Sql for biggnerSql for biggner
Sql for biggner
Arvind Kumar
 
presentasi romi-java-06-database-october2013.pptx
presentasi romi-java-06-database-october2013.pptxpresentasi romi-java-06-database-october2013.pptx
presentasi romi-java-06-database-october2013.pptx
steeveenn
 
New Features of SQL Server 2016
New Features of SQL Server 2016New Features of SQL Server 2016
New Features of SQL Server 2016
Mir Mahmood
 
Physical Design and Development
Physical Design and DevelopmentPhysical Design and Development
Physical Design and Development
Er. Nawaraj Bhandari
 
MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 Course
Marcus Davage
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answers
debarghyamukherjee60
 
sql-basic.ppt
sql-basic.pptsql-basic.ppt
sql-basic.ppt
wondmhunegn
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
AnasYunusa
 
Essentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test BankEssentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test Bank
saxlinsitou55
 
lecture-SQL_Working.ppt
lecture-SQL_Working.pptlecture-SQL_Working.ppt
lecture-SQL_Working.ppt
LaviKushwaha
 
Unit4_Lecture-sql.ppt and data science relate
Unit4_Lecture-sql.ppt and data science relateUnit4_Lecture-sql.ppt and data science relate
Unit4_Lecture-sql.ppt and data science relate
umang2782love
 
Essentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test BankEssentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test Bank
sayfealween98
 
Essentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test BankEssentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test Bank
nayenbuur
 
Essentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test BankEssentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test Bank
kromahmacfie
 
Essentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test BankEssentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test Bank
kontzorrano4
 
SQL Server 2000 Research Series - Essential Knowledge
SQL Server 2000 Research Series - Essential KnowledgeSQL Server 2000 Research Series - Essential Knowledge
SQL Server 2000 Research Series - Essential Knowledge
Jerry Yang
 
AVB202 Intermediate Microsoft Access VBA
AVB202 Intermediate Microsoft Access VBAAVB202 Intermediate Microsoft Access VBA
AVB202 Intermediate Microsoft Access VBA
Dan D'Urso
 
Getting Started with SQL Language.pptx
Getting Started with SQL Language.pptxGetting Started with SQL Language.pptx
Getting Started with SQL Language.pptx
Cecilia Brusatori
 
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweqdbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
wrushabhsirsat
 
Complete SQL in one video by shradha.pdf
Complete SQL in one video by shradha.pdfComplete SQL in one video by shradha.pdf
Complete SQL in one video by shradha.pdf
rahulashu699
 
presentasi romi-java-06-database-october2013.pptx
presentasi romi-java-06-database-october2013.pptxpresentasi romi-java-06-database-october2013.pptx
presentasi romi-java-06-database-october2013.pptx
steeveenn
 
New Features of SQL Server 2016
New Features of SQL Server 2016New Features of SQL Server 2016
New Features of SQL Server 2016
Mir Mahmood
 
MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 Course
Marcus Davage
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answers
debarghyamukherjee60
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
AnasYunusa
 
Essentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test BankEssentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test Bank
saxlinsitou55
 
lecture-SQL_Working.ppt
lecture-SQL_Working.pptlecture-SQL_Working.ppt
lecture-SQL_Working.ppt
LaviKushwaha
 
Unit4_Lecture-sql.ppt and data science relate
Unit4_Lecture-sql.ppt and data science relateUnit4_Lecture-sql.ppt and data science relate
Unit4_Lecture-sql.ppt and data science relate
umang2782love
 
Essentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test BankEssentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test Bank
sayfealween98
 
Essentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test BankEssentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test Bank
nayenbuur
 
Essentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test BankEssentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test Bank
kromahmacfie
 
Essentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test BankEssentials of Database Management 1st Edition Hoffer Test Bank
Essentials of Database Management 1st Edition Hoffer Test Bank
kontzorrano4
 
SQL Server 2000 Research Series - Essential Knowledge
SQL Server 2000 Research Series - Essential KnowledgeSQL Server 2000 Research Series - Essential Knowledge
SQL Server 2000 Research Series - Essential Knowledge
Jerry Yang
 
AVB202 Intermediate Microsoft Access VBA
AVB202 Intermediate Microsoft Access VBAAVB202 Intermediate Microsoft Access VBA
AVB202 Intermediate Microsoft Access VBA
Dan D'Urso
 
Getting Started with SQL Language.pptx
Getting Started with SQL Language.pptxGetting Started with SQL Language.pptx
Getting Started with SQL Language.pptx
Cecilia Brusatori
 
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweqdbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
wrushabhsirsat
 
Complete SQL in one video by shradha.pdf
Complete SQL in one video by shradha.pdfComplete SQL in one video by shradha.pdf
Complete SQL in one video by shradha.pdf
rahulashu699
 
Ad

More from Moutasm Tamimi (10)

Software Quality Assessment Practices
Software Quality Assessment PracticesSoftware Quality Assessment Practices
Software Quality Assessment Practices
Moutasm Tamimi
 
Reengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software SpecificationsReengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software Specifications
Moutasm Tamimi
 
Software Evolution and Maintenance Models
Software Evolution and Maintenance ModelsSoftware Evolution and Maintenance Models
Software Evolution and Maintenance Models
Moutasm Tamimi
 
Software evolution and maintenance basic concepts and preliminaries
Software evolution and maintenance   basic concepts and preliminariesSoftware evolution and maintenance   basic concepts and preliminaries
Software evolution and maintenance basic concepts and preliminaries
Moutasm Tamimi
 
Recovery in Multi database Systems
Recovery in Multi database SystemsRecovery in Multi database Systems
Recovery in Multi database Systems
Moutasm Tamimi
 
ISO 29110 Software Quality Model For Software SMEs
ISO 29110 Software Quality Model For Software SMEsISO 29110 Software Quality Model For Software SMEs
ISO 29110 Software Quality Model For Software SMEs
Moutasm Tamimi
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
Moutasm Tamimi
 
Asp.net Programming Training (Web design, Web development)
Asp.net Programming Training (Web design, Web  development)Asp.net Programming Training (Web design, Web  development)
Asp.net Programming Training (Web design, Web development)
Moutasm Tamimi
 
Measurement and Quality in Object-Oriented Design
Measurement and Quality in Object-Oriented DesignMeasurement and Quality in Object-Oriented Design
Measurement and Quality in Object-Oriented Design
Moutasm Tamimi
 
SQL Injection and Clickjacking Attack in Web security
SQL Injection and Clickjacking Attack in Web securitySQL Injection and Clickjacking Attack in Web security
SQL Injection and Clickjacking Attack in Web security
Moutasm Tamimi
 
Software Quality Assessment Practices
Software Quality Assessment PracticesSoftware Quality Assessment Practices
Software Quality Assessment Practices
Moutasm Tamimi
 
Reengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software SpecificationsReengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software Specifications
Moutasm Tamimi
 
Software Evolution and Maintenance Models
Software Evolution and Maintenance ModelsSoftware Evolution and Maintenance Models
Software Evolution and Maintenance Models
Moutasm Tamimi
 
Software evolution and maintenance basic concepts and preliminaries
Software evolution and maintenance   basic concepts and preliminariesSoftware evolution and maintenance   basic concepts and preliminaries
Software evolution and maintenance basic concepts and preliminaries
Moutasm Tamimi
 
Recovery in Multi database Systems
Recovery in Multi database SystemsRecovery in Multi database Systems
Recovery in Multi database Systems
Moutasm Tamimi
 
ISO 29110 Software Quality Model For Software SMEs
ISO 29110 Software Quality Model For Software SMEsISO 29110 Software Quality Model For Software SMEs
ISO 29110 Software Quality Model For Software SMEs
Moutasm Tamimi
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
Moutasm Tamimi
 
Asp.net Programming Training (Web design, Web development)
Asp.net Programming Training (Web design, Web  development)Asp.net Programming Training (Web design, Web  development)
Asp.net Programming Training (Web design, Web development)
Moutasm Tamimi
 
Measurement and Quality in Object-Oriented Design
Measurement and Quality in Object-Oriented DesignMeasurement and Quality in Object-Oriented Design
Measurement and Quality in Object-Oriented Design
Moutasm Tamimi
 
SQL Injection and Clickjacking Attack in Web security
SQL Injection and Clickjacking Attack in Web securitySQL Injection and Clickjacking Attack in Web security
SQL Injection and Clickjacking Attack in Web security
Moutasm Tamimi
 

Recently uploaded (20)

Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Raffi Khatchadourian
 
Build With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdfBuild With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdf
Google Developer Group - Harare
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
How to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabberHow to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabber
eGrabber
 
AI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamsonAI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamson
UXPA Boston
 
IT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information TechnologyIT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information Technology
SHEHABALYAMANI
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Cyntexa
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
CSUC - Consorci de Serveis Universitaris de Catalunya
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Raffi Khatchadourian
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
How to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabberHow to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabber
eGrabber
 
AI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamsonAI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamson
UXPA Boston
 
IT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information TechnologyIT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information Technology
SHEHABALYAMANI
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Everything You Need to Know About Agentforce? (Put AI Agents to Work)
Cyntexa
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 

Database Management System - SQL beginner Training

  • 1. Database Management System Beginner Training Practices in 2017 Prepared by: Moutasm Tamimi Using SQL language Microsoft SQL Server Management Studio Versions (2008-2010-2012-2014)
  • 2. Speaker Information  Moutasm tamimi Independent consultant , IT Researcher , CEO at ITG7 Instructor of: Project Development. DBMS. .NET applications. Digital marketing. Email: tamimi@itg7.com LinkedIn: click here.
  • 4. Introduction Database: is an organized collection of data It is the collection of schemas, tables, queries, reports, views, and other objects. SQL: is a standard language for accessing and manipulating databases. What is SQL? •SQL stands for Structured Query Language •SQL lets you access and manipulate databases •SQL is an ANSI (American National Standards Institute) standard
  • 5. The four main categories of SQL statements are as follows: 1. DDL (Data Definition Language) 2. DML (Data Manipulation Language) 3. DCL (Data Control Language) 4. TCL (Transaction Control Language)
  • 6. Open Microsoft SQL Server Server name Input (.) dot as default server login
  • 8. Creating a database  We need to use Master database for creating a database  By default the size of a database is 1 MB  A database consists of Master Data File (.mdf) Primary Log File (.ldf)
  • 9. Data Types in SQL  Data types in Microsoft SQL server 2012
  • 10. Create Tables in SQL PName Price Category Manufacturer Gizmo $19.99 Gadgets GizmoWorks Powergizmo $29.99 Gadgets GizmoWorks SingleTouch $149.99 Photography Canon MultiTouch $203.99 Household Hitachi Product Attribute names Table name Tuples or rows Column name
  • 12. Tables Explained  The schema of a table is the table name and its attributes: Product(PName, Price, Category, Manfacturer)  A key is an attribute whose values are unique; we underline a key Product(PName, Price, Category, Manfacturer)
  • 13. Identity Property  Identity has A seed An increment  Seed is the initial value  Increment is the value by which we need to skip to fetch the nextvalue  Identity(1,2) will generate sequence numbers 1,3,5,7…
  • 14. Primary key constraints and Identity Property
  • 15. Create a New Database Diagram A database schema of a database system is its structure described in a formal language supported by the database management system (DBMS).
  • 16. Create Database diagram Blue box: primary key Yellow box: foreign key
  • 17. How To add records from the database on a table
  • 18. Stored procedures  Stored procedures provide improved performance because fewer calls need to be sent to the database.  How to creare New Quey in Microsoft SQL server
  • 19. Store the code of Stored Procedures:
  • 20. Open the code of the Stored procedures
  • 21. Insert statements  Inserting data to all columns  Insert into tablename(col1,col2) values(v1,v2)  Insert into tablename values(v1,v2)  Inserting data to selected columns  Insert into tablename(col1) values (v1)  Insert into tablename(col2) values (v2)
  • 22. Insert statements in Microsoft SQL Server
  • 23. Update statement Update table tablename Set colname=value - This updates all rows with colname set to value Update table tablename Set colname=value Where <<condition>> - This updates selected rows with colname as value only if the row satisfies the condition
  • 24. Update statement statements in Microsoft SQL Server
  • 25. Delete statements Delete from table1; Deletes all rows in table1 Delete from table1 where <<condition>> Deletes few rows from table1 if they satisfy the condition
  • 26. Delete statement statements in Microsoft SQL Server
  • 27. SQL Select Query Basic form: SELECT <attributes> FROM <one or more relations> WHERE <conditions>
  • 28. Simple SQL Query PName Price Category Manufacturer Gizmo $19.99 Gadgets GizmoWorks Powergizmo $29.99 Gadgets GizmoWorks SingleTouch $149.99 Photography Canon MultiTouch $203.99 Household Hitachi SELECT * FROM Product WHERE category=‘Gadgets’ Product PName Price Category Manufacturer Gizmo $19.99 Gadgets GizmoWorks Powergizmo $29.99 Gadgets GizmoWorks“selection”
  • 29. Simple SQL Query PName Price Category Manufacturer Gizmo $19.99 Gadgets GizmoWorks Powergizmo $29.99 Gadgets GizmoWorks SingleTouch $149.99 Photography Canon MultiTouch $203.99 Household Hitachi SELECT PName, Price, Manufacturer FROM Product WHERE Price > 100 Product PName Price Manufacturer SingleTouch $149.99 Canon MultiTouch $203.99 Hitachi “selection” and “projection”
  • 30. Notation Product(PName, Price, Category, Manfacturer) Answer(PName, Price, Manfacturer) Input Schema Output Schema SELECT PName, Price, Manufacturer FROM Product WHERE Price > 100
  • 31. Details  Case insensitive:  Same: SELECT Select select  Same: Product product  Different: ‘Seattle’ ‘seattle’  Constants:  ‘abc’ - yes  “abc” - no
  • 32. The LIKE operator  s LIKE p: pattern matching on strings  p may contain two special symbols:  % = any sequence of characters  _ = any single character SELECT * FROM Products WHERE PName LIKE ‘%gizmo%’
  • 33. Eliminating Duplicates SELECT DISTINCT category FROM Product Compare to: SELECT category FROM Product Category Gadgets Gadgets Photography Household Category Gadgets Photography Household
  • 34. Ordering the Results SELECT pname, price, manufacturer FROM Product WHERE category=‘gizmo’ AND price > 50 ORDER BY price, pname Ties are broken by the second attribute on the ORDER BY list, etc. Ordering is ascending, unless you specify the DESC keyword.
  • 35. SELECT Category FROM Product ORDER BY PName PName Price Category Manufacturer Gizmo $19.99 Gadgets GizmoWorks Powergizmo $29.99 Gadgets GizmoWorks SingleTouch $149.99 Photography Canon MultiTouch $203.99 Household Hitachi ? SELECT DISTINCT category FROM Product ORDER BY category SELECT DISTINCT category FROM Product ORDER BY PName ? ?
  • 36. Keys and Foreign Keys PName Price Category Manufacturer Gizmo $19.99 Gadgets GizmoWorks Powergizmo $29.99 Gadgets GizmoWorks SingleTouch $149.99 Photography Canon MultiTouch $203.99 Household Hitachi Product Company CName StockPrice Country GizmoWorks 25 USA Canon 65 Japan Hitachi 15 Japan Key Foreign key
  • 37. Joins Product (pname, price, category, manufacturer) Company (cname, stockPrice, country) Find all products under $200 manufactured in Japan; return their names and prices. SELECT PName, Price FROM Product, Company WHERE Manufacturer=CName AND Country=‘Japan’ AND Price <= 200 Join between Product and Company
  • 38. Joins  Cross Join  Cartesian product. Simply merges two tables.  Inner Join  Cross join with a condition. Used to find matching records in the two tables  Outer Join  Used to find un matched rows in the two tables  Self Join  Joining a table with itself
  • 40. Joins PName Price Category Manufacturer Gizmo $19.99 Gadgets GizmoWorks Powergizmo $29.99 Gadgets GizmoWorks SingleTouch $149.99 Photography Canon MultiTouch $203.99 Household Hitachi Product Company Cname StockPrice Country GizmoWorks 25 USA Canon 65 Japan Hitachi 15 Japan PName Price SingleTouch $149.99 SELECT PName, Price FROM Product, Company WHERE Manufacturer=CName AND Country=‘Japan’ AND Price <= 200
  • 41. Database Management System Beginner Training Practices in 2017 Prepared by: Moutasm Tamimi Using SQL language Microsoft SQL Server Management Studio Versions (2008-2010-2012-2014)
  翻译: