SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
hasen@microcis.net July 15, 2013Hassen poreya
Trainer, Cresco Solution
Afghanistan Workforce
Development Program
Database
Database Management System, MySQL
Database
A Database is a container that holds tables and other
SQL structures related to those tables.
Database
Database Management System (DBMS)
 Elmasri & Navathe (2007):
“A database management system (DBMS) is a
collection of programs that enables users to
create and maintain a database.”
Database Management System (DBMS)
 A DBMS fulfills several purposes:
 Defining databases
 Constructing databases
 Manipulating databases
 Sharing databases among various users and
applications
Database Management System (DBMS)
 MS Access
 MySQL (Open Source)
 SQL-Server (Microsoft)
 Oracle
 PostgreSQL
 FoxPro
 SQLite
SQL (Structured Query Language)
 SQL is a database language designed for
 Retrieval and management of data in relational DBMS
 Database schema creation and modification
 It is used also in case of security, Authorization,
Integrity
 2 Originally, SQL was called SEQUEL (Structured
English QUEry Language)
 3 Three languages within a language:
 The Data Definition Language (DDL)
 The Data Manipulation Language (DML)
 The Data Control Language (DCL)
Data Definition Language (DDL)
 The Data Definition Language (DDL) is the part of
SQL.
 You use to create, change, or destroy the basic
elements of a relational database.
 Definition Language (DDL) deals with the structure
of a database.
Data Definition Language (DDL)
 The DDL consists of these three commands:
 CREATE: You use the various forms of this command to
build the essential structures of the database
 ALTER: You use this command to change structures
that You create
 DROP: If you apply this command to a table, it
destroys not only the table's data, but its structure as
well.
Data Manipulation Language (DML)
 The Data Manipulation Language deals with the
data contained within that structure.
 The Data Manipulation Language (DML) is the part
of SQL that operates on the data.
 The DML statements that can be use is:
 INSERT
 UPDATE
 DELETE
 SELECT
Data Control Language (DCL)
 Protects your database from becoming corrupted.
 The DCL provides security for your database
 DCL hast four commands:
 COMMIT
 ROLLBACK
 GRANT
 REVOKE
Data Control Language (DCL)
 Database Name: Company
 Tables: employee, project, works in
Create Command (DDL)
 SHOW databases;
 To list name of available databases.
 CREATE DATABASE name;
 USE name;
Create Command (DDL)
 To create new table:
 CREATE TABLE table_name (column1_name
data_type1, column2_name data_type2…);
Create Command (DDL)
 To create table project:
 To create table works_in:
ALTER TABLE Commands
 Add new column:
 ALTER TABLE employee ADD COLUMN (salary
INTEGER);
 Change data type of a column:
 ALTER TABLE employee MODIFY COLUMN salary
FLOAT;
 Delete column:
 ALTER TABLE employee DROP COLUMN salary;
DROP Commands
 Delete Database:
 DROP DATABASE Company;
 Delete Table:
 DROP TABLE employee;
 Two other useful command:
 SHOW TABLES; -- Show available tables (after selecting
a database with USE)
Commands
 DESCRIBE table name;
 Show structure of table
Data types
 INTEGER : integer
 FLOAT : floating point number
 DATE : a date, format: 'YYYY-MM-DD'
 VARCHAR(N) : variable length string, the length is
indicated by N, range 0-255
 TEXT : text, maximum length of 65,535 characters
 BOOLEAN : 0=false, any other value=true
Exercise
 Create a database “Student”
 Each student has different information including
ID, name, last name, class, phone number.
 Table student.
 Each student also needs a username and password
to enter to the library system.
 Table users
 Do entry at least for five students!
hasen@microcis.net July 15, 2013Hassen poreya
Trainer, Cresco Solution
Any Questions!

Weitere ähnliche Inhalte

Was ist angesagt?

Structured query language
Structured query languageStructured query language
Structured query languageRashid Ansari
 
Database Fundamental
Database FundamentalDatabase Fundamental
Database FundamentalGong Haibing
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic ConceptsTony Wong
 
