Presentation is loading. Please wait.

Presentation is loading. Please wait.

Seminar Programmiersprachen – FG Praktische Informatik Pablo Pinés León.

Similar presentations


Presentation on theme: "Seminar Programmiersprachen – FG Praktische Informatik Pablo Pinés León."— Presentation transcript:

1 Seminar Programmiersprachen – FG Praktische Informatik Pablo Pinés León

2  SQL is a language for managing data in RDBMS  SQL stands for Structured Query Language  Originally called SEQUEL  Based on Edgar Codd’s Relational Model, which had attracted a lot of attention at that time  Currently widely used  First experimental implementation: System R, by IBM  First commercial implementation: Oracle

3  Language based on common english, easy to write, based in tables  Procedural, but avoiding some mathematical concepts  High level querying concepts, as grouping

4  More functionality: data management not relying solely on database administrators  It should serve both as query language and as a development language  Unique opportunity: free from backward compatibility

5  Name changed  New facilities: Join, having  Null values, three-value logic  New predicates: Like o Pragmatic decisions

6  DML - Data Manipulation Language ◦ Insert, Merge, etc ◦ Transactions  DDL – Data Definition Language ◦ Create, Drop, etc

7 SELECT CASE (bottlecount) WHEN 0 THEN 'No more bottle of beer on the wall, no more bottles of beer. ' || 'Go to the store and buy some more, 99 bottles of beer on the wall.' WHEN 1 THEN '1 bottle of beer on the wall, 1 bottle of beer. ' || 'Take one down and pass it around, no more bottles of beer on the wall.' WHEN 2 THEN '2 bottles of beer on the wall, 2 bottles of beer. ' || 'Take one down and pass it around, 1 bottle of beer on the wall.' ELSE rtrim (cast((BottleCount) as char(2))) || ' bottles of beer on the wall, ' || rtrim (cast((BottleCount) as char(2))) || ' bottles of beer. ' || 'Take one down and pass it around, ' || rtrim (cast((BottleCount)-1 as char(2))) || ' bottles of beer on the wall.' END FROM ( SELECT avalue * 10 + bvalue as bottlecount FROM (VALUES (9), (8), (7), (6), (5), (4), (3), (2), (1), (0)) a(avalue), (VALUES (9), (8), (7), (6), (5), (4), (3), (2), (1), (0)) b(bvalue) ) as valuelist; SELECT CASE (bottlecount) WHEN 0 THEN 'No more bottle of beer on the wall, no more bottles of beer. ' || 'Go to the store and buy some more, 99 bottles of beer on the wall.' WHEN 1 THEN '1 bottle of beer on the wall, 1 bottle of beer. ' || 'Take one down and pass it around, no more bottles of beer on the wall.' WHEN 2 THEN '2 bottles of beer on the wall, 2 bottles of beer. ' || 'Take one down and pass it around, 1 bottle of beer on the wall.' ELSE rtrim (cast((BottleCount) as char(2))) || ' bottles of beer on the wall, ' || rtrim (cast((BottleCount) as char(2))) || ' bottles of beer. ' || 'Take one down and pass it around, ' || rtrim (cast((BottleCount)-1 as char(2))) || ' bottles of beer on the wall.' END FROM ( SELECT avalue * 10 + bvalue as bottlecount FROM (VALUES (9), (8), (7), (6), (5), (4), (3), (2), (1), (0)) a(avalue), (VALUES (9), (8), (7), (6), (5), (4), (3), (2), (1), (0)) b(bvalue) ) as valuelist;

8

9  Born in 1944 in San José, USA  M.Sc and PhD in electrical engineering by Stanford University. Minored in computer science  Worked for IBM Research, last years in Almaden  XQuery  He was awarded by the ACM in 1988

10  Born in 1947 in New York  PhD in Computer Science at Purdue  Worked in Yorktown Heights for IBM => Boyce- Codd Normal Form  He moved to San Jose to work with Don Chamberlain  Died of brain aneurysm in 1974

11

12  Important for any language: Well defined data model (though you can retrofit it later)  SQL is declarative: ◦ Optimizability ◦ Data independence ◦ High level is easier

13  Consistency is a must  Definition of ACID properties for transactions (atomicity, consistency, isolation, durability)  Degrees of isolation (the higher the isolation is, the bigger portion it might lock up)  Sidenote: halloween problem

14  Not all of them were well observed in SQL  Closure  Completeness  Orthogonality: concepts defined independently and avoiding special rules ◦ A expression that returns a certain type should be allows to be used in any context where that data type is expected  Consistency

15  Simplicity  Extensibility  Abstraction (data independence in DB)  Optimizability: where possible, the semantic specification should be declarative  Resilience

16  Database administration tasks  Quite easy to learn  Various implementations  Interfaces with popular programming languages  ANSI and ISO standards  Propitious time

17  SQL injection attacks  Now it’s an object-relational language ◦ User-defined types and methods  They expected “casual users” to use it

18

19


Download ppt "Seminar Programmiersprachen – FG Praktische Informatik Pablo Pinés León."

Similar presentations


Ads by Google