Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to SQL Steve Perry

Similar presentations


Presentation on theme: "Introduction to SQL Steve Perry"— Presentation transcript:

1 Introduction to SQL Steve Perry Email: steveperrymail@yahoo.com

2 What is SQL? SQL is an abbreviation for Structured Query Language. It is generally pronounced “Sequel” SQL is a unified language for... defining, querying, modifying, and controlling the data in a Relational Database. 2

3 SQL Standards SQL is a standard, not a software product Commercial institutions now lead the standard by extending SQL to meet the needs of business. The main commercial database management systems (DBMS) in the industry today are: Oracle (MySQL), Sybase, Microsoft SQL Server 3

4 Relational Database What is a Relational Database Management System (RDBMS)? – All data is stored in Tables (i.e. Relations) (grid-like format, similar to a spreadsheet) – The logical representation of data is separate from its physical storage – One high-level language is provided … for structuring, querying, and changing information. This, of course, is SQL 4

5 What is RDBMS? - cont. Supports the concept of NULL values Provides Mechanisms for Integrity, Recovery, Authorization, and Transactions 5

6 What are Tables? They have Rows and Columns (like a spreadsheets with rows & columns) 6

7 What is a Database A Set of Related Tables is called a Database Tables are separate, but equal in that... – They have no Hierarchical Ranking – They have inherent relationship to each other – You can create relationships 7

8 What is an Entity? An entity is a person, place, or thing for which you wish to hold information A table is a collection of separate occurrences of an Entity – E.g. the “Employee” table contains information about individual employees Separate Characteristics are stored for each Occurrence of an Entity (i.e a row) – E.g. An individual employee has a name, address, phone number, etc. 8

9 Example Table In the above table "Last Name" and "City" are the columns Each different person and their represent a row of data 9

10 Primary Key Each Row is uniquely identified using the Primary Key. The Primary Key is defined as any Column (or combination of columns) that can be used to uniquely identify a particular row. 10

11 Data Manipulation Statements –The SELECT statement displays information you want to see from the database –The INSERT statement allow you to add rows to the database –The UPDATE statement allows you to change existing column information –The DELETE statement deletes rows of data 11

12 Example Primary Key In the above example the Last Name column acts as the PRIMARY key. (Note: names are not usually a good choice, but this is a simple example) 12

13 Values A Value can be determined by the intersection of the Column Name for the row identified by the Primary Key. Example: If I wanted to know where “Perry” lives I need only tell SQL about the Primary Key value “Perry” and the City column. 13

14 SQL is a High-Level Language SQL statements can logically be broken in to three high-level sets... –Data ManipulationDML which can query and update the data –Data DefinitionDDL which defines the objects in a database –Data AdministrationDCL which controls access to the data 14

15 Data DefinitionStatements The CREATE statement allows you create tables, views, and indexes The DROP statement allows you to remove tables, views, and indexes 15

16 End 16


Download ppt "Introduction to SQL Steve Perry"

Similar presentations


Ads by Google