SlideShare ist ein Scribd-Unternehmen logo
1 von 56
SQL 2006 By  Cathie Usher
SQL
Introduction to SQL SQL stands for Structured Query Language In simple terms it is a universal language that permits the construction of tables and the manipulation of Data that lies within a table. SQL is extensively used in many areas of industry and is fast becoming the backbone of Internet display and functionality. In this section we concentrate on the construction and population of tables. This area is referred as the Data Definition Language of SQL (DDL). The following 2 sections concentrate on Data Manipulation Language (DML) where we do the actual queries. You will also be required to create tables yourself and perform some fundamental exercises in the Tutorials.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Introduction to SQL
Structured Query Language (SQL) ,[object Object],[object Object],[object Object],[object Object]
Vocabulary The following terminologies are used in this area of SQL
DML, DDL and Transaction Control ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Common Data Types ,[object Object],Numeric NUMBER(L,D) Oracle INTEGER ANSI SMALLINT ANSI DECIMAL(L,D) ANSI Character CHAR(L) Oracle VARCHAR2(L) Oracle Date DATE Oracle Data Type Format  Standard
Values allowed by data types ,[object Object],[object Object],[object Object],[object Object],[object Object],Here is a list of the values that are allowed and the method of predefining them.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Data Definition Commands It is critical when creating the tables that we define the Primary and Foreign Keys as displayed on the Database Schema and the consequential Network diagram.
Creating a Table  (1)   ,[object Object],[object Object],[object Object]
Creating a Table  (1) sql>  CREATE TABLE DEPARTMENT (DEPT_CODE CHAR(1) NOT NULL, DNAME VARCHAR(25)  NOT NULL, MAIL_NO CHAR(2) NOT NULL, PRIMARY KEY (DEPT_CODE));
Creating the Table  (2) sql>  CREATE TABLE EMPLOYEE (EMP_ID CHAR(3) NOT NULL, ENAME VARCHAR(25) NOT NULL, DEPT CHAR(1) NOT NULL, MANAGER CHAR(3), DATE_JOINED DATE, DOB DATE, PRIMARY KEY (EMP_ID), FOREIGN KEY (MANAGER) REFERENCES EMPLOYEE, FOREIGN KEY (DEPT) REFERENCE DEPARTMENT); Note: This table cannot be created until the Department table has been created, as it references the Department table.
SQL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Result Set ,[object Object],[object Object],[object Object],[object Object],[object Object]
SELECT item list FROM table-name ,[object Object],[object Object],[object Object],Output Col Sequence SQL statement " SELECT name AS "Employee Name", salary FROM emplo " SELECT name, (salary  *  1.1) "New_Salary" FROM emplo " SELECT name, (salary  *  1.1) FROM employee In item-list sequence SELECT name, salary, salary  *  1.1 FROM employee As listed in table def SELECT  *  FROM employee In item-list sequence SELECT empno, salary, name FROM employee In item-list sequence SELECT empno, name, salary FROM employee
Select Distinct ,[object Object],[object Object],[object Object],[object Object],SELECT DISTINCT  firstname, dept FROM … SELECT DISTINCT dept FROM employee 1 Jones Ted John Ted Ted firstname 1 Jones 2 Jones 1 Smith dept surname 1 John Ted Ted firstname 2 1 dept 2 1 dept
Order By ,[object Object],[object Object],[object Object],[object Object],[object Object]
Order By ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
WHERE clause ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data Types ,[object Object],[object Object],[object Object],[object Object],[object Object]
Data Types ,[object Object],[object Object]
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Activity ,[object Object]
Multiple criteria in the Where   Clause ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],10000 0 20000 30000 40000 > 20000 < 30000 AND includes range  common  to both lines OR includes range covered by either line
And Operator ,[object Object],[object Object],[object Object],[object Object],[object Object],FALSE FALSE Condition 2 False FALSE TRUE Condition 2 True Condition 1 False Condition 1 True AND FALSE M 18 FALSE F 19 M F Sex Result Age TRUE 22 FALSE 21
OR Operator ,[object Object],[object Object],[object Object],[object Object],[object Object],FALSE TRUE Condition 2 False TRUE TRUE Condition 2 True Condition 1 False Condition 1 True OR TRUE M 18 FALSE F 19 M F Sex Result Age TRUE 22 TRUE 21
Multiple operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],171 Height 86 Weight F 24 Sex Age 183 Height 93 Weight M 24 Sex Age
ANDs and ORs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],180 Height M 24 Sex Age 180 Height M 21 Sex Age
Parentheses   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
NOT   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],FALSE 17 TRUE 24 RESULT AGE TRUE 17 FALSE 24 RESULT AGE 17 24 RESULT AGE
Special Operators   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Constraints ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]
tablename.columnname and aliases ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
FROM with multiple tables ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SQL JOIN ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Effects of a missing Join ,[object Object],BRANCH RESULT SET EMPLOYEE 55000 37500 48000 Salary Hawthorn Box Hill Hawthorn Branch 345 119 207 EmpNo Carol Kent Jane Pitt John Smith Name 1 John St 1 Station St BranchAddr Hawthorn Box Hill Branch 1 Station St Box Hill 55000 Hawthorn Carol Kent 345 1 John St Hawthorn 37500 Box Hill Jane Pitt 119 1 John St Hawthorn 48000 Hawthorn John Smith 207 55000 37500 48000 Salary Hawthorn Box Hill Box Hill BranchCode 1 John St 1 Station St 1 Station St BranchAddr Hawthorn Box Hill Hawthorn Branch 345 119 207 EmpNo Carol Kent Jane Pitt John Smith Name
Multiple Foreign Keys ,[object Object],EMPLOYEE BRANCH DEPARTMENT 55000 37500 48000 Salary 2 2 1 Dept Hawthorn Box Hill Kew Branch 345 119 207 EmpNo Carol Kent Jane Pitt John Smith Name 1 High St 1 John St 1 Station St BranchAddr Kew Hawthorn Box Hill Branch 9999-1234 9999-2222 9999-5678 BranchPh Reception Admin Sales DeptDescr 3 2 1 DeptCode
SQL JOIN (a table with 2 foreign keys) ,[object Object],[object Object],[object Object],[object Object],[object Object],RESULT SET Joins employee to branch Joins employee to department Admin Sales deptdescr Hawthorn Kew branch 55000 48000 Salary 9999-2222 9999-1234 BranchPh 345 207 EmpNo Carol Kent John Smith Name
Multiple Foreign Keys (2) ,[object Object],EMPLOYEE BRANCH REGION 75000 37500 48000 Salary Penrith Box Hill Kew Branch 667 119 207 EmpNo John Dill Jane Pitt John Smith Name 1 Puckle St 1 John St 1 High St BranchAddr Penrith Hawthorn Kew Branch SW ME ME Region Sydney West Melbourne East RegionDescr SW ME RegionCode
SQL JOIN (3 tables each with a   FK ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],RESULT SET Joins employee to branch Joins branch to region Sydney West Melbourne East RegionDescr John Dill John Smith Name
Drop Table ,[object Object],[object Object],[object Object],[object Object],[object Object]
DELETE records ,[object Object],[object Object],[object Object],[object Object],[object Object]
COUNT ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SUM , AVERAGE , MAX , MIN ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
GROUP BY ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],ordnumb  Sum 12489 164.45 12491 714.94 12494 700.00 12495 115.90 12498 65.70 12500 402.99 12504 217.98
GROUP BY rules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],wrhsnumb itemclss count 1 SG 2 2 AP 1 2 SG 2 3 AP 1 3 HW 4 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Part Table Result Set Part Table
HAVING ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],wrhsnumb itemclss count 1 SG 2 2 AP 1 2 SG 2 3 AP 1 3 HW 4
Review ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sub Queries ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sub Query Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dates & related functions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
References ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Self Joins ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],EMPLOYEE Column Heading Same table – 2 aliases 543 37500 Jane Pitt 119 543 55000 Carol Kent 345 70000 48000 Salary ┴ 543 Manager 543 207 EmpNo Dave Bligh John Smith Name
Inner Joins ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],ordnumb  partnumb numbord partdesc 12489    AX12 11 IRON  12491   BT04 1 STOVE  12491  BZ66 1 WASHER  12494  CB03 4 BIKE  12495  CX11 2 MIXER  12498   AZ52 2 SKATES  12498   BA74 4 BASEBALL 12500   BT04 1 STOVE  12504   CZ81 2 WEIGHTS

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (19)

Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Sql server T-sql basics ppt-3
Sql server T-sql basics  ppt-3Sql server T-sql basics  ppt-3
Sql server T-sql basics ppt-3
 
