18
18
19
20 20
21 21
23 23
24
24
25 25
Franz Kafka
2
Emily Dickins... 3
Arthur Conan... 1
Kurt Vonnegut 0 Maya Angelou 0
Salman Rush... 0
Margaret Atw... 0 Haruki Murak... 0
5
1
0
0
0
0
0
Question 8:
Picture 7.1
Create a stored procedure named insertMember with @memberID int, @memberNamenvarchar(100), @address nvarchar(200), @email nvarchar(100), @sex nvarchar(20),@birthDate date as input parameters of the procedure. The stored procedure attempts to insert a new member into the table Members, but only if a member with the same MemberID does not already exists:
- if a member with MemberID = @memberID already exists, the procedure does nothing.
- if there is no member with MemberID = @memberID, the procedure will insert into the table Members a new row with @memberID, @memberName, @address, @email, @sex and @birthDate as values for its attributes.
For example, when we execute the insertMember procedure with input values as in the following statement, a new member with the corresponding values will be inserted into the table Members:
execute insertMember
@memberID = 50,
@memberName='John Smith',
8 of 8
Paper No: 6
@address=null,
@email='
[email protected]',
@sex='Male',
@birthDate='1989-10-14';
+ 100%
Close