SlideShare a Scribd company logo
1 of 18
MySQL
BITM 3730
Developing Web Applications
Previous Work Review
• http://pirate.shu.edu/~marinom6/work.html
• Please Note only previously due HW assignments are posted on my
pirate.shu.edu web space
• Begin organizing your creating files for this course into an easy to find folder
on your desktop for easy FTP later on
Basics
• SQL stands for Structured Query Language
• MySQL is a relational database management system
• h is asking for help in MySQL
• q is asking to exit in MySQL
• c is asking to cancel a command in MySQL
Other Basics
• Standards based queries
• Structured Query Language (SQL)
• MySQL (a type of SQL) is a relational database management system
• Advantages of SQL
• Supports Large Amount Of Data
• Provides flexibility
• High Security & Reliability
• Optimized Performance
• 3rd Party Support
What is SQL?
• Developed by IBM is San Jose CA.
• Originally called (and still commonly referred to as Sequel)
• SQL stands for Structured Query Language
• MySQL is a relational database management system
Why SQL over Access?
• Access is client side, SQL is server side
• SQL can be used online, which offers more “power” – works with HTTP,
HTML, PHP, etc.
• Access may freeze, SQL is more reliable
• Access requires payment for MS Office, SQL offers free options
What can SQL Do?
• Create Queries
• Offers multi-line commands – separate by using a comma (,) and end by using a semi-colon
(;)
• Create a Database
• Create a Table
• Showing Tables/Describing Tables/Deleting Tables
• Loading Data
• Selecting Data (Select – From – Where)
• Sorting Data
SQL with Our Other Types
• DBMS
• Bottom-tier database server
• PHP
• Middle-tier Web server
• HTML
• Client tier
SQL works with PHP
How SQL Works
• SQL schema
• Identified by a schema name
• Includes an authorization identifier and descriptors for each element
• Schema elements include
• Tables, constraints, views, domains, and other constructs
• Each statement in SQL ends with a semicolon
Visual
• CREATE SCHEMA statement
• CREATE SCHEMA COMPANY AUTHORIZATION ‘Jsmith’;
• Catalog
• Named collection of schemas in an SQL environment
• SQL also has the concept of a cluster of catalogs
Basic Data Types
• Numeric data types
• Integer numbers: INTEGER, INT, and SMALLINT
• Floating-point (real) numbers: FLOAT or REAL, and DOUBLE PRECISION
• Character-string data types
• Fixed length: CHAR(n), CHARACTER(n)
• Varying length: VARCHAR(n), CHAR VARYING(n), CHARACTER VARYING(n)
More Data Types
• Bit-string data types
• Fixed length: BIT(n)
• Varying length: BIT VARYING(n)
• Boolean data type
• Values of TRUE or FALSE or NULL
• DATE data type
• Ten positions
• Components are YEAR, MONTH, and DAY in the form YYYY-MM-DD
• Multiple mapping functions available in RDBMSs to change date formats
Even More Data Types
• Timestamp data type
• Includes the DATE and TIME fields
• Plus a minimum of six positions for decimal fractions of seconds
• Optional WITH TIME ZONE qualifier
• INTERVAL data type
• Specifies a relative value that can be used to increment or decrement an absolute value of a date, time, or
timestamp
• DATE, TIME, Timestamp, INTERVAL data types can be cast or converted to string
formats for comparison.
Integrity Constraints
• Key constraint: A primary key value cannot be duplicated
• Entity Integrity Constraint: A primary key value cannot be null
• Referential integrity constraints : The “foreign key “ must have a value that is
already present as a primary key, or may be null.
SQL Code
Building Assignment 14
branch (branch-name, branch-city, assets)
customer (customer-name, customer-street, customer-city)
account (account-number, branch-name, balance)
loan (loan-number, branch-name, amount)
depositor (customer-name, account-number)
borrower (customer-name, loan-number)
employee (employee-name, branch-name, salary)
SQL Notation
• Table name
• Fields inside ( )
• Underline is key attribute
• Attributes can be written as name_name, name-name or namename

More Related Content

Similar to BITM3730Week14.pptx

Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012
Brij Mishra
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
sqlserver.co.il
 

Similar to BITM3730Week14.pptx (20)

SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginnersSQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
 
Azure - Data Platform
Azure - Data PlatformAzure - Data Platform
Azure - Data Platform
 
Ibm datastage online training in hyderabad
Ibm datastage online training in hyderabadIbm datastage online training in hyderabad
Ibm datastage online training in hyderabad
 
