SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Introduction to Windows
Phone & Database
Session 6#
1
2
3
4
5
Discussion on your apps
Introduction to Database
What’s DBMS
SQL Database Manipulation
Exercises
Agenda
Your Apps
Your Apps
Your Apps
Your Apps
 Pros
 Readable Code
 Didn’t fail any test case
 Simple interface
 Cons
 Very abstract interface ( Not impressive )
Score 7 / 10
Your Apps
Your Apps
 Pros
 Readable Code
 Didn’t fail any test case
 Simple interface
 Cons
 Non matching colors
 Some parts in the layout are not responsive
Score 6.5 / 10
Your Apps
Your Apps
 Pros
 Readable Code
 Didn’t fail any test case
 Simple interface
 Cons
 Non matching colors
 Not responsive
Score 5.5 / 10
Your apps
Your Apps
 Pros
 Readable Code
 All test cases passed
 Elegant interface
 Cons
 Some components are responsive and some are not
Score 7 / 10
Your Apps
Your Apps
 Pros
 Readable Code
 Failed a test case ( Only one ) 
 Elegant interface
 Developed more functionalities
 Cons
 One of his extra functionalities produces wrong output
 His design is not creative
 Over handling to exception that will never happen (Long code)
Score 8 / 10
Your Apps
Your Apps
 Pros
 Readable Code
 All test cases passed
 Creative interface
 Cons
 Some components are responsive and some are not
Score 8 / 10
What is Database
 A structured set of data held in a computer, especially one that is
accessible in various ways.
Types of database
Database Management System
 A database management system (DBMS) is system software for creating and
managing databases.
 The DBMS provides users and programmers with a systematic way to
 Create
 Read
 Update
 Manage data
Data manipulation
Structured Query Language
 Structured Query Language (SQL) is a standard
computer language for relational database management and data
manipulation.
 SQL is used to query, insert, update and modify data.
Manipulation level
Database
Tables
Queries
Create
 Database:
CREATE DATABASE DB_name ;
 Table:
 CREATE TABLE table_name(
column1 datatype,
column2 datatype,
..... ,
columnN datatype,
PRIMARY KEY( one or more columns )
);
 Query:
 INSERT INTO TABLE_NAME VALUES (value1, value2,
value3,...valueN);
 INSERT INTO TABLE_NAME (column1, column2,
column3,...columnN) VALUES (value1, value2, value3,...valueN);
Data Types
 CHARACTER [(length)] or CHAR [(length)]
 VARCHAR (length)
 BOOLEAN
 SMALLINT
 INTEGER
 FLOAT
 DATE
 TIME
 BLOB
Read
 Database:
 USE DatabaseName;
 Query:
SELECT column FROM table_name;
SELECT column1, column2, …, columnN FROM table_name;
SELECT * FROM table_name;
Update
 Query:
 UPDATE table_name SET column1 = value1, column2 = value2....,
columnN = valueN WHERE [condition];
Exercise
Delete
 Database:
 DROP DATABASE DatabaseName;
 Table:
 DROP TABLE table_name;
 Query:
 DELETE FROM table_name WHERE condition;
Exercise
Aggregate Functions
 Reference : https://www.w3schools.com/sql/sql_functions.asp
AVG() Returns the average value
COUNT() Returns the number of rows
FIRST() Returns the first value
LAST() Returns the last value
MAX() Returns the largest value
MIN() Returns the smallest value
ROUND() Rounds a numeric field to the number
of decimals specified
SUM() Returns the sum
Examples
 SELECT COUNT(*) FROM table_name;
 The COUNT(*) function returns the number of records in a table:
 SELECT COUNT(column_name) FROM table_name;
 The COUNT(column_name) function returns the number of values
(NULL values will not be counted) of the specified column
 SELECT AVG(column) AS averageOfCol FROM Products;
 Return the average of col and name it averageOfCol
Foreign Key
 A FOREIGN KEY is a key used to link two tables together.
 A FOREIGN KEY in a table points to a PRIMARY KEY in another table.
PersonID LastName FirstName Age
1 Hansen Ola 20
2 Svendson Tove 23
3 Pettersen Kari 21
OrderID OrderNumber PersonID
1 1321312 3
2 2131222 3
3 2311313 1
4 3311233 2
Foreign key
 CREATE TABLE Orders (
OrderID int NOT NULL PRIMARY KEY,
OrderNumber int NOT NULL,
PersonID int,
FOREIGN KEY (PersonID) REFERENCES Persons(PersonID)
);
Dependent Table
 Table with no primary key
 Any record belong to another record in another table