Sql commands
Sql commandsSql commands
Sql commands
 
Subqueries, Backups, Users and Privileges
Subqueries, Backups, Users and PrivilegesSubqueries, Backups, Users and Privileges
Subqueries, Backups, Users and Privileges
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Xml part4
Xml part4Xml part4
Xml part4
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)
 
SQL- Introduction to PL/SQL
SQL- Introduction to  PL/SQLSQL- Introduction to  PL/SQL
SQL- Introduction to PL/SQL
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionIntro to T-SQL – 2nd session
Intro to T-SQL – 2nd session
 
Chapter 07 ddl_sql
Chapter 07 ddl_sqlChapter 07 ddl_sql
Chapter 07 ddl_sql
 
Sql
SqlSql
Sql
 
SQL Assessment Command Statements
SQL Assessment Command StatementsSQL Assessment Command Statements
SQL Assessment Command Statements
 
A must Sql notes for beginners
A must Sql notes for beginnersA must Sql notes for beginners
A must Sql notes for beginners
 
Module 3
Module 3Module 3
Module 3
 
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
Ch05
Ch05Ch05
Ch05
 

Ähnlich wie Sql 2006

Learning sql from w3schools
Learning sql from w3schoolsLearning sql from w3schools
Learning sql from w3schoolsfarhan516
 
