SQL Set Operators Traditional Set Operators: Union Compatibility: Requirement for the traditional set operators. Strong requirement. - Same number of columns. - Each corresponding column is compatible. - Positional correspondence. Apply to similar tables by removing columns first. SQL UNION Example: Example 1: Retrieve basic data about all university people. SELECT FacNo AS PerNo, FacFirstName ...
DML | Data Manipulation Language
DML(Data Manipulation Language) : used for adding (inserting), deleting and modifying (updating) data in a database
• Insert
• Update
• Delete
INSERT INTO:
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
INSERT INTO table_name
VALUES (value1, value2, value3, ...);
create table mytab3(
C1 int NOT NULL PRIMARY Key, c2
varchar(255))
insert into mytab3 values(01,'Ali')
create table mytab5(
c1 int, c2 int, c3 varchar(200),
PRIMARY KEY (c1,c3),
FOREIGN KEY (c2) REFERENCES
mytab3(c1)
insert into mytab5 (c1) insert into mytab5 (c3)
values (10) values ('Ahmed')
insert into mytab5 (c1,c2,c3)
values (111,60,'Ahmed')
insert into mytab5 (c1,c2,c3)
values (111,01,'Ahmed')
insert into mytab5 (c1,c3) insert into mytab5 (c1,c3)
values (09,'Ahmed') values (10,'Ahmed')
Re-Run
Update:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
update mytab5 update mytab5
set c1=12 set c1=12
where c1=09 where c1=10
update mytab5
set c1=13, c2=01,c3='aa'
where c1=12
update mytab5
set c1=13, c2=01,c3='aa'
where c1=12
Our Official Website : Web Conquerors (https://www.webconquerors.com/)
Want to get digital services? Contact US
Want to know about our services? Our Services
Comments
Post a Comment