Question

Help me fix my code's error: SQL Programming Error Message 8101 CREATE TABLE tblGPA       ...

Help me fix my code's error:

SQL Programming

Error Message 8101

CREATE TABLE tblGPA
       (GPA_ID INT IDENTITY(10001,1) ,
       MemberID INT REFERENCES tblMembers,
       Q1GPA DECIMAL,
       Q2GPA DECIMAL,
       Q3GPA DECIMAL,
   Q4GPA DECIMAL,
       );

   -- Insert data into the TRANSACTIONS table
       INSERT INTO tblGPA VALUES
       (10001, 1, 4.0, 4.0, 3.5, 4.0),
       (10002, 2, 4.0, 3.5, 4.0, 3.5),
(10003,   3, 3.5, 3.5, 3.5, 3.5),
       (10004, 4, 3.5, 4.0, 3.5, 3.5),
       (10005, 5, 4.0, 4.0, 4.0, 4.0),
       (10006, 6, 4.0, 4.0, 4.0, 3.5),
       (10007, 7, 1.5, 1.5, 2.0, 1.5),
       (10008, 8, 3.5, 3.5, 3.5, 3.5),
       (10009, 9, 3.0, 3.0, 3.0, 3.0),
       (10010, 10, 2.5, 2.5, 2.5, 2.5),
       (10011, 11, 3.0, 3.0, 3.0, 3.0),
       (10012, 12, 4.0, 4.0, 4.0, 4.0),
       (10013, 13, 4.0, 4.0, 4.0, 4.0),
       (10014, 14, 3.5, 3.0, 3.5, 3.5),
       (10015, 15, 3.5, 3.5, 3.5, 3.5),
       (10016, 16, 3.0, 3.0, 3.0, 3.0),
       (10017, 17, 4.0, 3.5, 4.0, 4.0),
       (10018, 18, 3.0, 3.0, 3.0, 3.0),
       (10019, 19, 3.0, 3.0, 3.0, 3.0),
       (10020, 20, 1.5, 1.5, 2.0, 2.5),
       (10021, 21, 2.0, 2.0, 2.0, 2.0),
       (10022, 22, 2.5, 3.0, 2.5, 3.0),
       (10023, 23, 3.5, 3.5, 3.5, 3.5),
       (10024, 24, 4.0, 4.0, 4.0, 4.0),
       (10025, 25, 4.0, 3.5, 4.0, 4.0),
       (10026, 26, 2.0, 2.5, 2.5, 2.0),
       (10027, 27, 3.0, 3.0, 3.0, 3.0),
       (10028, 28, 3.5, 3.5, 3.5, 3.0),
       (10029, 29, 4.0, 4.0, 4.0, 4.0),
       (10030, 30, 4.0, 4.0, 4.0, 4.0),
       (10031, 31, 4.0, 4.0, 4.0, 4.0),
       (10033, 33, 4.0, 4.0, 4.0, 4.0),
       (10034, 34, 4.0, 4.0, 4.0, 4.0),
       (10035, 35, 4.0, 4.0, 4.0, 4.0),
       (10036, 36, 3.0, 3.0, 3.5, 3.5),
       (10037, 37, 3.5, 4.0, 3.5, 3.5),
       (10038, 38, 3.5, 3.5, 3.5, 3.5),
       (10039, 39, 4.0, 4.0, 4.0, 4.0),
       (10040, 40, 4.0, 4.0, 4.0, 4.0),
       (10041, 41, 1.5, 1.5, 1.5, 2.5),
       (10042, 42, 4.0, 3.5, 4.0, 4.0);

SELECT * FROM tblGPA;
GO

0 0
Add a comment Improve this question Transcribed image text
Answer #1

create database GPA;

use GPA;

create table tblMembers
(
MemberID int primary key,
MemberName varchar(10)
);

------------insert values into table tblMembers--------------------

insert into tblMembers values(1,'a');

insert into tblMembers values(2,'b');

insert into tblMembers values(3,'c');

insert into tblMembers values(4,'d');

insert into tblMembers values(5,'e');

insert into tblMembers values(6,'f');

insert into tblMembers values(7,'g');

insert into tblMembers values(8,'h');

insert into tblMembers values(9,'i');

insert into tblMembers values(10,'j');

insert into tblMembers values(11,'k');

insert into tblMembers values(12,'l');

insert into tblMembers values(13,'m');

insert into tblMembers values(14,'n');

insert into tblMembers values(15,'o');

insert into tblMembers values(16,'p');

insert into tblMembers values(17,'q');

insert into tblMembers values(18,'r');

insert into tblMembers values(19,'s');

insert into tblMembers values(20,'t');

insert into tblMembers values(21,'u');

insert into tblMembers values(22,'v');

insert into tblMembers values(23,'w');

insert into tblMembers values(24,'x');

insert into tblMembers values(25,'y');

insert into tblMembers values(26,'z');

insert into tblMembers values(27,'aa');