Basic SQL Statments
Basic SQL StatmentsBasic SQL Statments
Basic SQL StatmentsUmair Shakir
 
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSabrinaShanta2
 
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSaiMiryala1
 
Sql intro
Sql introSql intro
Sql introglubox
 
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxBhupendraShahi6
 
Mysqlppt
MysqlpptMysqlppt
MysqlpptReka
 
Data Manipulation Language.pptx
Data Manipulation Language.pptxData Manipulation Language.pptx
Data Manipulation Language.pptxEllenGracePorras
 
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDSORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDSNewyorksys.com
 
Sql overview-1232931296681161-1
Sql overview-1232931296681161-1Sql overview-1232931296681161-1
Sql overview-1232931296681161-1sagaroceanic11
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETEAbrar ali
 

Ähnlich wie Sql 2006 (20)

Dbms
DbmsDbms
Dbms
 
ORACLE PL SQL
ORACLE PL SQLORACLE PL SQL
ORACLE PL SQL
 
Learning sql from w3schools
Learning sql from w3schoolsLearning sql from w3schools
Learning sql from w3schools
 
SQL Query
SQL QuerySQL Query
SQL Query
 
Select To Order By
Select  To  Order BySelect  To  Order By
Select To Order By
 
Basic SQL Statments
Basic SQL StatmentsBasic SQL Statments
Basic SQL Statments
 
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
 
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
 
Db1 lecture4
Db1 lecture4Db1 lecture4
Db1 lecture4
 
Sql intro
Sql introSql intro
Sql intro
 
