SlideShare a Scribd company logo
1 of 21
Download to read offline
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!

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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
 

Similar to 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
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 

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!