-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert_queries2.sql
More file actions
57 lines (53 loc) · 1.14 KB
/
insert_queries2.sql
File metadata and controls
57 lines (53 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
SELECT * from issue_status;
--Insert some data in issue_status table
INSERT INTO
issue_status (
issued_id,
issued_member_id,
issued_book_name,
issued_date,
issued_book_isbn,
issued_emp_id
)
VALUES (
'IS151',
'C118',
'The Catcher in the Rye',
CURRENT_DATE - INTERVAL 24 day,
'978-0-553-29698-2',
'E108'
),
(
'IS152',
'C119',
'The Catcher in the Rye',
CURRENT_DATE - INTERVAL 13 day,
'978-0-553-29698-2',
'E109'
),
(
'IS153',
'C106',
'Pride and Prejudice',
CURRENT_DATE - INTERVAL 7 day,
'978-0-14-143951-8',
'E107'
),
(
'IS154',
'C105',
'The Road',
CURRENT_DATE - INTERVAL 32 day,
'978-0-375-50167-0',
'E101'
);
--Add new colomn in return_status table
ALTER Table return_status
ADD COLUMN book_quality VARCHAR(30) DEFAULT("Good")
SELECT * FROM return_status;
UPDATE return_status
SET
book_quality = "Damaged"
WHERE
issued_id in ('IS112', 'IS117', 'IS118');
--End update database;