SlideShare una empresa de Scribd logo
1 de 31
 In our programs we use variables to store
  information.
 But when our program terminates all the
  variables declared in it disappear.
 Why this happens????
 What  if we need some information to be
  stored even after the termination of
  program. (We are here in this session for
  this need).
 How can we fulfill this need?
 Any suggestion……..
 The   most simple solution is store the
  information in the disk.
 Now the question is how we can store in
  disk.
 Create a file and store there.(simple
  enough)
 Is it a good solution or the best solution ?
 Suppose   we want to implement the log in
  section.(feature 1)
 We use a file and store the user_id and
  password in the following manner
 When  1105120 wants to log in we have to
  check all the previous record.
 Also we have to check whether multiple
  users are accessing the file.
 Any more problem………….
 So we need to care about a lot of facts
  beside storing, updating the file.
 But we are lazy people. We always want to
  minimize our task.(At least me!)
 Thank GOD there are some applications or
  Systems which handle the facts about
  which we were worried 
 And
    they are called DataBase
 Management System(DBMS).
  • Oracle
  • IBM DB2
  • Microsoft SQL Server
  • Microsoft Access
  • PostgreSQL
  • MySQL
  • SQLite
 But   not all our problems have been solved.
  
 Why???
 Because now we have to learn how to
  maintain Database using DBMS .
 Here we will see how to manage database
  using MySQL.
 CREATE   DATABASE [IF NOT EXISTS]
  database_name;
 Example: Suppose I want to create a
  database named “Quiz”.
 So the query will be
  CREATE DATABASE IF NOT EXISTS QUIZ;
 SHOW    DATABASES;
 You will see something like this-
 DROP   DATABASE [IF EXISTS]
  database_name;
 Example : Suppose I want to delete the
  quiz database :
 So the query will be
  DROP DATABASE IF EXISTS Quiz;
 We  have created Database in MySQL.
 Now we will store data in Database.
 We store data in Tabular format in MySQL.
 That means we have to create tables to
  store data.
 CREATE   TABLE [IF NOT EXISTS]
 table_name( column_list
  ) type=table_type

 Example: Suppose I want to create table
 named “User_Password”
Query will be:
 CREATE TABLE USER_PASSWORD(
         username varchar(6),
         password varchar(6)
 );

  Username(varchar(6))   Password(varchar(6))
 To
   see the created table in the database
 use query

 SHOW TABLES;

 To
   see the description of a particular table
 use query

 DESCRIBE table_name;
 INSERT INTO tbl_name () VALUES();
 Example:
  • INSERT INTO USER_PASSWORD
    VALUES(„0705001‟,‟123456‟);
  • INSERT INTO USER_PASSWORD
    VALUES(„0705002‟,‟678901‟);
    Username(varchar(6))   Password(varchar(6))
    0705001                123456
    0705002                678901
 Alter  table is used to change the structure
  of the table
 Suppose we forgot to add a column in the
  USER_PASSWORD table.
 Now we want to add a column name „type‟
  in that table
 ALTER
      TABLE USER_PASSWORD
 ADD COLUMN TYPE VARCHAR(5);

Using ALTER TABLE query:
 • We can also drop column
 • Rename the table
 • Change the properties of a column
 SELECT  column_name1,column_name2...
 FROM tables [WHERE conditions]
 [GROUP BY group [HAVING
 group_conditions]] [ORDER BY
 sort_columns] [LIMIT limits];

 Looking   very complex 
 Mostsimple select statement
 SELECT * FROM table_name;
  • It selects the whole table;


 SELECT     COLUMN_NAME FROM TABLE
  • Example:
   SELECT USERNAME,TYPE FROM
   USER_PASSWORD;
 We do not always want to select the whole
 table .Most of the time part of a table.

 Example:
  • SELECT PASSWORD,TYPE FROM
   USER_PASSWORD WHERE USERNAME =
   „0705001‟;
 Primary  key is used to distinguish two rows
  in a table.
 Now if I execute
     INSERT INTO USER_PASSWORD
     VALUES(„0705001‟,‟hello‟);
     Username(varchar(6))   Password(varchar(6))

     0705001                123456

     0705001                hello

     0705002                678901
 Big  problem.
 One user two passwords. :O
 We can avoid it by making USERNAME
  column as primary key.
 By making USERNAME column a primary
  key we ensure that this column will have
  all distinct value.