insert into tblMembers values(28,'bb');

insert into tblMembers values(29,'cc');

insert into tblMembers values(30,'dd');

insert into tblMembers values(31,'ee');

insert into tblMembers values(32,'ff');

insert into tblMembers values(33,'gg');

insert into tblMembers values(34,'hh');

insert into tblMembers values(35,'ii');

insert into tblMembers values(36,'jj');

insert into tblMembers values(37,'kk');

insert into tblMembers values(38,'ll');

insert into tblMembers values(39,'mm');

insert into tblMembers values(40,'oo');

insert into tblMembers values(41,'pp');

insert into tblMembers values(42,'qq');

desc tblMembers;
select * from tblMembers;

create table tblGPA
(
   GPA_ID int Auto_increment primary key,   
    MemberID int references tblMembers,
   Q1GPA decimal,
   Q2GPA decimal,
   Q3GPA decimal,
   Q4GPA decimal
);

desc tblGPA;

[explanation:-{in this table use Auto_increment with primary key instead of identity(10001,1)

identity(10001,1)- this is used for autoincrement value,10001 means value and 1 means increment value by 1}

above we write the tblMembers table firstly because tblGPA table having a refrence value from this table so we write it firstly.]


----------------------insert values into tbl tblGPA------------------------------

INSERT INTO tblGPA VALUES(10001, 1, 4.0, 4.0, 3.5, 4.0);
INSERT INTO tblGPA VALUES(10002, 2, 4.0, 3.5, 4.0, 3.5);
INSERT INTO tblGPA VALUES(10003, 3, 3.5, 3.5, 3.5, 3.5);
INSERT INTO tblGPA VALUES (10004, 4, 3.5, 4.0, 3.5, 3.5);
INSERT INTO tblGPA VALUES (10005, 5, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES (10006, 6, 4.0, 4.0, 4.0, 3.5);
INSERT INTO tblGPA VALUES (10007, 7, 1.5, 1.5, 2.0, 1.5);
INSERT INTO tblGPA VALUES (10008, 8, 3.5, 3.5, 3.5, 3.5);
INSERT INTO tblGPA VALUES (10009, 9, 3.0, 3.0, 3.0, 3.0);
INSERT INTO tblGPA VALUES (10010, 10, 2.5, 2.5, 2.5, 2.5);
INSERT INTO tblGPA VALUES (10011, 11, 3.0, 3.0, 3.0, 3.0);
INSERT INTO tblGPA VALUES(10012, 12, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10013, 13, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10014, 14, 3.5, 3.0, 3.5, 3.5);
INSERT INTO tblGPA VALUES(10015, 15, 3.5, 3.5, 3.5, 3.5);
INSERT INTO tblGPA VALUES (10016, 16, 3.0, 3.0, 3.0, 3.0);
INSERT INTO tblGPA VALUES(10017, 17, 4.0, 3.5, 4.0, 4.0);
INSERT INTO tblGPA VALUES (10018, 18, 3.0, 3.0, 3.0, 3.0);
INSERT INTO tblGPA VALUES(10019, 19, 3.0, 3.0, 3.0, 3.0);
INSERT INTO tblGPA VALUES(10020, 20, 1.5, 1.5, 2.0, 2.5);
INSERT INTO tblGPA VALUES(10021, 21, 2.0, 2.0, 2.0, 2.0);
INSERT INTO tblGPA VALUES(10022, 22, 2.5, 3.0, 2.5, 3.0);
INSERT INTO tblGPA VALUES(10023, 23, 3.5, 3.5, 3.5, 3.5);
INSERT INTO tblGPA VALUES(10024, 24, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10025, 25, 4.0, 3.5, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10026, 26, 2.0, 2.5, 2.5, 2.0);
INSERT INTO tblGPA VALUES(10027, 27, 3.0, 3.0, 3.0, 3.0);
INSERT INTO tblGPA VALUES(10028, 28, 3.5, 3.5, 3.5, 3.0);
INSERT INTO tblGPA VALUES(10029, 29, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10030, 30, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10031, 31, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10033, 33, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10034, 34, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10035, 35, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10036, 36, 3.0, 3.0, 3.5, 3.5);
INSERT INTO tblGPA VALUES(10037, 37, 3.5, 4.0, 3.5, 3.5);
INSERT INTO tblGPA VALUES(10038, 38, 3.5, 3.5, 3.5, 3.5);
INSERT INTO tblGPA VALUES(10039, 39, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10040, 40, 4.0, 4.0, 4.0, 4.0);
INSERT INTO tblGPA VALUES(10041, 41, 1.5, 1.5, 1.5, 2.5);
INSERT INTO tblGPA VALUES(10042, 42, 4.0, 3.5, 4.0, 4.0);

select * from tblGPA;

-----------screenshots of the output-----------------------------------------

Add a comment
Know the answer?
Add Answer to:
Help me fix my code's error: SQL Programming Error Message 8101 CREATE TABLE tblGPA       ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT