Questions On Creating Table Student

1244 Words5 Pages
/* CREATE TABLE STUDENT ( Student_name varchar (30) NOT NULL, Student_id char (4) NOT NULL, Course_name varchar(30) NOT NULL, Year smallint NOT NULL, PRIMARY KEY (Student_id) ); CREATE TABLE MODULE ( Module_name varchar (30) NOT NULL UNIQUE, Module_code varchar (6) NOT NULL, Department_name varchar (30), PRIMARY KEY (Module_code) ); CREATE TABLE HISTORY ( Module_code varchar(6) NOT NULL, Delivery_year smallint NOT NULL, Organiser_name varchar (30) NOT NULL, PRIMARY KEY(MODULE_CODE,DELIVERY_YEAR) ); CREATE TABLE EXAM ( Student_id char(4) NOT NULL, Module_code varchar(6) NOT NULL, Exam_year smallint NOT NULL, Score smallint NOT NULL, FOREIGN KEY (student_id) REFERENCES STUDENT(Student_id), FOREIGN KEY (Module_code,Exam_year)…show more content…
RT INTO STUDENT VALUES ( 'Sahil ', '5454 ', 'Physics ', '2013 '); INSERT INTO HISTORY VALUES ( 'SP125 ', '2014 ', 'Professor Peter Jones '); INSERT INTO HISTORY VALUES ( 'FR132 ', '2012 ', 'Professor Matthew Blanc '); INSERT INTO HISTORY VALUES ( 'FR132 ', '2011 ', 'Dr Matt Palin '); INSERT INTO HISTORY VALUES ( 'CH135 ', '2013 ', 'Dr Arthur Watson '); INSERT INTO HISTORY VALUES ( 'CS138 ', '2014 ', 'Dr Yulia Timofeeva '); INSERT INTO HISTORY VALUES ( 'CS241 ', '2012 ', 'Dr Graham Martin '); INSERT INTO HISTORY VALUES ( 'ST145 ', '2011 ', 'Dr Anton Grevenko '); INSERT INTO HISTORY VALUES ( 'ST148 ', '2012 ', 'Professor Harry Smith '); INSERT INTO HISTORY VALUES ( 'CH139 ', '2010 ', 'Professor John Francis '); INSERT INTO HISTORY VALUES ( 'IB323 ', '2012 ', 'Professor Mark Taylor '); INSERT INTO EXAM VALUES ( '3232 ', 'SP125 ', '2014 ', '78 '); INSERT INTO EXAM VALUES ( '3232 ', 'FR132 ', '2012 ', '65 '); INSERT INTO EXAM VALUES ( '3232 ', 'CH135 ', '2013 ', '66 '); INSERT INTO EXAM VALUES ( '3593 ', 'CS138 ', '2014 ', '76 '); INSERT INTO EXAM VALUES ( '3593 ', 'ST145 ', '2011 ', '55 '); INSERT INTO EXAM VALUES ( '3593 ', 'CH139 ', '2010 ', '80 '); */ import java.sql.*; import java.io.*; public class studentQueries { public static void main (String args[]) throws Exception, IOException, SQLException { try { Class.forName ("oracle.jdbc.driver.OracleDriver"); } catch (ClassNotFoundException e) {
Open Document