Quiz 2 Flashcards

1
Q
A

None of the options are correct.

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

To display all the name of bus stop locations that is used as the starting point of a bus route.

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

σQuantity > 5 (Product ⋈Product.ProductID = Order.ProductID Order)

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

The Student table may contain more than one student with the same age.

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

Trigger

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

Property JOIN Owner USING(OwnerID)

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

The correct answer is: None of these options are correct.

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

8

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

The correct answer is: A cursor handler is not compulsory

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

CALL Mystery7(5, @c);

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

ΠProductName, Price (Product)

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

Property JOIN Owner USING(OwnerID)

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

Can you give me an example of creating a table for students in SQL. There needs to be a student id (PK), first name, last name and age

A

CREATE TABLE Students (
StudentID INT PRIMARY KEY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
Age INT
);

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

What is the syntax to insert values into a table in SQL?

A

INSERT INTO table_name (column1, column2, … columnN)
VALUES (value1, value2, … valueN);

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

What is an example of the syntax to insert values into a table in SQL for Students?

A

INSERT INTO Students (StudentID, FirstName, LastName, Age)
VALUES (1, ‘John’, ‘Doe’, 20);

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

What is the syntax to create a comment in SQL

A

It is “–”

17
Q

What is the syntax to use a database in SQL

A

if the database is called “Database1” then the syntax is “use Database1”

18
Q

If a value wants to be added with an int and the int needs to be a positive number what to you add to the line

19
Q

If a value wants to be added with an int and the int needs to not be NULL what to you add to the line

20
Q

How to see information from a DBMS using SQL

A

Type the following:
SELECT ‘information’
From databasename;

21
Q

How to count the number of enrolmentIDS from denormalisation table

22
Q

How to show all the information from the denormalisation table

23
Q

Using the following information use SQL code to see how many enrolments does each student have

24
Q

Using the following information use SQL code to see how many enrolments does each student have. Sort them by first name in descending order

25
Using the following information use SQL code to see how many enrolments does each student have. Sort them by first name in descending order
26
Using the following information use SQL code to show me all the people who have 4 or more enrollments.
27
What is JOIN
-Returns rows when there is a match in both tables. -If there's no match, the row is not included in the result.
28