DDL And DML
DDL And DMLDDL And DML
DDL And DMLpnp @in
 
Data Definition and Data Manipulation Language-DDL & DML
Data Definition and Data Manipulation Language-DDL & DMLData Definition and Data Manipulation Language-DDL & DML
Data Definition and Data Manipulation Language-DDL & DMLMd. Selim Hossain
 
Data Ware Housing through SQL concept
Data Ware Housing through SQL conceptData Ware Housing through SQL concept
Data Ware Housing through SQL conceptUGKkhan
 
Sql database development part 1
Sql database development part 1Sql database development part 1
Sql database development part 1Sqlperfomance
 
Types of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligetiTypes of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligetiNaveen Kumar Veligeti
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introductionHasan Kata
 
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick LearningOracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick LearningeVideoTuition
 

Was ist angesagt? (20)

Structured query language
Structured query languageStructured query language
Structured query language
 
Database Fundamental
Database FundamentalDatabase Fundamental
Database Fundamental
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Data base
Data baseData base
Data base
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
 
DDL And DML
DDL And DMLDDL And DML
DDL And DML
 
MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
 
SQL for interview
SQL for interviewSQL for interview
SQL for interview
 
SQLSlide
SQLSlideSQLSlide
SQLSlide
 
Ddl vs dml
Ddl vs dmlDdl vs dml
Ddl vs dml
 
Data Definition and Data Manipulation Language-DDL & DML
Data Definition and Data Manipulation Language-DDL & DMLData Definition and Data Manipulation Language-DDL & DML
Data Definition and Data Manipulation Language-DDL & DML
 
Sql – pocket guide
Sql – pocket guideSql – pocket guide
Sql – pocket guide
 
Group Members
Group MembersGroup Members
Group Members
 
Data Ware Housing through SQL concept
Data Ware Housing through SQL conceptData Ware Housing through SQL concept
Data Ware Housing through SQL concept
 
Sql database development part 1
Sql database development part 1Sql database development part 1
Sql database development part 1
 
Types of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligetiTypes of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligeti
 
Presentation1
Presentation1Presentation1
Presentation1
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introduction
 
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick LearningOracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
 

Andere mochten auch

Learn to Code with JavaScript - Choose Your Own Adventures
Learn to Code with JavaScript - Choose Your Own AdventuresLearn to Code with JavaScript - Choose Your Own Adventures
Learn to Code with JavaScript - Choose Your Own AdventuresTessa Mero
 
Web app development_database_design_er-mapping_12
Web app development_database_design_er-mapping_12Web app development_database_design_er-mapping_12
Web app development_database_design_er-mapping_12Hassen Poreya
 
Web app development_php_04
Web app development_php_04Web app development_php_04
Web app development_php_04Hassen Poreya
 
Web app development_database_design_11
Web app development_database_design_11Web app development_database_design_11
Web app development_database_design_11Hassen Poreya
 
Web app development_crud_13
Web app development_crud_13Web app development_crud_13
Web app development_crud_13Hassen Poreya
 
Web app development_my_sql_09
Web app development_my_sql_09Web app development_my_sql_09
Web app development_my_sql_09Hassen Poreya
 
Web app development_html_css_03
Web app development_html_css_03Web app development_html_css_03
Web app development_html_css_03Hassen Poreya
 
Web app development_php_07
Web app development_php_07Web app development_php_07
Web app development_php_07Hassen Poreya
 
Web app development_php_06
Web app development_php_06Web app development_php_06
Web app development_php_06Hassen Poreya
 
Web app development_php_05
Web app development_php_05Web app development_php_05
Web app development_php_05Hassen Poreya
 
Web app development_database_design_10
Web app development_database_design_10Web app development_database_design_10
Web app development_database_design_10Hassen Poreya
 
Web app development_html_01
Web app development_html_01Web app development_html_01
Web app development_html_01Hassen Poreya
 
Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Hassen Poreya
 
Web app development_html_02
Web app development_html_02Web app development_html_02
Web app development_html_02Hassen Poreya
 

