What's new
  • Welcome to PHCorner forums. Take a moment to sign up and gain unlimited access and extra privileges that guests are not entitled to, such as: All that and more! Registration is quick, simple and absolutely free. Join our community today!

Help Pa Check naman ng SQL code ko.

Joined
Nov 18, 2017
Messages
3,785
Reaction
2,212
Age
20
CREATE TABLE Multiple_Choice_Questions
(
Question varchar(255),
Correct_answer varchar(255),
Score int(255),
Choice1 varchar(255),
Choice2 varchar(255),
Choice3 varchar(255),
Choice4 varchar(255)
);

INSERT INTO Multiple_Choice_Questions (Question, Score) VALUES("What was the name of the first supersonic passenger airliner?", 1);
INSERT INTO Multiple_Choice_Questions (Question, Score) VALUES("In electronics, what does DC stand for?", 1);
INSERT INTO Multiple_Choice_Questions (Question, Score) VALUES("How many vertebrae does the average human possess?", 1);
INSERT INTO Multiple_Choice_Questions (Question, Score) VALUES("How many teeth does an ãdül† human have?", 1);
INSERT INTO Multiple_Choice_Questions (Question, Score) VALUES("Which famous British physicist wrote A Brief History of Time?", 1);

SELECT*FROM Multiple_Choice_Questions;



Ano po kayang mali o kaylangan idagdag pa help naman po sa willing tumulong PM ko nalang po yung link ng SQL code ko. Salamat po. Respect post po. Gof bless.
 

Attachments

KyonG17

Established
sa an na part ts?

part 4 : States that need mo mag Execute ng insert into na statements
Table:
Should look like this\
1605742874645.png
Here's the default query structure for Insert:
"INSERT INTO multiple choice questions(Question, Correct_Answer, Score)
VALUES (DEFAULT, 1, DEFAULT)
"

For step 5: You need to perform Update Statements:
table should Look like this
1605742874453.png
Some Code Snippet for Your Guidance you can modify it accordingly you can set the Question as UniqueKey since there Should be no duplicates on the questions asked..

"UPDATE multiple choice questions
SET Choice1 = ' ',
Choice2 = ' ',
Choice3 = ' ',
Choice4 = ' '
WHERE Question = ' '
"


Take note that it is advice to use singleQoutes ( ' ' ) on string/varchar characters for your convenience.
 

Attachments

Last edited:
11 Comments View more comments…
G
G I N E B R A
Nalilito lang po talaga ako. Salamat po
 
TS ung default value is ang syntax lng mag change value ka depende sa content na ilagay mo all i give you was the syntax sa insert and update pro need mo pa din e edit un accordingly.. samples lng un binigay ko para di ka ma spoon feed.. fill in the blank nlng un.. you need to do it by your self mahirap pag spoon feed nasa basic palang klayo ng sql.. later on pag mga advance query na baka ma hirapan ka lalo nat maraming klase ng database then nasa Relational Database kayo na basic palang at isa sa pinaka madaling e analyze kasi lahat ng table may relationship...
Sorry po. Hahays. Nakakalito. Salamat po.
 
Comment

Online statistics

Members online
756
Guests online
881
Total visitors
1,637

Forum statistics

Threads
848,254
Messages
16,768,216
Members
1,469,075
Top