Download presentation
Presentation is loading. Please wait.
Published byEmory Wells Modified over 9 years ago
1
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 1 Database Management Ver: 1.0 E-Commerce Databases Basic SQL Usage
2
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 2 Database Management Queries Across Tables SELECT products.productname, products.price FROM `products`,`sales`,`customers` WHERE products.prod_id = sales.prod_id AND sales.cus_id = customers.cus_id AND customers.cus_id = 1; Displays name and price of products ordered by customer with customer id 1
3
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 3 Database Management Queries Across Tables Writing a query bases on the tables structures and relationships (see above) Customer Productsales products.productname, products.price (cus_id,prod_id) (cus_id) (prod_id) products.prod_id = sales.prod_idsales.cus_id = customers.cus_id customers.cus_id = 1 1. 2.3. 4.
4
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 4 Database Management Queries Across Tables SELECT customers.surname, products.productname, products.price FROM `products`,`sales`,`customers` WHERE products.prod_id = sales.prod_id AND sales.cus_id = customers.cus_id AND customers.surname LIKE “Messnarz”; Displays customer name, product name and price of products ordered by customer with customer surname Messnarz
5
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 5 Database Management Queries Across Tables SELECT customers.surname, products.productname, products.price FROM `products`,`sales`,`customers` WHERE products.prod_id = sales.prod_id AND sales.cus_id = customers.cus_id ; Displays all so far ordered products by customers
6
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 6 Database Management Queries Across Tables SELECT customers.surname, products.productname, products.price FROM `products`,`sales`,`customers` WHERE products.prod_id = sales.prod_id AND sales.cus_id = customers.cus_id GROUP BY products.productname, customers.surname; Displays all so far ordered products by customers, grouped by the products
7
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 7 Database Management Queries Across Tables SELECT products.productname FROM `products`,`sales`,`customers` WHERE products.prod_id = sales.prod_id AND sales.cus_id = customers.cus_id; Displays all so far ordered products by customers SELECT DISTINCT products.productname FROM `products`,`sales`,`customers` WHERE products.prod_id = sales.prod_id AND sales.cus_id = customers.cus_id; Displays all so far ordered products by customers but shows each product chosen just once
8
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 8 Database Management Run Queries From phpMyAdmin Enter queries, get advise about mistakes, execute queries Query by examples (for unexperienced users) Open phpMyAdmin
9
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 9 Database Management INSERT Records Syntax INSERT INTO table (column-1, column-2,... column-n) VALUES (value-1, value-2,... value-n); Use the INSERT statement to add new rows of data to a single table.
10
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 10 Database Management INSERT Records INSERT INTO customers VALUES (2,'Damjan','elvis','Damjan','Ekert','ISCN A','Schieszstattgasse 4','A- 8010 Graz, Austria','+43 316 811198','+43 316 811312','dekert@iscn.com'); Inserts the customer Ekert into the customer table
11
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 11 Database Management Delete Records Syntax DELETE FROM table_reference [WHERE predicates] see code example in notes page. The SQL DELETE statement is used to delete one or more rows from a table.
12
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 12 Database Management Update Records Syntax UPDATE table_reference SET column_ref = update_value [, column_ref = update_value...] [WHERE predicates] The SQL UPDATE statement is used to modify one or more existing rows in a table.
13
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 13 Database Management Exercise 4 Master Example 1 and 2 Enter more example records using the phpMyAdmin wizard Run and demonstrate first cross table queries
14
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme 14 Database Management References SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL View Larger Image Michael J. Hernandez, John L. Viescas Online SQL Manual, http://www.elevatesoft.com/manual.htm
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.