Database Design

Total Post:113

Points:791
 190  View(s)
Ratings:
Rate this:

Design a Database of student, subject and marks and describe various keys and attributes ? Example ??

  1. Post:140

    Points:984
    Re: Database Design

    Hey, Franco according to your question here I post a designed  database for you. its contain a student id, name and address and shown below how to create tables : 

    Database Design: 

    students(student_id, student_name, address)  
    enrollment(student_id, subject_id, mark)
    subject(subject_id, subject_name, department)

     Create student table : 

    CREATE TABLE STUDENTS 
    (
    STUDENT_ID VARCHAR2(10) PRIMARY KEY,
    STUDENT_NAME VARCHAR2(15),
         ADDRESS VARCHAR2(30)
    );

    Create enrollment table :

    CREATE TABLE ENROLMENT 
    (
    STUDENT_ID VARCHAR2(5) REFERENCES STUDENTS(STUDENT_ID),
    SUBJECT_ID VARCHAR2(6) REFERENCES SUBJECTS(SUBJECT_ID),
    MARK NUMBER(3),
    PRIMARY KEY(STUDENT_ID,SUBJECT_ID)
    );

    Create subject table :

    CREATE TABLE SUBJECTS 
    (
    SUBJECT_ID VARCHAR2(6) PRIMARY KEY,
    SUBJECT_NAME VARCHAR2(20),
    DEPARTMENT VARCHAR2(20)
    );

    Happy Coding :)

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!