0% found this document useful (0 votes)
43 views

Database Management System Lab Course Code: CSE 312: Instructor: Tasnim Tarannum Lecturer CSE Department

This document provides an overview and details of the Database Management System Lab course. It discusses the course outline, plan, and basic DBMS software and tools including SQL, its architecture and commands. It also defines database concepts like fields, rows/records, and columns. Additionally, it covers SQL data types such as numeric, character, and date/time. Finally, it describes various SQL operators for arithmetic, comparison, logical operations, and negation.

Uploaded by

Nirban Mitra
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Database Management System Lab Course Code: CSE 312: Instructor: Tasnim Tarannum Lecturer CSE Department

This document provides an overview and details of the Database Management System Lab course. It discusses the course outline, plan, and basic DBMS software and tools including SQL, its architecture and commands. It also defines database concepts like fields, rows/records, and columns. Additionally, it covers SQL data types such as numeric, character, and date/time. Finally, it describes various SQL operators for arithmetic, comparison, logical operations, and negation.

Uploaded by

Nirban Mitra
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Database Management System Lab

Course Code: CSE 312


Instructor : Tasnim Tarannum
Lecturer
CSE Department.
Overview
► Course Outline
► Course Plan
► Basic DBMS Software & Tools
► SQL
► Applications of SQL
► SQL Architecture
► SQL Commands
► SQL Tools
Field , Row or Record and Column

► What is field
Field is a smaller entity of the table which contains specific information about
every record in the table. In the above example, the field in the student table
consist of id, name, age, course.
► What is row or record
A row of a table is also called record. It contains the specific information of each
individual entry in the table. It is a horizontal entity in the table. For example:
The above table contains 5 records.
► What is column
A column is a vertical entity in the table which contains all information
associated with a specific field in a table. For example: "name" is a column in the
above table which contains all information about student's name.
Examples
Let's see the example of student table

ID Name AGE COURSE

1 Arafat 24 B.Tech
2 Sadia 20 C.A
3 Moin 21 BCA
4 Raju 22 MCA
5 Forid 26 BSC
Field: id, name, age, course

1 Arafat 24 B.Tech
Examples

Field: id, name, age, course

Row or record:

1 Arafat 24 B.Tech

Column:

Arafat
Sadia
Moin
Raju
Forid
SQL - Data Types
► Numeric Data Types

DATA TYPE FROM TO


bigint -9,223,372,036,854,775,808 9,223,372,036,854,775,807

int -2,147,483,648 2,147,483,647

smallint -32,768 32,767


tinyint 0 255
bit 0 1
decimal -10^38 +1 10^38 -1
numeric -10^38 +1 10^38 -1
money -922,337,203,685,477.5808 +922,337,203,685,477.5807

smallmoney -214,748.3648 +214,748.3647


SQL - Data Types

Approximate Numeric Data Types

DATA TYPE FROM TO


float -1.79E + 308 1.79E + 308
real -3.40E + 38 3.40E + 38
SQL - Data Types

► Date and Time Data Types

DATA TYPE FROM TO

datetime Jan 1, 1753 Dec 31, 9999


smalldatetime Jan 1, 1900 Jun 6, 2079
date Stores a date like June 30, 1991
time Stores a time of day like 12:30 P.M
SQL - Data Types

► Character Strings Data Types


Sr.No. DATA TYPE & Description
char
1 Maximum length of 8,000 characters.( Fixed length non-Unicode characters)

varchar
2 Maximum of 8,000 characters.(Variable-length non-Unicode data).

varchar(max)
3 Maximum length of 2E + 31 characters, Variable-length non-Unicode data (SQL Server
2005 only).

text
4 Variable-length non-Unicode data with a maximum length of 2,147,483,647 characters.
SQL - Operators

► Arithmetic operators
► Comparison operators
► Logical operators
► Operators used to negate conditions
SQL - Operators
► SQL Arithmetic Operators
Assume 'variable a' holds 10 and 'variable b' holds 20, then −

Operator Description Example

+ (Addition) Adds values on either side of the operator. a + b will give 30

Subtracts right hand operand from left hand


- (Subtraction) operand. a - b will give -10

Multiplies values on either side of the operator.


* (Multiplication) a * b will give 200

Divides left hand operand by right hand


/ (Division) b / a will give 2
operand.
Divides left hand operand by right hand operand
% (Modulus) and returns remainder. b % a will give 0
SQL - Operators
SQL Comparison Operators
Assume 'variable a' holds 10 and 'variable b' holds 20, then

Operator Description Example

Checks if the values of two operands are equal or not, if yes


= (a = b) is not true.
then condition becomes true.
Checks if the values of two operands are equal or not, if
!= values are not equal then condition becomes true. (a != b) is true.

Checks if the values of two operands are equal or not, if


<> values are not equal then condition becomes true. (a <> b) is true.

Checks if the value of left operand is greater than the value


> of right operand, if yes then condition becomes true. (a > b) is not true.

Checks if the value of left operand is less than the value of


< right operand, if yes then condition becomes true. (a < b) is true
SQL - Operators

Checks if the value of left operand is greater than or


>= equal to the value of right operand, if yes then (a >= b) is not true.
condition becomes true.

Checks if the value of left operand is less than or


<= equal to the value of right operand, if yes then (a <= b) is true.
condition becomes true.

Checks if the value of left operand is not less than


!< the value of right operand, if yes then condition (a !< b) is false.
becomes true.
Checks if the value of left operand is not greater
!> than the value of right operand, if yes then (a !> b) is true.
condition becomes true.
Any questions?
Thanks

You might also like