PersonID Last Name First Name Age
1 Mohey Sandra 20
2 Samir Mohamed 23
3 Zakryia Noha 21
PersonID Children Name
1 Hamda Mohey
1 Tamer Mohey
2 Magdy Samir
2 Kenzy Samir
Exercise
Session 6#
Session 6#

Weitere ähnliche Inhalte

Was ist angesagt?

MS SQL Server 1
MS SQL Server 1MS SQL Server 1
MS SQL Server 1
Iblesoft
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)
Nalina Kumari
 
Ms sql server ii
Ms sql server  iiMs sql server  ii
Ms sql server ii
Iblesoft
 

Was ist angesagt? (20)

Sql Basics | Edureka
Sql Basics | EdurekaSql Basics | Edureka
Sql Basics | Edureka
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
SQL Server Learning Drive
SQL Server Learning Drive SQL Server Learning Drive
SQL Server Learning Drive
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
MS SQL Server 1
MS SQL Server 1MS SQL Server 1
MS SQL Server 1
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
 
Relational database management system
Relational database management systemRelational database management system
Relational database management system
 
Sql
SqlSql
Sql
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Ms sql server ii
Ms sql server  iiMs sql server  ii
Ms sql server ii
 
Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
Nota ms access 2007
Nota ms access 2007Nota ms access 2007
Nota ms access 2007
 
Xml part4
Xml part4Xml part4
Xml part4
 
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
 
PostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | EdurekaPostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | Edureka
 
A must Sql notes for beginners
A must Sql notes for beginnersA must Sql notes for beginners
A must Sql notes for beginners
 

Ähnlich wie Session 6#

MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 Course
Marcus Davage
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
Tony Wong
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
SANTOSH RATH
 
BCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdfBCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdf
KeerthanaP37
 

Ähnlich wie Session 6# (20)

Getting Started with SQL Language.pptx
Getting Started with SQL Language.pptxGetting Started with SQL Language.pptx
Getting Started with SQL Language.pptx
 
Sql 2006
Sql 2006Sql 2006
Sql 2006
 
MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 Course
 
Rdbms day3
Rdbms day3Rdbms day3
Rdbms day3
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
Dbms sql-final
Dbms  sql-finalDbms  sql-final
Dbms sql-final
 
Sql for biggner
Sql for biggnerSql for biggner
Sql for biggner
 
ORACLE PL SQL
ORACLE PL SQLORACLE PL SQL
ORACLE PL SQL
 
PO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - SqlPO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - Sql
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Less08 Schema
Less08 SchemaLess08 Schema
Less08 Schema
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
 
Physical Design and Development
Physical Design and DevelopmentPhysical Design and Development
Physical Design and Development
 
lovely
lovelylovely
lovely
 
Les09
Les09Les09
Les09
 
BCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdfBCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdf
 
Module02
Module02Module02
Module02
 

Mehr von Mohamed Samir

Mehr von Mohamed Samir (8)

Fight for the quality of architecture against delivery - JobStack Cegedim
Fight for the quality of architecture against delivery - JobStack Cegedim Fight for the quality of architecture against delivery - JobStack Cegedim
Fight for the quality of architecture against delivery - JobStack Cegedim
 
An evaluation of FaaS platforms as a foundation for serverless big data proce...
An evaluation of FaaS platforms as a foundation for serverless big data proce...An evaluation of FaaS platforms as a foundation for serverless big data proce...
An evaluation of FaaS platforms as a foundation for serverless big data proce...
 
Serverless Computing Model
Serverless Computing ModelServerless Computing Model
Serverless Computing Model
 
Session 5#
Session 5#Session 5#
Session 5#
 
Session 4#
Session 4#Session 4#
Session 4#
 
Session 3#
Session 3#Session 3#
Session 3#
 
Session#2
Session#2Session#2
Session#2
 
Session#1
Session#1Session#1
Session#1
 

Kürzlich hochgeladen

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Kürzlich hochgeladen (20)

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
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
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
 
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...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 

