CSCI 4402: Database Systems - Module 3/Quiz 3

0.0(0)
studied byStudied by 10 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

20 Terms

1
New cards

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')

2
New cards

Which SQL keyword is used to sort the result-set?

a. ORDER BY

b. ORDER

c. SORT BY

d. SORT

ORDER BY

3
New cards

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.

4
New cards

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'

5
New cards

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

6
New cards

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')

7
New cards

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'

8
New cards

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

9
New cards

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

10
New cards

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

11
New cards

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

12
New cards

Which SQL statement is used to update data in a database?

a. MODIFY

b. SAVE AS

c. UPDATE

d. SAVE

UPDATE

13
New cards

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'

14
New cards

Which SQL statement is used to return only different values?

a. SELECT UNIQUE

b. SELECT DISTINCT

c. SELECT ALL

d. SELECT DIFFERENT

SELECT DISTINCT

15
New cards

What are rows of a relation known as?

a. Relation

b. Tuple

c. Entity

d. Degree

Tuple

16
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p>SELECT Did FROM Movies;</p><p>a. Five tuples</p><p>b. Three tuples</p><p>c. Four tuples</p><p>d. empty (zero tuples)</p>

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

17
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p>SELECT Dname FROM Directors;</p><p>a. Three tuples</p><p>b. Four tuples</p><p>c. Five tuples</p><p>d. empty (zero tuples)</p>

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

18
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p>SELECT Mname, Dname FROM Movies, Directors</p><p>a. Five tuples</p><p>b. Three tuples</p><p>c. Four tuples</p><p>d. 25 Tuples</p>

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

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

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

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

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