Posts

Showing posts from September, 2023

Primary Keys , Foreign Keys, Identity column

Image
                    Primary Keys ,  Foreign Keys, Identity column Watch YouTube Video:                               Primary Keys ,  Foreign Keys, Identity column CREATE TABLE auto.Departments ( Id INT NOT NULL identity , Name VARCHAR (25 ) NOT NULL , PRIMARY KEY (Id )  ) ; INSERT INTO auto.Departments ( Name ) VALUES (  'HR' ) , ('Sales' ), ('Tech ' ); select * from auto.Departments CREATE TABLE auto.Employees ( Id INT NOT NULL identity , FName VARCHAR (35 ) NOT NULL , LName VARCHAR (35 ) NOT NULL , PhoneNumber VARCHAR (11 ), Managerid INT , Departmentid INT NOT NULL , Salary INT NOT NULL , HireDate DATETIME NOT NULL , PRIMARY KEY (Id ) ) ; (INSERT INTO auto.Employees  (  FName , LName , PhoneNumber, Managerid , Departmentid , Salary , HireDate ) VALUES ('James','Smith','1234567890',NULL,1,1000,CONVERT(DATETIME,'2004-01-01')), ('John','Johnson','2468101214',1,1,400,CONVERT(DATETIME,'2007-03-23')),

Normal Forms in Relational Database Management System

Image
  Normal Forms in Relational Database Management System: TO watch YouTube Video ,      raw-data-: name  , phone  city,  state Ram,    919876543210 , 918987654327, Banaglore,                             KA Dave,    919876543212 , 918987654328, Banaglore,                             KA Ali,    919876543213 Jaipur,                                  RJ Milkha,    919876543219,  918987654329, Bathinda,                                PA 1st Normal Form - 1. each table cell contain a single value (atomic) 2. each record needs to be unique eliminate the repetition Solution: name    ,  Phone ,    City,    State Ram ,  919876543210,       Banaglore, KA Ram ,  918987654327,       Banaglore, KA Dave                   ,  919876543212,         Banaglore, KA Dave                   ,  918987654328,         Banaglore, KA Ali                         ,  919876543213,      Jaipur, RJ Milkha,                   919876543219          Bathin