CREATE TABLE USER_PASSWORD(
      username varchar(6),
      password varchar(6),
     PRIMARY KEY (USERNAME)
 );
 Used  to change data in the table.
 UPDATE table_name SET column_name
  =
   value WHERE (Some condition is true);

 Suppose 0705001 wants to change his/her
 password. The query will be :

 UPDATE USER_PASSWORD SET
 PASSWORD = „1234‟ WHERE
 USERNAME = „0705001‟;
 Usedto delete data in the table.
 DELETE FROM table_name WHERE
  (Some condition is true);

 Suppose we want to throw out an
 user(0*0*200) from our Database !!!

 DELTE FROM USER_PASSWORD
 WHERE USERNAME = „0*0*200‟;
 These   were very basic database queries.

 Don‟t be worried if you did not understand
 all the topics.

 You will learn all this and many other
 features in 3-1.
THANK YOU

Más contenido relacionado

La actualidad más candente

Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Colin O'Dell
 
DBD::SQLite
DBD::SQLiteDBD::SQLite
DBD::SQLitecharsbar
 
SQLite in Adobe AIR
SQLite in Adobe AIRSQLite in Adobe AIR
SQLite in Adobe AIRPeter Elst
 
Scrap your query boilerplate with specql
Scrap your query boilerplate with specqlScrap your query boilerplate with specql
Scrap your query boilerplate with specqlTatu Tarvainen
 
Avinash database
Avinash databaseAvinash database
Avinash databaseavibmas
 
Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016Colin O'Dell
 
Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Hacking Your Way To Better Security - DrupalCon Baltimore 2017Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Hacking Your Way To Better Security - DrupalCon Baltimore 2017Colin O'Dell
 
2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQLHung-yu Lin
 
FYBSC IT Web Programming Unit V Advanced PHP and MySQL
FYBSC IT Web Programming Unit V  Advanced PHP and MySQLFYBSC IT Web Programming Unit V  Advanced PHP and MySQL
FYBSC IT Web Programming Unit V Advanced PHP and MySQLArti Parab Academics
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax pluginsInbal Geffen
 
Creating, altering and dropping tables
Creating, altering and dropping tablesCreating, altering and dropping tables
Creating, altering and dropping tablespunu_82
 
Propel sfugmd
Propel sfugmdPropel sfugmd
Propel sfugmdiKlaus
 
SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Languageelliando dias
 
Casting for not so strange actors
Casting for not so strange actorsCasting for not so strange actors
Casting for not so strange actorszucaritask
 

La actualidad más candente (19)

PHP with MYSQL
PHP with MYSQLPHP with MYSQL
PHP with MYSQL
 
Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016
 
DBD::SQLite
DBD::SQLiteDBD::SQLite
DBD::SQLite
 
Mysql Ppt
Mysql PptMysql Ppt
Mysql Ppt
 
SQLite in Adobe AIR
SQLite in Adobe AIRSQLite in Adobe AIR
SQLite in Adobe AIR
 
Scrap your query boilerplate with specql
Scrap your query boilerplate with specqlScrap your query boilerplate with specql
Scrap your query boilerplate with specql
 
Avinash database
Avinash databaseAvinash database
Avinash database
 
Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016
 
Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Hacking Your Way To Better Security - DrupalCon Baltimore 2017Hacking Your Way To Better Security - DrupalCon Baltimore 2017
Hacking Your Way To Better Security - DrupalCon Baltimore 2017
 
2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL
 
FYBSC IT Web Programming Unit V Advanced PHP and MySQL
FYBSC IT Web Programming Unit V  Advanced PHP and MySQLFYBSC IT Web Programming Unit V  Advanced PHP and MySQL
FYBSC IT Web Programming Unit V Advanced PHP and MySQL
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
 
