1/19
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
With SQL, how can you insert a new record into the "Student" table?Note: Student table has only two attributes, which are Fname and Lname.
a. INSERT VALUES (Fname, Lname) INTO Student
b. INSERT INTO Student VALUES ('Peter', 'Jackson')
c. INSERT VALUES ('Peter', 'Jackson') INTO Student
d. INSERT ('Peter', 'Jackson') INTO Student
INSERT INTO Student VALUES ('Peter', 'Jackson')
Which SQL keyword is used to sort the result-set?
a. ORDER BY
b. ORDER
c. SORT BY
d. SORT
ORDER BY
What is the difference between the CHAR(n) and VARCHAR(n) data types?
a. Both of them are string data types but CHAR has fixed length while VARCHAR is variable.
b. They are the same because both of them are string data types.
c. CHAR is for characters and VARCHAR is for strings data types
d. There is no data type called CHAR it is just VARCHAR for strings
Both of them are string data types, but CHAR has a fixed length while VARCHAR is variable.
With SQL, how do you select all the records from a table named "Student" where the value of the column "FirstName" ends with an "a"?
a. SELECT * FROM Student WHERE FirstName LIKE '%a%'
b. SELECT * FROM Student WHERE FirstName LIKE '_ a'
c. SELECT * FROM Student WHERE FirstName LIKE '%a'
d. SELECT * FROM Student WHERE FirstName LIKE 'a%'
SELECT * FROM Student WHERE FirstName LIKE '%a'
Which of the following is the full form of DDL?
a. Detailed Data Language
b. Data Definition Language
c. Data Derivation Language
d. Dynamic Data Language
Data Definition Language
With SQL, how can you insert "Salah" as the "LastName" in the "Student" table?
The Student table has two attributes FirstName and LastName.
a. INSERT ('Salah') INTO Student (LastName)
b. INSERT INTO Student VALUES ('Salah')
c. INSERT INTO Student (Salah) INTO LastName
d. INSERT INTO Student (LastName) VALUES ('Salah')
INSERT INTO Student (LastName) VALUES ('Salah')
With SQL, how do you select all the records from a table named "Student" where the value of the column "FirstName" is "Adam"?
a. SELECT * FROM Student WHERE FirstName='Adam'
b. SELECT * FROM Student WHERE FirstName<>'Adam'
c. SELECT All FROM Student WHERE FirstName LIKE 'Adam'
d. SELECT ALL FROM Student WHERE FirstName='Adam'
SELECT * FROM Student WHERE FirstName='Adam'
Which SQL constraint do we use to set some value to a field whose value has not been added explicitly?
a. DEFAULT
b. UNIQUE
c. CHECK
d. NOT NULL
DEFAULT
What command is used to create a new table in SQL?
a. BUILD Table
b. CREATE Table
c. CREATE Shema
d. GENERATE Table
CREATE Table
What does the following statement in SQL do?
DELETE FROM student;
a. Will do nothing because there is no where clause.
b. Delete all tuples in table student
c. Delete the table student and all its tuples
d. Delete the table student from the schema
Delete all tuples in table student
With SQL, how do you select all the columns from a table named "Products"?
a. SELECT all FROM Products
b. SELECT Products
c. SELECT *.Products
d. SELECT * FROM Products
SELECT * FROM Products
Which SQL statement is used to update data in a database?
a. MODIFY
b. SAVE AS
c. UPDATE
d. SAVE
UPDATE
With SQL, how do you select all the records from a table named "Student" where the "FirstName" is "Robin" and the "LastName" is "Williams"?
a. SELECT * FROM Student WHERE FirstName<>'Robin' AND LastName<>'Williams'
b. SELECT FirstName='Robin' , LastName='Williams' FROM Student
c. SELECT * FROM Student WHERE FirstName='Robin' OR LastName='Williams'
d. SELECT * FROM Student WHERE FirstName='Robin' AND LastName='Williams'
SELECT * FROM Student WHERE FirstName='Robin' AND LastName='Williams'
Which SQL statement is used to return only different values?
a. SELECT UNIQUE
b. SELECT DISTINCT
c. SELECT ALL
d. SELECT DIFFERENT
SELECT DISTINCT
What are rows of a relation known as?
a. Relation
b. Tuple
c. Entity
d. Degree
Tuple

How many tuples does the following SQL statement retrieve?
SELECT Did FROM Movies;
a. Five tuples
b. Three tuples
c. Four tuples
d. empty (zero tuples)
Five tuples

How many tuples does the following SQL statement retrieve?
SELECT Dname FROM Directors;
a. Three tuples
b. Four tuples
c. Five tuples
d. empty (zero tuples)
Five tuples

How many tuples does the following SQL statement retrieve?
SELECT Mname, Dname FROM Movies, Directors
a. Five tuples
b. Three tuples
c. Four tuples
d. 25 Tuples
25 Tuples

How many tuples does the following SQL statement retrieve?
SELECT DISTINCT Did FROM Movies;
a. Five tuples
b. empty (zero tuples)
c. Three tuples
d. Four tuples
Three tuples

How many tuples does the following SQL statement retrieve?
SELECT Mname, Dname FROM Movies, Directors WHERE Movies.Did=Director.Did;
a. Three tuples
b. 25 Tuples
c. Four tuples
d. Five tuples
Five tuples