SQL STATEMENTS Flashcards

1
Q

Display all male students
SELECT * student
WHERE gender = “M”;

What is the missing operator?

A

FROM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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?

A

Change minitial to MI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Whats wrong with this syntax?

SELECT * ID, lname, age, gender FROM student;

A

Remove the * because it will show everything

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A.

Because in B the values are not in the right order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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;

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What will happen to the table with this syntax?

DELETE FROM TableName
WHERE Subject=’Math’;

A

Any record that contains the Subject “Math” Will be deleted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What will happen to the table with this syntax?

DELETE * FROM TableName
WHERE Subject=’Math’;

A

Everything will be deleted due to the *

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What will happen to the table with this syntax?
Attributes: AGE, GENDER

SELECT * FROM student
WHERE Age > 20 OR Gender = “F”;

A

It will cause an error or a parameter error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What will happen to the table with this syntax?

SELECT * FROM student
ORDER BY lname DSC;

A

it will cause an error because of DSC, It must be type as DESC or Descending

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What will happen to the table with this syntax?
Attributes: AGE, GENDER

SELECT * FROM student
WHERE Age > 20 AND Gender = “F”;

A

It will cause an error, the operator to be used must be OR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which syntax has the WHERE condition?

A

SELECT
DELETE
UPDATE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which syntax has the FROM condition?

A

SELECT
DELETE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which syntax that only has SET?

A

UPDATE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which syntax that only has VALUES?

A

INSERT INTO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which syntax has the ABILITY to only show a specific attribute?

A

SELECT DISTINCT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly