Sql

AS7

New member
Local time
Today, 02:55
Joined
Apr 24, 2009
Messages
3
Student(student_id, fname, lname, dob, city, cgpa, deptno)
Course (ccode, cname, noofcredits, deptno)
StudentCourse ( student_id, ccode, grade)
Department (deptno, dname)

*this colour indicates primary key

Q1: Assume that Student, Course and Department tables are already created. Please create ‘StudentCourse’ table using the following datatypes. Student_id must be number with 6 digits, Ccode must be variable length string (varchar2) with at most 7 characters and Grade must be variable length string with at most 2 characters.
All Primary Key and Foreign Keys must be declared clearly.


Below is how I tried to solve it but it didnt work :confused: plz help me out ... How do I declare primary and foreign keys? :confused:


Code:
CREATE TABLE studentcourse
(student_id integer(6) NOT NULL
ccode varchar(7) NOT NULL
grade varchar(2));







Q2: Update Student table and change the students’ cgpa from 2.00 to 2.50 whose department name is CMPE



Below is how I tried to solve it but i can't complete it :confused:



Code:
UPDATE student SET cgpa=2.50
WHERE cgpa=2.00
AND
 
Last edited:
I tried hard to complete but I can't. Please help me out :(
 

Users who are viewing this thread

Back
Top Bottom