









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
guria rani 09
Typology: Slides
1 / 16
This page cannot be seen from the preview
Don't miss anything!










Slide 2
The SUM() Function SELECT SUM(column_name) FROM table_name
Slide 4
SELECT SUM(OrderPrice) AS OrderTotal FROM Orders;
Slide 5 Aggregate functions often need an added GROUP BY statement The GROUP BY Statement SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name; GROUP BY statement is used in conjunction with the aggregate functions to group the result-set by one or more columns
Slide 7 Customer SUM(OrderPrice) Saqib 3600 Umer 1700 Waqas 400 SELECT Customer, SUM(OrderPrice) FROM Orders GROUP BY Customer;
Slide 8
Slide 10 Customer SUM(OrderPrice) Saqib 5700 Umer 5700 Waqas 5700 SELECT Customer, SUM(OrderPrice) FROM Orders GROUP BY Customer GROUP BY Customer;
Slide 11 The INSERT INTO Statement
Slide 13
The first form doesn't specify the column names where the data will be inserted, only their values:
Slide 14
INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...)
Slide 16 Now we want to insert a new row in the "Persons" table. P_Id LastName FirstName Address City 1 Ali Hassan 10H/555 Wah 2 Umer Kiyani basti Wah 3 Hamid shafiq CB-4545 Wah 4 Shoaib Akhtar I-8,st-2/ 45 ISL INSERT INTO Persons VALUES (4,‘Shoaib', ‘Akhtar', ‘I-8,st-2/ 45', ‘ISL')