Skip to content

Commit 2cf2073

Browse files
author
Gael Estrera
committed
Some SQL
1 parent 06b0920 commit 2cf2073

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

MySQL/DBPractice.sql

+14-1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ from company
145145
right join game
146146
on company_name = game.company;
147147

148+
#Alter field of database table
149+
148150
alter table company
149151
add GameTheme varchar(20) after company_location;
150152

@@ -154,6 +156,8 @@ add FoundDate varchar(30) after GameTheme;
154156
desc company;
155157
select * from company;
156158

159+
#Update existing record
160+
157161
update company
158162
set GameTheme = "MMORPG"
159163
where company_name = "Abyssal Sage";
@@ -176,6 +180,8 @@ desc game;
176180
alter table game #Renaming/Changing column name in table
177181
change column Endorser Company varchar(20);
178182

183+
#Inserting values rows
184+
179185
desc company;
180186
insert into company
181187
values
@@ -187,4 +193,11 @@ values
187193
insert into company
188194
values ("Bethesda","USA","Sandbox","4/2/1989");
189195

190-
select * from company;
196+
select * from company;
197+
198+
199+
#Deleting records
200+
201+
DELETE
202+
FROM company
203+
WHERE (GameTheme = "Nudity");

0 commit comments

Comments
 (0)