1 / 21

CIT 613 : Relational Database Development using SQL

CIT 613 : Relational Database Development using SQL. Introduction to SQL. Introduction to SQL. The history of SQL begins in an IBM laboratory in San Jose, California, where SQL was developed in the late 1970s.

irma
Download Presentation

CIT 613 : Relational Database Development using SQL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CIT 613 : Relational Database Development usingSQL Introduction to SQL Powered by DeSiaMore

  2. Introduction to SQL • The history of SQL begins in an IBM laboratory in San Jose, California, where SQL was developed in the late 1970s. • The initials stand for Structured Query Language, and the language itself is often referred to as "sequel." Powered by DeSiaMore

  3. Introduction to SQL • It was originally developed for IBM's DB2 product which is a relational database management system, or RDBMS. • SQL is a nonprocedural language, in contrast to the procedural or third-generation languages (3GLs) such as PASCAL, C and C++. Powered by DeSiaMore

  4. Introduction to SQL • Nonprocedural means what rather than how. For example, SQL describes what data to retrieve, delete, or insert, rather than how to perform the operation. • Two standards organizations, the American National Standards Institute (ANSI) and the International Standards Organization (ISO), currently promote SQL standards to industry. E.g. is ANSI 92 standard Powered by DeSiaMore

  5. A Brief History of Databases • Database systems store information in every conceivable business environment. From large tracking databases such as airline reservation systems to ATM application, database systems store and distribute the data that we depend on. Powered by DeSiaMore

  6. A Brief History of Databases • Until the last few years, large database systems could be run only on large mainframe computers. These machines have traditionally been expensive to design, purchase, and maintain. Powered by DeSiaMore

  7. A Brief History of Databases • However, today's generation of powerful, inexpensive workstation computers enables programmers to design software that maintains and distributes data quickly and inexpensively. Powered by DeSiaMore

  8. Relational Database Model • The most popular data storage model is the relational database. • The relational database model was invented by Dr. Edward E. Codd in 1970 • A relational database store data in the form of relations (or Tables) • Tables are made up of rows (tuples) and columns (fields). Powered by DeSiaMore

  9. Relational Database Model • It is important to understand the relational database model because SQL evolved to service its concepts. • Dr. Codd defined 13 rules, oddly enough referred to as Codd’s 12 rules, that define the relational model: Powered by DeSiaMore

  10. Codd’s 12 rules • 0. A relational DBMS must be able to manage databases entirely through its relational capabilities. • 1. The Information Rule. All information in a relational database (including table and column names) is represented explicitly as values in tables. • 2. Guaranteed Access. Every value in a relational database is guaranteed to be accessible by using a combination of the table name, primary key value, and column name. Powered by DeSiaMore

  11. Codd’s 12 rules Cont… • 3. Systematic Null Value Support. The DBMS provides systematic support for the treatment of null values (unknown or inapplicable data), distinct from default values, and independent of any domain. • 4. Active, On-Line Relational Catalog. The description of the database and its contents is represented at the logical level as tables, and can therefore be queried using the database language. Powered by DeSiaMore

  12. Codd’s 12 rules Cont… • 5. Comprehensive Data Sublanguage. There must be at least one language supported that has a well-defined syntax and is comprehensive, in that it supports data definition, manipulation, integrity rules, authorization, and transactions. • 6. View Updating Rule. All views that are theoretically updatable can be updated through the system. • 7. Set-Level Insertion, Update, and Deletion. The DBMS supports not only set-level retrievals, but also set-level inserts, updates, and deletes. Powered by DeSiaMore

  13. Codd’s 12 rules Cont… • 8. Physical Data Independence. Application programs and ad hoc programs are logically unaffected when physical access methods or storage structures are altered. • 9. Logical Data Independence. Application programs and ad hoc programs are logically unaffected, to the extent possible, when changes are made to the table structures. • 10. Integrity Independence. The database language must be capable of defining integrity rules. They must be stored in the on-line catalog, and they cannot be bypassed. Powered by DeSiaMore

  14. Codd’s 12 rules Cont… • 11. Distribution Independence. Application programs and ad hoc requests are logically unaffected when data is first distributed, or when it is redistributed. • 12. Nonsubversion. It must not be possible to bypass the integrity rules defined through the database language by using lower-level languages. Powered by DeSiaMore

  15. Relational DB Concept • Codd’s idea for a Relational Database Management System (RDBMS) uses the concepts of relational algebra to break data down into sets and common subsets. • Because information can naturally be grouped into distinct sets, Dr. Codd organized his database system around this concept. Powered by DeSiaMore

  16. Relational DB Concept • Under the relational model, data is separated into sets that resemble a table structure. • This table structure consists of individual data elements called columns or fields. • A single set of a group of fields is known as a record or row. Powered by DeSiaMore

  17. Relational DB Concept • For instance, to create a relational database consisting of employee data, one might start with a table called EMPLOYEE. • In this EMPLOYEE table, you might start with the following pieces of information: name, age, and occupation. • These three pieces of data make up the fields in the EMPLOYEE table Powered by DeSiaMore

  18. Relational DB Example: Employee Table Powered by DeSiaMore

  19. Employee Table • The four rows comprise the records for the EMPLOYEE table. • If a user wanted to retrieve a specific record from this table, he would instruct the database management system (DBMS) to retrieve the records where the NAME field equaled, for instance, Jan Janis. Powered by DeSiaMore

  20. Why SQL? • If the DBMS had been instructed to retrieve all the fields, the employee’s name, age, and occupation would be returned to the user. • SQL is the language used to instruct the database to retrieve this data. • An example SQL statement that makes this query is: SELECT * FROM EMPLOYEE Powered by DeSiaMore

  21. Why SQL? • One of SQL’s greatest benefits is that it is truly a cross-platform language. • In addition, it is virtually a cross-platform, cross-product language. • Because it is also what programmers refer to as a high-level or fourth-generation language (4GL), a large amount of work can be done in fewer lines of code. Powered by DeSiaMore

More Related