12312312

SQL DEMO

SQL DEMO

CREATE DATABASE qldulich;
USE qldulich;

CREATE TABLE mytable 
( 
id INT not null PRIMARY KEY,
name VARCHAR(20) not null,
gioitinh nchar(7),
birtday datetime not null,
place varchar(255) not null,
diachi varchar(255)not null,
)

INSERT INTO mytable (id,name,gioitinh,birtday,place,diachi) VALUES ( 1,'Will1',1,'1956','hcm','hcm1' );
INSERT INTO mytable (id,name,gioitinh,birtday,place,diachi) VALUES ( 2,'Will2',1,'1956','hcm','hcm1' );
INSERT INTO mytable (id,name,gioitinh,birtday,place,diachi) VALUES ( 3,'Will3',1,'1956','hcm','hcm1' );
INSERT INTO mytable (id,name,gioitinh,birtday,place,diachi) VALUES ( 4,'Will4',1,'1920','hcm','hcm1' );
INSERT INTO mytable (id,name,gioitinh,birtday,place,diachi) VALUES ( 5,'Will5',1,'1959','hcm','hcm1' );
INSERT INTO mytable (id,name,gioitinh,birtday,place,diachi) VALUES ( 6,'Will6',1,'1957','hcm','hcm1' );


--
select * from mytable

--hien thi ten va gioi tinh
select name,gioitinh from mytable
select name,place from mytable

select distinct place from mytable

--update lai database
update mytable set name = 'Nguyen Van A'where id = 1
update mytable set name = 'Nguyen Van B'where id = 2
update mytable set name = 'Nguyen Van C'where id = 3
update mytable set name = 'Nguyen Van D'where id = 4
update mytable set name = 'Nguyen Van E'where id = 5
update mytable set name = 'Nguyen Van F'where id = 6
--- Kiem tra Lai Thu

select * from mytable

--hien thi ho ten va nam sinh theo kieu tang dan
select name,birtday from mytable order by birtday asc
--hien thi ho ten va nam sinh theo kieu giam dan
select name,birtday from mytable order by birtday desc
--- where
select name,birtday from mytable where id=1 or id=2

--- where hien thi dieu kien va nam sinh lon hon 1950
select * from mytable
select name,birtday from mytable where name = 'Will' OR name = 'Will2';
select name,birtday from mytable Where (name = 'Will' OR name = 'Will2')  and (birtday > '1950');

select * from mytable
select name,birtday from mytable where birtday+20 > year

--hien thi theo nam sinh = 1956
C1
select * from mytable where birtday = '1956';
C2
-- in tap hop 
select * from mytable where birtday IN ('1950','1956');
-- them not gia tri ko thuoc tap hop
select * from mytable where birtday NOT IN ('1950','1956');

-- Lam Viec Vs Between

COMMENTS

quang cao1 Free website traffic to your site!
quang cao 2
quang cao 3
Tên

39 người việt nam chết tại anh,4,Ảnh Đẹp,1,C#,1,Chia Sẻ,34,ĐÀM ĐẠO LỊCH SỬ,2,Game Lậu,66,Game Mod,2,Game Sắp Ra Mắt,9,Giải Trí,6,Hồi Chuông Lạ,10,Hướng Dẫn Hack,1,Kĩ Thuật Youtube,3,Mu Online,6,Phần Mềm Free,3,Phim,2,Review Phim,111,ShareCode,2,SQL,1,Tiếng Anh Chuẩn Đầu Ra,1,Tips and Tricks,1,Trải Nghiệm Game,2,Túy Tây Du H5,1,Webgame Lậu,1,Youtube,10,
ltr
item
Chia Sẻ Hay: SQL DEMO
SQL DEMO
SQL DEMO
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeJLANmqGHtiOT01g6GD4oU5RlCEUJN2WUUz0lY0rHouf-bOSxdP1KOQgxpkJIAh8Qxoq8cimUrtBgHwa5sV1-CD9orQVHvE9UJtxaqgna4V9cVPemvxxdHy5CvQPsvT3gqPNR_5BLpBg/s640/tuxarin-er.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeJLANmqGHtiOT01g6GD4oU5RlCEUJN2WUUz0lY0rHouf-bOSxdP1KOQgxpkJIAh8Qxoq8cimUrtBgHwa5sV1-CD9orQVHvE9UJtxaqgna4V9cVPemvxxdHy5CvQPsvT3gqPNR_5BLpBg/s72-c/tuxarin-er.png
Chia Sẻ Hay
https://tapchicode.blogspot.com/2019/11/sql-demo.html
https://tapchicode.blogspot.com/
https://tapchicode.blogspot.com/
https://tapchicode.blogspot.com/2019/11/sql-demo.html
true
8654321755521810318
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy