Database Design

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

Last updated:7/17/2018 5:04:15 AM

1 Answers

Prakash nidhi Verma
Prakash nidhi Verma

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