Lab Full Slides Short Note Except 7&8
Lab Full Slides Short Note Except 7&8
Lab Slides
ER
The ER model is a high-level data model which stands for the Entity-Relationship Model. It
is used for defining the relationship and elements.
ER-Diagram is a pictorial representation of data that describes how data is communicated
and related to each other
Entities - Table name
Attributes - Column (Key, Multi Value, Derived). It describes the entity property.
Relationships - (Unary, Binary). Is the relation between each entity.
Cardinality – (1:1, 1:N, N:M)
SQL (Structured Query Language)
SQL lets you access and manipulate databases. It can execute queries against a database
SQL can retrieve data from a database. Insert Update Delete records in a database and set
permission on tables.
DDL (Data Definition Language) - Create
DML (Data Manipulation Language) - Insert
DCL (Data Control Language) - Grant, Deny
DQL (Data Query Language) – Select
MSSQL
Relational database management system (RDBMS), that is developed by Microsoft.
SQL language. Contains T-SQL its own implementation. SSMS (SQL Server Management
Studio)
System Databases
Master - contains information about SQL server configuration
Model - The model database sets a template for every database that was newly create
MSDB - Is used by SQL Server Agent for scheduling alerts and jobs.
tempdb - Is a workspace for holding temporary objects or intermediate result sets.
Relations
2D Table with specific characteristics. Rows contains instance of entity while Cells hold
single value. No two rows are identical
All value in column are same kind (Data type) and each column has unique name.
Data Types
bigint | int | smallint | tinyint (0 to 255) | Bit | numeric
char | nchar - UNICODE
varchar | nvarchar – UNICODE
decimal (P, S) - exact P - Precision (total number of digits ) | S - Scale, number
of digits after the decimal point
float - approximate
Datetime(3.33 milisec accuracy) | Smalldatetime(1 min accuracy) | Date | Time
text | ntext - (2,147,483,647) byte
money | Smallmoney
SQL Constraints
Constraints are used to limit the type of data that can go into a table. Constraints can be
specified when a table is created (with the CREATE TABLE statement) or after the table is
created (with the ALTER TABLE statement).