Creating, altering and dropping tables
Creating, altering and dropping tablesCreating, altering and dropping tables
Creating, altering and dropping tables
 
Propel sfugmd
Propel sfugmdPropel sfugmd
Propel sfugmd
 
My sql1
My sql1My sql1
My sql1
 
SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Language
 
Sql alchemy bpstyle_4
Sql alchemy bpstyle_4Sql alchemy bpstyle_4
Sql alchemy bpstyle_4
 
SQL Sort Notes
SQL Sort NotesSQL Sort Notes
SQL Sort Notes
 
Casting for not so strange actors
Casting for not so strange actorsCasting for not so strange actors
Casting for not so strange actors
 

Destacado

Take Full Advantage of the Oracle PL/SQL Compiler
Take Full Advantage of the Oracle PL/SQL CompilerTake Full Advantage of the Oracle PL/SQL Compiler
Take Full Advantage of the Oracle PL/SQL CompilerSteven Feuerstein
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to databaseshukriyah
 
A short introduction to database systems.ppt
A short introduction to  database systems.pptA short introduction to  database systems.ppt
A short introduction to database systems.pptMuruly Krishan
 
Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)Vidyasagar Mundroy
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to databaseEsmatullah Adel
 
Realm of the Mobile Database: an introduction to Realm
Realm of the Mobile Database: an introduction to RealmRealm of the Mobile Database: an introduction to Realm
Realm of the Mobile Database: an introduction to RealmMartin Grider
 
Introduction to database_software
Introduction to database_softwareIntroduction to database_software
Introduction to database_softwarePeah J Jambu
 
Introduction to Database system
Introduction to Database systemIntroduction to Database system
Introduction to Database systemPutu Sundika
 
Oracle Database Introduction
Oracle Database IntroductionOracle Database Introduction
Oracle Database IntroductionChhom Karath
 
The Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result CacheThe Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result CacheSteven Feuerstein
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sqlzahid6
 
utPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLutPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLSteven Feuerstein
 
PHP mysql Introduction database
 PHP mysql  Introduction database PHP mysql  Introduction database
PHP mysql Introduction databaseMudasir Syed
 
Session 01 introduction to database and database management
Session 01 introduction to database and database managementSession 01 introduction to database and database management
Session 01 introduction to database and database managementrbulalakaw
 
Database introduction
Database introductionDatabase introduction
Database introductionHarry Potter
 
Database management systems
Database management systemsDatabase management systems
Database management systemsJoel Briza
 

Destacado (20)

Take Full Advantage of the Oracle PL/SQL Compiler
Take Full Advantage of the Oracle PL/SQL CompilerTake Full Advantage of the Oracle PL/SQL Compiler
Take Full Advantage of the Oracle PL/SQL Compiler
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 
A short introduction to database systems.ppt
A short introduction to  database systems.pptA short introduction to  database systems.ppt
A short introduction to database systems.ppt
 
Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 
Realm of the Mobile Database: an introduction to Realm
Realm of the Mobile Database: an introduction to RealmRealm of the Mobile Database: an introduction to Realm
Realm of the Mobile Database: an introduction to Realm
 
Introduction to database_software
Introduction to database_softwareIntroduction to database_software
Introduction to database_software
 
Introduction to Database system
Introduction to Database systemIntroduction to Database system
Introduction to Database system
 
Oracle Database Introduction
Oracle Database IntroductionOracle Database Introduction
Oracle Database Introduction
 
Database
DatabaseDatabase
Database
 
The Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result CacheThe Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result Cache
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
utPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLutPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQL
 
database
databasedatabase
database
 
PHP mysql Introduction database
 PHP mysql  Introduction database PHP mysql  Introduction database
PHP mysql Introduction database
 
Session 01 introduction to database and database management
Session 01 introduction to database and database managementSession 01 introduction to database and database management
Session 01 introduction to database and database management
 
Database introduction
Database introductionDatabase introduction
Database introduction
 
Database an introduction
Database an introductionDatabase an introduction
Database an introduction
 
Database management systems
Database management systemsDatabase management systems
Database management systems
 
