0% found this document useful (0 votes)
10 views2 pages

Database

Uploaded by

Sebastian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Database

Uploaded by

Sebastian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

-- CREATE.

INSERT

/* Create syntax

Create table table name

(column 1 data type [not null] [primary key],

column 2 data type [not null],

.....

column n data type[not null]);

*/

drop table faculty;

create table faculty

(fac_id smallint not null,

name varchar(100) not null,

address varchar (200) not null,

dean varchar(200) not null);

/* Insert syntax

insert into table name [(list of columns)]

values (list of values)[,(list of values 2), .... , (list of values n)];

*/

insert into FACULTY

values (6, 'FIIR', 'Bucharest', 'Cristian Doicin');

--Date -> 'YYYY-MM-DD'


insert into "STUDENT"."STUDPERSONAL" ("COD_STUD", "FIRST_NAME", "LAST_NAME", "BIRTHDATE",
"CNP", "INITIALS", "FATHER", "MOTHER", "ADRESS", "PHONE", "EMAIL") values(2, 'Sebastian-Gabriel',
'Palii', '2005-01-18', '5050118460053', 'CM', 'Catalin-Marius', 'Manuela', 'Bucuresti Sector 6',
'0749185138', 'paliisebastian@yahoo...')

insert into "STUDENT"."GRADE" ("GRADE_ID", "GRADE", "DATE", "COURSE_ID", "COD_STUD") values('1',


10, '2024-02-12', 1, 1)

com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: The insert or update value of the


FOREIGN KEY "STUDENT.GRADE.GRADE_COURSE_FK" is not equal to any value of the parent key of the
parent table.. SQLCODE=-530, SQLSTATE=23503, DRIVER=3.68.61

insert into "STUDENT"."SPECIALITY" ("SPEC_ID", "NAME", "FAC_ID") values(1, 'Robotics', 6)

insert into "STUDENT"."COURSE" ("COURSE_ID", "YEAR", "SEMESTER", "PROF", "NAME", "SPEC_ID")


values(1, '2', '1', 'Pitea', 'Analiza Matematica', 1)

You might also like