🔒 Closed Pa Check naman ng SQL code ko.

Status
Not open for further replies.
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

  • Screenshot_20201116_101316.jpg
    Screenshot_20201116_101316.jpg
    54.1 KB · Views: 2
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

  • 1605742491390.webp
    1605742491390.webp
    38 KB · Views: 13
Ano po kayang mali.? Pasensya na first time kolang po mag SQL. Salamat po.
 

Attachments

  • Screenshot_20201119_101045_com.android.chrome.webp
    Screenshot_20201119_101045_com.android.chrome.webp
    41.8 KB · Views: 11
Bakit line 12-16 mo insert mo lang question tas point ang sabi sa task sainyo questions correct answer points
 
[XX='G I N E B R A, c: 507085, m: 1031988'][/XX] 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...
 
@G I N E B R A..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.
 
For number 4:
INSERT INTO @NameOfYourTable (Question, Correct_Answer, Score)
VALUES (@ Question, @Correct_Answer, @Score)


For Number 5:
UPDATE @nameOfYourTable
SET Choice1 = '@answerName',
Choice2 = '@NameChoice2',
Choice3 = '@NameChoice3',
Choice4 = '@NameChoice4'
WHERE Question = '@Question1_Name'



change all values na may" @"
 
KyonG17 kuys hindi kopa naeedit pero san ba ilalagay yung sagot dun sa tanong? Paano poba? Salamat po.
 

Attachments

  • Screenshot_20201119_173618_com.android.chrome.webp
    Screenshot_20201119_173618_com.android.chrome.webp
    49.3 KB · Views: 8
Tama poba yung pag lalagay ko ng answers sa Questions ko na nasa table? Pa check naman po please.
 

Attachments

  • Screenshot_20201120_091259_com.android.chrome.webp
    Screenshot_20201120_091259_com.android.chrome.webp
    42.9 KB · Views: 12
Status
Not open for further replies.

About this Thread

  • 25
    Replies
  • 742
    Views
  • 3
    Participants
Last reply from:
G I N E B R A

Online now

Members online
968
Guests online
925
Total visitors
1,893

Forum statistics

Threads
2,276,241
Posts
28,968,601
Members
1,231,180
Latest member
lumb
Back
Top