Sql
SqlSql
Sql
 
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Data Manipulation Language.pptx
Data Manipulation Language.pptxData Manipulation Language.pptx
Data Manipulation Language.pptx
 
012. SQL.pdf
012. SQL.pdf012. SQL.pdf
012. SQL.pdf
 
Lab
LabLab
Lab
 
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDSORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
 
Sql overview-1232931296681161-1
Sql overview-1232931296681161-1Sql overview-1232931296681161-1
Sql overview-1232931296681161-1
 
lovely
lovelylovely
lovely
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 

Mehr von Cathie101

Page Layout 2010
Page Layout 2010Page Layout 2010
Page Layout 2010Cathie101
 
Dynamic Web Pages Ch 8 V1.0
Dynamic Web Pages Ch 8 V1.0Dynamic Web Pages Ch 8 V1.0
Dynamic Web Pages Ch 8 V1.0Cathie101
 
Dynamic Web Pages Ch 6 V1.0
Dynamic Web Pages Ch 6 V1.0Dynamic Web Pages Ch 6 V1.0
Dynamic Web Pages Ch 6 V1.0Cathie101
 
Dynamic Web Pages Ch 1 V1.0
Dynamic Web Pages Ch 1 V1.0Dynamic Web Pages Ch 1 V1.0
Dynamic Web Pages Ch 1 V1.0Cathie101
 
Dynamic Web Pages Ch 9 V1.0
Dynamic Web Pages Ch 9 V1.0Dynamic Web Pages Ch 9 V1.0
Dynamic Web Pages Ch 9 V1.0Cathie101
 
Dynamic Web Pages Ch 7 V1.0
Dynamic Web Pages Ch 7 V1.0Dynamic Web Pages Ch 7 V1.0
Dynamic Web Pages Ch 7 V1.0Cathie101
 
Dynamic Web Pages Ch 5 V1.0
Dynamic Web Pages Ch 5 V1.0Dynamic Web Pages Ch 5 V1.0
Dynamic Web Pages Ch 5 V1.0Cathie101
 
Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Cathie101
 
Dynamic Web Pages Ch 3 V1.0
Dynamic Web Pages Ch 3 V1.0Dynamic Web Pages Ch 3 V1.0
Dynamic Web Pages Ch 3 V1.0Cathie101
 
Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0Cathie101
 
Dynamic Web Pages 2009v2.1
Dynamic Web Pages 2009v2.1Dynamic Web Pages 2009v2.1
Dynamic Web Pages 2009v2.1Cathie101
 
Database Fdd
Database FddDatabase Fdd
Database FddCathie101
 
Sql All Tuts 2009
Sql All Tuts 2009Sql All Tuts 2009
Sql All Tuts 2009Cathie101
 
Database Fdd
Database FddDatabase Fdd
Database FddCathie101
 
Database Design E R 2009
Database Design E R 2009Database Design E R 2009
Database Design E R 2009Cathie101
 
Database Design Fdd 2009
Database Design Fdd 2009Database Design Fdd 2009
Database Design Fdd 2009Cathie101
 
Database Design E R 2009
Database Design E R 2009Database Design E R 2009
Database Design E R 2009Cathie101
 

Mehr von Cathie101 (20)

Page Layout 2010
Page Layout 2010Page Layout 2010
Page Layout 2010
 
Css 2010
Css 2010Css 2010
Css 2010
 
Xhtml 2010
Xhtml 2010Xhtml 2010
Xhtml 2010
 
Dynamic Web Pages Ch 8 V1.0
Dynamic Web Pages Ch 8 V1.0Dynamic Web Pages Ch 8 V1.0
Dynamic Web Pages Ch 8 V1.0
 
Dynamic Web Pages Ch 6 V1.0
Dynamic Web Pages Ch 6 V1.0Dynamic Web Pages Ch 6 V1.0
Dynamic Web Pages Ch 6 V1.0
 
