Download presentation
Presentation is loading. Please wait.
1
Database Management System
Lecture - 25 © Virtual University of Pakistan
2
© Virtual University of Pakistan
Rules of the Format Writing general format Reserved words in capital User-defined identifiers in lowercase Valid identifiers Optionals in [ ] Curly braces means required items | means chioces [,…..n] means n items separated by comma © Virtual University of Pakistan
3
© Virtual University of Pakistan
Rules of the Format Writing general format Reserved words in capital User-defined identifiers in lowercase Valid identifiers Optionals in [ ] Curly braces means required items | means chioces [,…..n] means n items separated by comma © Virtual University of Pakistan
4
© Virtual University of Pakistan
Rules of the Format Writing general format Reserved words in capital User-defined identifiers in lowercase Valid identifiers Optionals in [ ] Curly braces means required items | means chioces [,…..n] means n items separated by comma © Virtual University of Pakistan
5
© Virtual University of Pakistan
Rules of the Format Writing general format Reserved words in capital User-defined identifiers in lowercase Valid identifiers Optionals in [ ] Curly braces means required items | means chioces [,…..n] means n items separated by comma © Virtual University of Pakistan
6
© Virtual University of Pakistan
Rules of the Format Writing general format Reserved words in capital User-defined identifiers in lowercase Valid identifiers Optionals in [ ] Curly braces means required items | means chioces [,…..n] means n items separated by comma © Virtual University of Pakistan
7
© Virtual University of Pakistan
Rules of the Format Writing general format Reserved words in capital User-defined identifiers in lowercase Valid identifiers Optionals in [ ] Curly braces means required items | means chioces [,…..n] means n items separated by comma © Virtual University of Pakistan
8
© Virtual University of Pakistan
Rules of the Format Writing general format Reserved words in capital User-defined identifiers in lowercase Valid identifiers Optionals in [ ] Curly braces means required items | means chioces [,…..n] means n items separated by comma © Virtual University of Pakistan
9
© Virtual University of Pakistan
Example SELECT [ALL|DISTINCT] {*|select_list} FROM {table|view[,…n]} Select * from std © Virtual University of Pakistan
10
© Virtual University of Pakistan
Data Types in SS Integer Bit ( 0 or 1) Tinyint (0 through 255) Smallint to 32767 Int -231 to (10 digits) Bigint -263 to (19 digits) Decimal or numeric © Virtual University of Pakistan
11
© Virtual University of Pakistan
Data Types in SS Text: handles textual data char: by default 30 characters, max 8000 varchar: variable length text, max 8000 Text: variable length automatically nchar, nvarchar, ntext Money: handles monetary data smallmoney: 6 digits, 4 decimal money: 15 digits, 4 decimal © Virtual University of Pakistan
12
© Virtual University of Pakistan
Data Type in SS Floating point Float Real Date Smalldatetime datetime © Virtual University of Pakistan
13
© Virtual University of Pakistan
Example Database © Virtual University of Pakistan
14
© Virtual University of Pakistan
PROGRAM COURSES STUDENT CRS_OFFERED SEMESTER TEACHER © Virtual University of Pakistan
15
© Virtual University of Pakistan
PROGRAM COURSES STUDENT CRS_OFFERED SEMESTER TEACHER © Virtual University of Pakistan
16
© Virtual University of Pakistan
PROGRAM (prName, totSem, prCredits) COURSE (crCode, crName, crCredits, prName) SEMESTER (semName, stDate, endDate) CROFRD (crCode, semName, facId) FACULTY (facId, fName, fQual, fSal, rank) STUDENT (stId, stName, stFName, stAdres, stPhone, prName, curSem, cgpa) ENROLL (stId, crCode, semName, mTerm, sMrks, fMrks, totMrks, grade, gp) SEM_RES (stId, semName, totCrs, totCrdts, totGP, gpa) © Virtual University of Pakistan
17
© Virtual University of Pakistan
SQL Commands Types SQL commands are categorized in three broad classes Data definition language (DDL) Data manipulation language (DML) Data control language (DCL) © Virtual University of Pakistan
18
Data Manipulation Language
DML commands are used to create, alter or drop tables or other database objects DBMSs provide graphic interface for creating tables © Virtual University of Pakistan
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.