Practices 8
Practices 8
Integrity Rules
1.It must be allowed to insert ”Female” and “Male” into “Gender “only.
8-On the table CH : Id, Course and semester must be unique together. Each student must have one row
for a course in a semester.
Example :
id Course Semester
------------------------------------
1 MATH 1 >>>> POSSIBLE
1 MATH 2 >>>> POSSIBLE
1 MATH 1 >>>> IMPOSSIBLE
9-Insert the following rows into tables above. Find the 4 errors while inserting following rows.
PT CH
ID NAME SURNAME GENDER ID COURSE SEMESTER GRADE
1 ADIL NUSIPOV MALE 1 CS200 1 F+
2 JAZIRA NUROVA FEMALE 2 INF100 3 A
4 AYNUR SAPAR EMALE 3 MATH 1 A-
10-Delete the first row from “PT”. Why can not you delete it?
B-Create a sequence name is MySequence with the following parameters.
Starting values : 25
Minimum Value : 10
Maximum Value : 100
Step : 3
Library
Book_id >>>> String Book_id Student_id Taken_date Given_date
Student_id >>>> number
Taken_date >>>> date AB102 10 12/05/08 05/06/08
Given_date >>>> date CT201 20 04/02/08 06/09/09
Rule
3.1-The default value of Taken_date is sysdate: It means, sysdate value is inserted into Taken_date if
any date is not inserted.
3.2- Students must pay 10 Tenge per each day. Write a query which will display students with reading
day and paid money.
Example :
KENAN CETINKAYA
5-MAR-2009
SDU