Session 6#

  • 1. Introduction to Windows Phone & Database Session 6#
  • 2. 1 2 3 4 5 Discussion on your apps Introduction to Database What’s DBMS SQL Database Manipulation Exercises Agenda
  • 6. Your Apps  Pros  Readable Code  Didn’t fail any test case  Simple interface  Cons  Very abstract interface ( Not impressive ) Score 7 / 10
  • 8. Your Apps  Pros  Readable Code  Didn’t fail any test case  Simple interface  Cons  Non matching colors  Some parts in the layout are not responsive Score 6.5 / 10
  • 10. Your Apps  Pros  Readable Code  Didn’t fail any test case  Simple interface  Cons  Non matching colors  Not responsive Score 5.5 / 10
  • 12. Your Apps  Pros  Readable Code  All test cases passed  Elegant interface  Cons  Some components are responsive and some are not Score 7 / 10
  • 14. Your Apps  Pros  Readable Code  Failed a test case ( Only one )   Elegant interface  Developed more functionalities  Cons  One of his extra functionalities produces wrong output  His design is not creative  Over handling to exception that will never happen (Long code) Score 8 / 10
  • 16. Your Apps  Pros  Readable Code  All test cases passed  Creative interface  Cons  Some components are responsive and some are not Score 8 / 10
  • 17. What is Database  A structured set of data held in a computer, especially one that is accessible in various ways.
  • 19. Database Management System  A database management system (DBMS) is system software for creating and managing databases.  The DBMS provides users and programmers with a systematic way to  Create  Read  Update  Manage data
  • 21. Structured Query Language  Structured Query Language (SQL) is a standard computer language for relational database management and data manipulation.  SQL is used to query, insert, update and modify data.
  • 23. Create  Database: CREATE DATABASE DB_name ;  Table:  CREATE TABLE table_name( column1 datatype, column2 datatype, ..... , columnN datatype, PRIMARY KEY( one or more columns ) );  Query:  INSERT INTO TABLE_NAME VALUES (value1, value2, value3,...valueN);  INSERT INTO TABLE_NAME (column1, column2, column3,...columnN) VALUES (value1, value2, value3,...valueN);
  • 24. Data Types  CHARACTER [(length)] or CHAR [(length)]  VARCHAR (length)  BOOLEAN  SMALLINT  INTEGER  FLOAT  DATE  TIME  BLOB
  • 25. Read  Database:  USE DatabaseName;  Query: SELECT column FROM table_name; SELECT column1, column2, …, columnN FROM table_name; SELECT * FROM table_name;
  • 26. Update  Query:  UPDATE table_name SET column1 = value1, column2 = value2...., columnN = valueN WHERE [condition];
  • 28. Delete  Database:  DROP DATABASE DatabaseName;  Table:  DROP TABLE table_name;  Query:  DELETE FROM table_name WHERE condition;
  • 30. Aggregate Functions  Reference : https://www.w3schools.com/sql/sql_functions.asp AVG() Returns the average value COUNT() Returns the number of rows FIRST() Returns the first value LAST() Returns the last value MAX() Returns the largest value MIN() Returns the smallest value ROUND() Rounds a numeric field to the number of decimals specified SUM() Returns the sum
  • 31. Examples  SELECT COUNT(*) FROM table_name;  The COUNT(*) function returns the number of records in a table:  SELECT COUNT(column_name) FROM table_name;  The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column  SELECT AVG(column) AS averageOfCol FROM Products;  Return the average of col and name it averageOfCol
  • 32. Foreign Key  A FOREIGN KEY is a key used to link two tables together.  A FOREIGN KEY in a table points to a PRIMARY KEY in another table. PersonID LastName FirstName Age 1 Hansen Ola 20 2 Svendson Tove 23 3 Pettersen Kari 21 OrderID OrderNumber PersonID 1 1321312 3 2 2131222 3 3 2311313 1 4 3311233 2
  • 33. Foreign key  CREATE TABLE Orders ( OrderID int NOT NULL PRIMARY KEY, OrderNumber int NOT NULL, PersonID int, FOREIGN KEY (PersonID) REFERENCES Persons(PersonID) );
  • 34. Dependent Table  Table with no primary key  Any record belong to another record in another table PersonID Last Name First Name Age 1 Mohey Sandra 20 2 Samir Mohamed 23 3 Zakryia Noha 21 PersonID Children Name 1 Hamda Mohey 1 Tamer Mohey 2 Magdy Samir 2 Kenzy Samir