Oracle: PLSQL Introduction
Oracle: PLSQL IntroductionOracle: PLSQL Introduction
Oracle: PLSQL Introduction
 

Similar a Introduction to database

My sql presentation
My sql presentationMy sql presentation
My sql presentationNikhil Jain
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfChapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfTamiratDejene1
 
Intro To TSQL - Unit 1
Intro To TSQL - Unit 1Intro To TSQL - Unit 1
Intro To TSQL - Unit 1iccma
 
database-querry-student-note
database-querry-student-notedatabase-querry-student-note
database-querry-student-noteLeerpiny Makouach
 
SQL Create Database.pptx
SQL Create Database.pptxSQL Create Database.pptx
SQL Create Database.pptxkulmiye2
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developerAhsan Kabir
 
SQL Fundamentals - Lecture 2
SQL Fundamentals - Lecture 2SQL Fundamentals - Lecture 2
SQL Fundamentals - Lecture 2MuhammadWaheed44
 
Intro to tsql unit 1
Intro to tsql   unit 1Intro to tsql   unit 1
Intro to tsql unit 1Syed Asrarali
 
working with database using mysql
working with database using mysql working with database using mysql
working with database using mysql Subhasis Nayak
 
Php, mysq lpart5(mysql)
Php, mysq lpart5(mysql)Php, mysq lpart5(mysql)
Php, mysq lpart5(mysql)Subhasis Nayak
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETEAbrar ali
 

Similar a Introduction to database (20)

My sql presentation
My sql presentationMy sql presentation
My sql presentation
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfChapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdf
 
Msql
Msql Msql
Msql
 
Intro To TSQL - Unit 1
Intro To TSQL - Unit 1Intro To TSQL - Unit 1
Intro To TSQL - Unit 1
 
database-querry-student-note
database-querry-student-notedatabase-querry-student-note
database-querry-student-note
 
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
 
MYSQL
MYSQLMYSQL
MYSQL
 
MySQL for beginners
MySQL for beginnersMySQL for beginners
MySQL for beginners
 
create database.pptx
create database.pptxcreate database.pptx
create database.pptx
 
SQL Create Database.pptx
SQL Create Database.pptxSQL Create Database.pptx
SQL Create Database.pptx
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developer
 
SQL Fundamentals - Lecture 2
SQL Fundamentals - Lecture 2SQL Fundamentals - Lecture 2
SQL Fundamentals - Lecture 2
 
Intro to tsql unit 1
Intro to tsql   unit 1Intro to tsql   unit 1
Intro to tsql unit 1
 
working with database using mysql
working with database using mysql working with database using mysql
working with database using mysql
 
Php, mysq lpart5(mysql)
Php, mysq lpart5(mysql)Php, mysq lpart5(mysql)
Php, mysq lpart5(mysql)
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 
MySQL Basics
MySQL BasicsMySQL Basics
MySQL Basics
 
Sah
SahSah
Sah
 
MySQL Introduction
MySQL IntroductionMySQL Introduction
MySQL Introduction
 
Database
Database Database
Database
 

Último

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
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
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
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
 
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
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
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
 

