120 likes | 197 Views
sql BEGINEER Level- 3 Sub-level-2 Version-1.0 by: ars. Agenda : USING TOP and TOP PERCENT. SqlServerSchool.com. S S S. Data Introduction. Seven Different People in the House. Hi I am Alok. My Id is 1 and date of birth is 15/Aug/1980.
E N D
sqlBEGINEER Level- 3Sub-level-2Version-1.0by: ars Agenda : USING TOP and TOP PERCENT Slides by SqlServerSchool.com
SqlServerSchool.com SSS Slides by SqlServerSchool.com
Data Introduction Seven Different People in the House. Hi I am Alok. My Id is 1 and date of birth is 15/Aug/1980 Hi I am Aman and my Id is 4 and date of birth is 16/Dec/1980 Hi I am Shree and my Id is 7 and date of birth is 20/Jan/1989 Hi I am Manish. My Id is 2 and date of birth is 20/Jan/1985 Hi I am Chandra. My Id is 5 and date of birth is 17/Jan/1980 Hi I am Ambrish. My Id is 3 and date of birth is 25/Nov/1975 Hi I am Shivam. My Id is 6 and date of birth is 18/Jan/1999 Skip Current Page >> Slides by SqlServerSchool.com
Keyword And Term Introduction • Input Data: Data Stored in Customer Table • Output Data:Data to show when requirement gets • filled (or data to show as Output). Or Expected OutputOr Output Imagination • Reqstands for “Requirement” • T-SQL stands for “Sql Server Executable code” Slides by SqlServerSchool.com
TIME SAVER TIPSFollowing are Concept slides to examine whether you require this course study or not… Slides by SqlServerSchool.com
Concept 1 : Select Top Some records from Table Input Data Output Data SELECT TOP 2 all the information FROM CUSTOMER in descending order of Name SELECT TOP 2 * FROM CUSTOMER ORDER BY Name DESC Slides by SqlServerSchool.com
Concept 2 : Select Top Some Percent records from Table Input Data Output Data SELECT TOP 75 PERCENT all the information FROM CUSTOMER SELECT TOP 75 PERCENT * FROM CUSTOMER Slides by SqlServerSchool.com
If you are able to answer all quick check correctly then you don’t require this course study…If you proceed with course study then at end of study always go through quick check slides for confirm you understood this courseware correct ? Thanks, ARS Slides by SqlServerSchool.com
CONCEPT 1 Slides by SqlServerSchool.com
How to fetch TOP N records from the customer table- Effort-1 Input Data Output Data REQ: SELECT TOP 3 all the information FROM CUSTOMER REQ: SELECT TOP 5 all the information FROM CUSTOMER REQ: SELECT TOP 2 all the information FROM CUSTOMER in ascending order of Name REQ: SELECT TOP 2 all the information FROM CUSTOMER in descending order of Name T-SQL: SELECT TOP 3 * FROM CUSTOMER T-SQL: SELECT TOP 5 * FROM CUSTOMER T-SQL: SELECT TOP 2 * FROM CUSTOMER ORDER BY Name ASC T-SQL: SELECT TOP 2 * FROM CUSTOMER ORDER BY Name DESC You learned, Fetching TOP N records from the customer table. Note: N having values 1 or more… Slide by SqlServerSchool.com
CONCEPT 2 Slides by SqlServerSchool.com
How to fetch TOP N PERCENT records from the customer table- Effort-1 Input Data Output Data REQ: SELECT TOP 50 PERCENT all the information FROM CUSTOMER REQ: SELECT TOP 75 PERCENT all the information FROM CUSTOMER T-SQL: SELECT TOP 50 PERCENT * FROM CUSTOMER SQL: SELECT TOP 75 PERCENT * FROM CUSTOMER You learned, Fetching TOP N PERCENT records from the customer table. Note: N having values 1 or more… Slide by SqlServerSchool.com