Sqlite
SqliteSqlite
Sqlite
 
Introduction to SalesForce
Introduction to SalesForceIntroduction to SalesForce
Introduction to SalesForce
 
Виталий Бондаренко "Fast Data Platform for Real-Time Analytics. Architecture ...
Виталий Бондаренко "Fast Data Platform for Real-Time Analytics. Architecture ...Виталий Бондаренко "Fast Data Platform for Real-Time Analytics. Architecture ...
Виталий Бондаренко "Fast Data Platform for Real-Time Analytics. Architecture ...
 
Partially Contained Databases
Partially Contained DatabasesPartially Contained Databases
Partially Contained Databases
 
Rdbms
RdbmsRdbms
Rdbms
 
Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012
 
Taming the shrew, Optimizing Power BI Options
Taming the shrew, Optimizing Power BI OptionsTaming the shrew, Optimizing Power BI Options
Taming the shrew, Optimizing Power BI Options
 
SilverStripe From a Developer's Perspective
SilverStripe From a Developer's PerspectiveSilverStripe From a Developer's Perspective
SilverStripe From a Developer's Perspective
 
PHP and MySQL.pptx
PHP and MySQL.pptxPHP and MySQL.pptx
PHP and MySQL.pptx
 
Voldemort Nosql
Voldemort NosqlVoldemort Nosql
Voldemort Nosql
 
SQL-Server Database.pdf
SQL-Server Database.pdfSQL-Server Database.pdf
SQL-Server Database.pdf
 
1696153390685.pdf
1696153390685.pdf1696153390685.pdf
1696153390685.pdf
 
Writing Space and the Cassandra NoSQL DBMS
Writing Space and the Cassandra NoSQL DBMSWriting Space and the Cassandra NoSQL DBMS
Writing Space and the Cassandra NoSQL DBMS
 
Cloud architectural patterns and Microsoft Azure tools
Cloud architectural patterns and Microsoft Azure toolsCloud architectural patterns and Microsoft Azure tools
Cloud architectural patterns and Microsoft Azure tools
 
Data modeling trends for analytics
Data modeling trends for analyticsData modeling trends for analytics
Data modeling trends for analytics
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server Databases
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 

More from MattMarino13

01_Felke-Morris_Lecture_ppt_ch01.pptx
01_Felke-Morris_Lecture_ppt_ch01.pptx01_Felke-Morris_Lecture_ppt_ch01.pptx
01_Felke-Morris_Lecture_ppt_ch01.pptx
MattMarino13
 
Project Presentation_castroxa_attempt_2021-12-05-18-30-10_No Cap.pptx
Project Presentation_castroxa_attempt_2021-12-05-18-30-10_No Cap.pptxProject Presentation_castroxa_attempt_2021-12-05-18-30-10_No Cap.pptx
Project Presentation_castroxa_attempt_2021-12-05-18-30-10_No Cap.pptx
MattMarino13
 
Project Presentation_mirzamad_attempt_2021-12-05-23-35-25_HTML_presentation.pptx
Project Presentation_mirzamad_attempt_2021-12-05-23-35-25_HTML_presentation.pptxProject Presentation_mirzamad_attempt_2021-12-05-23-35-25_HTML_presentation.pptx
Project Presentation_mirzamad_attempt_2021-12-05-23-35-25_HTML_presentation.pptx
MattMarino13
 
Project Presentation_padillni_attempt_2021-12-05-18-52-37_Web Application Pre...
Project Presentation_padillni_attempt_2021-12-05-18-52-37_Web Application Pre...Project Presentation_padillni_attempt_2021-12-05-18-52-37_Web Application Pre...
Project Presentation_padillni_attempt_2021-12-05-18-52-37_Web Application Pre...
MattMarino13
 
Project Presentation_thomasb1_attempt_2021-12-05-17-50-13_Developing Web Apps...
Project Presentation_thomasb1_attempt_2021-12-05-17-50-13_Developing Web Apps...Project Presentation_thomasb1_attempt_2021-12-05-17-50-13_Developing Web Apps...
Project Presentation_thomasb1_attempt_2021-12-05-17-50-13_Developing Web Apps...
MattMarino13
 
