Presentation is loading. Please wait.

Presentation is loading. Please wait.

REV 00 Chapter 4 SQL and QBE DDC 2483 – Database Systems.

Similar presentations


Presentation on theme: "REV 00 Chapter 4 SQL and QBE DDC 2483 – Database Systems."— Presentation transcript:

1 REV 00 Chapter 4 SQL and QBE DDC 2483 – Database Systems

2 Introduction to SQL Main language for relational DBMSs.
REV 00 Introduction to SQL Main language for relational DBMSs. Main characteristics: relatively easy to learn; non-procedural - you specify what information you require, rather than how to get it; essentially free-format; consists of standard English words like SELECT, INSERT, and UPDATE; can be used by range of users. DDC 2483 – Database Systems

3 REV 00 Importance of SQL First and, so far, only standard database language to gain widespread acceptance. Huge investment from both vendors and users. Federal Information Processing Standard (FIPS). Used as the basis for other standards. DDC 2483 – Database Systems

4 Objectives of SQL Ideally database language should let user:
REV 00 Objectives of SQL Ideally database language should let user: create database and table structures. perform basic tasks like insert, update, delete; perform both simple and complex queries. Must perform these tasks with minimal user effort. Must be easy to learn. DDC 2483 – Database Systems

5 REV 00 Objectives of SQL SQL is a transform-oriented language with 2 major components: a DDL for defining database structure; a DML for retrieving and updating data. Until SQL3, SQL did not contain flow of control commands (not computationally complete). SQL can be used interactively or embedded in a high-level language (eg. C, C++). DDC 2483 – Database Systems

6 REV 00 Writing SQL Commands SQL statement consists of reserved words and user-defined words. Reserved words – a fixed part of the SQL language and have a fixed meaning. They must be spelled exactly as required and cannot be split across lines. User-defined words – are made up by the user (according to certain syntax rules) and represent the names of various database objects. Many dialects of SQL require the use of a statement terminator to mark the end of each SQL statement (usually the semicolon “;” is used). DDC 2483 – Database Systems

7 Data Manipulation The SQL DML statements:
REV 00 Data Manipulation The SQL DML statements: SELECT – to query data in the database; INSERT – to insert data into a table; UPDATE – to update data in a table; DELETE – to delete data from a table; DDC 2483 – Database Systems

8 Data Manipulation Simple Queries Specific Columns, All Rows
REV 00 Data Manipulation Simple Queries Specific Columns, All Rows Example: List the catalog number, title and daily rental rate of all videos. SELECT catalogNo, title, dailyRental FROM Video; DDC 2483 – Database Systems


Download ppt "REV 00 Chapter 4 SQL and QBE DDC 2483 – Database Systems."

Similar presentations


Ads by Google