SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

Subqueries, Backups, Users and Privileges
Subqueries, Backups, Users and PrivilegesSubqueries, Backups, Users and Privileges
Subqueries, Backups, Users and Privileges
Ashwin Dinoriya
 
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
pandey3045_bit
 

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

Similar to Sql 2006

SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SaiMiryala1
 
Sql intro
Sql introSql intro
Sql intro
glubox
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
Reka
 
Sql overview-1232931296681161-1
Sql overview-1232931296681161-1Sql overview-1232931296681161-1
Sql overview-1232931296681161-1
sagaroceanic11
 

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

More from Cathie101

Page Layout 2010
Page Layout 2010Page Layout 2010
Page Layout 2010
Cathie101
 
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
Cathie101
 
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
Cathie101
 
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
Cathie101
 
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
Cathie101
 
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
Cathie101
 
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
Cathie101
 
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
Cathie101
 
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
Cathie101
 
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
Cathie101
 
Dynamic Web Pages 2009v2.1
Dynamic Web Pages 2009v2.1Dynamic Web Pages 2009v2.1
Dynamic Web Pages 2009v2.1
Cathie101
 
Database Fdd
Database FddDatabase Fdd
Database Fdd
Cathie101
 
Sql All Tuts 2009
Sql All Tuts 2009Sql All Tuts 2009
Sql All Tuts 2009
Cathie101
 
Database Fdd
Database FddDatabase Fdd
Database Fdd
Cathie101
 
Database Design E R 2009
Database Design E R 2009Database Design E R 2009
Database Design E R 2009
Cathie101
 
Database Design Fdd 2009
Database Design Fdd 2009Database Design Fdd 2009
Database Design Fdd 2009
Cathie101
 
Database Design E R 2009
Database Design E R 2009Database Design E R 2009
Database Design E R 2009
Cathie101
 

More from 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
 

Recently uploaded

The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
heathfieldcps1
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
Krashi Coaching
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
中 央社
 

Recently uploaded (20)

How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Championnat de France de Tennis de table/
Championnat de France de Tennis de table/Championnat de France de Tennis de table/
Championnat de France de Tennis de table/
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
“O BEIJO” EM ARTE .
“O BEIJO” EM ARTE                       .“O BEIJO” EM ARTE                       .
“O BEIJO” EM ARTE .
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 

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.

Editor's Notes

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