SQL STATEMENTS Flashcards
Display all male students
SELECT * student
WHERE gender = “M”;
What is the missing operator?
FROM
Display all student whose Middle initial (MI) is D
SELECT * FROM student
WHERE minitial = “D”;
It says a mismatch error occurred, what needs to be fixed?
Change minitial to MI
Whats wrong with this syntax?
SELECT * ID, lname, age, gender FROM student;
Remove the * because it will show everything
Which syntax structure is right?
A. INSERT INTO TableName (column2, column3, column4…)
VALUES(‘value2’, ‘value3’, value4…);
B. INSERT INTO TableName (column2, column3, column4…)
VALUES(‘value5’, ‘value7’, value2…);
A.
Because in B the values are not in the right order
Which syntax structure is right?
Reedit the values of TLname and MI
A. INSERT INTO teacher (Tlname, Tminitial,)
VALUES(‘Galang’, ‘A’,);
B. UPDATE Student
SET TLname = “Galang”, MI=”A”
WHERE TID = 6;
B
What will happen to the table with this syntax?
DELETE FROM TableName
WHERE Subject=’Math’;
Any record that contains the Subject “Math” Will be deleted
What will happen to the table with this syntax?
DELETE * FROM TableName
WHERE Subject=’Math’;
Everything will be deleted due to the *
What will happen to the table with this syntax?
Attributes: AGE, GENDER
SELECT * FROM student
WHERE Age > 20 OR Gender = “F”;
It will cause an error or a parameter error
What will happen to the table with this syntax?
SELECT * FROM student
ORDER BY lname DSC;
it will cause an error because of DSC, It must be type as DESC or Descending
What will happen to the table with this syntax?
Attributes: AGE, GENDER
SELECT * FROM student
WHERE Age > 20 AND Gender = “F”;
It will cause an error, the operator to be used must be OR
Which syntax has the WHERE condition?
SELECT
DELETE
UPDATE
Which syntax has the FROM condition?
SELECT
DELETE
Which syntax that only has SET?
UPDATE
Which syntax that only has VALUES?
INSERT INTO
Which syntax has the ABILITY to only show a specific attribute?
SELECT DISTINCT