Dynamic Web Pages Ch 1 V1.0
Dynamic Web Pages Ch 1 V1.0Dynamic Web Pages Ch 1 V1.0
Dynamic Web Pages Ch 1 V1.0
 
Dynamic Web Pages Ch 9 V1.0
Dynamic Web Pages Ch 9 V1.0Dynamic Web Pages Ch 9 V1.0
Dynamic Web Pages Ch 9 V1.0
 
Dynamic Web Pages Ch 7 V1.0
Dynamic Web Pages Ch 7 V1.0Dynamic Web Pages Ch 7 V1.0
Dynamic Web Pages Ch 7 V1.0
 
Dynamic Web Pages Ch 5 V1.0
Dynamic Web Pages Ch 5 V1.0Dynamic Web Pages Ch 5 V1.0
Dynamic Web Pages Ch 5 V1.0
 
Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0
 
Dynamic Web Pages Ch 3 V1.0
Dynamic Web Pages Ch 3 V1.0Dynamic Web Pages Ch 3 V1.0
Dynamic Web Pages Ch 3 V1.0
 
Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0Dynamic Web Pages Ch 2 V1.0
Dynamic Web Pages Ch 2 V1.0
 
Dynamic Web Pages 2009v2.1
Dynamic Web Pages 2009v2.1Dynamic Web Pages 2009v2.1
Dynamic Web Pages 2009v2.1
 
Database Fdd
Database FddDatabase Fdd
Database Fdd
 
Sql All Tuts 2009
Sql All Tuts 2009Sql All Tuts 2009
Sql All Tuts 2009
 
Database Fdd
Database FddDatabase Fdd
Database Fdd
 
Database Er
Database ErDatabase Er
Database Er
 
Database Design E R 2009
Database Design E R 2009Database Design E R 2009
Database Design E R 2009
 
Database Design Fdd 2009
Database Design Fdd 2009Database Design Fdd 2009
Database Design Fdd 2009
 
Database Design E R 2009
Database Design E R 2009Database Design E R 2009
Database Design E R 2009
 

Kürzlich hochgeladen

Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 

Kürzlich hochgeladen (20)

Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 

Sql 2006

  • 1. SQL 2006 By Cathie Usher
  • 2. SQL
  • 3. Introduction to SQL SQL stands for Structured Query Language In simple terms it is a universal language that permits the construction of tables and the manipulation of Data that lies within a table. SQL is extensively used in many areas of industry and is fast becoming the backbone of Internet display and functionality. In this section we concentrate on the construction and population of tables. This area is referred as the Data Definition Language of SQL (DDL). The following 2 sections concentrate on Data Manipulation Language (DML) where we do the actual queries. You will also be required to create tables yourself and perform some fundamental exercises in the Tutorials.
  • 4.
  • 5.
  • 6. Vocabulary The following terminologies are used in this area of SQL
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. Creating a Table (1) sql> CREATE TABLE DEPARTMENT (DEPT_CODE CHAR(1) NOT NULL, DNAME VARCHAR(25) NOT NULL, MAIL_NO CHAR(2) NOT NULL, PRIMARY KEY (DEPT_CODE));
  • 13. Creating the Table (2) sql> CREATE TABLE EMPLOYEE (EMP_ID CHAR(3) NOT NULL, ENAME VARCHAR(25) NOT NULL, DEPT CHAR(1) NOT NULL, MANAGER CHAR(3), DATE_JOINED DATE, DOB DATE, PRIMARY KEY (EMP_ID), FOREIGN KEY (MANAGER) REFERENCES EMPLOYEE, FOREIGN KEY (DEPT) REFERENCE DEPARTMENT); Note: This table cannot be created until the Department table has been created, as it references the Department table.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.

Hinweis der Redaktion

  1. 4
  2. 4
  3. 14
  4. tkjgjmmg. dghh dfhdfh dfhdhgdf