Project Presentation_hernana1_attempt_2021-12-05-22-06-56_Miyamoto BITM 3730 ...
Project Presentation_hernana1_attempt_2021-12-05-22-06-56_Miyamoto BITM 3730 ...Project Presentation_hernana1_attempt_2021-12-05-22-06-56_Miyamoto BITM 3730 ...
Project Presentation_hernana1_attempt_2021-12-05-22-06-56_Miyamoto BITM 3730 ...
MattMarino13
 

More from MattMarino13 (20)

1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptx1-22-24 INFO 2106.pptx
1-22-24 INFO 2106.pptx
 
1-24-24 INFO 3205.pptx
1-24-24 INFO 3205.pptx1-24-24 INFO 3205.pptx
1-24-24 INFO 3205.pptx
 
BITM3730 11-14.pptx
BITM3730 11-14.pptxBITM3730 11-14.pptx
BITM3730 11-14.pptx
 
01_Felke-Morris_Lecture_ppt_ch01.pptx
01_Felke-Morris_Lecture_ppt_ch01.pptx01_Felke-Morris_Lecture_ppt_ch01.pptx
01_Felke-Morris_Lecture_ppt_ch01.pptx
 
02slide_accessible.pptx
02slide_accessible.pptx02slide_accessible.pptx
02slide_accessible.pptx
 
Hoisington_Android_4e_PPT_CH01.pptx
Hoisington_Android_4e_PPT_CH01.pptxHoisington_Android_4e_PPT_CH01.pptx
Hoisington_Android_4e_PPT_CH01.pptx
 
AndroidHTP3_AppA.pptx
AndroidHTP3_AppA.pptxAndroidHTP3_AppA.pptx
AndroidHTP3_AppA.pptx
 
9780357132302_Langley11e_ch1_LEAP.pptx
9780357132302_Langley11e_ch1_LEAP.pptx9780357132302_Langley11e_ch1_LEAP.pptx
9780357132302_Langley11e_ch1_LEAP.pptx
 
krajewski_om12 _01.pptx
krajewski_om12 _01.pptxkrajewski_om12 _01.pptx
krajewski_om12 _01.pptx
 
CapsimOpsIntroPPT.Marino.pptx
CapsimOpsIntroPPT.Marino.pptxCapsimOpsIntroPPT.Marino.pptx
CapsimOpsIntroPPT.Marino.pptx
 
Project Presentation_castroxa_attempt_2021-12-05-18-30-10_No Cap.pptx
Project Presentation_castroxa_attempt_2021-12-05-18-30-10_No Cap.pptxProject Presentation_castroxa_attempt_2021-12-05-18-30-10_No Cap.pptx
Project Presentation_castroxa_attempt_2021-12-05-18-30-10_No Cap.pptx
 
Project Presentation_mirzamad_attempt_2021-12-05-23-35-25_HTML_presentation.pptx
Project Presentation_mirzamad_attempt_2021-12-05-23-35-25_HTML_presentation.pptxProject Presentation_mirzamad_attempt_2021-12-05-23-35-25_HTML_presentation.pptx
Project Presentation_mirzamad_attempt_2021-12-05-23-35-25_HTML_presentation.pptx
 
Project Presentation_padillni_attempt_2021-12-05-18-52-37_Web Application Pre...
Project Presentation_padillni_attempt_2021-12-05-18-52-37_Web Application Pre...Project Presentation_padillni_attempt_2021-12-05-18-52-37_Web Application Pre...
Project Presentation_padillni_attempt_2021-12-05-18-52-37_Web Application Pre...
 
Project Presentation_thomasb1_attempt_2021-12-05-17-50-13_Developing Web Apps...
Project Presentation_thomasb1_attempt_2021-12-05-17-50-13_Developing Web Apps...Project Presentation_thomasb1_attempt_2021-12-05-17-50-13_Developing Web Apps...
Project Presentation_thomasb1_attempt_2021-12-05-17-50-13_Developing Web Apps...
 
Project Presentation_hernana1_attempt_2021-12-05-22-06-56_Miyamoto BITM 3730 ...
Project Presentation_hernana1_attempt_2021-12-05-22-06-56_Miyamoto BITM 3730 ...Project Presentation_hernana1_attempt_2021-12-05-22-06-56_Miyamoto BITM 3730 ...
Project Presentation_hernana1_attempt_2021-12-05-22-06-56_Miyamoto BITM 3730 ...
 
1-23-19 Agenda.pptx
1-23-19 Agenda.pptx1-23-19 Agenda.pptx
1-23-19 Agenda.pptx
 
EDF 8289 Marino PPT.pptx
EDF 8289 Marino PPT.pptxEDF 8289 Marino PPT.pptx
EDF 8289 Marino PPT.pptx
 
