Presentation is loading. Please wait.

Presentation is loading. Please wait.

Databases and modelling 3. day. 2 Agenda Introduction to SQL Status on database implementation Forms Exercises Reports.

Similar presentations


Presentation on theme: "Databases and modelling 3. day. 2 Agenda Introduction to SQL Status on database implementation Forms Exercises Reports."— Presentation transcript:

1 Databases and modelling 3. day

2 2 Agenda Introduction to SQL Status on database implementation Forms Exercises Reports

3 3 Introduction to SQL SQL = Structured Query Language (DML – Data Manipulation Language included) A declarative programming language (telling the computer what to do – not how to do it by means of algoritms like imperative programming languages) BSQL tells the database management system what to do and to do the actual changes and retrievals in the database Developed as part of the development of relational databases SQL is in slightly different versions implemented in databases as MySQL, PostgreSQL, Oracle databases and MS Access

4 4 What SQL does SQL (+DML) can Bexecute queries Bretrieve data from a database Binsert new records in a database Bdelete records from a database Bupdate records in a database Example (see the difference?) BSELECT author.ID, author.Author FROM author; BSELECT book.[Book number], book.[Book title] FROM book;

5 5 SQL Statements SELECT - extracts data from a database table UPDATE - updates data in a database table DELETE - deletes data from a database table INSERT INTO - inserts new data into a database table SELECT LastName,FirstName FROM Persons

6 6 SQL Example BSELECT book.[Book number], book.[Book title] FROM book; BSELECT table_name.[field name], table_name.[field name 2] FROM table name; BSELECT book.[Book title], book.[Book number] FROM book WHERE (((book.[Book number])=1)); BSELECT author.Author, book.[Book title] FROM book INNER JOIN (author INNER JOIN [Written by] ON author.ID = [Written by].Author) ON book.[Book number] = [Written by].Book;

7 7 SQL exercise Write SQL expression that extracts book title, publication year and publisher from the book table Find publications from 2006 only

8 8 Step 6

9 9 Example

10 10 Different kinds of forms Forms for displaying data Form for navigating data Forms for user dialog and search (combined with queries)

11 11 Exercise - forms Analyse the Northwind database BHow does the main switchboard call other forms? BOrders form: How does the content in the Bill to dropdown come from? BImportant and often easier to learn (and copy…) from something already working

12 12 Reports Pulling data out of the database formatted for other media


Download ppt "Databases and modelling 3. day. 2 Agenda Introduction to SQL Status on database implementation Forms Exercises Reports."

Similar presentations


Ads by Google