


















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
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A portion of a database management system lecture from docsity.com. It covers the use of the select statement for querying data from one or more tables, including the use of aliases, expressions, and the distinct keyword. Examples are provided for selecting specific columns, rows, and calculating total marks.
Typology: Slides
1 / 26
This page cannot be seen from the preview
Don't miss anything!
INSERT INTO course VALUES (‘CS-211', ‘Operating Systems’, 4, ‘MCS’) INSERT INTO course (crCode, crName) VALUES (‘CS-316’, Database Systems’) INSERT INTO course (‘MG-103’, ‘Intro to Management’, NULL, NULL)
Select Statement Maximum used command in DML Used not only to select certain rows but also the columns Also used for different forms of product, that is, different joins
Select Selecting rows from one or more tables SELECT {*|col_name[,….n]} FROM table_name
Select Q: Give the names of the students with the program name SELECT stName, prName FROM student
Another Name “Urf” for an attribute SELECT {*|col_name [[AS] alias] [, …n]} FROM tab_name SELECT stName as ‘Student Name’ , prName ‘Program’ FROM Student
Expression Example Q: Display the total sessional marks of each student obtained in each subject Select stId, crCode, mTerm + sMrks ‘Total out of 50’ from enroll
Select Distinct The DISTINCT keyword is used to return only distinct (different) values
Q: Get the program names in which students are enrolled SELECT prName FROM Student Select Distinct