Download presentation
Presentation is loading. Please wait.
Published bySandy Plough Modified over 10 years ago
1
Query Methods (SQL)
2
What is SQL A programming language for databases. SQL (structured Query Language) It allows you add, edit, delete and run queries on databases.
3
Some basic commands SELECT * FROM table1 What do you think it will do? The * means everything so, select everything from table 1. easy! SELECT Name, ID, Colour FROM table1 You can select specific columns to show. SELECT Name, ID, Colour FROM table1 WHERE ID<10 The WHERE clause adds an additional parameter for SQL to run through to select only data “WHERE” ID is less than (<)10.
4
Adding data INSERT INTO table1 (Name, ID, Colour) VALUES (Jim, 10, ) Will insert VALUES into table1 in the order stated (Name, ID, Colour) The missing “Colour” means that NULL will be entered.
5
Editing UPDATE table1 SET Colour= Green WHERE Name= Jim This will “UPDATE” records “WHERE” Name= Jim to show Colour as Green. If more than one record has Name as Jim then these will also be updated. Using * also means that every record will be updated.
6
Questions from You
7
Questions from me What is a query? Write on paper a basic SQL Query. It must show me every customer whose favourite colour is Purple.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.