Andere mochten auch (15)

Learn to Code with JavaScript - Choose Your Own Adventures
Learn to Code with JavaScript - Choose Your Own AdventuresLearn to Code with JavaScript - Choose Your Own Adventures
Learn to Code with JavaScript - Choose Your Own Adventures
 
Web app development_database_design_er-mapping_12
Web app development_database_design_er-mapping_12Web app development_database_design_er-mapping_12
Web app development_database_design_er-mapping_12
 
Web app development_php_04
Web app development_php_04Web app development_php_04
Web app development_php_04
 
Web app development_database_design_11
Web app development_database_design_11Web app development_database_design_11
Web app development_database_design_11
 
CodeIgniter Practice
CodeIgniter PracticeCodeIgniter Practice
CodeIgniter Practice
 
Web app development_crud_13
Web app development_crud_13Web app development_crud_13
Web app development_crud_13
 
Web app development_my_sql_09
Web app development_my_sql_09Web app development_my_sql_09
Web app development_my_sql_09
 
Web app development_html_css_03
Web app development_html_css_03Web app development_html_css_03
Web app development_html_css_03
 
Web app development_php_07
Web app development_php_07Web app development_php_07
Web app development_php_07
 
Web app development_php_06
Web app development_php_06Web app development_php_06
Web app development_php_06
 
Web app development_php_05
Web app development_php_05Web app development_php_05
Web app development_php_05
 
Web app development_database_design_10
Web app development_database_design_10Web app development_database_design_10
Web app development_database_design_10
 
Web app development_html_01
Web app development_html_01Web app development_html_01
Web app development_html_01
 
Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Web app development_cookies_sessions_14
Web app development_cookies_sessions_14
 
Web app development_html_02
Web app development_html_02Web app development_html_02
Web app development_html_02
 

Ähnlich wie Web app development_my_sql_08 (20)

SQL2.pptx
SQL2.pptxSQL2.pptx
SQL2.pptx
 
lovely
lovelylovely
lovely
 
Database Languages.pptx
Database Languages.pptxDatabase Languages.pptx
Database Languages.pptx
 
Database Management System (DBMS).pptx
Database Management System (DBMS).pptxDatabase Management System (DBMS).pptx
Database Management System (DBMS).pptx
 
SQLGuide.ppt.pptx
SQLGuide.ppt.pptxSQLGuide.ppt.pptx
SQLGuide.ppt.pptx
 
SQLGuide.ppt.pptx
SQLGuide.ppt.pptxSQLGuide.ppt.pptx
SQLGuide.ppt.pptx
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
SQL Injection Attacks
SQL Injection AttacksSQL Injection Attacks
SQL Injection Attacks
 
Database Management Systems
Database Management SystemsDatabase Management Systems
Database Management Systems
 
Lecture on DBMS & MySQL.pdf v. C. .
Lecture on DBMS & MySQL.pdf v.  C.     .Lecture on DBMS & MySQL.pdf v.  C.     .
Lecture on DBMS & MySQL.pdf v. C. .
 
SQL ARPIT YADAV.pptx
SQL ARPIT YADAV.pptxSQL ARPIT YADAV.pptx
SQL ARPIT YADAV.pptx
 
SQL_Introduction_Updated.pptx
SQL_Introduction_Updated.pptxSQL_Introduction_Updated.pptx
SQL_Introduction_Updated.pptx
 
Introduction to SQL.pptx
Introduction to SQL.pptxIntroduction to SQL.pptx
Introduction to SQL.pptx
 
An intoduction to sql and its components
An intoduction to sql and its componentsAn intoduction to sql and its components
An intoduction to sql and its components
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
 
SQL_NOTES.pdf
SQL_NOTES.pdfSQL_NOTES.pdf
SQL_NOTES.pdf
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
Database language
Database languageDatabase language
Database language
 
BASIC_OF_DATABASE_PPT__new[1].pptx
BASIC_OF_DATABASE_PPT__new[1].pptxBASIC_OF_DATABASE_PPT__new[1].pptx
BASIC_OF_DATABASE_PPT__new[1].pptx
 