Último (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
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
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
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...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
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
 
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
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
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
 

Introduction to database

  • 1.
  • 2.  In our programs we use variables to store information.  But when our program terminates all the variables declared in it disappear.  Why this happens????
  • 3.  What if we need some information to be stored even after the termination of program. (We are here in this session for this need).  How can we fulfill this need?  Any suggestion……..
  • 4.  The most simple solution is store the information in the disk.  Now the question is how we can store in disk.  Create a file and store there.(simple enough)  Is it a good solution or the best solution ?
  • 5.
  • 6.  Suppose we want to implement the log in section.(feature 1)  We use a file and store the user_id and password in the following manner
  • 7.  When 1105120 wants to log in we have to check all the previous record.  Also we have to check whether multiple users are accessing the file.  Any more problem………….
  • 8.  So we need to care about a lot of facts beside storing, updating the file.  But we are lazy people. We always want to minimize our task.(At least me!)  Thank GOD there are some applications or Systems which handle the facts about which we were worried 
  • 9.  And they are called DataBase Management System(DBMS). • Oracle • IBM DB2 • Microsoft SQL Server • Microsoft Access • PostgreSQL • MySQL • SQLite
  • 10.  But not all our problems have been solved.   Why???  Because now we have to learn how to maintain Database using DBMS .  Here we will see how to manage database using MySQL.
  • 11.  CREATE DATABASE [IF NOT EXISTS] database_name;  Example: Suppose I want to create a database named “Quiz”.  So the query will be CREATE DATABASE IF NOT EXISTS QUIZ;
  • 12.  SHOW DATABASES;  You will see something like this-
  • 13.  DROP DATABASE [IF EXISTS] database_name;  Example : Suppose I want to delete the quiz database :  So the query will be DROP DATABASE IF EXISTS Quiz;
  • 14.
  • 15.  We have created Database in MySQL.  Now we will store data in Database.  We store data in Tabular format in MySQL.  That means we have to create tables to store data.
  • 16.  CREATE TABLE [IF NOT EXISTS] table_name( column_list ) type=table_type Example: Suppose I want to create table named “User_Password”
  • 17. Query will be: CREATE TABLE USER_PASSWORD( username varchar(6), password varchar(6) ); Username(varchar(6)) Password(varchar(6))
  • 18.  To see the created table in the database use query SHOW TABLES;  To see the description of a particular table use query DESCRIBE table_name;
  • 19.  INSERT INTO tbl_name () VALUES();  Example: • INSERT INTO USER_PASSWORD VALUES(„0705001‟,‟123456‟); • INSERT INTO USER_PASSWORD VALUES(„0705002‟,‟678901‟); Username(varchar(6)) Password(varchar(6)) 0705001 123456 0705002 678901
  • 20.  Alter table is used to change the structure of the table  Suppose we forgot to add a column in the USER_PASSWORD table.  Now we want to add a column name „type‟ in that table
  • 21.  ALTER TABLE USER_PASSWORD ADD COLUMN TYPE VARCHAR(5); Using ALTER TABLE query: • We can also drop column • Rename the table • Change the properties of a column
  • 22.  SELECT column_name1,column_name2... FROM tables [WHERE conditions] [GROUP BY group [HAVING group_conditions]] [ORDER BY sort_columns] [LIMIT limits];  Looking very complex 
  • 23.  Mostsimple select statement  SELECT * FROM table_name; • It selects the whole table;  SELECT COLUMN_NAME FROM TABLE • Example: SELECT USERNAME,TYPE FROM USER_PASSWORD;
  • 24.  We do not always want to select the whole table .Most of the time part of a table.  Example: • SELECT PASSWORD,TYPE FROM USER_PASSWORD WHERE USERNAME = „0705001‟;
  • 25.  Primary key is used to distinguish two rows in a table.  Now if I execute INSERT INTO USER_PASSWORD VALUES(„0705001‟,‟hello‟); Username(varchar(6)) Password(varchar(6)) 0705001 123456 0705001 hello 0705002 678901
  • 26.  Big problem.  One user two passwords. :O  We can avoid it by making USERNAME column as primary key.  By making USERNAME column a primary key we ensure that this column will have all distinct value.
  • 27. CREATE TABLE USER_PASSWORD( username varchar(6), password varchar(6), PRIMARY KEY (USERNAME) );
  • 28.  Used to change data in the table.  UPDATE table_name SET column_name = value WHERE (Some condition is true); Suppose 0705001 wants to change his/her password. The query will be : UPDATE USER_PASSWORD SET PASSWORD = „1234‟ WHERE USERNAME = „0705001‟;
  • 29.  Usedto delete data in the table.  DELETE FROM table_name WHERE (Some condition is true); Suppose we want to throw out an user(0*0*200) from our Database !!! DELTE FROM USER_PASSWORD WHERE USERNAME = „0*0*200‟;
  • 30.  These were very basic database queries.  Don‟t be worried if you did not understand all the topics.  You will learn all this and many other features in 3-1.