Skip to content

Commit 38175c0

Browse files
HrishiDhondgeDHONDGE Hrishikeshtheangrydev
authored
SQL-144 (#249)
* SQL-144 * Update sql-queries-6/remove-first-N-char-column/copy-column.sql Co-authored-by: Liam Williams <[email protected]> * Update sql-queries-6/remove-first-N-char-column/right_queries.sql Co-authored-by: Liam Williams <[email protected]> * Update and rename right_queries.sql to right-queries.sql * Update copy-column.sql * Update substring_queries.sql * Rename substring_queries.sql to substring-queries.sql --------- Co-authored-by: DHONDGE Hrishikesh <[email protected]> Co-authored-by: Liam Williams <[email protected]>
1 parent 524e78a commit 38175c0

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE Course ADD id_copy VARCHAR(10);
2+
UPDATE Course SET id_copy = id;
3+
SELECT id, id_copy, name FROM Course LIMIT 4;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SELECT RIGHT('websitebaeldung', 8);
2+
SELECT RIGHT(id_copy, LENGTH(id_copy) - 3) FROM Course;
3+
UPDATE Course SET id_copy = RIGHT(id_copy, LENGTH(id_copy) - 3);
4+
SELECT id, id_copy, name FROM Course;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SELECT SUBSTRING(id_copy, 3, 3) from Course;
2+
UPDATE Course SET id_copy = SUBSTRING(id_copy, 3, 3);
3+
SELECT id, id_copy, name FROM Course;

0 commit comments

Comments
 (0)