Database Languages
Database LanguagesDatabase Languages
Database Languages
 

Kürzlich hochgeladen

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Kürzlich hochgeladen (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

Web app development_my_sql_08

  • 1. hasen@microcis.net July 15, 2013Hassen poreya Trainer, Cresco Solution Afghanistan Workforce Development Program Database Database Management System, MySQL
  • 2. Database A Database is a container that holds tables and other SQL structures related to those tables.
  • 4. Database Management System (DBMS)  Elmasri & Navathe (2007): “A database management system (DBMS) is a collection of programs that enables users to create and maintain a database.”
  • 5. Database Management System (DBMS)  A DBMS fulfills several purposes:  Defining databases  Constructing databases  Manipulating databases  Sharing databases among various users and applications
  • 6. Database Management System (DBMS)  MS Access  MySQL (Open Source)  SQL-Server (Microsoft)  Oracle  PostgreSQL  FoxPro  SQLite
  • 7. SQL (Structured Query Language)  SQL is a database language designed for  Retrieval and management of data in relational DBMS  Database schema creation and modification  It is used also in case of security, Authorization, Integrity  2 Originally, SQL was called SEQUEL (Structured English QUEry Language)  3 Three languages within a language:  The Data Definition Language (DDL)  The Data Manipulation Language (DML)  The Data Control Language (DCL)
  • 8. Data Definition Language (DDL)  The Data Definition Language (DDL) is the part of SQL.  You use to create, change, or destroy the basic elements of a relational database.  Definition Language (DDL) deals with the structure of a database.
  • 9. Data Definition Language (DDL)  The DDL consists of these three commands:  CREATE: You use the various forms of this command to build the essential structures of the database  ALTER: You use this command to change structures that You create  DROP: If you apply this command to a table, it destroys not only the table's data, but its structure as well.
  • 10. Data Manipulation Language (DML)  The Data Manipulation Language deals with the data contained within that structure.  The Data Manipulation Language (DML) is the part of SQL that operates on the data.  The DML statements that can be use is:  INSERT  UPDATE  DELETE  SELECT
  • 11. Data Control Language (DCL)  Protects your database from becoming corrupted.  The DCL provides security for your database  DCL hast four commands:  COMMIT  ROLLBACK  GRANT  REVOKE
  • 12. Data Control Language (DCL)  Database Name: Company  Tables: employee, project, works in
  • 13. Create Command (DDL)  SHOW databases;  To list name of available databases.  CREATE DATABASE name;  USE name;
  • 14. Create Command (DDL)  To create new table:  CREATE TABLE table_name (column1_name data_type1, column2_name data_type2…);
  • 15. Create Command (DDL)  To create table project:  To create table works_in:
  • 16. ALTER TABLE Commands  Add new column:  ALTER TABLE employee ADD COLUMN (salary INTEGER);  Change data type of a column:  ALTER TABLE employee MODIFY COLUMN salary FLOAT;  Delete column:  ALTER TABLE employee DROP COLUMN salary;
  • 17. DROP Commands  Delete Database:  DROP DATABASE Company;  Delete Table:  DROP TABLE employee;  Two other useful command:  SHOW TABLES; -- Show available tables (after selecting a database with USE)
  • 18. Commands  DESCRIBE table name;  Show structure of table
  • 19. Data types  INTEGER : integer  FLOAT : floating point number  DATE : a date, format: 'YYYY-MM-DD'  VARCHAR(N) : variable length string, the length is indicated by N, range 0-255  TEXT : text, maximum length of 65,535 characters  BOOLEAN : 0=false, any other value=true
  • 20. Exercise  Create a database “Student”  Each student has different information including ID, name, last name, class, phone number.  Table student.  Each student also needs a username and password to enter to the library system.  Table users  Do entry at least for five students!
  • 21. hasen@microcis.net July 15, 2013Hassen poreya Trainer, Cresco Solution Any Questions!