ads

Chapter 3 SQL - DML(Data Manipulation Language) in Khmer Part 2

Chapter 3 SQL - DML(Data Manipulation Language) in Khmer Part 2


CREATE/INSERT INTO/UPDATE/DELETE/SELECT statements
These videos in Khmer will shows you from creating table, insert data to database, update, delete and select statment in Microsoft Access. Please feel free to follow along and if you have any comments please let me know.
Watch Chapter 3 SQL - DML PART 1 Watch Chapter 3 SQL - DML PART 2
Database Videos in Khmer language is HERE
Chapter 1: Introduction to Database System
Chapter 2: Data Definition Language (DDL - SQL)
Chapter 3: Data Manipulation Language (DML - SQL)
Chapter 4: Data Control Language (DCL - SQL)- coming soon
More...- coming soon

Click Here to Download Database Management System Book in Khmer language

Video #1

SQL Create Table Statements
CREATE TABLE Staff(
StaffID smallint Primary key,
StaffName varchar(30),
Gender varchar(6),
BirthDate Datetime,  
StaffPhone varchar(20),
StaffAddress varchar(250),
StaffPosition varchar(200),
Salary money,
HiredDate datetime,
StopWork bit 
)

CREATE TABLE Customer(
CusID int PRIMARY KEY,
CusName VARCHAR(30), 
Phone VARCHAR(20),
CusAddress VARCHAR(250)
)

Create Table Product(
ProductID smallint Primary key,
ProductName varchar(250),
StockQty smallint,
UnitPrice money,
SaleUnitPrice money
)

Create Table Invoice(
InvoiceNo int Primary key,
InvoiceDate datetime,
CusID int,
StaffID smallint,
TotalAmount money)

Create Table InvoiceDetail(
InvoiceNo int,
ProductID smallint,
SaleQty smallint,
SaleUnitPrice money,
Amount money)

Video #2

SQL INSERT INTO Table Statements
-----Table Staff------
INSERT INTO Staff VALUES (
1,'Sok Dara','Male',#1/19/1993#,'(855)12-222-444','BB','Manager',1000,#02/03/2020#,0);

INSERT INTO Staff VALUES (
2,'Seth Vantha','Male',#4/12/1999#,'(855)12-421-444','BB','IT Support',500,#12/23/2000#,0);

INSERT INTO Staff VALUES (
3,'Vuth Dany','Female',#6/28/1997#,'(855)12-421-655','PP','Casher',400,#12/17/2010#,0);

INSERT INTO Staff VALUES (
4,'Deth Chann','Female',#8/18/1996#,'(855)12-421-432','PP','Casher',250,#05/12/2013#,0);

INSERT INTO Staff VALUES (
5,'Chan Total','Male',#4/08/1999#,'(855)12-421-111','KC','IT',600,#09/25/2020#,0);

INSERT INTO Staff VALUES (
6,'Kosal Dara','Male',#5/29/1997#,'(855)12-421-888','PP','Secretary',900,#11/29/2021#,0);

---------Table Customer-----------
INSERT INTO Customer VALUES(1,'Heng Heng', '01238493','Phnom Penh');
INSERT INTO Customer VALUES(2,'Van Nita', '01129393','Battambong');
INSERT INTO Customer VALUES(3,'Sok Heng', '01833993','Takeo');
INSERT INTO Customer VALUES(4,'Chan Phalla', '01833993','Takeo');
INSERT INTO Customer VALUES(5,'Kaka', '01833993','siam reap');

---------Table Product-----------
INSERT INTO Product VALUES(1,'LapTop T100',10, 450, 500);
INSERT INTO Product VALUES(2,'LapTop T110',5, 500, 550);
INSERT INTO Product VALUES(3,'DeskTop 3in1',8, 400, 450);
INSERT INTO Product VALUES(4,'Gaming Keyboard',21, 20, 25);

---------Table Invoice-----------
INSERT INTO Invoice VALUES(1,#1/14/2022#,2,1,500);
INSERT INTO Invoice VALUES(2,#1/14/2022#,1,3,900); buy 2 unit desktop #3
INSERT INTO Invoice VALUES(3,#1/14/2022#,4,3,75); buy 3 unit gaming keyboard

---------Table InvoiceDetail-----------
INSERT INTO InvoiceDetail VALUES(1,1,1,500,500);
INSERT INTO InvoiceDetail VALUES(2,3,2,450,900);
INSERT INTO InvoiceDetail VALUES(3,4,3,25,75);

Video #3

Video #4

Video #5

SQL SELECT Statements
#Q1 Display all staff information
SELECT * FROM Staff;

#Q2 Display All Staff Name, Gender, Position 
SELECT StaffName, Gender, StaffPosition From Staff;

#Q3 Display All Staff Name, Gender and Position that "Stop Working"
SELECT StaffName,Gender, StaffPosition From Staff WHERE StopWork=-1;

#Q4 Display All Staff Information That have Salary >= 400
Select * From Staff Where Salary >=400;

#Q5 Display Staff ID, Name,Gender Salary That Gender is Male and Salary >500
SELECT StaffID, StaffName, Gender, Salary From Staff Where Gender ='Male' and Salary>500;


Video #6

SQL SELECT Statements
#1 Display all Customer Information 
SELECT * From Customer;
#2 Display all Customer Information That live in Takeo province
SELECT * From Customer WHERE CusAddress='Takeo';
#3 Display Customer ID, Name and Phone number That have ID = 2;
SELECT CusID, CusName,Phone from Customer Where CusID=2;


Useful links:

⚡ How to Download and Install Khmer Unicode for Windows and Mac OSX (apple)
⚡ Free Ebook Download - free PDF download
⚡ Learn Excel Formulas with Video and Example Download

No comments:

Powered by Blogger.