Agenda January 20th 2016.pptx
Agenda January 20th 2016.pptxAgenda January 20th 2016.pptx
Agenda January 20th 2016.pptx
 
BITM3730 8-29.pptx
BITM3730 8-29.pptxBITM3730 8-29.pptx
BITM3730 8-29.pptx
 
BITM3730 8-30.pptx
BITM3730 8-30.pptxBITM3730 8-30.pptx
BITM3730 8-30.pptx
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Recently uploaded (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 

BITM3730Week14.pptx

  • 2. Previous Work Review • http://pirate.shu.edu/~marinom6/work.html • Please Note only previously due HW assignments are posted on my pirate.shu.edu web space • Begin organizing your creating files for this course into an easy to find folder on your desktop for easy FTP later on
  • 3. Basics • SQL stands for Structured Query Language • MySQL is a relational database management system • h is asking for help in MySQL • q is asking to exit in MySQL • c is asking to cancel a command in MySQL
  • 4. Other Basics • Standards based queries • Structured Query Language (SQL) • MySQL (a type of SQL) is a relational database management system • Advantages of SQL • Supports Large Amount Of Data • Provides flexibility • High Security & Reliability • Optimized Performance • 3rd Party Support
  • 5. What is SQL? • Developed by IBM is San Jose CA. • Originally called (and still commonly referred to as Sequel) • SQL stands for Structured Query Language • MySQL is a relational database management system
  • 6. Why SQL over Access? • Access is client side, SQL is server side • SQL can be used online, which offers more “power” – works with HTTP, HTML, PHP, etc. • Access may freeze, SQL is more reliable • Access requires payment for MS Office, SQL offers free options
  • 7. What can SQL Do? • Create Queries • Offers multi-line commands – separate by using a comma (,) and end by using a semi-colon (;) • Create a Database • Create a Table • Showing Tables/Describing Tables/Deleting Tables • Loading Data • Selecting Data (Select – From – Where) • Sorting Data
  • 8. SQL with Our Other Types • DBMS • Bottom-tier database server • PHP • Middle-tier Web server • HTML • Client tier
  • 10. How SQL Works • SQL schema • Identified by a schema name • Includes an authorization identifier and descriptors for each element • Schema elements include • Tables, constraints, views, domains, and other constructs • Each statement in SQL ends with a semicolon
  • 11. Visual • CREATE SCHEMA statement • CREATE SCHEMA COMPANY AUTHORIZATION ‘Jsmith’; • Catalog • Named collection of schemas in an SQL environment • SQL also has the concept of a cluster of catalogs
  • 12. Basic Data Types • Numeric data types • Integer numbers: INTEGER, INT, and SMALLINT • Floating-point (real) numbers: FLOAT or REAL, and DOUBLE PRECISION • Character-string data types • Fixed length: CHAR(n), CHARACTER(n) • Varying length: VARCHAR(n), CHAR VARYING(n), CHARACTER VARYING(n)
  • 13. More Data Types • Bit-string data types • Fixed length: BIT(n) • Varying length: BIT VARYING(n) • Boolean data type • Values of TRUE or FALSE or NULL • DATE data type • Ten positions • Components are YEAR, MONTH, and DAY in the form YYYY-MM-DD • Multiple mapping functions available in RDBMSs to change date formats
  • 14. Even More Data Types • Timestamp data type • Includes the DATE and TIME fields • Plus a minimum of six positions for decimal fractions of seconds • Optional WITH TIME ZONE qualifier • INTERVAL data type • Specifies a relative value that can be used to increment or decrement an absolute value of a date, time, or timestamp • DATE, TIME, Timestamp, INTERVAL data types can be cast or converted to string formats for comparison.
  • 15. Integrity Constraints • Key constraint: A primary key value cannot be duplicated • Entity Integrity Constraint: A primary key value cannot be null • Referential integrity constraints : The “foreign key “ must have a value that is already present as a primary key, or may be null.
  • 17. Building Assignment 14 branch (branch-name, branch-city, assets) customer (customer-name, customer-street, customer-city) account (account-number, branch-name, balance) loan (loan-number, branch-name, amount) depositor (customer-name, account-number) borrower (customer-name, loan-number) employee (employee-name, branch-name, salary)
  • 18. SQL Notation • Table name • Fields inside ( ) • Underline is key attribute • Attributes can be written as name_name, name-name or namename